- Added yet another strict/unrestricted difference (idea mentioned a few months ago IIRC): after game over, restricted mode always restarts with a Jameson. Unrestricted mode still uses the last save game in the current session.
- HUD: temperature bars are now drawn marginally faster, minor code cleanup. (& inadvertently cleaned up all tabs/spaces...) git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3128 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
parent
32f250e957
commit
1abbce6fc4
@ -229,7 +229,6 @@ OOINLINE void GLColorWithOverallAlpha(const GLfloat *color, GLfloat alpha)
|
|||||||
[legendArray release];
|
[legendArray release];
|
||||||
[dialArray release];
|
[dialArray release];
|
||||||
[hudName release];
|
[hudName release];
|
||||||
|
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -829,7 +828,6 @@ static BOOL hostiles;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (ms_blip > 0.0)
|
if (ms_blip > 0.0)
|
||||||
{
|
{
|
||||||
DrawSpecialOval(x1 - 0.5, y2 + 1.5, z1, NSMakeSize(16.0 * (1.0 - ms_blip), 8.0 * (1.0 - ms_blip)), 30, col);
|
DrawSpecialOval(x1 - 0.5, y2 + 1.5, z1, NSMakeSize(16.0 * (1.0 - ms_blip), 8.0 * (1.0 - ms_blip)), 30, col);
|
||||||
@ -874,7 +872,6 @@ static BOOL hostiles;
|
|||||||
|
|
||||||
for (i = 0; i < ent_count; i++)
|
for (i = 0; i < ent_count; i++)
|
||||||
[my_entities[i] release]; // released
|
[my_entities[i] release]; // released
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1060,7 +1057,6 @@ static BOOL hostiles;
|
|||||||
case COMPASS_MODE_BASIC:
|
case COMPASS_MODE_BASIC:
|
||||||
[self drawCompassPlanetBlipAt:relativePosition Size:NSMakeSize(6, 6) Alpha:alpha];
|
[self drawCompassPlanetBlipAt:relativePosition Size:NSMakeSize(6, 6) Alpha:alpha];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case COMPASS_MODE_PLANET:
|
case COMPASS_MODE_PLANET:
|
||||||
[self drawCompassPlanetBlipAt:relativePosition Size:sz Alpha:alpha];
|
[self drawCompassPlanetBlipAt:relativePosition Size:sz Alpha:alpha];
|
||||||
break;
|
break;
|
||||||
@ -1286,10 +1282,11 @@ OOINLINE void SetCompassBlipColor(GLfloat relativeZ, GLfloat alpha)
|
|||||||
hudDrawSurroundAt(x, y, z1, siz);
|
hudDrawSurroundAt(x, y, z1, siz);
|
||||||
}
|
}
|
||||||
// draw speed bar
|
// draw speed bar
|
||||||
if (ds > .25)
|
|
||||||
GLColorWithOverallAlpha(yellow_color, alpha);
|
|
||||||
if (ds > .80)
|
if (ds > .80)
|
||||||
GLColorWithOverallAlpha(red_color, alpha);
|
GLColorWithOverallAlpha(red_color, alpha);
|
||||||
|
else if (ds > .25)
|
||||||
|
GLColorWithOverallAlpha(yellow_color, alpha);
|
||||||
|
|
||||||
hudDrawBarAt(x, y, z1, siz, ds);
|
hudDrawBarAt(x, y, z1, siz, ds);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1585,14 +1582,22 @@ OOINLINE void SetCompassBlipColor(GLfloat relativeZ, GLfloat alpha)
|
|||||||
double temp = [player hullHeatLevel];
|
double temp = [player hullHeatLevel];
|
||||||
int flash = (int)([UNIVERSE getTime] * 4);
|
int flash = (int)([UNIVERSE getTime] * 4);
|
||||||
flash &= 1;
|
flash &= 1;
|
||||||
// draw ship_temperature bar
|
// draw ship_temperature bar (only need to call GLColor() once!)
|
||||||
GLColorWithOverallAlpha(green_color, alpha);
|
|
||||||
if (temp > .25)
|
|
||||||
GLColorWithOverallAlpha(yellow_color, alpha);
|
|
||||||
if (temp > .80)
|
if (temp > .80)
|
||||||
GLColorWithOverallAlpha(red_color, alpha);
|
{
|
||||||
if ((flash)&&(temp > .90))
|
if (temp > .90 && flash)
|
||||||
GLColorWithOverallAlpha(redplus_color, alpha);
|
GLColorWithOverallAlpha(redplus_color, alpha);
|
||||||
|
else
|
||||||
|
GLColorWithOverallAlpha(red_color, alpha);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (temp > .25)
|
||||||
|
GLColorWithOverallAlpha(yellow_color, alpha);
|
||||||
|
else
|
||||||
|
GLColorWithOverallAlpha(green_color, alpha);
|
||||||
|
}
|
||||||
|
|
||||||
[player setAlertFlag:ALERT_FLAG_TEMP to:((temp > .90)&&([player status] == STATUS_IN_FLIGHT))];
|
[player setAlertFlag:ALERT_FLAG_TEMP to:((temp > .90)&&([player status] == STATUS_IN_FLIGHT))];
|
||||||
hudDrawBarAt(x, y, z1, siz, temp);
|
hudDrawBarAt(x, y, z1, siz, temp);
|
||||||
}
|
}
|
||||||
@ -1617,12 +1622,13 @@ OOINLINE void SetCompassBlipColor(GLfloat relativeZ, GLfloat alpha)
|
|||||||
alpha *= [info oo_nonNegativeFloatForKey:ALPHA_KEY defaultValue:1.0f];
|
alpha *= [info oo_nonNegativeFloatForKey:ALPHA_KEY defaultValue:1.0f];
|
||||||
|
|
||||||
double temp = [player laserHeatLevel];
|
double temp = [player laserHeatLevel];
|
||||||
// draw weapon_temp bar
|
// draw weapon_temp bar (only need to call GLColor() once!)
|
||||||
GLColorWithOverallAlpha(green_color, alpha);
|
|
||||||
if (temp > .25)
|
|
||||||
GLColorWithOverallAlpha(yellow_color, alpha);
|
|
||||||
if (temp > .80)
|
if (temp > .80)
|
||||||
GLColorWithOverallAlpha(red_color, alpha);
|
GLColorWithOverallAlpha(red_color, alpha);
|
||||||
|
else if (temp > .25)
|
||||||
|
GLColorWithOverallAlpha(yellow_color, alpha);
|
||||||
|
else
|
||||||
|
GLColorWithOverallAlpha(green_color, alpha);
|
||||||
hudDrawBarAt(x, y, z1, siz, temp);
|
hudDrawBarAt(x, y, z1, siz, temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1649,11 +1655,21 @@ OOINLINE void SetCompassBlipColor(GLfloat relativeZ, GLfloat alpha)
|
|||||||
int flash = (int)([UNIVERSE getTime] * 4);
|
int flash = (int)([UNIVERSE getTime] * 4);
|
||||||
flash &= 1;
|
flash &= 1;
|
||||||
|
|
||||||
// draw altitude bar
|
// draw altitude bar (evaluating the least amount of ifs per go)
|
||||||
if ((flash)&&(alt < .10)) GLColorWithOverallAlpha(redplus_color, alpha);
|
if (alt < .25)
|
||||||
else if (alt < .25) GLColorWithOverallAlpha(red_color, alpha);
|
{
|
||||||
else if (alt < .75) GLColorWithOverallAlpha(yellow_color, alpha);
|
if (alt < .10 && flash)
|
||||||
else GLColorWithOverallAlpha(green_color, alpha);
|
GLColorWithOverallAlpha(redplus_color, alpha);
|
||||||
|
else
|
||||||
|
GLColorWithOverallAlpha(red_color, alpha);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (alt < .75)
|
||||||
|
GLColorWithOverallAlpha(yellow_color, alpha);
|
||||||
|
else
|
||||||
|
GLColorWithOverallAlpha(green_color, alpha);
|
||||||
|
}
|
||||||
|
|
||||||
hudDrawBarAt(x, y, z1, siz, alt);
|
hudDrawBarAt(x, y, z1, siz, alt);
|
||||||
|
|
||||||
@ -2348,7 +2364,7 @@ static OOPolygonSprite *IconForMissileRole(NSString *role)
|
|||||||
OOGL(glColor4f(0.0, 1.0, 0.0, 1.0));
|
OOGL(glColor4f(0.0, 1.0, 0.0, 1.0));
|
||||||
// position the watermark string on the top right hand corner of the game window and right-align it
|
// position the watermark string on the top right hand corner of the game window and right-align it
|
||||||
OODrawString(watermarkString, MAIN_GUI_PIXEL_WIDTH / 2 - watermarkStringSize.width + 80,
|
OODrawString(watermarkString, MAIN_GUI_PIXEL_WIDTH / 2 - watermarkStringSize.width + 80,
|
||||||
MAIN_GUI_PIXEL_HEIGHT / 2 - watermarkStringSize.height, z1, NSMakeSize(10,10));
|
MAIN_GUI_PIXEL_HEIGHT / 2 - watermarkStringSize.height, z1, NSMakeSize(10,10));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------//
|
//---------------------------------------------------------------------//
|
||||||
|
@ -2721,8 +2721,9 @@ GLfloat docked_light_specular[4] = { DOCKED_ILLUM_LEVEL, DOCKED_ILLUM_LEVEL, DOC
|
|||||||
|
|
||||||
- (void) game_over
|
- (void) game_over
|
||||||
{
|
{
|
||||||
if ([[gameView gameController] playerFileToLoad]) [[gameView gameController] loadPlayerIfRequired];
|
// In unrestricted mode, reload last save game, if any. In strict mode, always restart as a fresh Jameson.
|
||||||
else [self reinitAndShowDemo:NO];
|
if (![self strict] && [[gameView gameController] playerFileToLoad]) [[gameView gameController] loadPlayerIfRequired];
|
||||||
|
else [self reinitAndShowDemo:NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user