utils: move GetGameName to internal

This commit is contained in:
Sebastian Krzyszkowiak 2018-07-13 18:38:02 +02:00
parent e5cf17a1a6
commit 52da2d53e4
4 changed files with 9 additions and 10 deletions

View file

@ -557,3 +557,11 @@ SYMBOL_INTERNAL void ResumeExecution(struct Game* game) {
game->_priv.paused = false;
PrintConsole(game, "DEBUG: game execution resumed.");
}
SYMBOL_INTERNAL char* GetGameName(struct Game* game, const char* format) {
char* result = malloc(sizeof(char) * 255);
SUPPRESS_WARNING("-Wformat-nonliteral")
snprintf(result, 255, format, game->name);
SUPPRESS_END
return AddGarbage(game, result);
}

View file

@ -95,5 +95,6 @@ void PauseExecution(struct Game* game);
void ResumeExecution(struct Game* game);
void ReloadShaders(struct Game* game, bool force);
void DestroyShaders(struct Game* game);
char* GetGameName(struct Game* game, const char* format);
#endif

View file

@ -317,14 +317,6 @@ static void TestPath(const char* filename, const char* subpath, char** result) {
al_destroy_path(path);
}
SYMBOL_EXPORT char* GetGameName(struct Game* game, const char* format) {
char* result = malloc(sizeof(char) * 255);
SUPPRESS_WARNING("-Wformat-nonliteral")
snprintf(result, 255, format, game->name);
SUPPRESS_END
return AddGarbage(game, result);
}
static char* TestDataFilePath(struct Game* game, const char* filename) {
char* result = NULL;

View file

@ -67,8 +67,6 @@ ALLEGRO_BITMAP* LoadScaledBitmap(struct Game* game, char* filename, int width, i
/*! \brief Finds path for data file. */
char* GetDataFilePath(struct Game* game, const char* filename);
char* GetGameName(struct Game* game, const char* format);
/*! \brief Print some message on game console.
*
* Draws message on console bitmap, so it'll be displayed when calling DrawConsole.