[Change] Improved hyperspace transition.
This commit is contained in:
parent
a10931b7b6
commit
409dbff310
11
src/player.c
11
src/player.c
@ -43,7 +43,6 @@ unsigned int player_target = PLAYER_ID; // Targetted pilot.
|
||||
static int planet_target = -1; // Targetted planet.
|
||||
// Internal.
|
||||
static int hyperspace_target = -1; // Target hyperspace route.
|
||||
static double hyperspace_flash = 0.;
|
||||
|
||||
// Pilot stuff for GUI.
|
||||
extern Pilot** pilot_stack;
|
||||
@ -477,8 +476,11 @@ void player_render(void) {
|
||||
}
|
||||
// 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.
|
||||
i = (int)player->ptimer - HYPERSPACE_FLY_DELAY/4.;
|
||||
j = (int)SDL_GetTicks();
|
||||
if(i < j) {
|
||||
x = (double)(j-i) / (HYPERSPACE_FLY_DELAY/4.);
|
||||
glColor4d(1.,1.,1.,pow(x,4)); // 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.);
|
||||
@ -487,6 +489,7 @@ void player_render(void) {
|
||||
glEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Renders a pilot.
|
||||
static void gui_renderPilot(const Pilot* p) {
|
||||
@ -991,9 +994,7 @@ void player_brokeHyperspace(void) {
|
||||
// Stop hyperspace.
|
||||
pilot_rmFlag(player, PILOT_HYPERSPACE | PILOT_HYP_BEGIN | PILOT_HYP_PREP);
|
||||
|
||||
// Done with that flash thingy.
|
||||
player_message("BANG!");
|
||||
hyperspace_flash = 0.;
|
||||
}
|
||||
|
||||
// Take a screenshot.
|
||||
|
Loading…
Reference in New Issue
Block a user