[Scummvm-git-logs] scummvm master -> 32258cf4fd78faed67b47a2bca5e12db3f30733a
antoniou79
a.antoniou79 at gmail.com
Thu Feb 20 20:44:16 UTC 2020
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:
32258cf4fd BLADERUNNER: Fix broken zbuf draw for debugger
Commit: 32258cf4fd78faed67b47a2bca5e12db3f30733a
https://github.com/scummvm/scummvm/commit/32258cf4fd78faed67b47a2bca5e12db3f30733a
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2020-02-20T22:41:00+02:00
Commit Message:
BLADERUNNER: Fix broken zbuf draw for debugger
Changed paths:
engines/bladerunner/bladerunner.cpp
diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index 1ce859a..6700ea1 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -1120,7 +1120,17 @@ void BladeRunnerEngine::gameTick() {
}
if (_debugger->_viewZBuffer) {
- _surfaceFront.copyRectToSurface(_zbuffer->getData(), 1280, 0, 0, 640, 480);
+ // The surface front pixel format is 32 bit now,
+ // but the _zbuffer->getData() still returns 16bit pixels
+ // We need to copy pixel by pixel, converting each pixel from 16 to 32bit
+ for (int y = 0; y < 480; ++y) {
+ for (int x = 0; x < 640; ++x) {
+ uint8 a, r, g, b;
+ getGameDataColor(_zbuffer->getData()[y*640 + x], a, r, g, b);
+ void *dstPixel = _surfaceFront.getBasePtr(x, y);
+ drawPixel(_surfaceFront, dstPixel, _surfaceFront.format.ARGBToColor(a, r, g, b));
+ }
+ }
}
_mouse->tick(p.x, p.y);
More information about the Scummvm-git-logs
mailing list