Merge branch 'master' of github.com:ancurio/mkxp

This commit is contained in:
Jonas Kulla 2017-04-23 14:38:13 +02:00
commit ecc4a30997
8 changed files with 37 additions and 2 deletions

View File

@ -124,6 +124,26 @@
# subImageFix=false
# Enable framebuffer blitting if the driver is
# capable of it. Some drivers carry buggy
# implementations of this functionality, so
# disabling it can be used as a workaround
# (default: enabled)
#
# enableBlitting=true
# Limit the maximum size (width, height) of
# most textures mkxp will create (exceptions are
# rendering backbuffers and similar).
# If set to 0, the hardware maximum is used.
# This is useful for recording traces that can
# be played back on machines with lower specs.
# (default: 0)
#
# maxTextureSize=0
# Set the base path of the game to '/path/to/game'
# (default: executable directory)
#

View File

@ -166,6 +166,8 @@ void Config::read(int argc, char *argv[])
PO_DESC(syncToRefreshrate, bool, false) \
PO_DESC(solidFonts, bool, false) \
PO_DESC(subImageFix, bool, false) \
PO_DESC(enableBlitting, bool, true) \
PO_DESC(maxTextureSize, int, 0) \
PO_DESC(gameFolder, std::string, ".") \
PO_DESC(anyAltToggleFS, bool, false) \
PO_DESC(enableReset, bool, true) \

View File

@ -55,6 +55,8 @@ struct Config
bool solidFonts;
bool subImageFix;
bool enableBlitting;
int maxTextureSize;
std::string gameFolder;
bool anyAltToggleFS;

View File

@ -27,6 +27,7 @@
#include <SDL_timer.h>
#include <SDL_thread.h>
#include <SDL_touch.h>
#include <SDL_rect.h>
#include <al.h>
#include <alc.h>

View File

@ -23,6 +23,7 @@
#include "shader.h"
#include "etc.h"
#include "gl-fun.h"
#include "config.h"
#include <SDL_rect.h>
@ -111,7 +112,7 @@ GLState::Caps::Caps()
gl.GetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTexSize);
}
GLState::GLState()
GLState::GLState(const Config &conf)
{
gl.Disable(GL_DEPTH_TEST);
@ -121,4 +122,7 @@ GLState::GLState()
scissorTest.init(false);
scissorBox.init(IntRect(0, 0, 640, 480));
program.init(0);
if (conf.maxTextureSize > 0)
caps.maxTexSize = conf.maxTextureSize;
}

View File

@ -27,6 +27,8 @@
#include <stack>
#include <assert.h>
struct Config;
template<typename T>
struct GLProperty
{
@ -130,7 +132,7 @@ public:
} caps;
GLState();
GLState(const Config &conf);
};
#endif // GLSTATE_H

View File

@ -102,6 +102,9 @@ int rgssThreadFun(void *userdata)
return 0;
}
if (!conf.enableBlitting)
gl.BlitFramebuffer = 0;
gl.ClearColor(0, 0, 0, 1);
gl.Clear(GL_COLOR_BUFFER_BIT);
SDL_GL_SwapWindow(win);

View File

@ -109,6 +109,7 @@ struct SharedStatePrivate
graphics(threadData),
input(*threadData),
audio(*threadData),
_glState(threadData->config),
fontState(threadData->config),
stampCounter(0)
{