mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-03-04 09:11:27 +01:00
add ChangeGamestate/ChangeCurrentGamestate API for replacing gamestates without unloading
This commit is contained in:
parent
4aad8fabac
commit
63451eb858
2 changed files with 12 additions and 0 deletions
|
@ -197,6 +197,16 @@ SYMBOL_EXPORT void SwitchGamestate(struct Game *game, const char* current, const
|
||||||
StartGamestate(game, n);
|
StartGamestate(game, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SYMBOL_EXPORT void ChangeGamestate(struct Game *game, const char* current, const char* n) {
|
||||||
|
StopGamestate(game, current);
|
||||||
|
LoadGamestate(game, n);
|
||||||
|
StartGamestate(game, n);
|
||||||
|
}
|
||||||
|
|
||||||
SYMBOL_EXPORT void SwitchCurrentGamestate(struct Game *game, const char* n) {
|
SYMBOL_EXPORT void SwitchCurrentGamestate(struct Game *game, const char* n) {
|
||||||
SwitchGamestate(game, game->_priv.current_gamestate->name, n);
|
SwitchGamestate(game, game->_priv.current_gamestate->name, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SYMBOL_EXPORT void ChangeCurrentGamestate(struct Game *game, const char* n) {
|
||||||
|
ChangeGamestate(game, game->_priv.current_gamestate->name, n);
|
||||||
|
}
|
||||||
|
|
|
@ -64,5 +64,7 @@ void ResumeGamestate(struct Game *game, const char* name);
|
||||||
void UnloadAllGamestates(struct Game *game);
|
void UnloadAllGamestates(struct Game *game);
|
||||||
void SwitchGamestate(struct Game *game, const char* current, const char* n);
|
void SwitchGamestate(struct Game *game, const char* current, const char* n);
|
||||||
void SwitchCurrentGamestate(struct Game *game, const char* n);
|
void SwitchCurrentGamestate(struct Game *game, const char* n);
|
||||||
|
void ChangeGamestate(struct Game *game, const char* current, const char* n);
|
||||||
|
void ChangeCurrentGamestate(struct Game *game, const char* n);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue