From 409dbff310a49f4c2c7aef03bfcd853247e15fc1 Mon Sep 17 00:00:00 2001
From: Allanis <allanis@saracraft.net>
Date: Tue, 26 Feb 2013 17:54:51 +0000
Subject: [PATCH] [Change] Improved hyperspace transition.

---
 src/player.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/src/player.c b/src/player.c
index 4625371..8ec70aa 100644
--- a/src/player.c
+++ b/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,14 +476,18 @@ 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.
-    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();
+		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.);
+      	glVertex2d( gl_screen.w/2.,  gl_screen.h/2.);
+      	glVertex2d( gl_screen.w/2., -gl_screen.h/2.);
+    	glEnd();
+		}
   }
 }
 
@@ -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.