Config: Add entry to override the game window title

This commit is contained in:
Jonas Kulla 2017-12-11 00:48:35 +01:00
parent d427df0c2b
commit 7d9a85dbbd
4 changed files with 12 additions and 1 deletions

View File

@ -77,6 +77,12 @@
# defScreenW=640 # defScreenW=640
# Override the game window title
# (default: none)
#
# windowTitle=Custom Title
# Specify the window height on startup. If set to 0, # Specify the window height on startup. If set to 0,
# it will default to the default resolution height # it will default to the default resolution height
# specific to the RGSS version (480 in RGSS1, 416 # specific to the RGSS version (480 in RGSS1, 416

View File

@ -161,6 +161,7 @@ void Config::read(int argc, char *argv[])
PO_DESC(vsync, bool, false) \ PO_DESC(vsync, bool, false) \
PO_DESC(defScreenW, int, 0) \ PO_DESC(defScreenW, int, 0) \
PO_DESC(defScreenH, int, 0) \ PO_DESC(defScreenH, int, 0) \
PO_DESC(windowTitle, std::string, "") \
PO_DESC(fixedFramerate, int, 0) \ PO_DESC(fixedFramerate, int, 0) \
PO_DESC(frameSkip, bool, true) \ PO_DESC(frameSkip, bool, true) \
PO_DESC(syncToRefreshrate, bool, false) \ PO_DESC(syncToRefreshrate, bool, false) \

View File

@ -41,6 +41,7 @@ struct Config
int defScreenW; int defScreenW;
int defScreenH; int defScreenH;
std::string windowTitle;
int fixedFramerate; int fixedFramerate;
bool frameSkip; bool frameSkip;

View File

@ -233,6 +233,9 @@ int main(int argc, char *argv[])
conf.readGameINI(); conf.readGameINI();
if (conf.windowTitle.empty())
conf.windowTitle = conf.game.title;
assert(conf.rgssVersion >= 1 && conf.rgssVersion <= 3); assert(conf.rgssVersion >= 1 && conf.rgssVersion <= 3);
printRgssVersion(conf.rgssVersion); printRgssVersion(conf.rgssVersion);
@ -272,7 +275,7 @@ int main(int argc, char *argv[])
if (conf.fullscreen) if (conf.fullscreen)
winFlags |= SDL_WINDOW_FULLSCREEN_DESKTOP; winFlags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
win = SDL_CreateWindow(conf.game.title.c_str(), win = SDL_CreateWindow(conf.windowTitle.c_str(),
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
conf.defScreenW, conf.defScreenH, winFlags); conf.defScreenW, conf.defScreenH, winFlags);