- fixed unwanted scanner zoom reset when switching HUDs. (manifest & trunk)

- code cleanup (trunk)

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3699 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Marc 2010-07-22 20:27:19 +00:00
parent 1cc13388dc
commit dee27e6e88
4 changed files with 15 additions and 10 deletions

View File

@ -1847,7 +1847,7 @@ static GLfloat sBaseMass = 0.0;
UPDATE_STAGE(@"updating scanner zoom");
if (scanner_zoom_rate)
{
double z = [hud scanner_zoom];
double z = [hud scannerZoom];
double z1 = z + scanner_zoom_rate * delta_t;
if (scanner_zoom_rate > 0.0)
{
@ -2753,8 +2753,9 @@ static GLfloat sBaseMass = 0.0;
- (BOOL) switchHudTo:(NSString *)hudFileName
{
NSDictionary *hudDict = nil;
BOOL theHudIsHidden = NO;
NSDictionary *hudDict = nil;
BOOL theHudIsHidden = NO;
double scannerZoom = 1.0;
if (!hudFileName) return NO;
@ -2766,7 +2767,11 @@ static GLfloat sBaseMass = 0.0;
return NO;
}
if (hud != nil) theHudIsHidden = [hud isHidden];
if (hud != nil)
{
theHudIsHidden = [hud isHidden];
scannerZoom = [hud scannerZoom];
}
// buggy oxp could override hud.plist with a non-dictionary.
if (hudDict != nil)
@ -2774,7 +2779,7 @@ static GLfloat sBaseMass = 0.0;
[hud setHidden:NO];
DESTROY(hud);
hud = [[HeadUpDisplay alloc] initWithDictionary:hudDict inFile:hudFileName];
[hud setScannerZoom:1.0];
[hud setScannerZoom:scannerZoom];
[hud resizeGuis: hudDict];
[hud setHidden:theHudIsHidden]; // reset hidden status to what it was originally.
}

View File

@ -2599,9 +2599,9 @@ static NSTimeInterval time_last_frame;
{
if (!scanner_zoom_rate)
{
if ([hud scanner_zoom] < 5.0)
if ([hud scannerZoom] < 5.0)
{
if (([hud scanner_zoom] > 1.0)||(!zoom_pressed))
if (([hud scannerZoom] > 1.0)||(!zoom_pressed))
scanner_zoom_rate = SCANNER_ZOOM_RATE_UP;
}
else
@ -2618,7 +2618,7 @@ static NSTimeInterval time_last_frame;
// Unzoom scanner 'Z'
if ([gameView isDown:key_scanner_unzoom] && ([gameView allowingStringInput] == gvStringInputNo)) // look for the 'Z' key
{
if ((!scanner_zoom_rate)&&([hud scanner_zoom] > 1.0))
if ((!scanner_zoom_rate)&&([hud scannerZoom] > 1.0))
scanner_zoom_rate = SCANNER_ZOOM_RATE_DOWN;
}

View File

@ -231,7 +231,7 @@ MA 02110-1301, USA.
- (NSString *) hudName;
- (void) setHudName:(NSString *)newHudName;
- (double) scanner_zoom;
- (double) scannerZoom;
- (void) setScannerZoom:(double) value;
- (GLfloat) overallAlpha;

View File

@ -321,7 +321,7 @@ OOINLINE void GLColorWithOverallAlpha(const GLfloat *color, GLfloat alpha)
}
- (double) scanner_zoom
- (double) scannerZoom
{
return scanner_zoom;
}