mirror of
https://github.com/glest/glest-source.git
synced 2025-08-14 04:13:58 +02:00
Bugfixes so that win32 code will compile with latest sdl changes
This commit is contained in:
Binary file not shown.
@@ -106,6 +106,7 @@ vector<std::pair<string,int32> > getFolderTreeContentsCheckSumListRecursively(co
|
|||||||
void createDirectoryPaths(string Path);
|
void createDirectoryPaths(string Path);
|
||||||
string extractDirectoryPathFromFile(string filename);
|
string extractDirectoryPathFromFile(string filename);
|
||||||
|
|
||||||
|
void getFullscreenVideoInfo(int &colorBits,int &screenWidth,int &screenHeight);
|
||||||
bool changeVideoMode(int resH, int resW, int colorBits, int refreshFrequency);
|
bool changeVideoMode(int resH, int resW, int colorBits, int refreshFrequency);
|
||||||
void restoreVideoMode();
|
void restoreVideoMode();
|
||||||
|
|
||||||
|
@@ -23,7 +23,6 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "opengl.h"
|
|
||||||
|
|
||||||
#include "leak_dumper.h"
|
#include "leak_dumper.h"
|
||||||
|
|
||||||
@@ -456,10 +455,44 @@ void createDirectoryPaths(string Path)
|
|||||||
|
|
||||||
void getFullscreenVideoInfo(int &colorBits,int &screenWidth,int &screenHeight) {
|
void getFullscreenVideoInfo(int &colorBits,int &screenWidth,int &screenHeight) {
|
||||||
// Get the current video hardware information
|
// Get the current video hardware information
|
||||||
const SDL_VideoInfo* vidInfo = SDL_GetVideoInfo();
|
//const SDL_VideoInfo* vidInfo = SDL_GetVideoInfo();
|
||||||
colorBits = vidInfo->vfmt->BitsPerPixel;
|
//colorBits = vidInfo->vfmt->BitsPerPixel;
|
||||||
screenWidth = vidInfo->current_w;
|
//screenWidth = vidInfo->current_w;
|
||||||
screenHeight = vidInfo->current_h;
|
|
||||||
|
/*
|
||||||
|
//screenHeight = vidInfo->current_h;
|
||||||
|
int cx = GetSystemMetrics(SM_CXVIRTUALSCREEN);
|
||||||
|
// height
|
||||||
|
int cy = GetSystemMetrics(SM_CYVIRTUALSCREEN);
|
||||||
|
|
||||||
|
printf("cx = %d, cy = %d\n",cx,cy);
|
||||||
|
|
||||||
|
if(cx > screenWidth) {
|
||||||
|
screenWidth = cx;
|
||||||
|
screenHeight = cy;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
int iMaxWidth = -1;
|
||||||
|
int iMaxHeight = -1;
|
||||||
|
int iMaxBits = -1;
|
||||||
|
|
||||||
|
DEVMODE devMode;
|
||||||
|
for (int i=0; EnumDisplaySettings(NULL, i, &devMode) ;i++){
|
||||||
|
|
||||||
|
printf("devMode.dmPelsWidth = %d, devMode.dmPelsHeight = %d, devMode.dmBitsPerPel = %d\n",devMode.dmPelsWidth,devMode.dmPelsHeight,devMode.dmBitsPerPel);
|
||||||
|
|
||||||
|
if(devMode.dmPelsWidth > iMaxWidth) {
|
||||||
|
iMaxWidth = devMode.dmPelsWidth;
|
||||||
|
iMaxHeight = devMode.dmPelsHeight;
|
||||||
|
iMaxBits = devMode.dmBitsPerPel;
|
||||||
|
//devMode.dmDisplayFrequency=refreshFrequency;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(iMaxWidth > 0) {
|
||||||
|
colorBits = iMaxBits;
|
||||||
|
screenWidth = iMaxWidth;
|
||||||
|
screenHeight = iMaxHeight;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool changeVideoMode(int resW, int resH, int colorBits, int refreshFrequency){
|
bool changeVideoMode(int resW, int resH, int colorBits, int refreshFrequency){
|
||||||
|
Reference in New Issue
Block a user