[Add] Fade to white when hyperspacing. Might want to add sound to that later.

This commit is contained in:
Allanis 2013-02-20 21:10:39 +00:00
parent c5fa395f17
commit 376a3af395
2 changed files with 16 additions and 1 deletions

View File

@ -357,7 +357,6 @@ void gl_blitSprite(const glTexture* sprite, const double bx, const double by,
ty = sprite->sh * (sprite->sy-(double)sy-1)/sprite->rh;
// Actual blitting....
glShadeModel(GL_FLAT);
glBindTexture(GL_TEXTURE_2D, sprite->texture);
glBegin(GL_QUADS);
if(c == NULL) glColor4d(1., 1., 1., 1.);

View File

@ -37,6 +37,7 @@ double player_acc = 0.; // Accel velocity from input.
unsigned int player_target = PLAYER_ID; // Targetted pilot.
static int planet_target = -1; // Targetted planet.
static int hyperspace_target = -1; // Target hyperspace route.
static double hyperspace_flash = 0.;
// Pilot stuff for GUI.
extern Pilot** pilot_stack;
@ -442,6 +443,18 @@ void player_render(void) {
else gl_print(NULL, x, y, NULL, "%s", msg_stack[msg_max-i-1].str);
}
}
// Hyperspace FLASH BANG!!!
if(pilot_isFlag(player, PILOT_HYPERSPACE)) {
x = 1. - (double)(player->ptimer - SDL_GetTicks()) / HYPERSPACE_FLY_DELAY;
glColor4d(1.,1.,1.,pow(x,16)); // We'll | I'll, make this more effiecent later.
glBegin(GL_QUADS);
glVertex2d(-gl_screen.w/2., -gl_screen.h/2.);
glVertex2d(-gl_screen.w/2., gl_screen.h/2.);
glVertex2d( gl_screen.w/2., gl_screen.h/2.);
glVertex2d( gl_screen.w/2., -gl_screen.h/2.);
glEnd();
}
}
// Renders a pilot.
@ -945,6 +958,9 @@ void player_brokeHyperspace(void) {
// Stop hyperspace.
pilot_rmFlag(player, PILOT_HYPERSPACE | PILOT_HYP_BEGIN | PILOT_HYP_PREP);
// Done with that flash thingy.
hyperspace_flash = 0.;
}
// Take a screenshot.