mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-23 23:33:45 +02:00
Don't vertically flip the screen in libretro builds
Libretro provides the option to make the libretro frontend vertically flip the video output when using OpenGL, so let's just allow the frontend to do that instead of doing it manually. It might be more efficient.
This commit is contained in:
parent
08ad3e9f8f
commit
c97b4b8b6e
2 changed files with 11 additions and 1 deletions
|
@ -2205,7 +2205,7 @@ extern "C" RETRO_API bool retro_load_game(const struct retro_game_info *info) {
|
|||
};
|
||||
hw_render.context_destroy = nullptr;
|
||||
hw_render.cache_context = true;
|
||||
hw_render.bottom_left_origin = true;
|
||||
hw_render.bottom_left_origin = false;
|
||||
if (hw_render.context_type = RETRO_HW_CONTEXT_OPENGL_CORE, hw_render.version_major = 4, hw_render.version_minor = 6, environment(RETRO_ENVIRONMENT_SET_HW_RENDER, &hw_render)) {
|
||||
log_printf(RETRO_LOG_INFO, "Using OpenGL 4.6 graphics driver\n");
|
||||
} else if (hw_render.context_type = RETRO_HW_CONTEXT_OPENGL_CORE, hw_render.version_major = 4, hw_render.version_minor = 5, environment(RETRO_ENVIRONMENT_SET_HW_RENDER, &hw_render)) {
|
||||
|
|
|
@ -1272,16 +1272,26 @@ struct GraphicsPrivate {
|
|||
metaBlitBufferFlippedScaled(scRes, scaleIsSpecial);
|
||||
GLMeta::blitRectangle(
|
||||
IntRect(0, 0, scRes.x, scRes.y),
|
||||
#ifdef MKXPZ_RETRO
|
||||
// Don't need to vertically flip the screen in libretro builds because the libretro frontend will do it for us
|
||||
IntRect(scOffset.x, scOffset.y, scSize.x, scSize.y),
|
||||
#else
|
||||
IntRect(scOffset.x,
|
||||
(scSize.y + scOffset.y),
|
||||
scSize.x,
|
||||
-scSize.y),
|
||||
#endif // MKXPZ_RETRO
|
||||
GLMeta::smoothScalingMethod(scaleIsSpecial) == Bilinear);
|
||||
}
|
||||
|
||||
void metaBlitBufferFlippedScaled(const Vec2i &sourceSize, int scaleIsSpecial, bool forceNearestNeighbor=false) {
|
||||
GLMeta::blitRectangle(IntRect(0, 0, sourceSize.x, sourceSize.y),
|
||||
#ifdef MKXPZ_RETRO
|
||||
// Don't need to vertically flip the screen in libretro builds because the libretro frontend will do it for us
|
||||
IntRect(scOffset.x, scOffset.y, scSize.x, scSize.y),
|
||||
#else
|
||||
IntRect(scOffset.x, scSize.y+scOffset.y, scSize.x, -scSize.y),
|
||||
#endif // MKXPZ_RETRO
|
||||
!forceNearestNeighbor && GLMeta::smoothScalingMethod(scaleIsSpecial) == Bilinear);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue