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:
@@ -4,6 +4,6 @@
|
|||||||
800x600x32
|
800x600x32
|
||||||
1024x768x32
|
1024x768x32
|
||||||
1280x1024x32
|
1280x1024x32
|
||||||
1600x1200x32
|
|
||||||
1680x1050x32
|
1680x1050x32
|
||||||
|
1600x1200x32
|
||||||
1920x1200x32
|
1920x1200x32
|
||||||
|
|||||||
35
readme.txt
35
readme.txt
@@ -1,18 +1,18 @@
|
|||||||
*************************************
|
**********************************************
|
||||||
* *
|
* *
|
||||||
* Commander Genius *
|
* Commander Genius *
|
||||||
* (CloneKeenPlus) *
|
* (CloneKeenPlus) *
|
||||||
* *
|
* *
|
||||||
* (c)2008-2009 Gerstrong *
|
* (c)2008-2009 Gerstrong *
|
||||||
* (c)2009 Pickle *
|
* (c)2009 Pickle *
|
||||||
* (c)2009 Tulip *
|
* (c)2009 Tulip *
|
||||||
* (c)2009 DaVince
|
* (c)2009 DaVince *
|
||||||
* (c)2003-2005 Caitlin Shaw *
|
* (c)2003-2005 and 2009 Caitlin Shaw *
|
||||||
* Released under GNU/GPL *
|
* Released under GNU/GPL *
|
||||||
* *
|
* *
|
||||||
* Prerelease v0.3 *
|
* Release v0.3 *
|
||||||
* *
|
* *
|
||||||
*************************************
|
**********************************************
|
||||||
|
|
||||||
Welcome to Commander Genius (aka CloneKeenPlus)
|
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
|
data files to work. You can play all three episodes of the game and
|
||||||
some fanmade mods.
|
some fanmade mods.
|
||||||
|
|
||||||
Commander Genius currently runs under Linux/X11 and Windows with SDL.
|
Commander Genius currently runs under Linux/X11, Windows
|
||||||
In Mac OS X it also runs, but we are still looking for a distributor.
|
and MacOS X with SDL. Also portable systems are supported (Wiz)
|
||||||
Check our website to get CG running on MacOs X Systems.
|
|
||||||
|
|
||||||
Commander Genius tries to mostly replicate the original game,
|
Commander Genius tries to mostly replicate the original game,
|
||||||
however there are also a number of improvements like:
|
however there are also a number of improvements like:
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#ifndef CLOGFILE_H_
|
#ifndef CLOGFILE_H_
|
||||||
#define CLOGFILE_H_
|
#define CLOGFILE_H_
|
||||||
|
|
||||||
#define REVISION "Commander Genius Prerelease v0.3 Pre9"
|
#define REVISION "Commander Genius Release v0.3"
|
||||||
#include "CSingleton.h"
|
#include "CSingleton.h"
|
||||||
#define g_pLogFile CLogFile::Get()
|
#define g_pLogFile CLogFile::Get()
|
||||||
|
|
||||||
|
|||||||
@@ -111,15 +111,42 @@ void CVideoDriver::initResolutionList()
|
|||||||
}
|
}
|
||||||
else
|
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())
|
while(!ResolutionFile.eof())
|
||||||
{
|
{
|
||||||
ResolutionFile.getline(buf,256);
|
ResolutionFile.getline(buf,256);
|
||||||
if(sscanf(buf,"%hdx%hdx%hd", &resolution.width,
|
if(sscanf(buf,"%hdx%hdx%hd", &resolution.width,
|
||||||
&resolution.height,
|
&resolution.height,
|
||||||
&resolution.depth) == 3)
|
&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();
|
ResolutionFile.close();
|
||||||
|
|
||||||
|
SDL_Quit();
|
||||||
|
|
||||||
|
// shutdown SDL, so the game can initialize it correctly
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_Resolutionlist.empty()) {
|
if(m_Resolutionlist.empty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user