aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/wintermute/Base/BRenderSDL.cpp9
-rw-r--r--engines/wintermute/Base/BRenderSDL.h2
-rw-r--r--engines/wintermute/Base/BSurfaceSDL.cpp2
3 files changed, 9 insertions, 4 deletions
diff --git a/engines/wintermute/Base/BRenderSDL.cpp b/engines/wintermute/Base/BRenderSDL.cpp
index 93fed39a59..01e48f3e04 100644
--- a/engines/wintermute/Base/BRenderSDL.cpp
+++ b/engines/wintermute/Base/BRenderSDL.cpp
@@ -282,9 +282,14 @@ HRESULT CBRenderSDL::FadeToColor(uint32 Color, RECT *rect) {
}
// Replacement for SDL2's SDL_RenderCopy
-void CBRenderSDL::drawFromSurface(Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRect, byte r, byte g, byte b, byte a) {
+void CBRenderSDL::drawFromSurface(Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRect, byte r, byte g, byte b, byte a, bool mirrorX, bool mirrorY) {
TransparentSurface src(*surf, false);
- src.blit(*_renderSurface, dstRect->left, dstRect->top, TransparentSurface::FLIP_NONE, srcRect,BS_ARGB(a, r, g, b), dstRect->width(), dstRect->height() );
+ int mirror = TransparentSurface::FLIP_NONE;
+ if (mirrorX)
+ mirror |= TransparentSurface::FLIP_V;
+ if (mirrorY)
+ mirror |= TransparentSurface::FLIP_H;
+ src.blit(*_renderSurface, dstRect->left, dstRect->top, mirror, srcRect,BS_ARGB(a, r, g, b), dstRect->width(), dstRect->height() );
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBRenderSDL::DrawLine(int X1, int Y1, int X2, int Y2, uint32 Color) {
diff --git a/engines/wintermute/Base/BRenderSDL.h b/engines/wintermute/Base/BRenderSDL.h
index 299eec3f0b..6718e33f86 100644
--- a/engines/wintermute/Base/BRenderSDL.h
+++ b/engines/wintermute/Base/BRenderSDL.h
@@ -58,7 +58,7 @@ public:
CBImage *TakeScreenshot();
- void drawFromSurface(Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRest, byte r = 255, byte g = 255, byte b = 255, byte a = 255);
+ void drawFromSurface(Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRest, byte r = 255, byte g = 255, byte b = 255, byte a = 255, bool mirrorX = false, bool mirrorY = false);
HRESULT SetViewport(int left, int top, int right, int bottom);
diff --git a/engines/wintermute/Base/BSurfaceSDL.cpp b/engines/wintermute/Base/BSurfaceSDL.cpp
index ba211ac86d..00b59792d4 100644
--- a/engines/wintermute/Base/BSurfaceSDL.cpp
+++ b/engines/wintermute/Base/BSurfaceSDL.cpp
@@ -494,7 +494,7 @@ HRESULT CBSurfaceSDL::DrawSprite(int X, int Y, RECT *Rect, float ZoomX, float Zo
position.left += offsetX;
position.top += offsetY;
- renderer->drawFromSurface(_surface, &srcRect, &position, r, g, b, a);
+ renderer->drawFromSurface(_surface, &srcRect, &position, r, g, b, a, MirrorX, MirrorY);
#if 0
SDL_RenderCopy(renderer->GetSdlRenderer(), _texture, &srcRect, &position);
#endif