2025-08-03 03:03 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000909Spring engineGeneralpublic2008-04-30 02:06
Reporterzenzike 
Assigned ToKloot 
PrioritynormalSeverityfeatureReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000909: [patch] Command line resolution
DescriptionWhen I'm debugging Spring, I like setting the resolution manually, but don't like having to play with configuration files all the time. I've patched SpringApp.cpp so that it takes arguments "x" and "y" (optionally), and sets the width and height accordingly. If these flags aren't set, then the default behaviour ensues.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • patch file icon resolution.patch (1,332 bytes) 2008-04-29 23:40 -
    Index: /spring/rts/System/SpringApp.cpp
    ===================================================================
    --- /spring/rts/System/SpringApp.cpp	(revision 5798)
    +++ /spring/rts/System/SpringApp.cpp	(working copy)
    @@ -545,6 +545,8 @@
     {
     	cmdline->addoption('f', "fullscreen",     OPTPARM_NONE,   "",  "Run in fullscreen mode");
     	cmdline->addoption('w', "window",         OPTPARM_NONE,   "",  "Run in windowed mode");
    +	cmdline->addoption('x', "xresolution",    OPTPARM_INT,    "",  "Set X resolution");
    +	cmdline->addoption('y', "yresolution",    OPTPARM_INT,    "",  "Set Y resolution");
     	cmdline->addoption('m', "minimise",       OPTPARM_NONE,   "",  "Start minimised");
     	cmdline->addoption('s', "server",         OPTPARM_NONE,   "",  "Run as a server");
     	cmdline->addoption('c', "client",         OPTPARM_NONE,   "",  "Run as a client");
    @@ -588,8 +590,14 @@
     		configHandler.SetString("name", name);
     	}
     
    -	screenWidth = configHandler.GetInt("XResolution", XRES_DEFAULT);
    -	screenHeight = configHandler.GetInt("YResolution", YRES_DEFAULT);
    +	if (!cmdline->result("xresolution", screenWidth)) {
    +	    screenWidth = configHandler.GetInt("XResolution", XRES_DEFAULT);
    +	}
    +	
    +	if (!cmdline->result("yresolution", screenHeight)) {
    +        screenHeight = configHandler.GetInt("YResolution", YRES_DEFAULT);
    +    }
    +	
     }
     
     /**
    
    
    patch file icon resolution.patch (1,332 bytes) 2008-04-29 23:40 +

-Relationships
+Relationships

-Notes

~0002186

Kloot (developer)

Committed with a slight modification to prevent negative resolutions, thank you.
+Notes

-Issue History
Date Modified Username Field Change
2008-04-29 23:39 zenzike New Issue
2008-04-29 23:40 zenzike File Added: resolution.patch
2008-04-30 02:06 Kloot Note Added: 0002186
2008-04-30 02:06 Kloot Status new => resolved
2008-04-30 02:06 Kloot Resolution open => fixed
2008-04-30 02:06 Kloot Assigned To => Kloot
+Issue History