resolution switch for windows fixed ( hopefully )

This commit is contained in:
Titus Tscharntke
2010-04-07 16:38:14 +00:00
parent b16b0f00fc
commit e290b6db82
2 changed files with 21 additions and 18 deletions

View File

@@ -643,8 +643,6 @@ void getFullscreenVideoModes(list<ModeInfo> *modeinfos) {
/* Print valid modes */ /* Print valid modes */
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] available Modes are:\n",__FILE__,__FUNCTION__,__LINE__); SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] available Modes are:\n",__FILE__,__FUNCTION__,__LINE__);
int bestW = -1;
int bestH = -1;
for(int i=0; modes[i]; ++i) { for(int i=0; modes[i]; ++i) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"%d x %d\n",modes[i]->w, modes[i]->h,bpp); SystemFlags::OutputDebug(SystemFlags::debugSystem,"%d x %d\n",modes[i]->w, modes[i]->h,bpp);
string lookupKey = intToStr(modes[i]->w) + "_" + intToStr(modes[i]->h) + "_" + intToStr(bpp); string lookupKey = intToStr(modes[i]->w) + "_" + intToStr(modes[i]->h) + "_" + intToStr(bpp);
@@ -653,7 +651,7 @@ void getFullscreenVideoModes(list<ModeInfo> *modeinfos) {
modeinfos->push_back(ModeInfo(modes[i]->w,modes[i]->h,bpp)); modeinfos->push_back(ModeInfo(modes[i]->w,modes[i]->h,bpp));
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] adding resolution: %d x %d - %d.\n",__FILE__,__FUNCTION__,__LINE__,modes[i]->w,modes[i]->h,bpp); SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] adding resolution: %d x %d - %d.\n",__FILE__,__FUNCTION__,__LINE__,modes[i]->w,modes[i]->h,bpp);
} }
// fake the missing 16 bit resolutions in linux // fake the missing 16 bit resolutions
string lookupKey16 = intToStr(modes[i]->w) + "_" + intToStr(modes[i]->h) + "_" + intToStr(16); string lookupKey16 = intToStr(modes[i]->w) + "_" + intToStr(modes[i]->h) + "_" + intToStr(16);
if(uniqueResList.find(lookupKey16) == uniqueResList.end()) { if(uniqueResList.find(lookupKey16) == uniqueResList.end()) {
uniqueResList[lookupKey16] = true; uniqueResList[lookupKey16] = true;

View File

@@ -748,15 +748,20 @@ void getFullscreenVideoModes(list<ModeInfo> *modeinfos) {
/* Print valid modes */ /* Print valid modes */
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] available Modes are:\n",__FILE__,__FUNCTION__,__LINE__); SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] available Modes are:\n",__FILE__,__FUNCTION__,__LINE__);
int bestW = -1;
int bestH = -1;
for(int i=0; modes[i]; ++i) { for(int i=0; modes[i]; ++i) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"%d x %d\n",modes[i]->w, modes[i]->h,modes[i]->x); SystemFlags::OutputDebug(SystemFlags::debugSystem,"%d x %d\n",modes[i]->w, modes[i]->h,bpp);
string lookupKey = intToStr(modes[i]->w) + "_" + intToStr(modes[i]->h) + "_" + intToStr(modes[i]->x); string lookupKey = intToStr(modes[i]->w) + "_" + intToStr(modes[i]->h) + "_" + intToStr(bpp);
if(uniqueResList.find(lookupKey) == uniqueResList.end()) { if(uniqueResList.find(lookupKey) == uniqueResList.end()) {
uniqueResList[lookupKey] = true; uniqueResList[lookupKey] = true;
modeinfos->push_back(ModeInfo(modes[i]->w,modes[i]->h,modes[i]->x)); modeinfos->push_back(ModeInfo(modes[i]->w,modes[i]->h,bpp));
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] adding resolution: %d x %d.\n",__FILE__,__FUNCTION__,__LINE__,modes[i]->w,modes[i]->h); SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] adding resolution: %d x %d - %d.\n",__FILE__,__FUNCTION__,__LINE__,modes[i]->w,modes[i]->h,bpp);
}
// fake the missing 16 bit resolutions
string lookupKey16 = intToStr(modes[i]->w) + "_" + intToStr(modes[i]->h) + "_" + intToStr(16);
if(uniqueResList.find(lookupKey16) == uniqueResList.end()) {
uniqueResList[lookupKey16] = true;
modeinfos->push_back(ModeInfo(modes[i]->w,modes[i]->h,16));
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] adding resolution: %d x %d - %d.\n",__FILE__,__FUNCTION__,__LINE__,modes[i]->w,modes[i]->h,16);
} }
} }
} }
@@ -865,14 +870,14 @@ bool isKeyDown(int virtualKey){
// ModeInfo // ModeInfo
// ===================================== // =====================================
ModeInfo::ModeInfo(int w, int h, int d) { ModeInfo::ModeInfo(int w, int h, int d) {
width=w; width=w;
height=h; height=h;
depth=d; depth=d;
} }
string ModeInfo::getString() const{ string ModeInfo::getString() const{
return intToStr(width)+"x"+intToStr(height); return intToStr(width)+"x"+intToStr(height)+"-"+intToStr(depth);
} }
}}//end namespace }}//end namespace