fallout2-ce/src/game.h

91 lines
2.1 KiB
C
Raw Normal View History

2022-05-19 01:51:26 -07:00
#ifndef GAME_H
#define GAME_H
#include "game_vars.h"
#include "message.h"
2022-09-23 05:43:44 -07:00
namespace fallout {
2022-09-01 08:41:37 -07:00
typedef enum GameState {
GAME_STATE_0,
GAME_STATE_1,
GAME_STATE_2,
GAME_STATE_3,
GAME_STATE_4,
GAME_STATE_5,
} GameState;
2022-05-19 01:51:26 -07:00
extern int* gGameGlobalVars;
extern int gGameGlobalVarsLength;
extern const char* asc_5186C8;
extern int _game_user_wants_to_quit;
extern MessageList gMiscMessageList;
extern int _master_db_handle;
extern int _critter_db_handle;
int gameInitWithOptions(const char* windowTitle, bool isMapper, int a3, int a4, int argc, char** argv);
void gameReset();
void gameExit();
int gameHandleKey(int eventCode, bool isInCombatMode);
void gameUiDisable(int a1);
void gameUiEnable();
bool gameUiIsDisabled();
int gameGetGlobalVar(int var);
int gameSetGlobalVar(int var, int value);
int globalVarsRead(const char* path, const char* section, int* variablesListLengthPtr, int** variablesListPtr);
2022-10-03 05:54:18 -07:00
int gameGetState();
int gameRequestState(int newGameState);
void gameUpdateState();
2022-05-19 01:51:26 -07:00
int showQuitConfirmationDialog();
int gameShowDeathDialog(const char* message);
2022-12-06 23:17:48 -08:00
class GameMode {
2022-12-06 06:22:30 -08:00
public:
2022-12-06 23:17:48 -08:00
enum Flags {
2022-12-06 06:22:30 -08:00
kWorldmap = 0x1,
kDialog = 0x4,
kOptions = 0x8,
kSaveGame = 0x10,
kLoadGame = 0x20,
kCombat = 0x40,
kPreferences = 0x80,
kHelp = 0x100,
kEditor = 0x200,
kPipboy = 0x400,
kPlayerTurn = 0x800,
kInventory = 0x1000,
kAutomap = 0x2000,
kSkilldex = 0x4000,
kUseOn = 0x8000,
kLoot = 0x10000,
kBarter = 0x20000,
kHero = 0x40000,
kDialogReview = 0x80000,
kCounter = 0x100000,
kSpecial = 0x80000000,
};
static void enterGameMode(int gameMode);
static void exitGameMode(int gameMode);
static bool isInGameMode(int gameMode);
static int getCurrentGameMode() { return currentGameMode; }
private:
static int currentGameMode;
};
class ScopedGameMode {
public:
ScopedGameMode(int gameMode);
~ScopedGameMode();
private:
int gameMode;
};
2022-09-23 05:43:44 -07:00
} // namespace fallout
2022-05-19 01:51:26 -07:00
#endif /* GAME_H */