[Fix] Fixed segfault on GUI and fixed incorrect pilot target position.

This commit is contained in:
Allanis 2014-07-20 22:27:25 +01:00
parent 62f31aa8c4
commit 526bdd578f
2 changed files with 4 additions and 4 deletions

View File

@ -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]);

View File

@ -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. */
}