[Scummvm-git-logs] scummvm master -> d810267015b0f60ac2dbe87985de81a8c0c84f8c

aquadran aquadran at gmail.com
Mon Nov 8 08:07:26 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d810267015 STARK: Fixed blitting offset in software renderer


Commit: d810267015b0f60ac2dbe87985de81a8c0c84f8c
    https://github.com/scummvm/scummvm/commit/d810267015b0f60ac2dbe87985de81a8c0c84f8c
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2021-11-08T09:07:21+01:00

Commit Message:
STARK: Fixed blitting offset in software renderer

Changed paths:
    engines/stark/gfx/tinyglsurface.cpp


diff --git a/engines/stark/gfx/tinyglsurface.cpp b/engines/stark/gfx/tinyglsurface.cpp
index 693b9102c6..c8ee702b2e 100644
--- a/engines/stark/gfx/tinyglsurface.cpp
+++ b/engines/stark/gfx/tinyglsurface.cpp
@@ -42,7 +42,6 @@ void TinyGLSurfaceRenderer::render(const Texture *texture, const Common::Point &
 }
 
 void TinyGLSurfaceRenderer::render(const Texture *texture, const Common::Point &dest, uint width, uint height) {
-	// Destination rectangle with given width and height
 	_gfx->start2DMode();
 
 	Math::Vector2d sizeWH;
@@ -54,13 +53,16 @@ void TinyGLSurfaceRenderer::render(const Texture *texture, const Common::Point &
 	auto verOffsetXY = normalizeOriginalCoordinates(dest.x, dest.y);
 	auto nativeViewport = _gfx->getViewport();
 	auto viewport = Math::Vector2d(nativeViewport.width(), nativeViewport.height());
-
 	auto blitImage = ((TinyGlBitmap *)const_cast<Texture *>(texture))->getBlitTexture();
 	int blitTextureWidth, blitTextureHeight;
 	Graphics::tglGetBlitImageSize(blitImage, blitTextureWidth, blitTextureHeight);
-	Graphics::BlitTransform transform(viewport.getX() * verOffsetXY.getX(), viewport.getY() * verOffsetXY.getY());
+	int posX = viewport.getX() * verOffsetXY.getX() + nativeViewport.left;
+	int posY = viewport.getY() * verOffsetXY.getY() + nativeViewport.top;
+	int dstWidth = viewport.getX() * sizeWH.getX();
+	int dstHeight = viewport.getY() * sizeWH.getY();
+	Graphics::BlitTransform transform(posX, posY);
 	transform.sourceRectangle(0, 0, blitTextureWidth, blitTextureHeight);
-	transform.scale(viewport.getX() * sizeWH.getX(), viewport.getY() * sizeWH.getY());
+	transform.scale(dstWidth, dstHeight);
 	transform.tint(1.0, 1.0 - _fadeLevel, 1.0 - _fadeLevel, 1.0 - _fadeLevel);
 	tglBlit(blitImage, transform);
 




More information about the Scummvm-git-logs mailing list