App::IGameModeManager class

A manager that takes care of game modes; check IGameMode for more information.

The manager has a vector with all the modes and keeps track of the active mode. The active mode can be set by either ID or name.

The manager also controls the active ICameraManager and Viewer, which control all the calculations related with camera and view projections used for rendering.

Derived classes

class cGameModeManager
The implementation of IGameModeManager; this should only be used for extending and detouring.

Public static functions

static auto Get() -> IGameModeManager*
Gets the active game mode manager.

Constructors, destructors, conversion operators

~IGameModeManager() virtual

Public functions

auto AddRef() -> int pure virtual
auto Release() -> int pure virtual
auto Initialize() -> bool pure virtual
auto Dispose() -> bool pure virtual
auto func14h() -> bool pure virtual
auto InitializeModes() -> bool pure virtual
Calls the IGameMode::Initialize() method on all the modes in this manager.
auto ClearActiveMode() -> bool pure virtual
Sets the active game mode to nullptr.
auto AddGameMode(IGameMode* pMode, uint32_t modeID, const char* pName) -> void pure virtual
Adds the given game mode to this manager under the modeID specified.
auto RemoveGameMode(uint32_t modeID) -> bool pure virtual
Removes the game mode with the ID specified from this manager.
auto SetActiveMode(uint32_t modeID) -> bool pure virtual
Sets the active game mode to be the one with the specified ID.
auto GetActiveMode() -> IGameMode* pure virtual
Returns the game mode that is currently in action.
auto GetGameMode(uint32_t modeID) -> IGameMode* pure virtual
Gets the game mode in this manager with the specified ID.
auto GetModeIDAt(size_t index) -> uint32_t pure virtual
Gets the modeID at the specified index.
auto GetActiveModeID() -> uint32_t pure virtual
Gets the modeID of the currently active IGameMode.
auto GetModeCount() -> size_t pure virtual
Gets the number of game modes contained in this manager.
auto SetActiveModeAt(size_t index) -> bool pure virtual
Sets the active game mode to be the one at the specified index.
auto GetGameModeAt(size_t index) -> IGameMode* pure virtual
Gets the IGameMode at the specified index.
auto func48h(int) -> int pure virtual
auto SetActiveModeByName(const char* pName) -> bool pure virtual
Sets the active game mode to be the one with the specified name.
auto GetCameraManager() -> ICameraManager* pure virtual
Gets the ICameraManager instance used in this mode manager, and that manages the active camera of the active game mode.
auto SetViewer(cViewer* pViewer) -> void pure virtual
Sets the Viewer instance that is used for rendering the main game frame.
auto GetViewer() -> cViewer* pure virtual
Returns the Viewer instance that is being used for rendering the main game frame.

Function documentation

bool App::IGameModeManager::ClearActiveMode() pure virtual

Sets the active game mode to nullptr.

Returns True if there was an active context, false otherwise.

The IGameMode::OnExit() method will be called on the active context, and the messages 0x212D3E7 and 0x22D1ADC will be generated.

void App::IGameModeManager::AddGameMode(IGameMode* pMode, uint32_t modeID, const char* pName) pure virtual

Adds the given game mode to this manager under the modeID specified.

Parameters
pMode The IGameMode to add.
modeID The ID that uniquely identifies this game mode, and that can be used to access it.
pName The name of this mode.

bool App::IGameModeManager::RemoveGameMode(uint32_t modeID) pure virtual

Removes the game mode with the ID specified from this manager.

Parameters
modeID The ID of the mode to remove.
Returns True if the game mode was removed, false if it was not in this manager.

This will call the IGameMode::Dispose() method on the mode.

bool App::IGameModeManager::SetActiveMode(uint32_t modeID) pure virtual

Sets the active game mode to be the one with the specified ID.

Parameters
modeID The ID of the game mode to set as active.
Returns True if the mode was found and set active, false otherwise.

If there's already an active mode, the method IGameMode::OnExit(). The method IGameMode::OnEnter() will be called on the mode with the specified ID. A message with ID 0x22D1ADC will be generated.

IGameMode* App::IGameModeManager::GetGameMode(uint32_t modeID) pure virtual

Gets the game mode in this manager with the specified ID.

Parameters
modeID The ID of the mode.
Returns The IGameMode with that ID, or nullptr if there is none.

uint32_t App::IGameModeManager::GetModeIDAt(size_t index) pure virtual

Gets the modeID at the specified index.

Parameters
index The index of the game modes array.
Returns The ID of the game mode at that index, or 0 if the index is out of bounds.

uint32_t App::IGameModeManager::GetActiveModeID() pure virtual

Gets the modeID of the currently active IGameMode.

Returns The ID of the active game mode, or 0 if no mode is active.

bool App::IGameModeManager::SetActiveModeAt(size_t index) pure virtual

Sets the active game mode to be the one at the specified index.

Parameters
index The index of the game mode to set as active.
Returns True if the mode was found and set active, false otherwise.

If there's already an active mode, the method IGameMode::OnExit() will be called on it. The method IGameMode::OnEnter() will be called on the mode at the specified index. A message with ID 0x22D1ADC will be generated.

IGameMode* App::IGameModeManager::GetGameModeAt(size_t index) pure virtual

Gets the IGameMode at the specified index.

Parameters
index The index of the game modes array.
Returns A pointer to the IGameMode at that index, or nullptr if the index is out of bounds.

bool App::IGameModeManager::SetActiveModeByName(const char* pName) pure virtual

Sets the active game mode to be the one with the specified name.

Parameters
pName The name of the game mode to set as active.
Returns True if the mode was found and set active, false otherwise.

If there's already an active mode, the method IGameMode::OnExit() will be called on it. The method IGameMode::OnEnter() will be called on the moed at the specified index. A message with ID 0x22D1ADC will be generated.

void App::IGameModeManager::SetViewer(cViewer* pViewer) pure virtual

Sets the Viewer instance that is used for rendering the main game frame.

Parameters
pViewer The Viewer instance.