From eda894e7dcd0015a9bf9de5816ccb0b41e4f6620 Mon Sep 17 00:00:00 2001 From: Jens Ayton Date: Sun, 11 Mar 2007 13:09:28 +0000 Subject: [PATCH] Possibly fixed mouse control bug under OS X. Or not. git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@849 127b21dd-08f5-0310-b4b7-95ae10353056 --- Resources/Config/logcontrol.plist | 9 +++++++++ src/Core/AI.m | 3 ++- src/Core/PlayerEntity.m | 10 ++++++---- src/Core/PlayerEntityControls.m | 9 +++++---- src/Core/Universe.m | 3 ++- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Resources/Config/logcontrol.plist b/Resources/Config/logcontrol.plist index 7f2e837f..194aa608 100644 --- a/Resources/Config/logcontrol.plist +++ b/Resources/Config/logcontrol.plist @@ -59,6 +59,11 @@ ai.takeAction.noAction = $entityState; ai.takeAction.orphaned = $error; ai.takeAction.debugMessage = inherit; ai.takeAction.badSelector = $scriptError; +ai.pop = $entityState; + + +beacon.list = $scriptDebugOn; +beacon.list.flightTraining = inherit; dataCache.found = inherit; @@ -103,6 +108,10 @@ entity.linkedList.verify.rebuild = inherit; entity.linkedList.update.error = $linkedListError; +equip.buy.mounted = no; +equip.buy.mounted.failed = $scriptError; + + input.keyMapping.codeOutOfRange = inherit; input.keyMapping.keyPress = no; input.keyMapping.keyPress.keyDown = inherit; diff --git a/src/Core/AI.m b/src/Core/AI.m index 170e1ba8..5fb0bd10 100644 --- a/src/Core/AI.m +++ b/src/Core/AI.m @@ -34,6 +34,7 @@ static NSString * const kOOLogAINoAction = @"ai.takeAction.noAction"; static NSString * const kOOLogAITakeActionOrphaned = @"ai.takeAction.orphaned"; static NSString * const kOOLogAIDebugMessage = @"ai.takeAction.debugNessage"; static NSString * const kOOLogAIBadSelector = @"ai.takeAction.badSelector"; +static NSString * const kOOLogAIPop = @"ai.pop"; @implementation AI @@ -179,7 +180,7 @@ static NSString * const kOOLogAIBadSelector = @"ai.takeAction.badSelector"; { if ([ai_stack count] > 0) { - if ((owner)&&([owner reportAImessages])) NSLog(@"Popping previous state machine for %@",self); + if ((owner)&&([owner reportAImessages])) OOLog(kOOLogAIPop, @"Popping previous state machine for %@",self); [self restorePreviousStateMachine]; [self reactToMessage:@"RESTARTED"]; } diff --git a/src/Core/PlayerEntity.m b/src/Core/PlayerEntity.m index 216ba59a..a87465f4 100644 --- a/src/Core/PlayerEntity.m +++ b/src/Core/PlayerEntity.m @@ -54,6 +54,10 @@ MA 02110-1301, USA. #define OG_ELITE_FORWARD_DRIFT 10.0f +static NSString * const kOOLogBuyMountedOK = @"equip.buy.mounted"; +static NSString * const kOOLogBuyMountedFailed = @"equip.buy.mounted.failed"; + + @implementation PlayerEntity static Quaternion quaternion_identity = { (GLfloat)1.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0}; @@ -5886,10 +5890,8 @@ static int last_outfitting_index; if ([eq_key hasSuffix:@"MISSILE"]||[eq_key hasSuffix:@"MINE"]) { ShipEntity* weapon = [[universe getShipWithRole:eq_key] autorelease]; - if (weapon) - NSLog(@"got ship for role %@", eq_key); - else - NSLog(@"could not find ship for role %@", eq_key); + if (weapon) OOLog(kOOLogBuyMountedOK, @"Got ship for mounted weapon role %@", eq_key); + else OOLog(kOOLogBuyMountedFailed, @"Could not find ship for mounted weapon role %@", eq_key); BOOL mounted_okay = [self mountMissile:weapon]; if (mounted_okay) diff --git a/src/Core/PlayerEntityControls.m b/src/Core/PlayerEntityControls.m index ce8e147d..03816067 100644 --- a/src/Core/PlayerEntityControls.m +++ b/src/Core/PlayerEntityControls.m @@ -41,6 +41,10 @@ MA 02110-1301, USA. #import "Groolite.h" #endif + +static NSString * const kOOLogFlightTrainingBeacons = @"beacon.list.flightTraining"; + + @implementation PlayerEntity (Controls) - (void) pollControls:(double) delta_t @@ -929,7 +933,7 @@ static NSTimeInterval time_last_frame; if ([gameView isDown:'f'])// look for the 'f' key { [universe addMessage:@"Flight Training Test Engaged" forCount:3]; - NSLog(@"Flight Training (tr) beacons:\n%@", [universe listBeaconsWithCode:@"tr"]); + OOLog(kOOLogFlightTrainingBeacons, @"Flight Training (tr) beacons:\n%@", [universe listBeaconsWithCode:@"tr"]); [self awardEquipment:@"EQ_DOCK_COMP"]; [self targetFirstBeaconWithCode:@"tr"]; [self setRacepointsFromTarget]; @@ -965,7 +969,6 @@ static NSTimeInterval time_last_frame; [universe setDoProcedurallyTexturedPlanets: YES]; [universe addMessage:@"Procedural Textures On" forCount:3]; } - } // // Pause game 'p' @@ -1103,11 +1106,9 @@ static BOOL taking_snapshot; if (mouse_control_on) { [universe addMessage:[universe expandDescription:@"[mouse-on]" forSystem:system_seed] forCount:3.0]; -#ifdef GNUSTEP // ensure the keyboard pitch override (intended to lock out the joystick if the // player runs to the keyboard) is reset keyboardRollPitchOverride = NO; -#endif } else [universe addMessage:[universe expandDescription:@"[mouse-off]" forSystem:system_seed] forCount:3.0]; diff --git a/src/Core/Universe.m b/src/Core/Universe.m index f30f8688..cd091bf2 100644 --- a/src/Core/Universe.m +++ b/src/Core/Universe.m @@ -54,6 +54,7 @@ static NSString * const kOOLogScriptNoSystemForName = @"script.debug.note.syst static NSString * const kOOLogStringCoordinateConversion = @"strings.conversion.coordinates"; extern NSString * const kOOLogEntityVerificationError; static NSString * const kOOLogEntityVerificationRebuild = @"entity.linkedList.verify.rebuild"; +static NSString * const kOOLogFoundBeacon = @"beacon.list"; @implementation Universe @@ -7837,7 +7838,7 @@ NSComparisonResult comparePrice( id dict1, id dict2, void * context) while (beacon) { NSString* beacon_code = [beacon beaconCode]; - NSLog(@"beacon: %@ %@", beacon, beacon_code); + OOLog(kOOLogFoundBeacon, @"Beacon: %@ has code %@", beacon, beacon_code); if ([beacon_code rangeOfString:code options: NSCaseInsensitiveSearch].location != NSNotFound) [result addObject:beacon]; beacon = (ShipEntity*)[self entityForUniversalID:[beacon nextBeaconID]];