[Scummvm-git-logs] scummvm master -> 3065b6b2d83cb5ea9d00f9bb32a895b7fef9a102
aquadran
noreply at scummvm.org
Wed May 21 09:13:16 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
3065b6b2d8 WINTERMUTE: Implemented surface getPixel() for 3D renderer
Commit: 3065b6b2d83cb5ea9d00f9bb32a895b7fef9a102
https://github.com/scummvm/scummvm/commit/3065b6b2d83cb5ea9d00f9bb32a895b7fef9a102
Author: PaweÅ KoÅodziejski (aquadran at gmail.com)
Date: 2025-05-21T11:13:11+02:00
Commit Message:
WINTERMUTE: Implemented surface getPixel() for 3D renderer
Changed paths:
engines/wintermute/base/gfx/opengl/base_surface_opengl3d.cpp
diff --git a/engines/wintermute/base/gfx/opengl/base_surface_opengl3d.cpp b/engines/wintermute/base/gfx/opengl/base_surface_opengl3d.cpp
index bc6a9298516..61313ebe857 100644
--- a/engines/wintermute/base/gfx/opengl/base_surface_opengl3d.cpp
+++ b/engines/wintermute/base/gfx/opengl/base_surface_opengl3d.cpp
@@ -235,7 +235,20 @@ bool BaseSurfaceOpenGL3D::putSurface(const Graphics::Surface &surface, bool hasA
}
bool BaseSurfaceOpenGL3D::getPixel(int x, int y, byte *r, byte *g, byte *b, byte *a) {
- warning("BaseSurfaceOpenGL3D::getPixel not yet implemented");
+ if (x < 0 || y < 0 || x >= _width || y >= _height) {
+ return false;
+ }
+
+ if (_imageData == nullptr) {
+ return false;
+ }
+
+ uint8 alpha, red, green, blue;
+ _imageData->format.colorToARGB(_imageData->getPixel(x, y), alpha, red, green, blue);
+ *r = red;
+ *g = green;
+ *b = blue;
+ *a = alpha;
return true;
}
More information about the Scummvm-git-logs
mailing list