Improved resolution detection system

git-svn-id: https://clonekeenplus.svn.sourceforge.net/svnroot/clonekeenplus/cgenius/trunk@218 4df4b0f3-56ce-47cb-b001-ed939b7d65a6
This commit is contained in:
gerstrong
2009-08-09 13:52:35 +00:00
parent 7c529bec6d
commit 843be847eb
4 changed files with 47 additions and 21 deletions

View File

@@ -4,6 +4,6 @@
800x600x32
1024x768x32
1280x1024x32
1600x1200x32
1680x1050x32
1600x1200x32
1920x1200x32

View File

@@ -1,18 +1,18 @@
*************************************
* *
* Commander Genius *
* (CloneKeenPlus) *
* *
* (c)2008-2009 Gerstrong *
* (c)2009 Pickle *
* (c)2009 Tulip *
* (c)2009 DaVince
* (c)2003-2005 Caitlin Shaw *
* Released under GNU/GPL *
* *
* Prerelease v0.3 *
* *
*************************************
**********************************************
* *
* Commander Genius *
* (CloneKeenPlus) *
* *
* (c)2008-2009 Gerstrong *
* (c)2009 Pickle *
* (c)2009 Tulip *
* (c)2009 DaVince *
* (c)2003-2005 and 2009 Caitlin Shaw *
* Released under GNU/GPL *
* *
* Release v0.3 *
* *
**********************************************
Welcome to Commander Genius (aka CloneKeenPlus)
@@ -22,9 +22,8 @@ Vorticons by ID Software. Commander Genius requires the original game
data files to work. You can play all three episodes of the game and
some fanmade mods.
Commander Genius currently runs under Linux/X11 and Windows with SDL.
In Mac OS X it also runs, but we are still looking for a distributor.
Check our website to get CG running on MacOs X Systems.
Commander Genius currently runs under Linux/X11, Windows
and MacOS X with SDL. Also portable systems are supported (Wiz)
Commander Genius tries to mostly replicate the original game,
however there are also a number of improvements like:

View File

@@ -8,7 +8,7 @@
#ifndef CLOGFILE_H_
#define CLOGFILE_H_
#define REVISION "Commander Genius Prerelease v0.3 Pre9"
#define REVISION "Commander Genius Release v0.3"
#include "CSingleton.h"
#define g_pLogFile CLogFile::Get()

View File

@@ -111,15 +111,42 @@ void CVideoDriver::initResolutionList()
}
else
{
// Init SDL in order to check, if the resolutions are really supported
if(SDL_Init(SDL_INIT_VIDEO) < 0)
{
g_pLogFile->textOut(RED,"Could not initialize SDL for mode detection: %s<br>", SDL_GetError());
return;
}
else
g_pLogFile->textOut(GREEN,"SDL-Video was successfully initialized for mode detections!<br>");
std::list<st_resolution> :: iterator i;
while(!ResolutionFile.eof())
{
ResolutionFile.getline(buf,256);
if(sscanf(buf,"%hdx%hdx%hd", &resolution.width,
&resolution.height,
&resolution.depth) == 3)
m_Resolutionlist.push_back(resolution);
// Now check if it's possible to use this resolution
resolution.depth = SDL_VideoModeOK(resolution.width, resolution.height,
resolution.depth, SDL_FULLSCREEN);
if(resolution.depth)
{
for( i = m_Resolutionlist.begin() ; i != m_Resolutionlist.end() ; i++ )
if(i->width == resolution.width &&
i->height == resolution.height &&
i->depth == resolution.depth) break;
if(i == m_Resolutionlist.end())
m_Resolutionlist.push_back(resolution);
}
}
ResolutionFile.close();
SDL_Quit();
// shutdown SDL, so the game can initialize it correctly
}
if(m_Resolutionlist.empty()) {