Add config option "fixedFramerate"
This commit is contained in:
parent
1759a1b4a9
commit
f5a178b9bb
|
@ -77,6 +77,7 @@ mkxp reads configuration data from the file "mkxp.conf" contained in the current
|
||||||
| vsync | bool | false | Sync screen redraws to the monitor refresh rate |
|
| vsync | bool | false | Sync screen redraws to the monitor refresh rate |
|
||||||
| defScreenW | int | 640 | Width the game window starts in (this is **not** the game resolution) |
|
| defScreenW | int | 640 | Width the game window starts in (this is **not** the game resolution) |
|
||||||
| defScreenH | int | 480 | Height the game window starts in |
|
| defScreenH | int | 480 | Height the game window starts in |
|
||||||
|
| fixedFramerate | int | 0 | FPS will be fixed to this amount. Ignored if 0. |
|
||||||
| solidFonts | bool | false | Don't use alpha blending for fonts |
|
| solidFonts | bool | false | Don't use alpha blending for fonts |
|
||||||
| gameFolder | string | "." | mkxp will look for all game related files here |
|
| gameFolder | string | "." | mkxp will look for all game related files here |
|
||||||
| customScript | string | "" | Execute a raw ruby script file instead of an RPG Maker game. |
|
| customScript | string | "" | Execute a raw ruby script file instead of an RPG Maker game. |
|
||||||
|
|
|
@ -37,6 +37,7 @@ Config::Config()
|
||||||
vsync(false),
|
vsync(false),
|
||||||
defScreenW(640),
|
defScreenW(640),
|
||||||
defScreenH(480),
|
defScreenH(480),
|
||||||
|
fixedFramerate(0),
|
||||||
solidFonts(false),
|
solidFonts(false),
|
||||||
gameFolder(".")
|
gameFolder(".")
|
||||||
{}
|
{}
|
||||||
|
@ -55,6 +56,7 @@ void Config::read()
|
||||||
READ_VAL(vsync, Bool);
|
READ_VAL(vsync, Bool);
|
||||||
READ_VAL(defScreenW, Int);
|
READ_VAL(defScreenW, Int);
|
||||||
READ_VAL(defScreenH, Int);
|
READ_VAL(defScreenH, Int);
|
||||||
|
READ_VAL(fixedFramerate, Int);
|
||||||
READ_VAL(solidFonts, Bool);
|
READ_VAL(solidFonts, Bool);
|
||||||
READ_VAL(gameFolder, ByteArray);
|
READ_VAL(gameFolder, ByteArray);
|
||||||
READ_VAL(customScript, ByteArray);
|
READ_VAL(customScript, ByteArray);
|
||||||
|
|
|
@ -40,6 +40,8 @@ struct Config
|
||||||
int defScreenW;
|
int defScreenW;
|
||||||
int defScreenH;
|
int defScreenH;
|
||||||
|
|
||||||
|
int fixedFramerate;
|
||||||
|
|
||||||
bool solidFonts;
|
bool solidFonts;
|
||||||
|
|
||||||
QByteArray gameFolder;
|
QByteArray gameFolder;
|
||||||
|
|
|
@ -451,6 +451,9 @@ Graphics::Graphics(RGSSThreadData *data)
|
||||||
{
|
{
|
||||||
p = new GraphicsPrivate;
|
p = new GraphicsPrivate;
|
||||||
p->threadData = data;
|
p->threadData = data;
|
||||||
|
|
||||||
|
if (data->config.fixedFramerate > 0)
|
||||||
|
p->fpsLimiter.setDesiredFPS(data->config.fixedFramerate);
|
||||||
}
|
}
|
||||||
|
|
||||||
Graphics::~Graphics()
|
Graphics::~Graphics()
|
||||||
|
@ -580,6 +583,10 @@ DEF_ATTR_SIMPLE(Graphics, FrameCount, int, p->frameCount)
|
||||||
void Graphics::setFrameRate(int value)
|
void Graphics::setFrameRate(int value)
|
||||||
{
|
{
|
||||||
p->frameRate = clamp(value, 10, 120);
|
p->frameRate = clamp(value, 10, 120);
|
||||||
|
|
||||||
|
if (p->threadData->config.fixedFramerate > 0)
|
||||||
|
return;
|
||||||
|
|
||||||
p->fpsLimiter.setDesiredFPS(p->frameRate);
|
p->fpsLimiter.setDesiredFPS(p->frameRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue