Core: Begin on video scale hack

This commit is contained in:
Vicki Pfau 2019-05-10 15:04:14 -07:00
parent 3e0675f539
commit 36477ca40d
3 changed files with 13 additions and 5 deletions

View File

@ -255,12 +255,19 @@ static void _GBACoreLoadConfig(struct mCore* core, const struct mCoreConfig* con
mCoreConfigCopyValue(&core->config, config, "threadedVideo");
#endif
mCoreConfigCopyValue(&core->config, config, "hwaccelVideo");
mCoreConfigCopyValue(&core->config, config, "videoScale");
}
static void _GBACoreDesiredVideoDimensions(struct mCore* core, unsigned* width, unsigned* height) {
UNUSED(core);
*width = GBA_VIDEO_HORIZONTAL_PIXELS;
*height = GBA_VIDEO_VERTICAL_PIXELS;
struct GBACore* gbacore = (struct GBACore*) core;
int fakeBool;
int scale = 1;
if (mCoreConfigGetIntValue(&core->config, "hwaccelVideo", &fakeBool) && fakeBool) {
scale = gbacore->glRenderer.scale;
}
*width = GBA_VIDEO_HORIZONTAL_PIXELS * scale;
*height = GBA_VIDEO_VERTICAL_PIXELS * scale;
}
static void _GBACoreSetVideoBuffer(struct mCore* core, color_t* buffer, size_t stride) {
@ -406,6 +413,7 @@ static void _GBACoreReset(struct mCore* core) {
#endif
if (mCoreConfigGetIntValue(&core->config, "hwaccelVideo", &fakeBool) && fakeBool) {
renderer = &gbacore->glRenderer.d;
mCoreConfigGetIntValue(&core->config, "videoScale", &gbacore->glRenderer.scale);
}
if (core->videoLogger) {
gbacore->proxyRenderer.logger = core->videoLogger;

View File

@ -40,7 +40,7 @@ CoreController::CoreController(mCore* core, QObject* parent)
m_threadContext.core = core;
m_threadContext.userData = this;
QSize size(256, 512);
QSize size(1024, 2048);
m_buffers[0].resize(size.width() * size.height() * sizeof(color_t));
m_buffers[1].resize(size.width() * size.height() * sizeof(color_t));
m_buffers[0].fill(0xFF);

View File

@ -251,7 +251,7 @@ PainterGL::PainterGL(int majorVersion, VideoProxy* proxy, QGLWidget* parent)
m_backend->lockAspectRatio = false;
for (int i = 0; i < 2; ++i) {
m_free.append(new uint32_t[256 * 256]);
m_free.append(new uint32_t[1024 * 2048]);
}
}