Added malfunctioning ship.

Currently it doesn't seem to be detecting the key preses.
This commit is contained in:
2018-03-25 17:47:31 +02:00
parent 80113d51ff
commit 88f3a5f1a5
8 changed files with 54 additions and 118 deletions

View File

@@ -17,7 +17,6 @@
*/
#include "globals.h"
#include "display.h"
#include "event_manager.h"
#include "ship.h"
@@ -38,23 +37,32 @@ int main() {
fprintf(stderr, "alleg5: failed to initialize Allegro.\n");
return 1;
}
#ifdef DEBUG
puts("Initialized allegro system.");
#endif
if(!al_init_primitives_addon())
{
fprintf(stderr, "alleg5: failed to initialize primitives addon.\n");
return 1;
}
#ifdef DEBUG
puts("Initialized primitives addon.");
#endif
ALLEGRO_DISPLAY *display;
if(!create_display(display, 800, 600))
ALLEGRO_DISPLAY *display = al_create_display(800, 600);
if(!display)
{
fprintf(stderr, "alleg5: failed to create display.\n");
fprintf(stderr, "alleg5: failed to initialize display.\n");
return 1;
}
#ifdef DEBUG
puts("Created display.");
#endif
if(!evnt_mngr_init(display))
{
fprintf(stderr, "alleg5: failed to initialize event queue.\n");
destroy_display(display);
al_destroy_display(display);
return 1;
}
@@ -81,7 +89,7 @@ int main() {
*/
ship_update(&ship);
al_clear_to_color(al_map_rgb(0, 0, 0));
// TODO: run simulation draw functions
ship_draw(&ship);
if(show_info)
{
// TODO: draw simulation stats
@@ -97,7 +105,7 @@ int main() {
}
evnt_mngr_deinit();
destroy_display(display);
al_destroy_display(display);
al_shutdown_primitives_addon();
#ifdef DEBUG
puts("Shutdown primitives addon.");