From 526bdd578fd2b52650e9aecf2fa8b2c8b540c6b2 Mon Sep 17 00:00:00 2001 From: Allanis Date: Sun, 20 Jul 2014 22:27:25 +0100 Subject: [PATCH] [Fix] Fixed segfault on GUI and fixed incorrect pilot target position. --- src/gui.c | 6 +++--- src/lephisto.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui.c b/src/gui.c index 50f2a03..05715d7 100644 --- a/src/gui.c +++ b/src/gui.c @@ -292,7 +292,7 @@ void gui_renderTarget(double dt) { y -= p->ship->gfx_space->sh * PILOT_SIZE_APROX; gl_blitSprite(gui.gfx_targetPilot, x, y, 1, 1, c); /* Bottom right. */ - y -= p->ship->gfx_space->sw * PILOT_SIZE_APROX; + x -= p->ship->gfx_space->sw * PILOT_SIZE_APROX; gl_blitSprite(gui.gfx_targetPilot, x, y, 0, 1, c); /* Bottom left. */ } } @@ -552,7 +552,6 @@ void gui_render(double dt) { * @brief Render the GUI Radar. * @param dt Current deltatick. */ - static void gui_renderRadar(double dt) { int i, j; @@ -575,12 +574,13 @@ static void gui_renderRadar(double dt) { /* Render the pilot_nstack. */ j = 0; - for(i = 1; j < pilot_nstack; i++) { /* Skip the player. */ + for(i = 1; i < pilot_nstack; i++) { /* Skip the player. */ if(pilot_stack[i]->id == player->target) j = i; else gui_renderPilot(pilot_stack[i]); } + /* Render the targetted pilot. */ if(j != 0) gui_renderPilot(pilot_stack[j]); diff --git a/src/lephisto.c b/src/lephisto.c index e31062d..6d53c2c 100644 --- a/src/lephisto.c +++ b/src/lephisto.c @@ -529,7 +529,7 @@ static void render_all(void) { player_render(dt); spfx_render(SPFX_LAYER_FRONT); space_renderOverlay(dt); - //gui_render(dt); + gui_render(dt); display_fps(dt); /* Exception. */ }