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

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

[Wesnoth-cvs-commits] wesnoth/src game.cpp


From: David White
Subject: [Wesnoth-cvs-commits] wesnoth/src game.cpp
Date: Fri, 15 Jul 2005 23:53:37 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     David White <address@hidden>    05/07/16 03:53:37

Modified files:
        src            : game.cpp 

Log message:
        added code which attempts to query the video settings to work out what 
the best colour depth is

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game.cpp.diff?tr1=1.263&tr2=1.264&r1=text&r2=text

Patches:
Index: wesnoth/src/game.cpp
diff -u wesnoth/src/game.cpp:1.263 wesnoth/src/game.cpp:1.264
--- wesnoth/src/game.cpp:1.263  Sun Jul 10 20:46:35 2005
+++ wesnoth/src/game.cpp        Sat Jul 16 03:53:36 2005
@@ -1,4 +1,4 @@
-/* $Id: game.cpp,v 1.263 2005/07/10 20:46:35 Sirp Exp $ */
+/* $Id: game.cpp,v 1.264 2005/07/16 03:53:36 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -265,11 +265,15 @@
 
        std::pair<int,int> resolution = preferences::resolution();
 
-       const int DefaultBPP = 24;
+       int DefaultBPP = 24;
+       const SDL_VideoInfo* const video_info = SDL_GetVideoInfo();
+       if(video_info != NULL && video_info->vfmt != NULL) {
+               DefaultBPP = video_info->vfmt->BitsPerPixel;
+       }
 
        std::cerr << "Checking video mode: " << resolution.first
                  << "x" << resolution.second << "x" << DefaultBPP << "...\n";
-       int bpp = 
video_.modePossible(resolution.first,resolution.second,DefaultBPP,video_flags);
+       int bpp = 
video_.modePossible(resolution.first,resolution.second,0,video_flags);
 
        std::cerr << bpp << "\n";
 




reply via email to

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