Oolite 1.93.0.7767-260207-f2a8cb5
Loading...
Searching...
No Matches
GameController Class Reference

#include <GameController.h>

Inheritance diagram for GameController:
Collaboration diagram for GameController:

Instance Methods

(void) - applicationDidFinishLaunching:
(BOOL) - finishedLaunching
(BOOL) - isGamePaused
(void) - setGamePaused:
(OOMouseInteractionMode- mouseInteractionMode
(void) - setMouseInteractionMode:
(void) - setMouseInteractionModeForFlight
(void) - setMouseInteractionModeForUIWithMouseInteraction:
(void) - performGameTick:
(IBAction) - showLogAction:
(IBAction) - showLogFolderAction:
(IBAction) - showSnapshotsAction:
(IBAction) - showAddOnsAction:
(void) - recenterVirtualJoystick
(void) - exitAppWithContext:
(void) - exitAppCommandQ
(NSString *) - playerFileToLoad
(void) - setPlayerFileToLoad:
(NSString *) - playerFileDirectory
(void) - setPlayerFileDirectory:
(void) - loadPlayerIfRequired
(void) - beginSplashScreen
(void) - logProgress:
(void) - endSplashScreen
(void) - startAnimationTimer
(void) - stopAnimationTimer
(MyOpenGLView *) - gameView
(void) - setGameView:
(void) - windowDidResize:
(void) - setUpBasicOpenGLStateWithSize:
(NSURL *) - snapshotsURLCreatingIfNeeded:
(id) - init [implementation]
(void) - dealloc [implementation]
(void) - doPerformGameTick [implementation]
(BOOL) - isDirectoryAtPath: [implementation]
(BOOL) - addOnsExistAtPath: [implementation]
(void) - openPath: [implementation]
(BOOL) - validateMenuItem: [implementation]
(NSMenu *) - applicationDockMenu: [implementation]
(void) - awakeFromNib [implementation]
(BOOL) - application:openFile: [implementation]
(NSApplicationTerminateReply) - applicationShouldTerminate: [implementation]
(void) - reportUnhandledStartupException: [implementation]
(BOOL) - suppressClangStuff [implementation]
(IBAction) - toggleFullScreenAction: [implementation]
(void) - setFullScreenMode: [implementation]
(void) - exitFullScreenMode [implementation]
(BOOL) - inFullScreenMode [implementation]
(BOOL) - setDisplayWidth:Height:Refresh: [implementation]
(NSDictionary *) - findDisplayModeForWidth:Height:Refresh: [implementation]
(NSArray *) - displayModes [implementation]
(NSUInteger) - indexOfCurrentDisplayMode [implementation]
(void) - pauseFullScreenModeToPerform:onTarget: [implementation]
(void) - setUpDisplayModes [implementation]
(void) - toggleFullScreenCalledForWindow:withSender: [implementation]

Class Methods

(GameController *) + sharedController
(static id) + GetPreference [implementation]
(static void) + SetPreference [implementation]
(static void) + RemovePreference [implementation]

Private Attributes

IBOutlet NSTextField * splashProgressTextField
IBOutlet NSView * splashView
IBOutlet NSWindow * gameWindow
IBOutlet PDFView * helpView
IBOutlet NSMenu * dockMenu
IBOutlet MyOpenGLViewgameView
NSTimeInterval last_timeInterval
double delta_t
int my_mouse_x
int my_mouse_y
NSString * playerFileDirectory
NSString * playerFileToLoad
NSMutableArray * expansionPathsToInclude
NSTimer * timer
NSTimeInterval _animationTimerInterval
NSDate * _splashStart
SEL pauseSelector
NSObject * pauseTarget
BOOL gameIsPaused
OOMouseInteractionMode _mouseMode
OOMouseInteractionMode _resumeMode
OOFullScreenController_fullScreenController

Detailed Description

Definition at line 52 of file GameController.h.

Method Documentation

◆ addOnsExistAtPath:

- (BOOL) addOnsExistAtPath: (NSString *) path
implementation

Definition at line 576 of file GameController.m.

576 :(NSString *)path
577{
578 if (![self isDirectoryAtPath:path]) return NO;
579
580 NSWorkspace *workspace = NSWorkspace.sharedWorkspace;
581 for (NSString *subPath in [NSFileManager.defaultManager enumeratorAtPath:path]) {
582 subPath = [path stringByAppendingPathComponent:subPath];
583 NSString *type = [workspace typeOfFile:subPath error:NULL];
584 if ([workspace type:type conformsToType:@"org.aegidian.oolite.expansion"]) return YES;
585 }
586
587 return NO;
588}

◆ application:openFile:

- (BOOL) application: (NSApplication *) theApplication
openFile: (NSString *) filename 
implementation

Definition at line 796 of file GameController.m.

796 :(NSApplication *)theApplication openFile:(NSString *)filename
797{
798 if ([[filename pathExtension] isEqual:@"oolite-save"])
799 {
800 [self setPlayerFileToLoad:filename];
801 [self setPlayerFileDirectory:filename];
802 return YES;
803 }
804 if ([[filename pathExtension] isEqualToString:@"oxp"])
805 {
806 BOOL dir_test;
807 [[NSFileManager defaultManager] fileExistsAtPath:filename isDirectory:&dir_test];
808 if (dir_test)
809 {
811 {
812 expansionPathsToInclude = [[NSMutableArray alloc] init];
813 }
814 [expansionPathsToInclude addObject:filename];
815 return YES;
816 }
817 }
818 return NO;
819}
return nil
NSMutableArray * expansionPathsToInclude
const char * filename
Definition ioapi.h:133

References expansionPathsToInclude, nil, setPlayerFileDirectory:, and setPlayerFileToLoad:.

Here is the call graph for this function:

◆ applicationDidFinishLaunching:

- (void) applicationDidFinishLaunching: (NSNotification *) notification

Definition at line 205 of file GameController.m.

205 :(NSNotification *)notification
206{
207 NSAutoreleasePool *pool = nil;
208 unsigned i;
209
210 pool = [[NSAutoreleasePool alloc] init];
211
212 @try
213 {
214 // if not verifying oxps, ensure that gameView is drawn to using beginSplashScreen
215 // OpenGL is initialised and that allows textures to initialise too.
216
217#if OO_OXP_VERIFIER_ENABLED
218
219 if ([OOOXPVerifier runVerificationIfRequested])
220 {
221 [self exitAppWithContext:@"OXP verifier run"];
222 }
223 else
224 {
225 [self beginSplashScreen];
226 }
227
228#else
229 [self beginSplashScreen];
230#endif
231
232#if OOLITE_MAC_OS_X
234 SetUpSparkle();
235#endif
236
237 [self setUpDisplayModes];
238
239 // moved to before the Universe is created
241 {
242 for (i = 0; i < [expansionPathsToInclude count]; i++)
243 {
244 [ResourceManager addExternalPath: (NSString*)[expansionPathsToInclude objectAtIndex: i]];
245 }
246 }
247
248 // initialise OXZ manager
250
251 // moved here to try to avoid initialising this before having an Open GL context
252 //[self logProgress:DESC(@"Initialising universe")]; // DESC expansions only possible after Universe init
253 [[Universe alloc] initWithGameView:gameView];
254
255 [self loadPlayerIfRequired];
256
257 [self logProgress:@""];
258
259 // get the run loop and add the call to performGameTick:
260 [self startAnimationTimer];
261
262 [self endSplashScreen];
263 }
264 @catch (NSException *exception)
265 {
266 [self reportUnhandledStartupException:exception];
267 exit(EXIT_FAILURE);
268 }
269
270 OOLog(@"startup.complete", @"========== Loading complete in %.2f seconds. ==========", -[_splashStart timeIntervalSinceNow]);
271
272#if OO_USE_FULLSCREEN_CONTROLLER
273 [self setFullScreenMode:[[NSUserDefaults standardUserDefaults] boolForKey:@"fullscreen"]];
274#endif
275
276 _finishedLaunching = YES;
277
278 // Release anything allocated above that is not required.
279 [pool release];
280
281#if !OOLITE_MAC_OS_X
282 [[NSRunLoop currentRunLoop] run];
283#endif
284}
static void SetUpSparkle(void)
#define OOLog(class, format,...)
Definition OOLogging.h:88
NSDate * _splashStart
BOOL setStickHandlerClass:(Class aClass)
OOOXZManager * sharedManager()
void addExternalPath:(NSString *fileName)

References _splashStart, ResourceManager::addExternalPath:, beginSplashScreen, endSplashScreen, exitAppWithContext:, expansionPathsToInclude, loadPlayerIfRequired, logProgress:, nil, OOLog, reportUnhandledStartupException:, setFullScreenMode:, OOJoystickManager::setStickHandlerClass:, setUpDisplayModes, SetUpSparkle(), OOOXZManager::sharedManager, and startAnimationTimer.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ applicationDockMenu:

- (NSMenu *) applicationDockMenu: (NSApplication *) sender
implementation

Definition at line 641 of file GameController.m.

641 :(NSApplication *)sender
642{
643 return dockMenu;
644}
IBOutlet NSMenu * dockMenu

References dockMenu.

◆ applicationShouldTerminate:

- (NSApplicationTerminateReply) applicationShouldTerminate: (NSApplication *) sender
implementation

Definition at line 830 of file GameController.m.

830 :(NSApplication *)sender
831{
834 return NSTerminateNow;
835}
void OOLoggingTerminate(void)
Definition OOLogging.m:612
OOCacheManager * sharedCache()

References OOCacheManager::finishOngoingFlush, OOLoggingTerminate(), and OOCacheManager::sharedCache.

Here is the call graph for this function:

◆ awakeFromNib

- (void) awakeFromNib
implementation

Definition at line 779 of file GameController.m.

780{
781 NSString *path = nil;
782
783 // Set contents of Help window
784 path = [[NSBundle mainBundle] pathForResource:@"OoliteReadMe" ofType:@"pdf"];
785 if (path != nil)
786 {
787 PDFDocument *document = [[PDFDocument alloc] initWithURL:[NSURL fileURLWithPath:path]];
788 [helpView setDocument:document];
789 [document release];
790 }
791 [helpView setBackgroundColor:[NSColor whiteColor]];
792}

References awakeFromNib, and nil.

Referenced by awakeFromNib.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ beginSplashScreen

- (void) beginSplashScreen

Definition at line 307 of file GameController.m.

308{
309#if !OOLITE_MAC_OS_X
310 if(!gameView)
311 {
312 gameView = [MyOpenGLView alloc];
313 [gameView init];
314 [gameView setGameController:self];
315 [gameView initSplashScreen];
316 }
317#else
318 [gameView updateScreen];
319#endif
320}
IBOutlet MyOpenGLView * gameView

References beginSplashScreen, gameView, MyOpenGLView::init, MyOpenGLView::initSplashScreen, MyOpenGLView::setGameController:, and MyOpenGLView::updateScreen.

Referenced by applicationDidFinishLaunching:, beginSplashScreen, and playerFileDirectory.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dealloc

- (void) dealloc
implementation

Definition at line 109 of file GameController.m.

110{
111#if OOLITE_MAC_OS_X
112 [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:UNIVERSE];
113#endif
114
115 [timer release];
116 [gameView release];
117 [UNIVERSE release];
118
119 [playerFileToLoad release];
120 [playerFileDirectory release];
121 [expansionPathsToInclude release];
122
123 [super dealloc];
124}

References dealloc.

Referenced by dealloc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ displayModes

- (NSArray *) displayModes
implementation

Provided by category GameController(FullScreen).

Definition at line 156 of file GameController+FullScreen.m.

157{
158 return [_fullScreenController displayModes];
159}

Referenced by gameView, PlayerEntity(OOControlsPrivate)::handleGameOptionsScreenKeys, and PlayerEntity::setGuiToGameOptionsScreen.

Here is the caller graph for this function:

◆ doPerformGameTick

- (void) doPerformGameTick
implementation

Provided by category GameController(OOPrivate).

Definition at line 346 of file GameController.m.

347{
348 @try
349 {
350 if (gameIsPaused)
351 delta_t = 0.0; // no movement!
352 else
353 {
354 delta_t = [NSDate timeIntervalSinceReferenceDate] - last_timeInterval;
357 delta_t = MINIMUM_GAME_TICK; // peg the maximum pause (at 0.5->1.0 seconds) to protect against when the machine sleeps
358 }
359
360 [UNIVERSE update:delta_t];
361 if (EXPECT_NOT([PLAYER status] == STATUS_RESTART_GAME))
362 {
363 [UNIVERSE reinitAndShowDemo:YES];
364 }
365 [OOSound update];
366 if (!gameIsPaused)
367 {
369 }
370 }
371 @catch (id exception)
372 {
373 OOLog(@"exception.backtrace",@"%@",[exception callStackSymbols]);
374 }
375
376 @try
377 {
378 [gameView display];
379 }
380 @catch (id exception) {}
381}
#define MINIMUM_GAME_TICK
#define EXPECT_NOT(x)
void OOJSFrameCallbacksInvoke(OOTimeDelta delta)
#define PLAYER
NSTimeInterval last_timeInterval
void update()
Definition OOALSound.m:149

References GameController(OOPrivate)::doPerformGameTick, EXPECT_NOT, MINIMUM_GAME_TICK, OOJSFrameCallbacksInvoke(), OOLog, PLAYER, and OOSound::update.

Referenced by GameController(OOPrivate)::doPerformGameTick, and performGameTick:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ endSplashScreen

- (void) endSplashScreen

Definition at line 758 of file GameController.m.

759{
760 OOLogSetDisplayMessagesInClass(@"startup.progress", NO);
761
762#if OOLITE_MAC_OS_X
763 // These views will be released when we replace the content view.
765 splashView = nil;
766
767 [gameWindow setAcceptsMouseMovedEvents:YES];
768 [gameWindow setContentView:gameView];
769 [gameWindow makeFirstResponder:gameView];
770#elif OOLITE_SDL
771 [gameView endSplashScreen];
772#endif
773}
void OOLogSetDisplayMessagesInClass(NSString *inClass, BOOL inFlag)
Definition OOLogging.m:182
IBOutlet NSTextField * splashProgressTextField
IBOutlet NSView * splashView

References endSplashScreen, MyOpenGLView::endSplashScreen, nil, OOLogSetDisplayMessagesInClass(), splashProgressTextField, and splashView.

Referenced by applicationDidFinishLaunching:, endSplashScreen, and playerFileDirectory.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exitAppCommandQ

- (void) exitAppCommandQ

Definition at line 867 of file GameController.m.

868{
869 [self exitAppWithContext:@"Command-Q"];
870}

References exitAppCommandQ, and exitAppWithContext:.

Referenced by exitAppCommandQ.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exitAppWithContext:

- (void) exitAppWithContext: (NSString *) context

Definition at line 822 of file GameController.m.

822 :(NSString *)context
823{
824 [gameView.window orderOut:nil];
825 [(OoliteApp *)NSApp setExitContext:context];
826 [NSApp terminate:self];
827}
void setExitContext:(NSString *exitContext)
Definition OoliteApp.m:58

References OoliteApp::setExitContext:.

Referenced by applicationDidFinishLaunching:, exitAppCommandQ, OOStandardsInternal(), PlayerEntity(OOControlsPrivate)::pollApplicationControls, and MyOpenGLView::pollControls.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exitFullScreenMode

- (void) exitFullScreenMode
implementation

Provided by category GameController(FullScreen).

Definition at line 123 of file GameController+FullScreen.m.

124{
125 [self setFullScreenMode:NO];
126}

Referenced by gameView, and PlayerEntity(OOControlsPrivate)::pollApplicationControls.

Here is the caller graph for this function:

◆ findDisplayModeForWidth:Height:Refresh:

- (NSDictionary *) findDisplayModeForWidth: (unsigned int) d_width
Height: (unsigned int) d_height
Refresh: (unsigned int) d_refresh 
implementation

Provided by category GameController(FullScreen).

Definition at line 150 of file GameController+FullScreen.m.

150 :(unsigned int)d_width Height:(unsigned int)d_height Refresh:(unsigned int)d_refresh
151{
152 return [_fullScreenController findDisplayModeForWidth:d_width height:d_height refreshRate:d_refresh];
153}
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque

◆ finishedLaunching

- (BOOL) finishedLaunching

Definition at line 287 of file GameController.m.

288{
289 return _finishedLaunching;
290}

References finishedLaunching.

Referenced by finishedLaunching.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gameView

References displayModes, exitFullScreenMode, gameView, indexOfCurrentDisplayMode, inFullScreenMode, and setUpDisplayModes.

Here is the call graph for this function:

◆ GetPreference

+ (id) GetPreference (NSString *) key
(Class) expectedClass 
implementation

Definition at line 435 of file GameController.m.

436{
437 id result = [[NSUserDefaults standardUserDefaults] objectForKey:key];
438 if (expectedClass != Nil && ![result isKindOfClass:expectedClass]) result = nil;
439
440 return result;
441}

References nil.

Referenced by snapshotsURLCreatingIfNeeded:.

Here is the caller graph for this function:

◆ indexOfCurrentDisplayMode

- (NSUInteger) indexOfCurrentDisplayMode
implementation

Provided by category GameController(FullScreen).

Definition at line 162 of file GameController+FullScreen.m.

163{
164 return [_fullScreenController indexOfCurrentDisplayMode];
165}

Referenced by gameView, PlayerEntity(OOControlsPrivate)::handleGameOptionsScreenKeys, and PlayerEntity::setGuiToGameOptionsScreen.

Here is the caller graph for this function:

◆ inFullScreenMode

- (BOOL) inFullScreenMode
implementation

Provided by category GameController(FullScreen).

Definition at line 100 of file GameController+FullScreen.m.

101{
102 return [_fullScreenController inFullScreenMode];
103}

Referenced by Universe::gameSettings, gameView, PlayerEntity(OOControlsPrivate)::pollApplicationControls, setMouseInteractionMode:, and GameController(FullScreen)::toggleFullScreenAction:.

Here is the caller graph for this function:

◆ init

- (id) init
implementation

Definition at line 83 of file GameController.m.

84{
86 {
87 [self release];
88 [NSException raise:NSInternalInconsistencyException format:@"%s: expected only one GameController to exist at a time.", __PRETTY_FUNCTION__];
89 }
90
91 if ((self = [super init]))
92 {
93 _finishedLaunching = NO;
94 last_timeInterval = [NSDate timeIntervalSinceReferenceDate];
95 delta_t = 0.01; // one hundredth of a second
96 _animationTimerInterval = [[NSUserDefaults standardUserDefaults] oo_doubleForKey:@"animation_timer_interval" defaultValue:MINIMUM_ANIMATION_TICK];
97
98 // rather than seeding this with the date repeatedly, seed it
99 // once here at startup
100 ranrot_srand((uint32_t)[[NSDate date] timeIntervalSince1970]); // reset randomiser with current time
101
102 _splashStart = [[NSDate alloc] init];
103 }
104
105 return self;
106}
static GameController * sSharedController
NSTimeInterval _animationTimerInterval
void ranrot_srand(uint32_t seed)

References _animationTimerInterval, _splashStart, delta_t, init, last_timeInterval, nil, ranrot_srand(), and sSharedController.

Referenced by init.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isDirectoryAtPath:

- (BOOL) isDirectoryAtPath: (NSString *) path
implementation

Definition at line 569 of file GameController.m.

569 :(NSString *)path
570{
571 BOOL isDirectory;
572 return [NSFileManager.defaultManager fileExistsAtPath:path isDirectory:&isDirectory] && isDirectory;
573}

◆ isGamePaused

- (BOOL) isGamePaused

Definition at line 127 of file GameController.m.

128{
129 return gameIsPaused;
130}

References gameIsPaused, and isGamePaused.

Referenced by isGamePaused, and Universe::setViewDirection:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadPlayerIfRequired

- (void) loadPlayerIfRequired

Definition at line 293 of file GameController.m.

294{
295 if (playerFileToLoad != nil)
296 {
297 [self logProgress:DESC(@"loading-player")];
298 // fix problem with non-shader lighting when starting skips
299 // the splash screen
300 [UNIVERSE useGUILightSource:YES];
301 [UNIVERSE useGUILightSource:NO];
302 [PLAYER loadPlayerFromFile:playerFileToLoad asNew:NO];
303 }
304}
NSString * playerFileToLoad

References loadPlayerIfRequired, logProgress:, nil, and playerFileToLoad.

Referenced by applicationDidFinishLaunching:, Universe::handleGameOver, loadPlayerIfRequired, and playerFileDirectory.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ logProgress:

- (void) logProgress: (NSString *) message

Definition at line 668 of file GameController.m.

668 :(NSString *)message
669{
670 if (![UNIVERSE doingStartUp]) return;
671
672#if OOLITE_MAC_OS_X
673 [splashProgressTextField setStringValue:message];
674 [splashProgressTextField display];
675#endif
676 if([message length] > 0)
677 {
678 OOLog(@"startup.progress", @"===== [%.2f s] %@", -[_splashStart timeIntervalSinceNow], message);
679 }
680}
#define UNIVERSE
Definition Universe.h:844

References _splashStart, OOLog, and UNIVERSE.

Referenced by applicationDidFinishLaunching:, Universe::initWithGameView:, loadPlayerIfRequired, NoteVerificationStage(), PlayerEntity::setUpAndConfirmOK:saveGame:, and Universe::setUpSpace.

Here is the caller graph for this function:

◆ mouseInteractionMode

- (OOMouseInteractionMode) mouseInteractionMode

Definition at line 151 of file GameController.m.

152{
153 return _mouseMode;
154}
OOMouseInteractionMode _mouseMode

References _mouseMode, and mouseInteractionMode.

Referenced by mouseInteractionMode, and setGamePaused:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ openPath:

- (void) openPath: (NSString *) path
implementation

Definition at line 591 of file GameController.m.

591 :(NSString *)path
592{
593 [NSWorkspace.sharedWorkspace openURL:[NSURL fileURLWithPath:path]];
594}

Referenced by showAddOnsAction:.

Here is the caller graph for this function:

◆ pauseFullScreenModeToPerform:onTarget:

- (void) pauseFullScreenModeToPerform: (SEL) selector
onTarget: (id) target 
implementation

Provided by category GameController(FullScreen).

Definition at line 168 of file GameController+FullScreen.m.

168 :(SEL)selector onTarget:(id)target
169{
170 [target performSelector:selector];
171}

Referenced by PlayerEntity(OOControlsPrivate)::pollApplicationControls, PlayerEntity(OOControlsPrivate)::pollGuiArrowKeyControls:, and MyOpenGLView::update.

Here is the caller graph for this function:

◆ performGameTick:

- (void) performGameTick: (id) sender

Definition at line 325 of file GameController.m.

325 :(id)sender
326{
327 [gameView pollControls];
328 [self doPerformGameTick];
329}

References doPerformGameTick, and MyOpenGLView::pollControls.

Here is the call graph for this function:

◆ playerFileDirectory

- (NSString *) playerFileDirectory

References beginSplashScreen, endSplashScreen, loadPlayerIfRequired, playerFileDirectory, startAnimationTimer, and stopAnimationTimer.

Here is the call graph for this function:

◆ playerFileToLoad

- (NSString *) playerFileToLoad

References playerFileToLoad.

◆ recenterVirtualJoystick

- (void) recenterVirtualJoystick

Definition at line 414 of file GameController.m.

415{
416 // FIXME: does this really need to be spread across GameController and MyOpenGLView? -- Ahruman 2011-01-22
417 my_mouse_x = my_mouse_y = 0; // center mouse
418 [gameView setVirtualJoystick:0.0 :0.0];
419}

References my_mouse_x, my_mouse_y, and recenterVirtualJoystick.

Referenced by recenterVirtualJoystick, and MyOpenGLView(Internal)::recenterVirtualJoystick.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemovePreference

+ (void) RemovePreference (NSString *) key
implementation

Definition at line 450 of file GameController.m.

451{
452 [[NSUserDefaults standardUserDefaults] removeObjectForKey:key];
453}

Referenced by snapshotsURLCreatingIfNeeded:.

Here is the caller graph for this function:

◆ reportUnhandledStartupException:

- (void) reportUnhandledStartupException: (NSException *) exception
implementation

Provided by category GameController(OOPrivate).

Definition at line 931 of file GameController.m.

931 :(NSException *)exception
932{
933 OOLog(@"startup.exception", @"***** Unhandled exception during startup: %@ (%@).", [exception name], [exception reason]);
934
935 #if OOLITE_MAC_OS_X
936 // Display an error alert.
937 // TODO: provide better information on reporting bugs in the manual, and refer to it here.
938 NSRunCriticalAlertPanel(@"Oolite failed to start up, because an unhandled exception occurred.", @"An exception of type %@ occurred. If this problem persists, please file a bug report.", @"OK", NULL, NULL, [exception name]);
939 #endif
940}

References OOLog.

Referenced by applicationDidFinishLaunching:.

Here is the caller graph for this function:

◆ setDisplayWidth:Height:Refresh:

- (BOOL) setDisplayWidth: (unsigned int) d_width
Height: (unsigned int) d_height
Refresh: (unsigned int) d_refresh 
implementation

Provided by category GameController(FullScreen).

Definition at line 129 of file GameController+FullScreen.m.

129 :(unsigned int)width Height:(unsigned int)height Refresh:(unsigned int)refreshRate
130{
131 if ([_fullScreenController setDisplayWidth:width height:height refreshRate:refreshRate])
132 {
133 NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
134
135 [userDefaults setInteger:width forKey:@"display_width"];
136 [userDefaults setInteger:height forKey:@"display_height"];
137 [userDefaults setInteger:refreshRate forKey:@"display_refresh"];
138
139 [userDefaults synchronize];
140
141 return YES;
142 }
143 else
144 {
145 return NO;
146 }
147}
OOFullScreenController * _fullScreenController

Referenced by PlayerEntity(OOControlsPrivate)::handleGameOptionsScreenKeys.

Here is the caller graph for this function:

◆ setFullScreenMode:

- (void) setFullScreenMode: (BOOL) value
implementation

Provided by category GameController(FullScreen).

Definition at line 106 of file GameController+FullScreen.m.

106 :(BOOL)value
107{
108 if (value == [self inFullScreenMode]) return;
109
110 [[NSUserDefaults standardUserDefaults] setBool:value forKey:@"fullscreen"];
111
112 if (value)
113 {
114 [_fullScreenController setFullScreenMode:YES];
115 }
116 else
117 {
118 [_fullScreenController setFullScreenMode:NO];
119 }
120}

Referenced by applicationDidFinishLaunching:, GameController(FullScreen)::exitFullScreenMode, and GameController(FullScreen)::toggleFullScreenAction:.

Here is the caller graph for this function:

◆ setGamePaused:

- (void) setGamePaused: (BOOL) value

Definition at line 133 of file GameController.m.

133 :(BOOL)value
134{
135 if (value && !gameIsPaused)
136 {
137 _resumeMode = [self mouseInteractionMode];
138 [self setMouseInteractionModeForUIWithMouseInteraction:NO];
139 gameIsPaused = YES;
140 [PLAYER doScriptEvent:OOJSID("gamePaused")];
141 }
142 else if (!value && gameIsPaused)
143 {
144 [self setMouseInteractionMode:_resumeMode];
145 gameIsPaused = NO;
146 [PLAYER doScriptEvent:OOJSID("gameResumed")];
147 }
148}
OOMouseInteractionMode _resumeMode

References _resumeMode, gameIsPaused, mouseInteractionMode, setMouseInteractionMode:, and setMouseInteractionModeForUIWithMouseInteraction:.

Referenced by Universe::handleOoliteException:, Universe::pauseGame, PlayerEntity(OOControlsPrivate)::pollApplicationControls, PlayerEntity(OOControlsPrivate)::pollDockedControls:, Universe::reinitAndShowDemo:, and StationDockPlayer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setGameView:

- (void) setGameView: (MyOpenGLView *) view

Definition at line 196 of file GameController.m.

196 :(MyOpenGLView *)view
197{
198 [gameView release];
199 gameView = [view retain];
200 [gameView setGameController:self];
201 [UNIVERSE setGameView:gameView];
202}

References gameView, and MyOpenGLView::setGameController:.

Here is the call graph for this function:

◆ setMouseInteractionMode:

- (void) setMouseInteractionMode: (OOMouseInteractionMode) mode

Definition at line 157 of file GameController.m.

158{
160 if (mode == oldMode) return;
161
163 OOLog(@"input.mouseMode.changed", @"Mouse interaction mode changed from %@ to %@", OOStringFromMouseInteractionMode(oldMode), OOStringFromMouseInteractionMode(mode));
164
165#if OO_USE_FULLSCREEN_CONTROLLER
166 if ([self inFullScreenMode])
167 {
168 [_fullScreenController noteMouseInteractionModeChangedFrom:oldMode to:mode];
169 }
170 else
171#endif
172 {
173 [[self gameView] noteMouseInteractionModeChangedFrom:oldMode to:mode];
174 }
175}
OOMouseInteractionMode
NSString * OOStringFromMouseInteractionMode(OOMouseInteractionMode mode)
const char int mode
Definition ioapi.h:133

References _mouseMode, gameView, inFullScreenMode, MyOpenGLView::noteMouseInteractionModeChangedFrom:to:, OOFullScreenController::noteMouseInteractionModeChangedFrom:to:, OOLog, and OOStringFromMouseInteractionMode().

Referenced by setGamePaused:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMouseInteractionModeForFlight

- (void) setMouseInteractionModeForFlight

Definition at line 178 of file GameController.m.

179{
180 [self setMouseInteractionMode:[PLAYER isMouseControlOn] ? MOUSE_MODE_FLIGHT_WITH_MOUSE_CONTROL : MOUSE_MODE_FLIGHT_NO_MOUSE_CONTROL];
181}

References setMouseInteractionModeForFlight.

Referenced by PlayerEntity(OOControlsPrivate)::pollApplicationControls, setMouseInteractionModeForFlight, and Universe::setViewDirection:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMouseInteractionModeForUIWithMouseInteraction:

- (void) setMouseInteractionModeForUIWithMouseInteraction: (BOOL) interaction

Definition at line 184 of file GameController.m.

184 :(BOOL)interaction
185{
186 [self setMouseInteractionMode:interaction ? MOUSE_MODE_UI_SCREEN_WITH_INTERACTION : MOUSE_MODE_UI_SCREEN_NO_INTERACTION];
187}

Referenced by Universe::enterGUIViewModeWithMouseInteraction:, Universe::reinitAndShowDemo:, setGamePaused:, and Universe::setViewDirection:.

Here is the caller graph for this function:

◆ setPlayerFileDirectory:

- (void) setPlayerFileDirectory: (NSString *) filename

Definition at line 913 of file GameController.m.

913 :(NSString *)filename
914{
916 {
917 [playerFileDirectory autorelease];
919 }
920
921 if ([[[filename pathExtension] lowercaseString] isEqual:@"oolite-save"])
922 {
923 filename = [filename stringByDeletingLastPathComponent];
924 }
925
926 playerFileDirectory = [filename retain];
927 [[NSUserDefaults standardUserDefaults] setObject:filename forKey:@"save-directory"];
928}
NSString * playerFileDirectory

References nil, and playerFileDirectory.

Referenced by application:openFile:.

Here is the caller graph for this function:

◆ setPlayerFileToLoad:

- (void) setPlayerFileToLoad: (NSString *) filename

Definition at line 885 of file GameController.m.

885 :(NSString *)filename
886{
888 [playerFileToLoad autorelease];
890 if ([[[filename pathExtension] lowercaseString] isEqual:@"oolite-save"])
891 playerFileToLoad = [filename copy];
892}

References nil, and playerFileToLoad.

Referenced by application:openFile:, main(), and Universe::reinitAndShowDemo:.

Here is the caller graph for this function:

◆ SetPreference

+ (void) SetPreference (NSString *) key
(id) value 
implementation

Definition at line 444 of file GameController.m.

445{
446 [[NSUserDefaults standardUserDefaults] setObject:value forKey:key];
447}

Referenced by snapshotsURLCreatingIfNeeded:.

Here is the caller graph for this function:

◆ setUpBasicOpenGLStateWithSize:

- (void) setUpBasicOpenGLStateWithSize: (NSSize) viewSize

Definition at line 943 of file GameController.m.

943 :(NSSize)viewSize
944{
945 OOOpenGLExtensionManager *extMgr = [OOOpenGLExtensionManager sharedManager];
946
947 float ratio = 0.5;
948 float aspect = viewSize.height/viewSize.width;
949
950 OOGL(glClearColor(0.0, 0.0, 0.0, 0.0));
951 OOGL(glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT));
952
953 OOGL(glClearDepth(1.0));
954 OOGL(glViewport(0, 0, viewSize.width, viewSize.height));
955
956 OOGLResetProjection(); // reset matrix
957 OOGLFrustum(-ratio, ratio, -aspect*ratio, aspect*ratio, 1.0, MAX_CLEAR_DEPTH); // set projection matrix
958
959 OOGL(glDepthFunc(GL_LESS)); // depth buffer
960
961 if (UNIVERSE)
962 {
963 [UNIVERSE setLighting];
964 }
965 else
966 {
967 GLfloat black[4] = {0.0, 0.0, 0.0, 1.0};
968 GLfloat white[] = {1.0, 1.0, 1.0, 1.0};
969 GLfloat stars_ambient[] = {0.25, 0.2, 0.25, 1.0};
970
971 OOGL(glLightfv(GL_LIGHT1, GL_AMBIENT, black));
972 OOGL(glLightfv(GL_LIGHT1, GL_SPECULAR, white));
973 OOGL(glLightfv(GL_LIGHT1, GL_DIFFUSE, white));
974 OOGL(glLightfv(GL_LIGHT1, GL_POSITION, black));
975 OOGL(glLightModelfv(GL_LIGHT_MODEL_AMBIENT, stars_ambient));
976
977 }
978
979 if ([extMgr usePointSmoothing]) OOGL(glEnable(GL_POINT_SMOOTH));
980 if ([extMgr useLineSmoothing]) OOGL(glEnable(GL_LINE_SMOOTH));
981
982 // world's simplest OpenGL optimisations...
983#if GL_APPLE_transform_hint
984 if ([extMgr haveExtension:@"GL_APPLE_transform_hint"])
985 {
986 OOGL(glHint(GL_TRANSFORM_HINT_APPLE, GL_FASTEST));
987 }
988#endif
989
990 OOGL(glDisable(GL_NORMALIZE));
991 OOGL(glDisable(GL_RESCALE_NORMAL));
992
993#if GL_VERSION_1_2
994 // For OpenGL 1.2 or later, we want GL_SEPARATE_SPECULAR_COLOR all the time.
995 if ([extMgr versionIsAtLeastMajor:1 minor:2])
996 {
997 OOGL(glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR));
998 }
999#endif
1000}
#define MAX_CLEAR_DEPTH
void OOGLFrustum(double left, double right, double bottom, double top, double near, double far)
void OOGLResetProjection(void)
#define OOGL(statement)
Definition OOOpenGL.h:251
OOOpenGLExtensionManager * sharedManager()

References MAX_CLEAR_DEPTH, OOGL, OOGLFrustum(), OOGLResetProjection(), OOOpenGLExtensionManager::sharedManager, and UNIVERSE.

Referenced by MyOpenGLView::initialiseGLWithSize:useVideoMode:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setUpDisplayModes

- (void) setUpDisplayModes
implementation

Provided by category GameController(FullScreen).

Definition at line 49 of file GameController+FullScreen.m.

50{
51#if OOLITE_MAC_OS_X
52 OOFullScreenController *fullScreenController = nil;
53
54#if OO_MAC_SUPPORT_SYSTEM_STANDARD_FULL_SCREEN
55 if ([OOMacSystemStandardFullScreenController shouldUseSystemStandardFullScreenController])
56 {
57 fullScreenController = [[OOMacSystemStandardFullScreenController alloc] initWithGameView:gameView];
58 }
59#endif
60
61 if (fullScreenController == nil)
62 {
63 fullScreenController = [[OOMacSnowLeopardFullScreenController alloc] initWithGameView:gameView];
64 }
65#endif
66
67 // Load preferred display mode, falling back to current mode if no preferences set.
68 NSDictionary *currentMode = [fullScreenController currentDisplayMode];
69 NSUInteger width = [currentMode oo_unsignedIntegerForKey:kOODisplayWidth];
70 NSUInteger height = [currentMode oo_unsignedIntegerForKey:kOODisplayHeight];
71 NSUInteger refresh = [currentMode oo_unsignedIntegerForKey:kOODisplayRefreshRate];
72
73 NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
74 width = [userDefaults oo_unsignedIntegerForKey:@"display_width" defaultValue:width];
75 height = [userDefaults oo_unsignedIntegerForKey:@"display_height" defaultValue:height];
76 refresh = [userDefaults oo_unsignedIntegerForKey:@"display_refresh" defaultValue:refresh];
77
78 [fullScreenController setDisplayWidth:width height:height refreshRate:refresh];
79
80 _fullScreenController = fullScreenController;
81}
BOOL setDisplayWidth:height:refreshRate:(NSUInteger width,[height] NSUInteger height,[refreshRate] NSUInteger refresh)

Referenced by applicationDidFinishLaunching:, and gameView.

Here is the caller graph for this function:

◆ sharedController

+ (GameController *) sharedController

Definition at line 73 of file GameController.m.

74{
76 {
77 sSharedController = [[self alloc] init];
78 }
79 return sSharedController;
80}

References nil, sharedController, and sSharedController.

Referenced by Universe::initWithGameView:, NoteVerificationStage(), OOStandardsInternal(), MyOpenGLView(Internal)::recenterVirtualJoystick, PlayerEntity::setUpAndConfirmOK:saveGame:, Universe::setUpSpace, and sharedController.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ showAddOnsAction:

- (IBAction) showAddOnsAction: (id) sender

Definition at line 540 of file GameController.m.

540 :sender
541{
542 NSArray *paths = ResourceManager.userRootPaths;
543
544 // Look for an AddOns directory that actually contains some AddOns.
545 for (NSString *path in paths) {
546 if ([self addOnsExistAtPath:path]) {
547 [self openPath:path];
548 return;
549 }
550 }
551
552 // If that failed, look for an AddOns directory that actually exists.
553 for (NSString *path in paths) {
554 if ([self isDirectoryAtPath:path]) {
555 [self openPath:path];
556 return;
557 }
558 }
559
560 // None found, create the default path.
561 [NSFileManager.defaultManager createDirectoryAtPath:[paths objectAtIndex:0]
562 withIntermediateDirectories:YES
563 attributes:nil
564 error:NULL];
565 [self openPath:[paths objectAtIndex:0]];
566}

References openPath:, and ResourceManager::userRootPaths.

Here is the call graph for this function:

◆ showLogAction:

- (IBAction) showLogAction: (id) sender

Definition at line 422 of file GameController.m.

422 :sender
423{
424 [[NSWorkspace sharedWorkspace] openFile:[OOLogHandlerGetLogBasePath() stringByAppendingPathComponent:@"Previous.log"]];
425}

◆ showLogFolderAction:

- (IBAction) showLogFolderAction: (id) sender

Definition at line 428 of file GameController.m.

428 :sender
429{
430 [[NSWorkspace sharedWorkspace] openFile:OOLogHandlerGetLogBasePath()];
431}

◆ showSnapshotsAction:

- (IBAction) showSnapshotsAction: (id) sender

Definition at line 534 of file GameController.m.

534 :sender
535{
536 [[NSWorkspace sharedWorkspace] openURL:[self snapshotsURLCreatingIfNeeded:YES]];
537}

References snapshotsURLCreatingIfNeeded:.

Here is the call graph for this function:

◆ snapshotsURLCreatingIfNeeded:

- (NSURL *) snapshotsURLCreatingIfNeeded: (BOOL) create

Definition at line 459 of file GameController.m.

459 :(BOOL)create
460{
461 BOOL stale = NO;
462 NSDictionary *snapshotDirDict = GetPreference(kSnapshotsDirRefKey, [NSDictionary class]);
463 NSURL *url = nil;
464 NSString *name = DESC(@"snapshots-directory-name-mac");
465
466 if (snapshotDirDict != nil)
467 {
469 if (url != nil)
470 {
471 NSString *existingName = [[url path] lastPathComponent];
472 if ([existingName compare:name options:NSCaseInsensitiveSearch] != 0)
473 {
474 // Check name from previous access, because we might have changed localizations.
475 NSString *originalOldName = GetPreference(kSnapshotsDirNameKey, [NSString class]);
476 if (originalOldName == nil || [existingName compare:originalOldName options:NSCaseInsensitiveSearch] != 0)
477 {
478 url = nil;
479 }
480 }
481
482 // did we put the old directory in the trash?
483 Boolean inTrash = false;
484 const UInt8 *utfPath = (const UInt8 *)[[url path] UTF8String];
485
486 OSStatus err = DetermineIfPathIsEnclosedByFolder(kOnAppropriateDisk, kTrashFolderType, utfPath, false, &inTrash);
487 // if so, create a new directory.
488 if (err == noErr && inTrash == true) url = nil;
489 }
490 }
491
492 if (url == nil)
493 {
494 NSString *path = nil;
495 NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDesktopDirectory, NSUserDomainMask, YES);
496 if ([searchPaths count] > 0)
497 {
498 path = [[searchPaths objectAtIndex:0] stringByAppendingPathComponent:name];
499 }
500 url = [NSURL fileURLWithPath:path];
501
502 if (url != nil)
503 {
504 stale = YES;
505 if (create)
506 {
507 NSFileManager *fmgr = [NSFileManager defaultManager];
508 if (![fmgr fileExistsAtPath:path])
509 {
510 [fmgr oo_createDirectoryAtPath:path attributes:nil];
511 }
512 }
513 }
514 }
515
516 if (stale)
517 {
518 snapshotDirDict = JAPersistentFileReferenceFromURL(url);
519 if (snapshotDirDict != nil)
520 {
521 SetPreference(kSnapshotsDirRefKey, snapshotDirDict);
522 SetPreference(kSnapshotsDirNameKey, [[url path] lastPathComponent]);
523 }
524 else
525 {
527 }
528 }
529
530 return url;
531}
#define kSnapshotsDirNameKey
#define kSnapshotsDirRefKey
@ kJAPersistentFileReferenceWithoutUI
@ kJAPersistentFileReferenceWithoutMounting
NSURL * JAURLFromPersistentFileReference(NSDictionary *fileRef, JAPersistentFileReferenceResolveFlags flags, BOOL *isStale)
NSDictionary * JAPersistentFileReferenceFromURL(NSURL *url)
unsigned count
#define DESC(key)
Definition Universe.h:850
static id GetPreference(NSString *key, Class expectedClass)
static void SetPreference(NSString *key, id value)
static void RemovePreference(NSString *key)

References count, DESC, GetPreference, JAPersistentFileReferenceFromURL(), JAURLFromPersistentFileReference(), kJAPersistentFileReferenceWithoutMounting, kJAPersistentFileReferenceWithoutUI, kSnapshotsDirNameKey, kSnapshotsDirRefKey, nil, RemovePreference, and SetPreference.

Referenced by showSnapshotsAction:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ startAnimationTimer

- (void) startAnimationTimer

Definition at line 384 of file GameController.m.

385{
386 if (timer == nil)
387 {
388 NSTimeInterval ti = _animationTimerInterval; // default one two-hundredth of a second (should be a fair bit faster than expected frame rate ~60Hz to avoid problems with phase differences)
389
390 timer = [[NSTimer timerWithTimeInterval:ti target:self selector:@selector(performGameTick:) userInfo:nil repeats:YES] retain];
391
392 [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSDefaultRunLoopMode];
393#if OOLITE_MAC_OS_X
394 [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSEventTrackingRunLoopMode];
395#endif
396
397 }
398}

References _animationTimerInterval, nil, startAnimationTimer, and timer.

Referenced by applicationDidFinishLaunching:, playerFileDirectory, PlayerEntity::setUpAndConfirmOK:saveGame:, and startAnimationTimer.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopAnimationTimer

- (void) stopAnimationTimer

Definition at line 401 of file GameController.m.

402{
403 if (timer != nil)
404 {
405 [timer invalidate];
406 [timer release];
407 timer = nil;
408 }
409}

References nil, stopAnimationTimer, and timer.

Referenced by playerFileDirectory, PlayerEntity::setUpAndConfirmOK:saveGame:, and stopAnimationTimer.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suppressClangStuff

- (BOOL) suppressClangStuff
implementation

Definition at line 1007 of file GameController.m.

1008{
1009 return pauseSelector &&
1011}
NSObject * pauseTarget

References pauseSelector, pauseTarget, and suppressClangStuff.

Referenced by suppressClangStuff.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toggleFullScreenAction:

- (IBAction) toggleFullScreenAction: (id) sender
implementation

Provided by category GameController(FullScreen).

Definition at line 86 of file GameController+FullScreen.m.

86 :(id)sender
87{
88 [self setFullScreenMode:![self inFullScreenMode]];
89}

Referenced by GameController(FullScreen)::toggleFullScreenCalledForWindow:withSender:.

Here is the caller graph for this function:

◆ toggleFullScreenCalledForWindow:withSender:

- (void) toggleFullScreenCalledForWindow: (OOPrimaryWindow *) window
withSender: (id) sender 
implementation

Provided by category GameController(FullScreen).

Definition at line 92 of file GameController+FullScreen.m.

92 :(OOPrimaryWindow *)window withSender:(id)sender
93{
94 [self toggleFullScreenAction:sender];
95}

◆ validateMenuItem:

- (BOOL) validateMenuItem: (NSMenuItem *) menuItem
implementation

Definition at line 597 of file GameController.m.

597 :(NSMenuItem *)menuItem
598{
599 SEL action = menuItem.action;
600
601 if (action == @selector(showLogAction:))
602 {
603 // the first path is always Resources
604 return ([[NSFileManager defaultManager] fileExistsAtPath:[OOLogHandlerGetLogBasePath() stringByAppendingPathComponent:@"Previous.log"]]);
605 }
606
607 if (action == @selector(showAddOnsAction:))
608 {
609 // Always enabled in unrestricted mode, to allow users to add OXPs more easily.
610 return [ResourceManager useAddOns] != nil;
611 }
612
613 if (action == @selector(showSnapshotsAction:))
614 {
615 BOOL pathIsDirectory;
616 if(![[NSFileManager defaultManager] fileExistsAtPath:[self snapshotsURLCreatingIfNeeded:NO].path isDirectory:&pathIsDirectory])
617 {
618 return NO;
619 }
620 return pathIsDirectory;
621 }
622
623 if (action == @selector(toggleFullScreenAction:))
624 {
625 if (_fullScreenController.fullScreenMode)
626 {
627 // NOTE: not DESC, because menu titles are not generally localizable.
628 menuItem.title = NSLocalizedString(@"Exit Full Screen", NULL);
629 }
630 else
631 {
632 menuItem.title = NSLocalizedString(@"Enter Full Screen", NULL);
633 }
634 }
635
636 // default
637 return YES;
638}
NSString * OOLogHandlerGetLogBasePath(void)
NSString * useAddOns()

References _fullScreenController, nil, OOLogHandlerGetLogBasePath(), and ResourceManager::useAddOns.

Here is the call graph for this function:

◆ windowDidResize:

- (void) windowDidResize: (NSNotification *) aNotification

Definition at line 873 of file GameController.m.

873 :(NSNotification *)aNotification
874{
875 [gameView updateScreen];
876}

References MyOpenGLView::updateScreen.

Here is the call graph for this function:

Member Data Documentation

◆ _animationTimerInterval

- (NSTimeInterval) _animationTimerInterval
private

Definition at line 75 of file GameController.h.

Referenced by init, and startAnimationTimer.

◆ _fullScreenController

- (OOFullScreenController*) _fullScreenController
private

Definition at line 89 of file GameController.h.

Referenced by validateMenuItem:.

◆ _mouseMode

- (OOMouseInteractionMode) _mouseMode
private

Definition at line 84 of file GameController.h.

Referenced by mouseInteractionMode, and setMouseInteractionMode:.

◆ _resumeMode

- (OOMouseInteractionMode) _resumeMode
private

Definition at line 85 of file GameController.h.

Referenced by setGamePaused:.

◆ _splashStart

- (NSDate*) _splashStart
private

Definition at line 77 of file GameController.h.

Referenced by applicationDidFinishLaunching:, init, and logProgress:.

◆ delta_t

- (double) delta_t
private

Definition at line 66 of file GameController.h.

Referenced by init.

◆ dockMenu

- (IBOutlet NSMenu*) dockMenu
private

Definition at line 60 of file GameController.h.

Referenced by applicationDockMenu:.

◆ expansionPathsToInclude

- (NSMutableArray*) expansionPathsToInclude
private

Definition at line 72 of file GameController.h.

Referenced by application:openFile:, and applicationDidFinishLaunching:.

◆ gameIsPaused

- (BOOL) gameIsPaused
private

Definition at line 82 of file GameController.h.

Referenced by isGamePaused, and setGamePaused:.

◆ gameView

- (MyOpenGLView *) gameView
private

Definition at line 190 of file GameController.m.

191{
192 return gameView;
193}

Referenced by beginSplashScreen, gameView, OoliteApp::sendEvent:, setGameView:, and setMouseInteractionMode:.

◆ gameWindow

- (IBOutlet NSWindow*) gameWindow
private

Definition at line 58 of file GameController.h.

◆ helpView

- (IBOutlet PDFView*) helpView
private

Definition at line 59 of file GameController.h.

◆ last_timeInterval

- (NSTimeInterval) last_timeInterval
private

Definition at line 65 of file GameController.h.

Referenced by init.

◆ my_mouse_x

- (int) my_mouse_x
private

Definition at line 68 of file GameController.h.

Referenced by recenterVirtualJoystick.

◆ my_mouse_y

- (int) my_mouse_y
private

Definition at line 68 of file GameController.h.

Referenced by recenterVirtualJoystick.

◆ pauseSelector

- (SEL) pauseSelector
private

Definition at line 79 of file GameController.h.

Referenced by suppressClangStuff.

◆ pauseTarget

- (NSObject*) pauseTarget
private

Definition at line 80 of file GameController.h.

Referenced by suppressClangStuff.

◆ playerFileDirectory

- (NSString *) playerFileDirectory
private

Definition at line 895 of file GameController.m.

896{
898 {
899 playerFileDirectory = [[NSUserDefaults standardUserDefaults] stringForKey:@"save-directory"];
900 if (playerFileDirectory != nil && ![[NSFileManager defaultManager] fileExistsAtPath:playerFileDirectory])
901 {
903 }
904 if (playerFileDirectory == nil) playerFileDirectory = [[NSFileManager defaultManager] defaultCommanderPath];
905
906 [playerFileDirectory retain];
907 }
908
909 return playerFileDirectory;
910}

Referenced by playerFileDirectory, and setPlayerFileDirectory:.

◆ playerFileToLoad

- (NSString *) playerFileToLoad
private

◆ splashProgressTextField

- (IBOutlet NSTextField*) splashProgressTextField
private

Definition at line 56 of file GameController.h.

Referenced by endSplashScreen.

◆ splashView

- (IBOutlet NSView*) splashView
private

Definition at line 57 of file GameController.h.

Referenced by endSplashScreen.

◆ timer

- (NSTimer*) timer
private

Definition at line 74 of file GameController.h.

Referenced by startAnimationTimer, and stopAnimationTimer.


The documentation for this class was generated from the following files: