diff --git a/src/gamestate.c b/src/gamestate.c index e39d975..dd56fb4 100644 --- a/src/gamestate.c +++ b/src/gamestate.c @@ -254,6 +254,10 @@ SYMBOL_EXPORT ALLEGRO_BITMAP* GetGamestateFramebuffer(struct Game* game, struct return gamestate->fb; } +SYMBOL_EXPORT char* GetGamestateName(struct Game* game, struct Gamestate* gamestate) { + return AddGarbage(game, strdup(gamestate->name)); +} + SYMBOL_EXPORT struct Gamestate* GetNextGamestate(struct Game* game, struct Gamestate* gamestate) { if (!gamestate) { return game->_priv.gamestates; diff --git a/src/gamestate.h b/src/gamestate.h index 9f290b5..307ad9e 100644 --- a/src/gamestate.h +++ b/src/gamestate.h @@ -67,6 +67,7 @@ void UnloadCurrentGamestate(struct Game* game); struct Gamestate* GetCurrentGamestate(struct Game* game); struct Gamestate* GetGamestate(struct Game* game, const char* name); ALLEGRO_BITMAP* GetGamestateFramebuffer(struct Game* game, struct Gamestate* gamestate); +char* GetGamestateName(struct Game* game, struct Gamestate* gamestate); struct Gamestate* GetNextGamestate(struct Game* game, struct Gamestate* gamestate); bool IsGamestateVisible(struct Game* game, struct Gamestate* gamestate);