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"/>
|
||||
</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">
|
||||
|
|
|
@ -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)))
|
||||
{
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue