[Scummvm-git-logs] scummvm master -> 776cfe758512cd54c453a545bbff8b181e5383ae

aquadran noreply at scummvm.org
Tue Dec 7 13:14:24 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:
776cfe7585 GRIM: Moved getting tinygl buffer reference out of loop


Commit: 776cfe758512cd54c453a545bbff8b181e5383ae
    https://github.com/scummvm/scummvm/commit/776cfe758512cd54c453a545bbff8b181e5383ae
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2021-12-07T14:14:16+01:00

Commit Message:
GRIM: Moved getting tinygl buffer reference out of loop

Changed paths:
    engines/grim/gfx_tinygl.cpp


diff --git a/engines/grim/gfx_tinygl.cpp b/engines/grim/gfx_tinygl.cpp
index 7beb6e8767..e2fed2e7c4 100644
--- a/engines/grim/gfx_tinygl.cpp
+++ b/engines/grim/gfx_tinygl.cpp
@@ -1501,6 +1501,8 @@ void GfxTinyGL::readPixels(int x, int y, int width, int height, uint8 *buffer) {
 	assert(x < _screenWidth);
 	assert(y < _screenHeight);
 
+	Graphics::Surface glBuffer;
+	TinyGL::getSurfaceRef(glBuffer);
 	uint8 r, g, b;
 	int pos = x + y * _screenWidth;
 	for (int i = 0; i < height; ++i) {
@@ -1508,8 +1510,6 @@ void GfxTinyGL::readPixels(int x, int y, int width, int height, uint8 *buffer) {
 			if ((j + x) >= _screenWidth || (i + y) >= _screenHeight) {
 				buffer[0] = buffer[1] = buffer[2] = 0;
 			} else {
-				Graphics::Surface glBuffer;
-				TinyGL::getSurfaceRef(glBuffer);
 				uint32 pixel = glBuffer.getPixel(j, i);
 				glBuffer.format.colorToRGB(pixel, r, g, b);
 				buffer[0] = r;




More information about the Scummvm-git-logs mailing list