Added new setting to allow playing glest using multiple monitors
This commit is contained in:
parent
4e9d348fbd
commit
1f2c805fe8
|
@ -215,6 +215,16 @@ shadows and shadow mapping, bigger sizes result in less pixelized shadows but ar
|
||||||
<enum value="false"/>
|
<enum value="false"/>
|
||||||
</enums>
|
</enums>
|
||||||
</field>
|
</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>
|
||||||
|
|
||||||
<field-group name="Audio">
|
<field-group name="Audio">
|
||||||
|
|
|
@ -319,6 +319,13 @@ void Program::setDisplaySettings(){
|
||||||
int screenWidth= config.getInt("ScreenWidth");
|
int screenWidth= config.getInt("ScreenWidth");
|
||||||
int screenHeight= config.getInt("ScreenHeight");
|
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) ||
|
if(!(changeVideoMode(screenWidth, screenHeight, colorBits, freq) ||
|
||||||
changeVideoMode(screenWidth, screenHeight, colorBits, 0)))
|
changeVideoMode(screenWidth, screenHeight, colorBits, 0)))
|
||||||
{
|
{
|
||||||
|
|
|
@ -97,6 +97,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();
|
||||||
|
|
||||||
|
|
|
@ -435,6 +435,14 @@ void createDirectoryPaths(string Path)
|
||||||
mkdir(DirName, S_IRWXO);
|
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 ) {
|
bool changeVideoMode(int resW, int resH, int colorBits, int ) {
|
||||||
Private::shouldBeFullscreen = true;
|
Private::shouldBeFullscreen = true;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#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"
|
||||||
|
|
||||||
|
@ -452,6 +453,14 @@ void createDirectoryPaths(string Path)
|
||||||
}
|
}
|
||||||
_mkdir(DirName);
|
_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){
|
bool changeVideoMode(int resW, int resH, int colorBits, int refreshFrequency){
|
||||||
DEVMODE devMode;
|
DEVMODE devMode;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user