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

aquadran noreply at scummvm.org
Sat Jan 1 16:42:36 UTC 2022


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:
cf8b3cc1f9 TINYGL: Move function to GLContext


Commit: cf8b3cc1f9971f8ff89ed441dd9b74192f41df6d
    https://github.com/scummvm/scummvm/commit/cf8b3cc1f9971f8ff89ed441dd9b74192f41df6d
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2022-01-01T17:42:32+01:00

Commit Message:
TINYGL: Move function to GLContext

Changed paths:
    graphics/tinygl/zdirtyrect.cpp
    graphics/tinygl/zgl.h


diff --git a/graphics/tinygl/zdirtyrect.cpp b/graphics/tinygl/zdirtyrect.cpp
index 4dea70e3cc5..cb753f4d5ef 100644
--- a/graphics/tinygl/zdirtyrect.cpp
+++ b/graphics/tinygl/zdirtyrect.cpp
@@ -34,9 +34,8 @@ void GLContext::issueDrawCall(DrawCall *drawCall) {
 	_drawCallsQueue.push_back(drawCall);
 }
 
-static void debugDrawRectangle(Common::Rect rect, int r, int g, int b) {
-	GLContext *c = gl_get_context();
-	int fbWidth = c->fb->getPixelBufferWidth();
+void GLContext::debugDrawRectangle(Common::Rect rect, int r, int g, int b) {
+	int fbWidth = fb->getPixelBufferWidth();
 
 	if (rect.left < 0)
 		rect.left = 0;
@@ -44,16 +43,16 @@ static void debugDrawRectangle(Common::Rect rect, int r, int g, int b) {
 		rect.right = fbWidth - 1;
 	if (rect.top < 0)
 		rect.top = 0;
-	if (rect.bottom >= c->fb->getPixelBufferHeight())
-		rect.bottom = c->fb->getPixelBufferHeight() - 1;
+	if (rect.bottom >= fb->getPixelBufferHeight())
+		rect.bottom = fb->getPixelBufferHeight() - 1;
 
 	for (int x = rect.left; x < rect.right; x++) {
-		c->fb->writePixel(rect.top * fbWidth + x, 255, r, g, b);
-		c->fb->writePixel((rect.bottom - 1) * fbWidth + x, 255, r, g, b);
+		fb->writePixel(rect.top * fbWidth + x, 255, r, g, b);
+		fb->writePixel((rect.bottom - 1) * fbWidth + x, 255, r, g, b);
 	}
 	for (int y = rect.top; y < rect.bottom; y++) {
-		c->fb->writePixel(y * fbWidth + rect.left, 255, r, g, b);
-		c->fb->writePixel(y * fbWidth + rect.right - 1, 255, r, g, b);
+		fb->writePixel(y * fbWidth + rect.left, 255, r, g, b);
+		fb->writePixel(y * fbWidth + rect.right - 1, 255, r, g, b);
 	}
 }
 
diff --git a/graphics/tinygl/zgl.h b/graphics/tinygl/zgl.h
index 493fa86e6e5..9a3b36bc626 100644
--- a/graphics/tinygl/zgl.h
+++ b/graphics/tinygl/zgl.h
@@ -481,7 +481,9 @@ public:
 
 	void presentBufferDirtyRects(Common::List<Common::Rect> &dirtyAreas);
 	void presentBufferSimple(Common::List<Common::Rect> &dirtyAreas);
-	
+
+	void debugDrawRectangle(Common::Rect rect, int r, int g, int b);
+
 	GLSpecBuf *specbuf_get_buffer(const int shininess_i, const float shininess);
 	void specbuf_cleanup();
 




More information about the Scummvm-git-logs mailing list