1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-11-16 16:09:42 +01:00

Add branch name to window title in brackets

The branch name will be added to the window title if it is an interim
version, e.g. "VVVVVV [master]".

This makes it easier for developers to tell at a glance which build of
the game they're running.
This commit is contained in:
Misa 2023-01-16 12:59:48 -08:00
parent 19a83853b8
commit 172e3a8985

View file

@ -8,6 +8,7 @@
#include "FileSystemUtils.h" #include "FileSystemUtils.h"
#include "Game.h" #include "Game.h"
#include "GraphicsUtil.h" #include "GraphicsUtil.h"
#include "InterimVersion.h"
#include "Vlogging.h" #include "Vlogging.h"
void ScreenSettings_default(struct ScreenSettings* _this) void ScreenSettings_default(struct ScreenSettings* _this)
@ -52,7 +53,16 @@ void Screen::init(const struct ScreenSettings* settings)
&m_window, &m_window,
&m_renderer &m_renderer
); );
#ifdef INTERIM_VERSION_EXISTS
/* Branch name limits are ill-defined but on GitHub it's ~256 chars
* ( https://stackoverflow.com/a/24014513/ ).
* Really though, just don't use super long branch names. */
char title[256];
SDL_snprintf(title, sizeof(title), "VVVVVV [%s]", BRANCH_NAME);
SDL_SetWindowTitle(m_window, title);
#else
SDL_SetWindowTitle(m_window, "VVVVVV"); SDL_SetWindowTitle(m_window, "VVVVVV");
#endif
LoadIcon(); LoadIcon();