Config: Add entry to override the game window title
This commit is contained in:
		
							parent
							
								
									d427df0c2b
								
							
						
					
					
						commit
						7d9a85dbbd
					
				
					 4 changed files with 12 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -77,6 +77,12 @@
 | 
			
		|||
# defScreenW=640
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Override the game window title
 | 
			
		||||
# (default: none)
 | 
			
		||||
#
 | 
			
		||||
# windowTitle=Custom Title
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Specify the window height on startup. If set to 0,
 | 
			
		||||
# it will default to the default resolution height
 | 
			
		||||
# specific to the RGSS version (480 in RGSS1, 416
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -161,6 +161,7 @@ void Config::read(int argc, char *argv[])
 | 
			
		|||
	PO_DESC(vsync, bool, false) \
 | 
			
		||||
	PO_DESC(defScreenW, int, 0) \
 | 
			
		||||
	PO_DESC(defScreenH, int, 0) \
 | 
			
		||||
	PO_DESC(windowTitle, std::string, "") \
 | 
			
		||||
	PO_DESC(fixedFramerate, int, 0) \
 | 
			
		||||
	PO_DESC(frameSkip, bool, true) \
 | 
			
		||||
	PO_DESC(syncToRefreshrate, bool, false) \
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -41,6 +41,7 @@ struct Config
 | 
			
		|||
 | 
			
		||||
	int defScreenW;
 | 
			
		||||
	int defScreenH;
 | 
			
		||||
	std::string windowTitle;
 | 
			
		||||
 | 
			
		||||
	int fixedFramerate;
 | 
			
		||||
	bool frameSkip;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -233,6 +233,9 @@ int main(int argc, char *argv[])
 | 
			
		|||
 | 
			
		||||
	conf.readGameINI();
 | 
			
		||||
 | 
			
		||||
	if (conf.windowTitle.empty())
 | 
			
		||||
		conf.windowTitle = conf.game.title;
 | 
			
		||||
 | 
			
		||||
	assert(conf.rgssVersion >= 1 && conf.rgssVersion <= 3);
 | 
			
		||||
	printRgssVersion(conf.rgssVersion);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -272,7 +275,7 @@ int main(int argc, char *argv[])
 | 
			
		|||
	if (conf.fullscreen)
 | 
			
		||||
		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,
 | 
			
		||||
	                       conf.defScreenW, conf.defScreenH, winFlags);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue