project_files/HedgewarsMobile/Classes/ObjcExports.m
changeset 6078 8c0cc07731e5
parent 6018 3b86826f6665
child 6247 6dfad55fd71c
equal deleted inserted replaced
6077:d8fa5a85d24f 6078:8c0cc07731e5
    21 
    21 
    22 #import "ObjcExports.h"
    22 #import "ObjcExports.h"
    23 #import "OverlayViewController.h"
    23 #import "OverlayViewController.h"
    24 #import "AmmoMenuViewController.h"
    24 #import "AmmoMenuViewController.h"
    25 
    25 
    26 #pragma mark -
    26 
    27 #pragma mark internal variables
       
    28 // actual game started (controls should be enabled)
    27 // actual game started (controls should be enabled)
    29 BOOL gameRunning;
    28 static BOOL gameRunning;
    30 // black screen present
    29 // black screen present
    31 BOOL savedGame;
    30 static BOOL savedGame;
    32 // cache the grenade time
    31 // cache the grenade time
    33 NSInteger grenadeTime;
    32 static NSInteger grenadeTime;
    34 // the reference to the newMenu instance
    33 // the reference to the newMenu instance
    35 OverlayViewController *overlay_instance;
    34 static OverlayViewController *overlay_instance;
    36 
    35 
       
    36 @implementation ObjcExports
    37 
    37 
    38 #pragma mark -
    38 +(void) initialize {
    39 #pragma mark functions called like oop
       
    40 void objcExportsInit() {
       
    41     overlay_instance = [OverlayViewController mainOverlay];
    39     overlay_instance = [OverlayViewController mainOverlay];
    42     gameRunning = NO;
    40     gameRunning = NO;
    43     savedGame = NO;
    41     savedGame = NO;
    44     grenadeTime = 2;
    42     grenadeTime = 2;
    45 }
    43 }
    46 
    44 
       
    45 @end
       
    46 
       
    47 #pragma mark -
       
    48 #pragma mark functions called by objc code
    47 BOOL inline isGameRunning() {
    49 BOOL inline isGameRunning() {
    48     return gameRunning;
    50     return gameRunning;
    49 }
    51 }
    50 
    52 
    51 void inline setGameRunning(BOOL value) {
    53 void inline setGameRunning(BOOL value) {