OpenTTD Source 20260206-master-g4d4e37dbf1
OTTDMain Class Reference

The main class of the application, the application's delegate. More...

Inheritance diagram for OTTDMain:

Instance Methods

(void) - stopEngine [implementation]
 Stop the game engine.
(void) - launchGameEngine: [implementation]
 Start the game loop.
(void) - applicationDidFinishLaunching: [implementation]
 Called when the internal event loop has just started running.
(NSApplicationTerminateReply) - applicationShouldTerminate: [implementation]
 Display the in game quit confirmation dialog.
(void) - unregisterObserver [implementation]
 Remove ourself as a notification observer.
(BOOL) - applicationSupportsSecureRestorableState: [implementation]
 Indicates to AppKit that OpenTTD is compatible with secure state storage.

Detailed Description

The main class of the application, the application's delegate.

Definition at line 71 of file cocoa_wnd.mm.

Method Documentation

◆ applicationDidFinishLaunching:

- (void) applicationDidFinishLaunching: (NSNotification*) note
implementation

Called when the internal event loop has just started running.

Definition at line 214 of file cocoa_wnd.mm.

◆ applicationShouldTerminate:

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

Display the in game quit confirmation dialog.

Definition at line 226 of file cocoa_wnd.mm.

◆ applicationSupportsSecureRestorableState:

- (BOOL) applicationSupportsSecureRestorableState: (NSApplication*) sender
implementation

Indicates to AppKit that OpenTTD is compatible with secure state storage.

Starting with macOS 12, macOS expects us to be better compatible with NSSecureCoding, as to prevent attacks through restorable storage. Starting with 14, macOS logs a warning if we don't implement this ourselves. Since OpenTTD does not (yet) make use of restorable state, we simply don't care what happens with it.

Explained here: https://developer.apple.com/documentation/foundation/nssecurecoding

Definition at line 248 of file cocoa_wnd.mm.

◆ launchGameEngine:

- (void) launchGameEngine: (NSNotification*) note
implementation

Start the game loop.

Definition at line 195 of file cocoa_wnd.mm.

References VideoDriver::GetInstance(), and VideoDriver_Cocoa::MainLoopReal().

◆ stopEngine

- (void) stopEngine
implementation

Stop the game engine.

Must be called on main thread.

Definition at line 182 of file cocoa_wnd.mm.

References stopEngine.

Referenced by stopEngine.

◆ unregisterObserver

- (void) unregisterObserver
implementation

Remove ourself as a notification observer.

Definition at line 236 of file cocoa_wnd.mm.

References unregisterObserver.

Referenced by CocoaExitApplication(), and unregisterObserver.


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