Added new setting to allow playing glest using multiple monitors

This commit is contained in:
Mark Vejvoda 2010-03-20 07:19:45 +00:00
parent 4e9d348fbd
commit 1f2c805fe8
5 changed files with 35 additions and 0 deletions

View File

@ -215,6 +215,16 @@ shadows and shadow mapping, bigger sizes result in less pixelized shadows but ar
<enum value="false"/>
</enums>
</field>
<field type="Enum">
<name value="Auto maximum screen"/>
<variable-name value="AutoMaxFullScreen"/>
<description value="Automatically use maximum screen space and resolution"/>
<default value="true"/>
<enums>
<enum value="true"/>
<enum value="false"/>
</enums>
</field>
</field-group>
<field-group name="Audio">

View File

@ -319,6 +319,13 @@ void Program::setDisplaySettings(){
int screenWidth= config.getInt("ScreenWidth");
int screenHeight= config.getInt("ScreenHeight");
if(config.getBool("AutoMaxFullScreen","false") == true) {
getFullscreenVideoInfo(colorBits,screenWidth,screenHeight);
config.setInt("ColorBits",colorBits);
config.setInt("ScreenWidth",screenWidth);
config.setInt("ScreenHeight",screenHeight);
}
if(!(changeVideoMode(screenWidth, screenHeight, colorBits, freq) ||
changeVideoMode(screenWidth, screenHeight, colorBits, 0)))
{

View File

@ -97,6 +97,7 @@ vector<std::pair<string,int32> > getFolderTreeContentsCheckSumListRecursively(co
void createDirectoryPaths(string Path);
string extractDirectoryPathFromFile(string filename);
void getFullscreenVideoInfo(int &colorBits,int &screenWidth,int &screenHeight);
bool changeVideoMode(int resH, int resW, int colorBits, int refreshFrequency);
void restoreVideoMode();

View File

@ -435,6 +435,14 @@ void createDirectoryPaths(string Path)
mkdir(DirName, S_IRWXO);
}
void getFullscreenVideoInfo(int &colorBits,int &screenWidth,int &screenHeight) {
// Get the current video hardware information
const SDL_VideoInfo* vidInfo = SDL_GetVideoInfo();
colorBits = vidInfo->vfmt->BitsPerPixel;
screenWidth = vidInfo->current_w;
screenHeight = vidInfo->current_h;
}
bool changeVideoMode(int resW, int resH, int colorBits, int ) {
Private::shouldBeFullscreen = true;
return true;

View File

@ -23,6 +23,7 @@
#include <sys/stat.h>
#include <direct.h>
#include <algorithm>
#include "opengl.h"
#include "leak_dumper.h"
@ -452,6 +453,14 @@ void createDirectoryPaths(string Path)
}
_mkdir(DirName);
}
void getFullscreenVideoInfo(int &colorBits,int &screenWidth,int &screenHeight) {
// Get the current video hardware information
const SDL_VideoInfo* vidInfo = SDL_GetVideoInfo();
colorBits = vidInfo->vfmt->BitsPerPixel;
screenWidth = vidInfo->current_w;
screenHeight = vidInfo->current_h;
}
bool changeVideoMode(int resW, int resH, int colorBits, int refreshFrequency){
DEVMODE devMode;