[Scummvm-git-logs] scummvm master -> 803714660dd32f9f1dcb975a74320b70ef7e8807

mgerhardy noreply at scummvm.org
Thu Oct 10 16:12:06 UTC 2024


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

Summary:
62d8c709da TWINE: removed duplicate defines
b018caf4e4 TWINE: renamed holomap related functions to match original sources
03aabee84b TWINE: removed unused rgba palette method
d476afa528 TWINE: let whiteFade use a Graphics::Palette, too
8973fa63bd TWINE: renamed holomap members to match original sources
7ebec1d234 TWINE: fixed missing setBlackPal call for holoTraj
78e16a2001 TWINE: scenes are faded in now (found in the original sources)
803714660d TWINE: a few palette fixes


Commit: 62d8c709da8d3a341e2c1e675810405afdfc3df6
    https://github.com/scummvm/scummvm/commit/62d8c709da8d3a341e2c1e675810405afdfc3df6
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-10T18:11:44+02:00

Commit Message:
TWINE: removed duplicate defines

Changed paths:
    engines/twine/holomap.h


diff --git a/engines/twine/holomap.h b/engines/twine/holomap.h
index ba05df85052..bd861b1cb06 100644
--- a/engines/twine/holomap.h
+++ b/engines/twine/holomap.h
@@ -25,9 +25,6 @@
 #include "twine/shared.h"
 #include "common/scummsys.h"
 
-#define NUM_HOLOMAPCOLORS 32
-#define HOLOMAP_PALETTE_INDEX 192
-
 namespace Common {
 class SeekableReadStream;
 }


Commit: b018caf4e4a76fdd6ad3fd1d579ac27fc79f6ddb
    https://github.com/scummvm/scummvm/commit/b018caf4e4a76fdd6ad3fd1d579ac27fc79f6ddb
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-10T18:11:44+02:00

Commit Message:
TWINE: renamed holomap related functions to match original sources

Changed paths:
    engines/twine/holomap.h
    engines/twine/holomap_v1.cpp
    engines/twine/holomap_v1.h
    engines/twine/holomap_v2.cpp
    engines/twine/holomap_v2.h
    engines/twine/resources/resources.cpp
    engines/twine/resources/resources.h
    engines/twine/scene/scene.cpp


diff --git a/engines/twine/holomap.h b/engines/twine/holomap.h
index bd861b1cb06..a6d4fb18f19 100644
--- a/engines/twine/holomap.h
+++ b/engines/twine/holomap.h
@@ -66,7 +66,7 @@ public:
 	 */
 	virtual void clrHoloPos(int32 locationIdx) = 0;
 
-	virtual void drawHolomapTrajectory(int32 trajectoryIndex) = 0;
+	virtual void holoTraj(int32 trajectoryIndex) = 0;
 
 	/** Load Holomap content */
 	virtual void initHoloDatas() = 0;
diff --git a/engines/twine/holomap_v1.cpp b/engines/twine/holomap_v1.cpp
index ec2262bceba..856f89db845 100644
--- a/engines/twine/holomap_v1.cpp
+++ b/engines/twine/holomap_v1.cpp
@@ -327,13 +327,13 @@ void HolomapV1::renderHolomapVehicle(uint &frameNumber, ActorMoveStruct &move, A
 	_engine->copyBlockPhys(rect);
 }
 
-void HolomapV1::drawHolomapTrajectory(int32 trajectoryIndex) {
+void HolomapV1::holoTraj(int32 trajectoryIndex) {
 	if (_engine->isDemo()) {
 		return;
 	}
 	debug("Draw trajectory index %i", trajectoryIndex);
 
-	const Trajectory *data = _engine->_resources->getTrajectory(trajectoryIndex);
+	const Trajectory *data = _engine->_resources->giveTrajPtr(trajectoryIndex);
 	if (data == nullptr) {
 		warning("Failed to load trajectory data for index %i", trajectoryIndex);
 		return;
diff --git a/engines/twine/holomap_v1.h b/engines/twine/holomap_v1.h
index 17ac8f2a474..f567d32c293 100644
--- a/engines/twine/holomap_v1.h
+++ b/engines/twine/holomap_v1.h
@@ -25,7 +25,7 @@
 #include "twine/holomap.h"
 
 #define NUM_HOLOMAPCOLORS 32
-#define HOLOMAP_PALETTE_INDEX 192
+#define HOLOMAP_PALETTE_INDEX (12*16)
 
 namespace TwinE {
 
@@ -113,7 +113,7 @@ public:
 	 */
 	void clrHoloPos(int32 locationIdx) override;
 
-	void drawHolomapTrajectory(int32 trajectoryIndex) override;
+	void holoTraj(int32 trajectoryIndex) override;
 
 	/** Load Holomap content */
 	void initHoloDatas() override;
diff --git a/engines/twine/holomap_v2.cpp b/engines/twine/holomap_v2.cpp
index 03c8d185f53..ed0c17ed4c5 100644
--- a/engines/twine/holomap_v2.cpp
+++ b/engines/twine/holomap_v2.cpp
@@ -44,7 +44,7 @@ const char *HolomapV2::getLocationName(int index) const {
 void HolomapV2::clrHoloPos(int32 locationIdx) {
 }
 
-void HolomapV2::drawHolomapTrajectory(int32 trajectoryIndex) {
+void HolomapV2::holoTraj(int32 trajectoryIndex) {
 }
 
 void HolomapV2::initHoloDatas() {
diff --git a/engines/twine/holomap_v2.h b/engines/twine/holomap_v2.h
index 3de4ece4758..7a8fd41c577 100644
--- a/engines/twine/holomap_v2.h
+++ b/engines/twine/holomap_v2.h
@@ -74,7 +74,7 @@ public:
 	 */
 	void clrHoloPos(int32 locationIdx) override;
 
-	void drawHolomapTrajectory(int32 trajectoryIndex) override;
+	void holoTraj(int32 trajectoryIndex) override;
 
 	/** Load Holomap content */
 	void initHoloDatas() override;
diff --git a/engines/twine/resources/resources.cpp b/engines/twine/resources/resources.cpp
index 52526c01dd6..a99422d67bf 100644
--- a/engines/twine/resources/resources.cpp
+++ b/engines/twine/resources/resources.cpp
@@ -239,7 +239,7 @@ const TextEntry *Resources::getText(TextBankId textBankId, TextId index) const {
 	return _textData.getText(textBankId, index);
 }
 
-const Trajectory *Resources::getTrajectory(int index) const {
+const Trajectory *Resources::giveTrajPtr(int index) const {
 	return _trajectories.getTrajectory(index);
 }
 
diff --git a/engines/twine/resources/resources.h b/engines/twine/resources/resources.h
index 7b0220d71c5..d70a6c7384e 100644
--- a/engines/twine/resources/resources.h
+++ b/engines/twine/resources/resources.h
@@ -192,7 +192,7 @@ public:
 	/** Initialize resource pointers */
 	void initResources();
 
-	const Trajectory *getTrajectory(int index) const;
+	const Trajectory *giveTrajPtr(int index) const;
 	const TrajectoryData &getTrajectories() const {
 		return _trajectories;
 	}
diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index 4c7e0a1ebd7..eb5824a95c4 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -593,7 +593,7 @@ void Scene::changeCube() {
 
 	if (_numHolomapTraj != -1) {
 		_engine->testRestoreModeSVGA(false);
-		_engine->_holomap->drawHolomapTrajectory(_numHolomapTraj);
+		_engine->_holomap->holoTraj(_numHolomapTraj);
 		_numHolomapTraj = -1;
 	}
 


Commit: 03aabee84b92f2b25abe8a79d3ac267d9ef56284
    https://github.com/scummvm/scummvm/commit/03aabee84b92f2b25abe8a79d3ac267d9ef56284
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-10T18:11:44+02:00

Commit Message:
TWINE: removed unused rgba palette method

Changed paths:
    engines/twine/twine.cpp
    engines/twine/twine.h


diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index 7dc75f2baae..335a4b80167 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -1255,20 +1255,6 @@ void TwinEEngine::blitFrontToWork(const Common::Rect &rect) {
 	_interface->blitBox(rect, _frontVideoBuffer, _workVideoBuffer);
 }
 
-void TwinEEngine::setPalette(const uint32 *palette) {
-	uint8 pal[NUMOFCOLORS * 3];
-	uint8 *out = pal;
-	const uint8 *in = (const uint8 *)palette;
-	for (int i = 0; i < NUMOFCOLORS; i++) {
-		out[0] = in[0];
-		out[1] = in[1];
-		out[2] = in[2];
-		out += 3;
-		in += 4;
-	}
-	setPalette(0, NUMOFCOLORS, pal);
-}
-
 void TwinEEngine::setPalette(const Graphics::Palette &palette, uint startColor) {
 	_frontVideoBuffer.setPalette(palette, startColor);
 }
diff --git a/engines/twine/twine.h b/engines/twine/twine.h
index b5deba539b3..6ba784e2528 100644
--- a/engines/twine/twine.h
+++ b/engines/twine/twine.h
@@ -377,7 +377,6 @@ public:
 	 * Set a new palette in the SDL screen buffer
 	 * @param palette palette to set in RGBA
 	 */
-	void setPalette(const uint32 *palette);
 	void setPalette(const Graphics::Palette &palette, uint startColor = 0u);
 
 	/**


Commit: d476afa52884404a944a5b818ad7add45c274eba
    https://github.com/scummvm/scummvm/commit/d476afa52884404a944a5b818ad7add45c274eba
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-10T18:11:45+02:00

Commit Message:
TWINE: let whiteFade use a Graphics::Palette, too

Changed paths:
    engines/twine/renderer/screens.cpp


diff --git a/engines/twine/renderer/screens.cpp b/engines/twine/renderer/screens.cpp
index 52c359b30bc..d723c8253f6 100644
--- a/engines/twine/renderer/screens.cpp
+++ b/engines/twine/renderer/screens.cpp
@@ -207,11 +207,13 @@ void Screens::fadeToBlack(const Graphics::Palette &ptrpal) {
 }
 
 void Screens::whiteFade() {
-	uint32 workpal[NUMOFCOLORS];
+	Graphics::Palette workpal{NUMOFCOLORS};
 
-	for (int32 n = 0; n < 255; n += 3) {
+	for (int32 n = 0; n <= 255; n++) {
 		FrameMarker frame(_engine, DEFAULT_HZ); // VSync()
-		memset(workpal, n, sizeof(workpal));
+		for (int i = 0; i < NUMOFCOLORS; i++) {
+			workpal.set(i, n, n, n);
+		}
 
 		_engine->setPalette(workpal);
 		_engine->_frontVideoBuffer.update();


Commit: 8973fa63bdbdd2b3afd724f8352d6cd67c8e4b66
    https://github.com/scummvm/scummvm/commit/8973fa63bdbdd2b3afd724f8352d6cd67c8e4b66
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-10T18:11:45+02:00

Commit Message:
TWINE: renamed holomap members to match original sources

Changed paths:
    engines/twine/holomap_v1.cpp
    engines/twine/holomap_v1.h


diff --git a/engines/twine/holomap_v1.cpp b/engines/twine/holomap_v1.cpp
index 856f89db845..f634077c937 100644
--- a/engines/twine/holomap_v1.cpp
+++ b/engines/twine/holomap_v1.cpp
@@ -127,23 +127,20 @@ void HolomapV1::initHoloDatas() {
 	constexpr TwineResource resource(Resources::HQR_RESS_FILE, RESSHQR_HOLOPAL);
 	_engine->_screens->loadCustomPalette(resource);
 
-	int32 j = HOLOMAP_PALETTE_INDEX;
-	const int32 n = NUM_HOLOMAPCOLORS * 3;
-	for (int32 i = 0; i < n; i += 3, j++) {
+	for (int32 n = 0; n < NUM_HOLOMAPCOLORS; n++) {
 		byte r, g, b;
-		_engine->_screens->_palettePcx.get(j, r, g, b);
-		_paletteHolomap[i + 0] = r;
-		_paletteHolomap[i + 1] = g;
-		_paletteHolomap[i + 2] = b;
+		_engine->_screens->_palettePcx.get(HOLOMAP_PALETTE_INDEX + n, r, g, b);
+		_rotPal[n * 3 + 0] = r;
+		_rotPal[n * 3 + 1] = g;
+		_rotPal[n * 3 + 2] = b;
 	}
 
-	j = HOLOMAP_PALETTE_INDEX;
-	for (int32 i = n; i < 2 * n - 3; i += 3, j++) {
+	for (int32 n = 0; n < NUM_HOLOMAPCOLORS - 1; n++) {
 		byte r, g, b;
-		_engine->_screens->_palettePcx.get(j, r, g, b);
-		_paletteHolomap[i + 0] = r;
-		_paletteHolomap[i + 1] = g;
-		_paletteHolomap[i + 2] = b;
+		_engine->_screens->_palettePcx.get(HOLOMAP_PALETTE_INDEX + n, r, g, b);
+		_rotPal[(NUM_HOLOMAPCOLORS + n) * 3 + 0] = r;
+		_rotPal[(NUM_HOLOMAPCOLORS + n) * 3 + 1] = g;
+		_rotPal[(NUM_HOLOMAPCOLORS + n) * 3 + 2] = b;
 	}
 
 	computeCoorMapping();
@@ -154,7 +151,7 @@ void HolomapV1::initHoloDatas() {
 	}
 	computeCoorGlobe(surfaceStream);
 	delete surfaceStream;
-	_holomapPaletteIndex = 0;
+	_rotPalPos = 0;
 }
 
 void HolomapV1::computeCoorGlobe(Common::SeekableReadStream *holomapSurfaceStream) {
@@ -384,9 +381,10 @@ void HolomapV1::holoTraj(int32 trajectoryIndex) {
 
 		if (!flagpal && waterPaletteChangeTimer < _engine->timerRef) {
 			// animate the water surface
-			_engine->setPalette(HOLOMAP_PALETTE_INDEX, NUM_HOLOMAPCOLORS, &_paletteHolomap[3 * _holomapPaletteIndex++]);
-			if (_holomapPaletteIndex == NUM_HOLOMAPCOLORS) {
-				_holomapPaletteIndex = 0;
+			_engine->setPalette(HOLOMAP_PALETTE_INDEX, NUM_HOLOMAPCOLORS, &_rotPal[3 * _rotPalPos]);
+			_rotPalPos++;
+			if (_rotPalPos == NUM_HOLOMAPCOLORS) {
+				_rotPalPos = 0;
 			}
 			waterPaletteChangeTimer = _engine->timerRef + 3;
 		}
@@ -635,9 +633,10 @@ void HolomapV1::holoMap() {
 
 		if (!flagpal && waterPaletteChangeTimer < _engine->timerRef) {
 			// animate the water surface
-			_engine->setPalette(HOLOMAP_PALETTE_INDEX, NUM_HOLOMAPCOLORS, &_paletteHolomap[3 * _holomapPaletteIndex++]);
-			if (_holomapPaletteIndex == NUM_HOLOMAPCOLORS) {
-				_holomapPaletteIndex = 0;
+			_engine->setPalette(HOLOMAP_PALETTE_INDEX, NUM_HOLOMAPCOLORS, &_rotPal[3 * _rotPalPos]);
+			_rotPalPos++;
+			if (_rotPalPos == NUM_HOLOMAPCOLORS) {
+				_rotPalPos = 0;
 			}
 			waterPaletteChangeTimer = _engine->timerRef + 3;
 			flagredraw = true;
diff --git a/engines/twine/holomap_v1.h b/engines/twine/holomap_v1.h
index f567d32c293..fdb3368009b 100644
--- a/engines/twine/holomap_v1.h
+++ b/engines/twine/holomap_v1.h
@@ -68,8 +68,8 @@ private:
 	int32 _numHoloPos = 0;
 	Location _listHoloPos[MAX_HOLO_POS];
 
-	int32 _holomapPaletteIndex = 0;
-	uint8 _paletteHolomap[NUMOFCOLORS * 3]{0};
+	int32 _rotPalPos = 0;
+	uint8 _rotPal[NUMOFCOLORS * 3]{0};
 
 	void drawTitle(int32 centerx, int32 top, const char *title);
 	int32 searchNextArrow(int32 num) const;


Commit: 7ebec1d234fafa17e9d789693322e17e55bf2590
    https://github.com/scummvm/scummvm/commit/7ebec1d234fafa17e9d789693322e17e55bf2590
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-10T18:11:45+02:00

Commit Message:
TWINE: fixed missing setBlackPal call for holoTraj

Changed paths:
    engines/twine/holomap_v1.cpp
    engines/twine/scene/scene.cpp


diff --git a/engines/twine/holomap_v1.cpp b/engines/twine/holomap_v1.cpp
index f634077c937..48d6dc119a0 100644
--- a/engines/twine/holomap_v1.cpp
+++ b/engines/twine/holomap_v1.cpp
@@ -336,11 +336,15 @@ void HolomapV1::holoTraj(int32 trajectoryIndex) {
 		return;
 	}
 
+	if (_engine->_screens->_flagPalettePcx)
+		_engine->_screens->fadeToBlack(_engine->_screens->_palettePcx);
+	else
+		_engine->_screens->fadeToBlack(_engine->_screens->_ptrPal);
+
 	_engine->_interface->unsetClip();
 	_engine->_screens->clearScreen();
 
 	initHoloDatas();
-	_engine->setPalette(_engine->_screens->_palettePcx);
 
 	ScopedEngineFreeze timeFreeze(_engine);
 	const int32 cameraPosX = _engine->width() / 2 + 80;
diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index eb5824a95c4..71a815e453f 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -593,6 +593,7 @@ void Scene::changeCube() {
 
 	if (_numHolomapTraj != -1) {
 		_engine->testRestoreModeSVGA(false);
+		_engine->_screens->setBlackPal();
 		_engine->_holomap->holoTraj(_numHolomapTraj);
 		_numHolomapTraj = -1;
 	}


Commit: 78e16a2001cd88487e2d28acb45738a786c7ebc2
    https://github.com/scummvm/scummvm/commit/78e16a2001cd88487e2d28acb45738a786c7ebc2
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-10T18:11:45+02:00

Commit Message:
TWINE: scenes are faded in now (found in the original sources)

Changed paths:
    engines/twine/scene/scene.cpp


diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index 71a815e453f..38235ef2fb2 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -638,7 +638,7 @@ void Scene::changeCube() {
 	_engine->_movements->_lastJoyFlag = true;
 	_engine->_grid->_useCellingGrid = -1;
 	_engine->_grid->_cellingGridIdx = -1;
-	_engine->_screens->_flagFade = false;
+	_engine->_screens->_flagFade = true;
 	_engine->_renderer->setLightVector(_alphaLight, _betaLight, LBAAngles::ANGLE_0);
 
 	_newCube = SCENE_CEILING_GRID_FADE_1;


Commit: 803714660dd32f9f1dcb975a74320b70ef7e8807
    https://github.com/scummvm/scummvm/commit/803714660dd32f9f1dcb975a74320b70ef7e8807
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-10T18:11:45+02:00

Commit Message:
TWINE: a few palette fixes

this transition is not yet done...

Changed paths:
    engines/twine/holomap_v1.cpp
    engines/twine/menu/menu.cpp
    engines/twine/renderer/screens.cpp
    engines/twine/scene/gamestate.cpp
    engines/twine/text.cpp
    engines/twine/twine.cpp


diff --git a/engines/twine/holomap_v1.cpp b/engines/twine/holomap_v1.cpp
index 48d6dc119a0..4a946b65b9f 100644
--- a/engines/twine/holomap_v1.cpp
+++ b/engines/twine/holomap_v1.cpp
@@ -23,6 +23,7 @@
 #include "common/algorithm.h"
 #include "common/debug.h"
 #include "common/memstream.h"
+#include "common/scummsys.h"
 #include "common/stream.h"
 #include "common/types.h"
 #include "graphics/palette.h"
@@ -283,12 +284,17 @@ void HolomapV1::drawHoloMap(uint8 *holomapImage, uint32 holomapImageSize) {
 	}
 }
 
-void HolomapV1::drawTitle(int32 centerx, int32 top, const char *title) {
+void HolomapV1::drawTitle(int32 x, int32 y, const char *title) {
 	const int32 size = _engine->_text->sizeFont(title);
-	const int32 x = centerx - size / 2;
-	const int32 y = top;
+	const int32 textx = x - size / 2;
+	const int32 texty = y - 18;
 	_engine->_text->setFontColor(COLOR_WHITE);
-	_engine->_text->drawText(x, y, title);
+	_engine->_text->drawText(textx, texty, title);
+	int32 x0 = x - 630 / 2;
+	int32 x1 = x + 630 / 2;
+	int32 y0 = y - 40 / 2;
+	int32 y1 = y + 40 / 2;
+	_engine->copyBlockPhys(x0, y0, x1, y1);
 }
 
 void HolomapV1::drawHoloObj(const IVec3 &angle, int32 alpha, int32 beta) {
@@ -373,7 +379,6 @@ void HolomapV1::holoTraj(int32 trajectoryIndex) {
 	int32 frameTime = _engine->timerRef;
 	int16 trajAnimFrameIdx = 0;
 
-	int32 waterPaletteChangeTimer = 0;
 	bool flagpal = true;
 	_engine->_input->enableKeyMap(holomapKeyMapId);
 	for (;;) {
@@ -383,14 +388,13 @@ void HolomapV1::holoTraj(int32 trajectoryIndex) {
 			break;
 		}
 
-		if (!flagpal && waterPaletteChangeTimer < _engine->timerRef) {
+		if (!flagpal) {
 			// animate the water surface
 			_engine->setPalette(HOLOMAP_PALETTE_INDEX, NUM_HOLOMAPCOLORS, &_rotPal[3 * _rotPalPos]);
 			_rotPalPos++;
 			if (_rotPalPos == NUM_HOLOMAPCOLORS) {
 				_rotPalPos = 0;
 			}
-			waterPaletteChangeTimer = _engine->timerRef + 3;
 		}
 
 		renderHolomapVehicle(frameNumber, move, animTimerData, bodyData, animData);
@@ -569,7 +573,6 @@ void HolomapV1::holoMap() {
 	bool automove = false;
 	bool flagredraw = true;
 	bool dialstat = true;
-	int waterPaletteChangeTimer = 0;
 	bool flagpal = true;
 	_engine->_input->enableKeyMap(holomapKeyMapId);
 	for (;;) {
@@ -635,20 +638,19 @@ void HolomapV1::holoMap() {
 			flagredraw = true;
 		}
 
-		if (!flagpal && waterPaletteChangeTimer < _engine->timerRef) {
+		if (!flagpal) {
 			// animate the water surface
 			_engine->setPalette(HOLOMAP_PALETTE_INDEX, NUM_HOLOMAPCOLORS, &_rotPal[3 * _rotPalPos]);
 			_rotPalPos++;
 			if (_rotPalPos == NUM_HOLOMAPCOLORS) {
 				_rotPalPos = 0;
 			}
-			waterPaletteChangeTimer = _engine->timerRef + 3;
 			flagredraw = true;
 		}
 
 		if (flagredraw) {
 			flagredraw = false;
-			const Common::Rect &rect = _engine->centerOnScreenX(scale(300), 0, scale(330));
+			const Common::Rect &rect = _engine->centerOnScreenX(scale(300), 50, scale(280));
 			// clip reduces the bad effect of https://bugs.scummvm.org/ticket/12074
 			// but it's not part of the original code
 			_engine->_interface->memoClip();
@@ -664,7 +666,7 @@ void HolomapV1::holoMap() {
 			_engine->_interface->restoreClip();
 			if (automove) {
 				// draw cursor
-				const Common::Rect &targetRect = _engine->centerOnScreen(SIZE_CURSOR * 2, SIZE_CURSOR * 2);
+				const Common::Rect &targetRect = _engine->centerOnScreenX(SIZE_CURSOR * 2, 170, SIZE_CURSOR * 2);
 				_engine->_menu->drawRectBorders(targetRect.left, cameraPosY - 20, targetRect.right, cameraPosY + 20, 15, 15);
 			}
 		}
@@ -687,14 +689,12 @@ void HolomapV1::holoMap() {
 		}
 	}
 
-	_engine->_screens->clearScreen();
 	_engine->_text->_flagMessageShade = true;
-	_engine->setPalette(_engine->_screens->_ptrPal);
+	_engine->_screens->fadeToBlack(_engine->_screens->_palettePcx);
 	_engine->_scene->_alphaLight = alphaLightTmp;
 	_engine->_scene->_betaLight = betaLightTmp;
 
 	_engine->_gameState->init3DGame();
-	_engine->_interface->restoreClip();
 
 	_engine->_input->enableKeyMap(mainKeyMapId);
 	_engine->_text->initSceneTextBank();
diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index 38126ca307e..c639b7bca9f 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -1204,7 +1204,6 @@ void Menu::drawBehaviourMenu(int32 left, int32 top, int32 angle) {
 }
 
 void Menu::processBehaviourMenu(bool behaviourMenu) {
-	_engine->extInitSvga();
 	if (_engine->_actor->_heroBehaviour == HeroBehaviourType::kProtoPack) {
 		_engine->_sound->stopSamples();
 		_engine->_actor->setBehaviour(HeroBehaviourType::kNormal);
diff --git a/engines/twine/renderer/screens.cpp b/engines/twine/renderer/screens.cpp
index d723c8253f6..1d066ada124 100644
--- a/engines/twine/renderer/screens.cpp
+++ b/engines/twine/renderer/screens.cpp
@@ -55,6 +55,7 @@ int32 Screens::mapLba2Palette(int32 palIndex) {
 bool Screens::adelineLogo() {
 	_engine->_music->playMidiFile(31);
 
+	// TODO: whiteFade and fadeWhiteToPal
 	return loadImageDelay(_engine->_resources->adelineLogo(), 7);
 }
 
diff --git a/engines/twine/scene/gamestate.cpp b/engines/twine/scene/gamestate.cpp
index 260bc6619a0..eab417838a2 100644
--- a/engines/twine/scene/gamestate.cpp
+++ b/engines/twine/scene/gamestate.cpp
@@ -333,7 +333,6 @@ void GameState::doFoundObj(InventoryItems item) {
 	ScopedEngineFreeze freeze(_engine);
 	_engine->_grid->centerOnActor(_engine->_scene->_sceneHero);
 
-	_engine->extInitSvga();
 	// Hide hero in scene
 	_engine->_scene->_sceneHero->_staticFlags.bIsInvisible = 1;
 	_engine->_redraw->redrawEngineActions(true);
diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp
index 1dae436e300..9c0f6264774 100644
--- a/engines/twine/text.cpp
+++ b/engines/twine/text.cpp
@@ -817,7 +817,6 @@ bool Text::displayText(TextId index, bool showText, bool playVox, bool loop) {
 }
 
 bool Text::drawTextProgressive(TextId index, bool playVox, bool loop) { // Dial
-	_engine->extInitSvga();
 	_engine->_interface->memoClip();
 	_engine->_interface->unsetClip();
 	_engine->saveFrontBuffer();
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index 335a4b80167..27db423f709 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -720,6 +720,7 @@ void TwinEEngine::processActorSamplePosition(int32 actorIdx) {
 void TwinEEngine::processBookOfBu() {
 	_screens->fadeToBlack(_screens->_ptrPal);
 	_screens->loadImage(TwineImage(Resources::HQR_RESS_FILE, 15, 16));
+	_screens->fadeToPal(_screens->_palettePcx);
 	_text->initDial(TextBankId::Inventory_Intro_and_Holomap);
 	_text->_flagMessageShade = false;
 	_text->bigWinDial();
@@ -733,8 +734,6 @@ void TwinEEngine::processBookOfBu() {
 	_text->initSceneTextBank();
 	_screens->fadeToBlack(_screens->_palettePcx);
 	_screens->clearScreen();
-	// TODO: the palette handling here looks wrong
-	setPalette(_screens->_ptrPal);
 	_screens->_flagFade = true;
 }
 
@@ -752,7 +751,7 @@ void TwinEEngine::processBonusList() {
 
 void TwinEEngine::processInventoryAction() {
 	ScopedEngineFreeze scoped(this);
-	extInitSvga();
+	testRestoreModeSVGA(true) ;
 	_menu->inventory();
 
 	switch (_loopInventoryItem) {




More information about the Scummvm-git-logs mailing list