r83 - in trunk: . src

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Feb 2 16:54:06 EST 2005


Author: jonas
Date: 2005-02-02 16:54:06 -0500 (Wed, 02 Feb 2005)
New Revision: 83

Modified:
   trunk/lost_penguins.conf
   trunk/src/common.h
   trunk/src/gfxeng.cpp
   trunk/src/lost_penguins.cpp
Log:
configurable color depth...

Modified: trunk/lost_penguins.conf
===================================================================
--- trunk/lost_penguins.conf	2005-02-02 20:27:43 UTC (rev 82)
+++ trunk/lost_penguins.conf	2005-02-02 21:54:06 UTC (rev 83)
@@ -4,3 +4,4 @@
 full 1
 width 1024
 height 768
+bpp 32
\ No newline at end of file

Modified: trunk/src/common.h
===================================================================
--- trunk/src/common.h	2005-02-02 20:27:43 UTC (rev 82)
+++ trunk/src/common.h	2005-02-02 21:54:06 UTC (rev 83)
@@ -71,6 +71,7 @@
 struct Config {
     Uint16 width;
     Uint16 height;
+    Uint8 bpp;
     bool full;
     Uint16 audio_format;
     int audio_rate;

Modified: trunk/src/gfxeng.cpp
===================================================================
--- trunk/src/gfxeng.cpp	2005-02-02 20:27:43 UTC (rev 82)
+++ trunk/src/gfxeng.cpp	2005-02-02 21:54:06 UTC (rev 83)
@@ -27,7 +27,7 @@
 void GraphicsEngine::resize(Uint16 width, Uint16 height) {
     if (screen) SDL_FreeSurface(screen);
     
-    if ((screen=SDL_SetVideoMode(width,height,16,SDL_HWSURFACE|SDL_RESIZABLE|SDL_DOUBLEBUF|(fullscreen ? SDL_FULLSCREEN : 0))) != NULL) {
+    if ((screen=SDL_SetVideoMode(width,height,config.bpp,SDL_HWSURFACE|SDL_RESIZABLE|SDL_DOUBLEBUF|(fullscreen ? SDL_FULLSCREEN : 0))) != NULL) {
     } else {
         cout << "Couldn't set VideoMode: " << SDL_GetError() << endl;
         quitGame(-1);

Modified: trunk/src/lost_penguins.cpp
===================================================================
--- trunk/src/lost_penguins.cpp	2005-02-02 20:27:43 UTC (rev 82)
+++ trunk/src/lost_penguins.cpp	2005-02-02 21:54:06 UTC (rev 83)
@@ -95,6 +95,7 @@
     //default values
     config.width=640;
     config.height=480;
+    config.bpp=16;
     config.full=false;
     config.audio_rate = MIX_DEFAULT_FREQUENCY;
     config.audio_format = MIX_DEFAULT_FORMAT;
@@ -120,6 +121,8 @@
             config.width=atoi(arg1.c_str());
         } else if (option=="height") {
             config.height=atoi(arg1.c_str());
+        } else if (option=="bpp") {
+            config.bpp=atoi(arg1.c_str());
         } else if (option=="full" && arg1=="1") {
             config.full=true;
         } else if (option=="map") {
@@ -140,6 +143,9 @@
         } else if ( strcmp(argv[i], "-height") == 0 || strcmp(argv[i], "-h") == 0) {
             config.height=atoi(argv[i+1]);
             i++;
+        } else if ( strcmp(argv[i], "-bpp") == 0 ) {
+            config.bpp=atoi(argv[i+1]);
+            i++;
         } else if ( strcmp(argv[i], "-full") == 0 || strcmp(argv[i], "-fs") == 0) {
             config.full=SDL_FULLSCREEN;
         } else if ( strcmp(argv[i], "-map") == 0 ) {
@@ -154,10 +160,11 @@
 
 void usage() {
     cout << "Usage: lost_penguins [OPTIONS]\n";
-    cout << "  -w, -width	Changes resolution (width) of game.  Default: 640\n";
-    cout << "  -h, -height	Changes resolution (height) of game. Default: 480\n";
-    cout << "  -fs, -full	Enable fullscreen.                   Default: disabled\n";
-    cout << "  -map		Load specified map from data dir.    Default: map1\n";
-    cout << "  -h, --help	Show this text \n";
+    cout << "  -w, -width   Changes resolution (width) of game.    Default: 640\n";
+    cout << "  -h, -height  Changes resolution (height) of game.   Default: 480\n";
+    cout << "  -bpp         Specifies color depth (bpp) of screen. Default: 16\n";
+    cout << "  -fs, -full	Enable fullscreen.                     Default: disabled\n";
+    cout << "  -map         Load specified map from data dir.      Default: map1\n";
+    cout << "  -h, --help   Show this text \n";
     quitGame(4);
 }




More information about the lostpenguins-commits mailing list