- screen resolutions sorted now in options menu
This commit is contained in:
parent
3866cf286f
commit
c8a6404ecf
|
@ -130,7 +130,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu):
|
||||||
config.getString("ScreenHeight") + "-" +
|
config.getString("ScreenHeight") + "-" +
|
||||||
intToStr(config.getInt("ColorBits"));
|
intToStr(config.getInt("ColorBits"));
|
||||||
bool currentResolutionFound = false;
|
bool currentResolutionFound = false;
|
||||||
for(list<ModeInfo>::const_iterator it= modeInfos.begin(); it!=modeInfos.end(); ++it){
|
for(vector<ModeInfo>::const_iterator it= modeInfos.begin(); it!=modeInfos.end(); ++it){
|
||||||
if((*it).getString() == currentResString) {
|
if((*it).getString() == currentResString) {
|
||||||
currentResolutionFound = true;
|
currentResolutionFound = true;
|
||||||
}
|
}
|
||||||
|
@ -821,7 +821,7 @@ void MenuStateOptions::saveConfig(){
|
||||||
string currentResolution=config.getString("ScreenWidth")+"x"+config.getString("ScreenHeight");
|
string currentResolution=config.getString("ScreenWidth")+"x"+config.getString("ScreenHeight");
|
||||||
string selectedResolution=listBoxScreenModes.getSelectedItem();
|
string selectedResolution=listBoxScreenModes.getSelectedItem();
|
||||||
if(currentResolution!=selectedResolution){
|
if(currentResolution!=selectedResolution){
|
||||||
for(list<ModeInfo>::const_iterator it= modeInfos.begin(); it!=modeInfos.end(); ++it){
|
for(vector<ModeInfo>::const_iterator it= modeInfos.begin(); it!=modeInfos.end(); ++it){
|
||||||
if((*it).getString()==selectedResolution)
|
if((*it).getString()==selectedResolution)
|
||||||
{
|
{
|
||||||
config.setInt("ScreenWidth",(*it).width);
|
config.setInt("ScreenWidth",(*it).width);
|
||||||
|
|
|
@ -61,7 +61,7 @@ private:
|
||||||
|
|
||||||
GraphicLabel labelScreenModes;
|
GraphicLabel labelScreenModes;
|
||||||
GraphicListBox listBoxScreenModes;
|
GraphicListBox listBoxScreenModes;
|
||||||
list<ModeInfo> modeInfos;
|
vector<ModeInfo> modeInfos;
|
||||||
|
|
||||||
GraphicLabel labelFullscreenWindowed;
|
GraphicLabel labelFullscreenWindowed;
|
||||||
GraphicCheckBox checkBoxFullscreenWindowed;
|
GraphicCheckBox checkBoxFullscreenWindowed;
|
||||||
|
|
|
@ -102,6 +102,21 @@ public:
|
||||||
|
|
||||||
ModeInfo(int width, int height, int depth);
|
ModeInfo(int width, int height, int depth);
|
||||||
|
|
||||||
|
bool operator< (const ModeInfo &j) const {
|
||||||
|
if(this->width < j.width) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if(this->width == j.width && this->height < j.height) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if(this->width == j.width &&
|
||||||
|
this->height == j.height &&
|
||||||
|
this->depth < j.depth) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
string getString() const;
|
string getString() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -142,7 +157,7 @@ string extractDirectoryPathFromFile(string filename);
|
||||||
string extractLastDirectoryFromPath(string Path);
|
string extractLastDirectoryFromPath(string Path);
|
||||||
string extractExtension(const string& filename);
|
string extractExtension(const string& filename);
|
||||||
|
|
||||||
void getFullscreenVideoModes(list<ModeInfo> *modeinfos,bool isFullscreen);
|
void getFullscreenVideoModes(vector<ModeInfo> *modeinfos,bool isFullscreen);
|
||||||
void getFullscreenVideoInfo(int &colorBits,int &screenWidth,int &screenHeight,bool isFullscreen);
|
void getFullscreenVideoInfo(int &colorBits,int &screenWidth,int &screenHeight,bool isFullscreen);
|
||||||
bool changeVideoMode(int resH, int resW, int colorBits, int refreshFrequency);
|
bool changeVideoMode(int resH, int resW, int colorBits, int refreshFrequency);
|
||||||
void restoreVideoMode(bool exitingApp=false);
|
void restoreVideoMode(bool exitingApp=false);
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include "randomgen.h"
|
#include "randomgen.h"
|
||||||
|
#include <algorithm>
|
||||||
#include "leak_dumper.h"
|
#include "leak_dumper.h"
|
||||||
|
|
||||||
using namespace Shared::Platform;
|
using namespace Shared::Platform;
|
||||||
|
@ -1314,7 +1315,7 @@ void getFullscreenVideoInfo(int &colorBits,int &screenWidth,int &screenHeight,bo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void getFullscreenVideoModes(list<ModeInfo> *modeinfos, bool isFullscreen) {
|
void getFullscreenVideoModes(vector<ModeInfo> *modeinfos, bool isFullscreen) {
|
||||||
// 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;
|
||||||
|
@ -1499,6 +1500,8 @@ void getFullscreenVideoModes(list<ModeInfo> *modeinfos, bool isFullscreen) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while(++loops != 4);
|
} while(++loops != 4);
|
||||||
|
|
||||||
|
std::sort(modeinfos->begin(),modeinfos->end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user