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

antoniou79 noreply at scummvm.org
Sun May 7 22:07:16 UTC 2023


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

Summary:
fceab98331 BLADERUNNER: Janitorial remove rogue space
4534114106 BLADERUNNER: Fix glitches in CT01 and PS15
f258ba352d BLADERUNNER: Rename static method that hid base class method


Commit: fceab98331d01de40e7469e011f848127026d0b0
    https://github.com/scummvm/scummvm/commit/fceab98331d01de40e7469e011f848127026d0b0
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2023-05-08T01:01:51+03:00

Commit Message:
BLADERUNNER: Janitorial remove rogue space

Changed paths:
    engines/bladerunner/ui/esper.cpp


diff --git a/engines/bladerunner/ui/esper.cpp b/engines/bladerunner/ui/esper.cpp
index b76e48373e7..d3fae00a7df 100644
--- a/engines/bladerunner/ui/esper.cpp
+++ b/engines/bladerunner/ui/esper.cpp
@@ -1105,7 +1105,7 @@ void ESPER::drawMouse(Graphics::Surface &surface) {
 					_mouseOverScroll = 4;
 				} else if (_mouseOverScroll == 1 && this->_viewport.right == kPhotoWidth - 1) {
 					_mouseOverScroll = 4;
-				} else if (_mouseOverScroll == 2 && this->_viewport.bottom ==  kPhotoHeight - 1) {
+				} else if (_mouseOverScroll == 2 && this->_viewport.bottom == kPhotoHeight - 1) {
 					_mouseOverScroll = 4;
 				} else if (_mouseOverScroll == 3 && this->_viewport.left == 0) {
 					_mouseOverScroll = 4;


Commit: 45341141068d71a3f82842f7ff1ef97ac3e38128
    https://github.com/scummvm/scummvm/commit/45341141068d71a3f82842f7ff1ef97ac3e38128
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2023-05-08T01:01:51+03:00

Commit Message:
BLADERUNNER: Fix glitches in CT01 and PS15

PS15 was rogue pixels with bad z-buffer. Both are original bugs

CT01 fix is an expansion of the existing fix to cover other loops and chapters affected.

Changed paths:
    engines/bladerunner/vqa_player.cpp
    engines/bladerunner/vqa_player.h
    engines/bladerunner/zbuffer.cpp
    engines/bladerunner/zbuffer.h


diff --git a/engines/bladerunner/vqa_player.cpp b/engines/bladerunner/vqa_player.cpp
index f2d1556ba7b..7751ed34265 100644
--- a/engines/bladerunner/vqa_player.cpp
+++ b/engines/bladerunner/vqa_player.cpp
@@ -27,6 +27,7 @@
 #if BLADERUNNER_ORIGINAL_SETTINGS
 #include "bladerunner/audio_speech.h"
 #endif
+#include "bladerunner/zbuffer.h"
 
 #include "audio/decoders/raw.h"
 
@@ -47,6 +48,7 @@ bool VQAPlayer::open() {
 	}
 
 #if !BLADERUNNER_ORIGINAL_BUGS
+	_specialPS15GlitchFix = false;
 	// TB05 has wrong end of a loop and this will load empty zbuffer from next loop, which will lead to broken pathfinding
 	if (_name.equals("TB05_2.VQA")) {
 		_decoder._loopInfo.loops[1].end = 60;
@@ -54,11 +56,19 @@ bool VQAPlayer::open() {
 		// smoke (overlay) after explosion of Dermo Labs in DR04
 		// This has still frames in the end that so it looked as if the smoke was "frozen"
 		_decoder._loopInfo.loops[0].end  = 58; // 59 up to 74 are still frames
-	} else if (_name.equals("CT01.VQA")) {
+	} else if (_name.equals("CT01.VQA") || _name.equals("CT01_2.VQA") || _name.equals("CT01_3.VQA") ) {
 		// In the last frame of the Mainloop (255) a Howie Lee's customer's hand
 		// backwards abruptly the loop looks jarring. We skip the last frame.
+		// The issue is also present in the non-spinner versions of the loop
+		// and for all chapters where this scene is available (Acts 1 through 5)
 		_decoder._loopInfo.loops[2].end  = 254;
 		_decoder._loopInfo.loops[3].end  = 254;
+
+		_decoder._loopInfo.loops[7].end  = 510;
+		_decoder._loopInfo.loops[8].end  = 510;
+	} else if (_name.equals("PS15.VQA") || _name.equals("PS15_2.VQA")) {
+		// Fix should be applied in Act 1-3 versions of this background
+		_specialPS15GlitchFix = true;
 	}
 #endif
 
@@ -306,6 +316,21 @@ int VQAPlayer::update(bool forceDraw, bool advanceFrame, bool useTime, Graphics:
 
 void VQAPlayer::updateZBuffer(ZBuffer *zbuffer) {
 	_decoder.decodeZBuffer(zbuffer);
+#if !BLADERUNNER_ORIGINAL_BUGS
+	if (_specialPS15GlitchFix) {
+		// The glitch (bad z-buffer, value zero (0))
+		// is present in the following pixels:
+		//  x: 387, y in [179, 192]
+		//  x: 388, y in [179, 202]
+		for (int y = 179; y < 193; ++y) {
+			_vm->_zbuffer->setDataZbufExplicit(387, y, 10720);
+			_vm->_zbuffer->setDataZbufExplicit(388, y, 10720);
+		}
+		for (int y = 193; y < 203; ++y) {
+			_vm->_zbuffer->setDataZbufExplicit(388, y, 10720);
+		}
+	}
+#endif
 }
 
 void VQAPlayer::updateView(View *view) {
diff --git a/engines/bladerunner/vqa_player.h b/engines/bladerunner/vqa_player.h
index f0a00891385..6de6abced66 100644
--- a/engines/bladerunner/vqa_player.h
+++ b/engines/bladerunner/vqa_player.h
@@ -86,6 +86,8 @@ class VQAPlayer {
 	bool   _audioStarted;
 	Audio::SoundHandle _soundHandle;
 
+	bool   _specialPS15GlitchFix;
+
 	void (*_callbackLoopEnded)(void *, int frame, int loopId);
 	void  *_callbackData;
 
@@ -112,6 +114,7 @@ public:
 		  _frameNextTime(0),
 		  _hasAudio(false),
 		  _audioStarted(false),
+		  _specialPS15GlitchFix(false),
 		  _callbackLoopEnded(nullptr),
 		  _callbackData(nullptr) { }
 
diff --git a/engines/bladerunner/zbuffer.cpp b/engines/bladerunner/zbuffer.cpp
index b53a7d09937..843e6c3b6e7 100644
--- a/engines/bladerunner/zbuffer.cpp
+++ b/engines/bladerunner/zbuffer.cpp
@@ -167,7 +167,8 @@ bool ZBuffer::decodeData(const uint8 *data, int size) {
 	} else {
 		clean();
 		decodePartialZBuffer(data, _zbuf1, size);
-		decodePartialZBuffer(data, _zbuf2, size);
+		//decodePartialZBuffer(data, _zbuf2, size);
+		memcpy(_zbuf2, _zbuf1, size);
 	}
 
 	return true;
@@ -177,6 +178,15 @@ uint16 *ZBuffer::getData() const {
 	return _zbuf2;
 }
 
+#if !BLADERUNNER_ORIGINAL_BUGS
+void ZBuffer::setDataZbufExplicit(int x, int y, uint16 overidingVal) {
+	assert(x >= 0 && x < _width);
+	assert(y >= 0 && y < _height);
+	_zbuf1[y * _width + x] = overidingVal;
+	_zbuf2[y * _width + x] = overidingVal;
+}
+#endif // BLADERUNNER_ORIGINAL_BUGS
+
 uint16 ZBuffer::getZValue(int x, int y) const {
 	assert(x >= 0 && x < _width);
 	assert(y >= 0 && y < _height);
diff --git a/engines/bladerunner/zbuffer.h b/engines/bladerunner/zbuffer.h
index ac69900c04e..17b89801503 100644
--- a/engines/bladerunner/zbuffer.h
+++ b/engines/bladerunner/zbuffer.h
@@ -67,6 +67,10 @@ public:
 	uint16 *getData() const;
 	uint16 getZValue(int x, int y) const;
 
+#if !BLADERUNNER_ORIGINAL_BUGS
+	void setDataZbufExplicit(int x, int y, uint16 overidingVal);
+#endif // BLADERUNNER_ORIGINAL_BUGS
+
 private:
 	void blit(Common::Rect rect);
 


Commit: f258ba352d1573a692ceb7c9d082b513a3399c9e
    https://github.com/scummvm/scummvm/commit/f258ba352d1573a692ceb7c9d082b513a3399c9e
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2023-05-08T01:01:51+03:00

Commit Message:
BLADERUNNER: Rename static method that hid base class method

Changed paths:
    engines/bladerunner/ui/kia_section_save.cpp
    engines/bladerunner/ui/kia_section_save.h


diff --git a/engines/bladerunner/ui/kia_section_save.cpp b/engines/bladerunner/ui/kia_section_save.cpp
index 6908510c27f..3962a495618 100644
--- a/engines/bladerunner/ui/kia_section_save.cpp
+++ b/engines/bladerunner/ui/kia_section_save.cpp
@@ -105,7 +105,7 @@ void KIASectionSave::open() {
 
 	if (!_saveList.empty() || ableToSaveGame) {
 
-		_buttons->activate(onButtonHovered, nullptr, nullptr, onButtonPressed, this);
+		_buttons->activate(onButtonHovered, nullptr, nullptr, onKSSButtonPressed, this);
 		_inputBox->show();
 
 		_scrollBox->clearLines();
@@ -337,7 +337,7 @@ void KIASectionSave::onButtonHovered(int buttonId, void *callbackData) {
 	self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(kSfxTEXT3), 100, 0, 0, 50, 0);
 }
 
-void KIASectionSave::onButtonPressed(int buttonId, void *callbackData) {
+void KIASectionSave::onKSSButtonPressed(int buttonId, void *callbackData) {
 	KIASectionSave *self = (KIASectionSave *)callbackData;
 
 	if (buttonId == 0) {
diff --git a/engines/bladerunner/ui/kia_section_save.h b/engines/bladerunner/ui/kia_section_save.h
index 4f6e2e54772..23964ffd685 100644
--- a/engines/bladerunner/ui/kia_section_save.h
+++ b/engines/bladerunner/ui/kia_section_save.h
@@ -90,7 +90,9 @@ private:
 	static void inputBoxCallback(void *callbackData, void *source);
 
 	static void onButtonHovered(int buttonId, void *callbackData);
-	static void onButtonPressed(int buttonId, void *callbackData);
+	// NOTE: Renamed the method from onButtonPressed() to onKSSButtonPressed(),
+	// since this static method hides the virtual method of KIASectionBase (which is not static and has different signature)
+	static void onKSSButtonPressed(int buttonId, void *callbackData);
 
 	void changeState(State state);
 	void save();




More information about the Scummvm-git-logs mailing list