wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth doc/man/wesnoth_editor.6 src/editor/edi...


From: Bram Ridder
Subject: [Wesnoth-cvs-commits] wesnoth doc/man/wesnoth_editor.6 src/editor/edi...
Date: Sat, 17 Sep 2005 13:32:12 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Bram Ridder <address@hidden>    05/09/17 17:32:12

Modified files:
        doc/man        : wesnoth_editor.6 
        src/editor     : editor_main.cpp 

Log message:
        Fixed bug #14551, changed the default bits per pixel value to 24.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/doc/man/wesnoth_editor.6.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/editor/editor_main.cpp.diff?tr1=1.38&tr2=1.39&r1=text&r2=text

Patches:
Index: wesnoth/doc/man/wesnoth_editor.6
diff -u wesnoth/doc/man/wesnoth_editor.6:1.7 
wesnoth/doc/man/wesnoth_editor.6:1.8
--- wesnoth/doc/man/wesnoth_editor.6:1.7        Sat Jun 11 07:50:01 2005
+++ wesnoth/doc/man/wesnoth_editor.6    Sat Sep 17 17:32:12 2005
@@ -49,6 +49,10 @@
 sets screen resolution. Example: -r 800x600
 
 .TP
+.BR --bpp
+sets BitsPerPixel value. Example: --bpp 32
+
+.TP
 .BR -v , \ --version
 prints version number and exits.
 
Index: wesnoth/src/editor/editor_main.cpp
diff -u wesnoth/src/editor/editor_main.cpp:1.38 
wesnoth/src/editor/editor_main.cpp:1.39
--- wesnoth/src/editor/editor_main.cpp:1.38     Tue Sep  6 14:00:05 2005
+++ wesnoth/src/editor/editor_main.cpp  Sat Sep 17 17:32:12 2005
@@ -60,6 +60,7 @@
                        << "  -w, --windowed    Runs the game in windowed 
mode\n"
                        << "  -v, --version     Prints the game's version 
number and exits\n"
                        << "  --resolution      Set the resolution of the 
window\n"
+                       << "  --bpp             Set the bits per pixel\n"
                    << "  --datadir         Select the data directory to use\n";
                        return 0;
                } else if(val == "--version" || val == "-v") {
@@ -81,12 +82,19 @@
        std::string filename = "";
        std::string mapdata;
 
+       int choosen_bpp = 0;
+
        for(arg = 1; arg != argc; ++arg) {
                const std::string val(argv[arg]);
                if(val.empty()) {
                        continue;
                }
-               if(val == "--resolution" || val == "-r") {
+               if(val == "--bpp" && arg + 1 != argc) {
+                       ++arg;
+                       choosen_bpp = lexical_cast_default<int>(argv[arg]);
+               }
+                       
+               else if(val == "--resolution" || val == "-r") {
                        if(arg+1 != argc) {
                                ++arg;
                                const std::string val(argv[arg]);
@@ -156,47 +164,54 @@
        image::set_wm_icon();
        int video_flags = preferences::fullscreen() ? FULL_SCREEN : 0;
        std::pair<int,int> resolution = preferences::resolution();
-
+       
        std::cerr << "checking mode possible...\n";
-       const int bpp = 
video.modePossible(resolution.first,resolution.second,16,video_flags);
-
-       std::cerr << bpp << "\n";
+       const int default_bpp = 24;
+       int bpp = default_bpp;
 
-       if(bpp == 0) {
-               //Video mode not supported, maybe from bad prefs.
-               std::cerr << "The video mode, " << resolution.first
-                                 << "x" << resolution.second << "x16 "
-                                 << "is not supported\nAttempting 
1024x768x16...\n";
+       if(choosen_bpp == 0) {
+               bpp = 
video.modePossible(resolution.first,resolution.second,default_bpp,video_flags);
 
-               //Attempt 1024x768.
-               resolution.first = 1024;
-               resolution.second = 768;
+               std::cerr << bpp << "\n";
 
-               int bpp = 
video.modePossible(resolution.first,resolution.second,16,video_flags);
+               if(bpp == 0)  {
+                       //Video mode not supported, maybe from bad prefs.
+                       std::cerr << "The video mode, " << resolution.first
+                                 << "x" << resolution.second << "x" << 
default_bpp <<
+                                 "is not supported\nAttempting 1024x768x" << 
default_bpp << "...\n";
 
-               if(bpp == 0) {
-                                //Attempt 1024x768.
+                       //Attempt 1024x768.
                        resolution.first = 1024;
                        resolution.second = 768;
-                       std::cerr << "1024x768x16 is not possible.\nAttempting 
800x600x16...\n";
 
-                       resolution.first = 800;
-                       resolution.second = 600;
+                       bpp = 
video.modePossible(resolution.first,resolution.second,default_bpp,video_flags);
 
-                       bpp = 
video.modePossible(resolution.first,resolution.second,16,video_flags);
-               }
+                       if(bpp == 0) {
+                                //Attempt 1024x768.
+                               resolution.first = 1024;
+                               resolution.second = 768;
+                               std::cerr << "1024x768x" << default_bpp << " is 
not possible.\nAttempting 800x600x" << default_bpp << "...\n";
 
-               if(bpp == 0) {
-                       //couldn't do 1024x768 or 800x600
+                               resolution.first = 800;
+                               resolution.second = 600;
 
-                       std::cerr << "The required video mode, " << 
resolution.first
-                                         << "x" << resolution.second << "x16 "
-                                         << "is not supported\n";
+                               bpp = 
video.modePossible(resolution.first,resolution.second,default_bpp,video_flags);
+                       }
 
-                       return 0;
+                       if(bpp == 0) {
+                               //couldn't do 1024x768 or 800x600
+
+                               std::cerr << "The required video mode, " << 
resolution.first
+                                         << "x" << resolution.second << "x" << 
default_bpp <<
+                                         "is not supported\n";
+
+                               return 0;
+                       }
                }
+       } else {
+               bpp = choosen_bpp;
        }
-
+       
        std::cerr << "setting mode to " << resolution.first << "x" << 
resolution.second << "\n";
        const int res = 
video.setMode(resolution.first,resolution.second,bpp,video_flags);
        video.setBpp(bpp);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]