parent
d0383ae09b
commit
487e43ff4e
|
@ -168,12 +168,11 @@ CApplication::CApplication()
|
||||||
m_runSceneRank = 0;
|
m_runSceneRank = 0;
|
||||||
|
|
||||||
m_sceneTest = false;
|
m_sceneTest = false;
|
||||||
|
m_resolutionOverride = false;
|
||||||
|
|
||||||
m_language = LANGUAGE_ENV;
|
m_language = LANGUAGE_ENV;
|
||||||
|
|
||||||
m_lowCPU = true;
|
m_lowCPU = true;
|
||||||
|
|
||||||
m_protoMode = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CApplication::~CApplication()
|
CApplication::~CApplication()
|
||||||
|
@ -228,7 +227,8 @@ ParseArgsStatus CApplication::ParseArguments(int argc, char *argv[])
|
||||||
OPT_DATADIR,
|
OPT_DATADIR,
|
||||||
OPT_SAVEDIR,
|
OPT_SAVEDIR,
|
||||||
OPT_MOD,
|
OPT_MOD,
|
||||||
OPT_VBO
|
OPT_VBO,
|
||||||
|
OPT_RESOLUTION
|
||||||
};
|
};
|
||||||
|
|
||||||
option options[] =
|
option options[] =
|
||||||
|
@ -244,6 +244,7 @@ ParseArgsStatus CApplication::ParseArguments(int argc, char *argv[])
|
||||||
{ "savedir", required_argument, nullptr, OPT_SAVEDIR },
|
{ "savedir", required_argument, nullptr, OPT_SAVEDIR },
|
||||||
{ "mod", required_argument, nullptr, OPT_MOD },
|
{ "mod", required_argument, nullptr, OPT_MOD },
|
||||||
{ "vbo", required_argument, nullptr, OPT_VBO },
|
{ "vbo", required_argument, nullptr, OPT_VBO },
|
||||||
|
{ "resolution", required_argument, nullptr, OPT_RESOLUTION },
|
||||||
{ nullptr, 0, nullptr, 0}
|
{ nullptr, 0, nullptr, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -285,6 +286,7 @@ ParseArgsStatus CApplication::ParseArguments(int argc, char *argv[])
|
||||||
GetLogger()->Message(" -savedir path set custom save directory path (must be writable)\n");
|
GetLogger()->Message(" -savedir path set custom save directory path (must be writable)\n");
|
||||||
GetLogger()->Message(" -mod path load datadir mod from given path\n");
|
GetLogger()->Message(" -mod path load datadir mod from given path\n");
|
||||||
GetLogger()->Message(" -vbo mode set OpenGL VBO mode (one of: auto, enable, disable)\n");
|
GetLogger()->Message(" -vbo mode set OpenGL VBO mode (one of: auto, enable, disable)\n");
|
||||||
|
GetLogger()->Message(" -resolution WxH set resolution\n");
|
||||||
return PARSE_ARGS_HELP;
|
return PARSE_ARGS_HELP;
|
||||||
}
|
}
|
||||||
case OPT_DEBUG:
|
case OPT_DEBUG:
|
||||||
|
@ -388,6 +390,18 @@ ParseArgsStatus CApplication::ParseArguments(int argc, char *argv[])
|
||||||
CResourceManager::AddLocation(optarg, true);
|
CResourceManager::AddLocation(optarg, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case OPT_RESOLUTION:
|
||||||
|
{
|
||||||
|
std::istringstream resolution(optarg);
|
||||||
|
std::string w, h;
|
||||||
|
std::getline(resolution, w, 'x');
|
||||||
|
std::getline(resolution, h, 'x');
|
||||||
|
|
||||||
|
m_deviceConfig.size.x = atoi(w.c_str());
|
||||||
|
m_deviceConfig.size.y = atoi(h.c_str());
|
||||||
|
m_resolutionOverride = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
assert(false); // should never get here
|
assert(false); // should never get here
|
||||||
}
|
}
|
||||||
|
@ -493,7 +507,7 @@ bool CApplication::Create()
|
||||||
|
|
||||||
// load settings from profile
|
// load settings from profile
|
||||||
int iValue;
|
int iValue;
|
||||||
if ( GetProfile().GetIntProperty("Setup", "Resolution", iValue) )
|
if ( GetProfile().GetIntProperty("Setup", "Resolution", iValue) && !m_resolutionOverride )
|
||||||
{
|
{
|
||||||
std::vector<Math::IntPoint> modes;
|
std::vector<Math::IntPoint> modes;
|
||||||
GetVideoResolutionList(modes, true, true);
|
GetVideoResolutionList(modes, true, true);
|
||||||
|
@ -501,7 +515,7 @@ bool CApplication::Create()
|
||||||
m_deviceConfig.size = modes.at(iValue);
|
m_deviceConfig.size = modes.at(iValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( GetProfile().GetIntProperty("Setup", "Fullscreen", iValue) )
|
if ( GetProfile().GetIntProperty("Setup", "Fullscreen", iValue) && !m_resolutionOverride )
|
||||||
{
|
{
|
||||||
m_deviceConfig.fullScreen = (iValue == 1);
|
m_deviceConfig.fullScreen = (iValue == 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -503,5 +503,8 @@ protected:
|
||||||
|
|
||||||
//! Show prototype levels
|
//! Show prototype levels
|
||||||
bool m_protoMode;
|
bool m_protoMode;
|
||||||
|
|
||||||
|
//! Screen resoultion overriden by commandline
|
||||||
|
bool m_resolutionOverride;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue