[Scummvm-git-logs] scummvm master -> 2697a9c3ec4121330251f23a5ace8cb894eb7fc0

mgerhardy martin.gerhardy at gmail.com
Sat Jan 30 14:26:03 UTC 2021


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:
406c934776 TWINE: sanity checks to prevent memory corruptions
ad794cf05f TWINE: sanity checks for sprite loading
e3fa8aaa25 TWINE: moved prepareIsoModel calls into the resource loading
9ca1c06c60 TWINE: some lba2 fixes for startup
219daa6146 TWINE: added scene parsing for lba2
61ae5fa027 TWINE: renamed method
4ca2d937da TWINE: renamed method
2697a9c3ec TWINE: fixed missing holomap title after redraw


Commit: 406c9347763c4723179922e956ea1c89419beada
    https://github.com/scummvm/scummvm/commit/406c9347763c4723179922e956ea1c89419beada
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-30T14:09:34+01:00

Commit Message:
TWINE: sanity checks to prevent memory corruptions

Changed paths:
    engines/twine/resources/hqr.cpp
    engines/twine/resources/lzss.cpp
    engines/twine/resources/lzss.h


diff --git a/engines/twine/resources/hqr.cpp b/engines/twine/resources/hqr.cpp
index 166a11f6ab..03b6e87ffa 100644
--- a/engines/twine/resources/hqr.cpp
+++ b/engines/twine/resources/hqr.cpp
@@ -208,14 +208,22 @@ Common::SeekableReadStream *makeReadStream(const char *filename, int index) {
 
 	const uint32 headerSize = file->readUint32LE();
 	if ((uint32)index >= headerSize / 4) {
-		warning("HQR: Invalid entry index");
+		warning("HQR: Invalid entry index: %i", index);
 		delete file;
 		return nullptr;
 	}
 
-	file->seek(index * 4);
+	if (!file->seek(index * 4)) {
+		warning("HQR: Invalid index: %i", index);
+		delete file;
+		return nullptr;
+	}
 	const uint32 offsetToData = file->readUint32LE();
-	file->seek(offsetToData);
+	if (!file->seek(offsetToData)) {
+		warning("HQR: Invalid index: %i", index);
+		delete file;
+		return nullptr;
+	}
 
 	const uint32 realSize = file->readUint32LE();
 	const uint32 compressedSize = file->readUint32LE();
diff --git a/engines/twine/resources/lzss.cpp b/engines/twine/resources/lzss.cpp
index 9266de5521..dd7f941ec3 100644
--- a/engines/twine/resources/lzss.cpp
+++ b/engines/twine/resources/lzss.cpp
@@ -39,21 +39,41 @@ LzssReadStream::~LzssReadStream() {
 }
 
 void LzssReadStream::decodeLZSS(Common::ReadStream *in, uint32 mode, uint32 dataSize) {
+	if (in->eos() || in->err() || dataSize == 0) {
+		_err = dataSize > 0;
+		return;
+	}
+
 	uint8 *dst = _outLzssBufData;
+	int32 remainingBytes = (int32)dataSize;
 
 	do {
 		uint8 b = in->readByte();
 		for (int32 d = 0; d < 8; d++) {
+			if (in->eos() || in->err()) {
+				_err = dataSize > 0;
+				return;
+			}
 			int32 length;
 			if (!(b & (1 << d))) {
 				const uint16 offset = in->readUint16LE();
 				length = (offset & 0x0F) + (mode + 1);
 				const uint8 *ptr = dst - (offset >> 4) - 1;
+				if (remainingBytes < length) {
+					_err = true;
+					return;
+				}
+				remainingBytes -= length;
 				for (int32 i = 0; i < length; i++) {
 					*dst++ = *ptr++;
 				}
 			} else {
 				length = 1;
+				if (remainingBytes < length) {
+					_err = true;
+					return;
+				}
+				remainingBytes -= length;
 				*dst++ = in->readByte();
 			}
 			dataSize -= length;
@@ -70,7 +90,8 @@ bool LzssReadStream::eos() const {
 
 uint32 LzssReadStream::read(void *buf, uint32 dataSize) {
 	if (dataSize > _size - _pos) {
-		error("LzssReadStream::read past end of buffer");
+		_err = true;
+		return 0;
 	}
 
 	memcpy(buf, &_outLzssBufData[_pos], dataSize);
diff --git a/engines/twine/resources/lzss.h b/engines/twine/resources/lzss.h
index ff7cd34e7f..bdabee980d 100644
--- a/engines/twine/resources/lzss.h
+++ b/engines/twine/resources/lzss.h
@@ -29,19 +29,22 @@ private:
 	uint8 *_outLzssBufData;
 	uint32 _size;
 	uint32 _pos;
+	bool _err = false;
 
 	void decodeLZSS(Common::ReadStream *indata, uint32 mode, uint32 length);
 
 public:
 	LzssReadStream(Common::ReadStream *indata, uint32 mode, uint32 realsize);
-	~LzssReadStream();
+	virtual ~LzssReadStream();
 
-	virtual int32 pos() const { return _pos; }
-	virtual int32 size() const { return _size; }
-	virtual bool seek(int32 offset, int whence = SEEK_SET);
+	void clearErr() override { _err = false; }
+	bool err() const override { return _err; }
+	int32 pos() const override { return _pos; }
+	int32 size() const override { return _size; }
+	bool seek(int32 offset, int whence = SEEK_SET) override;
 
-	bool eos() const;
-	uint32 read(void *buf, uint32 size);
+	bool eos() const override;
+	uint32 read(void *buf, uint32 size) override;
 };
 
 } // namespace TwinE


Commit: ad794cf05f823f3b3ca114d22140a942bf329704
    https://github.com/scummvm/scummvm/commit/ad794cf05f823f3b3ca114d22140a942bf329704
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-30T14:09:34+01:00

Commit Message:
TWINE: sanity checks for sprite loading

Changed paths:
    engines/twine/parser/sprite.cpp
    engines/twine/resources/resources.cpp


diff --git a/engines/twine/parser/sprite.cpp b/engines/twine/parser/sprite.cpp
index d9dc67da7e..afc24ef99b 100644
--- a/engines/twine/parser/sprite.cpp
+++ b/engines/twine/parser/sprite.cpp
@@ -54,6 +54,7 @@ bool SpriteData::loadFromStream(Common::SeekableReadStream &stream) {
 	_offsetY = stream.readByte();
 	const Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8();
 	_surface.create(width, height, format);
+	const uint8 *last = (const uint8 *)_surface.getBasePtr(width, height - 1);
 	const int maxY = _offsetY + height;
 	for (int y = _offsetY; y < maxY; ++y) {
 		const uint8 numRuns = stream.readByte();
@@ -65,10 +66,16 @@ bool SpriteData::loadFromStream(Common::SeekableReadStream &stream) {
 			if (type == 2) {
 				uint8 *start = (uint8 *)_surface.getBasePtr(x, y);
 				uint8 *end = (uint8 *)_surface.getBasePtr(x + runLength, y);
+				if (end > last) {
+					return false;
+				}
 				Common::fill(start, end, stream.readByte());
 			} else if (type == 1 || type == 3) {
 				uint8 *start = (uint8 *)_surface.getBasePtr(x, y);
 				for (uint8 i = 0; i < runLength; ++i) {
+					if (start > last) {
+						return false;
+					}
 					*start++ = stream.readByte();
 				}
 			}
diff --git a/engines/twine/resources/resources.cpp b/engines/twine/resources/resources.cpp
index b461fa90be..0e5eb8be76 100644
--- a/engines/twine/resources/resources.cpp
+++ b/engines/twine/resources/resources.cpp
@@ -78,7 +78,7 @@ void Resources::preloadSprites() {
 	for (int32 i = 0; i < numEntries; i++) {
 		spriteSizeTable[i] = HQR::getAllocEntry(&spriteTable[i], Resources::HQR_SPRITES_FILE, i);
 		if (!spriteData[i].loadFromBuffer(spriteTable[i], spriteSizeTable[i])) {
-			error("Failed to load sprite %i", i);
+			warning("Failed to load sprite %i", i);
 		}
 	}
 }


Commit: e3fa8aaa25238923ce22a24d483edd920cc979a7
    https://github.com/scummvm/scummvm/commit/e3fa8aaa25238923ce22a24d483edd920cc979a7
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-30T14:09:34+01:00

Commit Message:
TWINE: moved prepareIsoModel calls into the resource loading

Changed paths:
    engines/twine/menu/menu.cpp
    engines/twine/renderer/redraw.cpp
    engines/twine/resources/resources.cpp
    engines/twine/scene/gamestate.cpp


diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index 1465bf5ec3..123d292fe2 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -1077,7 +1077,6 @@ void Menu::drawItem(int32 item, Common::Rect &dirtyRect) {
 	_engine->_interface->drawSplittedBox(rect, inventorySelectedItem == item ? inventorySelectedColor : COLOR_BLACK);
 
 	if (item < NUM_INVENTORY_ITEMS && _engine->_gameState->hasItem((InventoryItems)item) && !_engine->_gameState->inventoryDisabled()) {
-		Renderer::prepareIsoModel(_engine->_resources->inventoryTable[item]);
 		itemAngle[item] += 8;
 		_engine->_renderer->renderInventoryItem(itemX, itemY, _engine->_resources->inventoryTable[item], itemAngle[item], 15000);
 
diff --git a/engines/twine/renderer/redraw.cpp b/engines/twine/renderer/redraw.cpp
index 69f981874f..44945aa510 100644
--- a/engines/twine/renderer/redraw.cpp
+++ b/engines/twine/renderer/redraw.cpp
@@ -622,7 +622,6 @@ void Redraw::renderOverlays() {
 				_engine->_interface->setClip(rect);
 
 				uint8* bodyPtr = _engine->_resources->inventoryTable[item];
-				Renderer::prepareIsoModel(bodyPtr);
 				overlayRotation += 1; // overlayRotation += 8;
 				_engine->_renderer->renderInventoryItem(40, 40, bodyPtr, overlayRotation, 16000);
 				_engine->_menu->drawBox(rect);
diff --git a/engines/twine/resources/resources.cpp b/engines/twine/resources/resources.cpp
index 0e5eb8be76..09d3ab934c 100644
--- a/engines/twine/resources/resources.cpp
+++ b/engines/twine/resources/resources.cpp
@@ -122,6 +122,7 @@ void Resources::preloadInventoryItems() {
 	debug("preload %i inventory items", numEntries);
 	for (int32 i = 0; i < numEntries; i++) {
 		inventorySizeTable[i] = HQR::getAllocEntry(&inventoryTable[i], Resources::HQR_INVOBJ_FILE, i);
+		Renderer::prepareIsoModel(_engine->_resources->inventoryTable[i]);
 	}
 }
 
diff --git a/engines/twine/scene/gamestate.cpp b/engines/twine/scene/gamestate.cpp
index 1b3e74f252..4d9e083ab1 100644
--- a/engines/twine/scene/gamestate.cpp
+++ b/engines/twine/scene/gamestate.cpp
@@ -336,7 +336,6 @@ void GameState::processFoundItem(int32 item) {
 
 	int32 currentAnimState = 0;
 
-	Renderer::prepareIsoModel(_engine->_resources->inventoryTable[item]);
 	_engine->_redraw->numOfRedrawBox = 0;
 
 	ScopedKeyMap uiKeyMap(_engine, uiKeyMapId);


Commit: 9ca1c06c608e1debe9f5f0e8220a2c568bb13458
    https://github.com/scummvm/scummvm/commit/9ca1c06c608e1debe9f5f0e8220a2c568bb13458
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-30T14:09:34+01:00

Commit Message:
TWINE: some lba2 fixes for startup

Changed paths:
    engines/twine/resources/resources.cpp
    engines/twine/resources/resources.h
    engines/twine/scene/actor.h


diff --git a/engines/twine/resources/resources.cpp b/engines/twine/resources/resources.cpp
index 09d3ab934c..975d17708e 100644
--- a/engines/twine/resources/resources.cpp
+++ b/engines/twine/resources/resources.cpp
@@ -71,8 +71,9 @@ void Resources::initPalettes() {
 
 void Resources::preloadSprites() {
 	const int32 numEntries = HQR::numEntries(Resources::HQR_SPRITES_FILE);
-	if (numEntries > NUM_SPRITES) {
-		error("Max allowed sprites exceeded: %i/%i", numEntries, NUM_SPRITES);
+	const int32 maxSprites = _engine->isLBA1() ? 200 : NUM_SPRITES;
+	if (numEntries > maxSprites) {
+		error("Max allowed sprites exceeded: %i/%i", numEntries, maxSprites);
 	}
 	debug("preload %i sprites", numEntries);
 	for (int32 i = 0; i < numEntries; i++) {
@@ -85,8 +86,9 @@ void Resources::preloadSprites() {
 
 void Resources::preloadAnimations() {
 	const int32 numEntries = HQR::numEntries(Resources::HQR_ANIM_FILE);
-	if (numEntries > NUM_ANIMS) {
-		error("Max allowed animations exceeded: %i/%i", numEntries, NUM_ANIMS);
+	const int32 maxAnims = _engine->isLBA1() ? 600 : NUM_ANIMS;
+	if (numEntries > maxAnims) {
+		error("Max allowed animations exceeded: %i/%i", numEntries, maxAnims);
 	}
 	debug("preload %i animations", numEntries);
 	for (int32 i = 0; i < numEntries; i++) {
@@ -96,8 +98,9 @@ void Resources::preloadAnimations() {
 
 void Resources::preloadSamples() {
 	const int32 numEntries = HQR::numEntries(Resources::HQR_SAMPLES_FILE);
-	if (numEntries > NUM_SAMPLES) {
-		error("Max allowed samples exceeded: %i/%i", numEntries, NUM_SAMPLES);
+	const int32 maxSamples = _engine->isLBA1() ? 243 : NUM_SAMPLES;
+	if (numEntries > maxSamples) {
+		error("Max allowed samples exceeded: %i/%i", numEntries, maxSamples);
 	}
 	debug("preload %i samples", numEntries);
 	for (int32 i = 0; i < numEntries; i++) {
@@ -143,8 +146,10 @@ void Resources::initResources() {
 		error("Failed to load sprite shadow");
 	}
 
-	if (!spriteBoundingBox.loadFromHQR(Resources::HQR_RESS_FILE, RESSHQR_SPRITEBOXDATA)) {
-		error("Failed to load sprite bounding box data");
+	if (_engine->isLBA1()) {
+		if (!spriteBoundingBox.loadFromHQR(Resources::HQR_RESS_FILE, RESSHQR_SPRITEBOXDATA)) {
+			error("Failed to load sprite bounding box data");
+		}
 	}
 
 	holomapSurfaceSize = HQR::getAllocEntry(&holomapSurfacePtr, Resources::HQR_RESS_FILE, RESSHQR_HOLOSURFACE);
diff --git a/engines/twine/resources/resources.h b/engines/twine/resources/resources.h
index 673bedd63f..2453e48f52 100644
--- a/engines/twine/resources/resources.h
+++ b/engines/twine/resources/resources.h
@@ -124,10 +124,10 @@ namespace TwinE {
 #define SPRITEHQR_DIAG_BUBBLE_LEFT 91
 
 /** Total number of animations allowed in the game */
-#define NUM_ANIMS 600
+#define NUM_ANIMS 2083 // 600 for lba1
 
 /** Total number of samples allowed in the game */
-#define NUM_SAMPLES 243
+#define NUM_SAMPLES 895 // 243 for lba1
 
 class TwinEEngine;
 
diff --git a/engines/twine/scene/actor.h b/engines/twine/scene/actor.h
index 884614d95a..bf14c10f28 100644
--- a/engines/twine/scene/actor.h
+++ b/engines/twine/scene/actor.h
@@ -32,7 +32,7 @@
 namespace TwinE {
 
 /** Total number of sprites allowed in the game */
-#define NUM_SPRITES 200
+#define NUM_SPRITES 425 // 200 for lba1
 
 /** Total number of bodies allowed in the game */
 #define NUM_BODIES 200


Commit: 219daa614645f0f518b4b01e85d914283823b546
    https://github.com/scummvm/scummvm/commit/219daa614645f0f518b4b01e85d914283823b546
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-30T14:09:34+01:00

Commit Message:
TWINE: added scene parsing for lba2

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


diff --git a/engines/twine/scene/actor.h b/engines/twine/scene/actor.h
index bf14c10f28..c296d8bff8 100644
--- a/engines/twine/scene/actor.h
+++ b/engines/twine/scene/actor.h
@@ -78,23 +78,29 @@ struct AnimTimerDataStruct {
 
 /** Actors static flags structure */
 struct StaticFlagsStruct {
-	uint16 bComputeCollisionWithObj : 1;    // 0x0001
-	uint16 bComputeCollisionWithBricks : 1; // 0x0002
-	uint16 bIsZonable : 1;                  // 0x0004
-	uint16 bUsesClipping : 1;               // 0x0008
-	uint16 bCanBePushed : 1;                // 0x0010
-	uint16 bComputeLowCollision : 1;        // 0x0020
-	uint16 bCanDrown : 1;                   // 0x0040
-	uint16 bComputeCollisionWithFloor : 1;  // 0x0080
-	uint16 bUnk0100 : 1;                    // 0x0100
-	uint16 bIsHidden : 1;                   // 0x0200
-	uint16 bIsSpriteActor : 1;              // 0x0400
-	uint16 bCanFall : 1;                    // 0x0800
-	uint16 bDoesntCastShadow : 1;           // 0x1000
-	uint16 bIsBackgrounded : 1;             // 0x2000
-	uint16 bIsCarrierActor : 1;             // 0x4000
+	uint32 bComputeCollisionWithObj : 1;    // 0x000001
+	uint32 bComputeCollisionWithBricks : 1; // 0x000002
+	uint32 bIsZonable : 1;                  // 0x000004
+	uint32 bUsesClipping : 1;               // 0x000008
+	uint32 bCanBePushed : 1;                // 0x000010
+	uint32 bComputeLowCollision : 1;        // 0x000020
+	uint32 bCanDrown : 1;                   // 0x000040
+	uint32 bComputeCollisionWithFloor : 1;  // 0x000080
+	uint32 bUnk0100 : 1;                    // 0x000100
+	uint32 bIsHidden : 1;                   // 0x000200
+	uint32 bIsSpriteActor : 1;              // 0x000400
+	uint32 bCanFall : 1;                    // 0x000800
+	uint32 bDoesntCastShadow : 1;           // 0x001000
+	uint32 bIsBackgrounded : 1;             // 0x002000
+	uint32 bIsCarrierActor : 1;             // 0x004000
 	// take smaller value for bound, or if not set take average for bound
-	uint16 bUseMiniZv : 1; // 0x8000
+	uint32 bUseMiniZv : 1;                  // 0x008000
+	uint32 bHasInvalidPosition : 1;          // 0x010000
+	uint32 bNoElectricShock : 1;             // 0x020000
+	uint32 bHasSpriteAnim3D : 1;             // 0x040000
+	uint32 bNoPreClipping : 1;               // 0x080000
+	uint32 bHasZBuffer : 1;                  // 0x100000
+	uint32 bHasZBufferInWater : 1;           // 0x200000
 };
 
 /** Actors dynamic flags structure */
diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index 7b226739d5..a1f6fe73fb 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -47,7 +47,7 @@ Scene::~Scene() {
 	free(currentScene);
 }
 
-void Scene::setActorStaticFlags(ActorStruct *act, uint16 staticFlags) {
+void Scene::setActorStaticFlags(ActorStruct *act, uint32 staticFlags) {
 	if (staticFlags & 0x1) {
 		act->staticFlags.bComputeCollisionWithObj = 1;
 	}
@@ -89,7 +89,7 @@ void Scene::setActorStaticFlags(ActorStruct *act, uint16 staticFlags) {
 		act->staticFlags.bDoesntCastShadow = 1;
 	}
 	if (staticFlags & 0x2000) {
-		//sceneActors[actorIdx].staticFlags.bIsBackgrounded = 1;
+		//act->staticFlags.bIsBackgrounded = 1;
 	}
 	if (staticFlags & 0x4000) {
 		act->staticFlags.bIsCarrierActor = 1;
@@ -97,6 +97,24 @@ void Scene::setActorStaticFlags(ActorStruct *act, uint16 staticFlags) {
 	if (staticFlags & 0x8000) {
 		act->staticFlags.bUseMiniZv = 1;
 	}
+	if (staticFlags & 0x10000) {
+		act->staticFlags.bHasInvalidPosition = 1;
+	}
+	if (staticFlags & 0x20000) {
+		act->staticFlags.bNoElectricShock = 1;
+	}
+	if (staticFlags & 0x40000) {
+		act->staticFlags.bHasSpriteAnim3D = 1;
+	}
+	if (staticFlags & 0x80000) {
+		act->staticFlags.bNoPreClipping = 1;
+	}
+	if (staticFlags & 0x100000) {
+		act->staticFlags.bHasZBuffer = 1;
+	}
+	if (staticFlags & 0x200000) {
+		act->staticFlags.bHasZBufferInWater = 1;
+	}
 }
 
 void Scene::setBonusParameterFlags(ActorStruct *act, uint16 bonusFlags) {
@@ -129,6 +147,138 @@ void Scene::setBonusParameterFlags(ActorStruct *act, uint16 bonusFlags) {
 	}
 }
 
+bool Scene::loadSceneLBA2() {
+	Common::MemoryReadStream stream(currentScene, _currentSceneSize);
+	sceneTextBank = stream.readByte();
+	_currentGameOverScene = stream.readByte();
+	stream.skip(4);
+
+	alphaLight = ClampAngle(stream.readUint16LE());
+	betaLight = ClampAngle(stream.readUint16LE());
+	debug(2, "Using %i and %i as light vectors", alphaLight, betaLight);
+
+	_isOutsideScene = stream.readByte();
+
+	for (int i = 0; i < 4; ++i) {
+		_sampleAmbiance[i] = stream.readUint16LE();
+		_sampleRepeat[i] = stream.readUint16LE();
+		_sampleRound[i] = stream.readUint16LE();
+		_sampleFrequency[i] = stream.readUint16LE();
+		_sampleVolume[i] = stream.readUint16LE();
+	}
+
+	_sampleMinDelay = stream.readUint16LE();
+	_sampleMinDelayRnd = stream.readUint16LE();
+
+	_sceneMusic = stream.readByte();
+
+	// load hero properties
+	_sceneHeroX = stream.readUint16LE();
+	_sceneHeroY = stream.readUint16LE();
+	_sceneHeroZ = stream.readUint16LE();
+
+	sceneHero->moveScriptSize = stream.readUint16LE();
+	sceneHero->moveScript = currentScene + stream.pos();
+	stream.skip(sceneHero->moveScriptSize);
+
+	sceneHero->lifeScriptSize = stream.readUint16LE();
+	sceneHero->lifeScript = currentScene + stream.pos();
+	stream.skip(sceneHero->lifeScriptSize);
+
+	sceneNumActors = stream.readUint16LE();
+	int cnt = 1;
+	for (int32 i = 1; i < sceneNumActors; i++, cnt++) {
+		_engine->_actor->resetActor(i);
+		ActorStruct *act = &_sceneActors[i];
+		setActorStaticFlags(act, stream.readUint32LE());
+
+		act->loadModel(stream.readUint16LE());
+
+		act->body = (BodyType)stream.readSint16LE();
+		act->anim = (AnimationTypes)stream.readByte();
+		act->sprite = stream.readUint16LE();
+		act->x = stream.readUint16LE();
+		act->collisionX = act->x;
+		act->y = stream.readUint16LE();
+		act->collisionY = act->y;
+		act->z = stream.readUint16LE();
+		act->collisionZ = act->z;
+		act->strengthOfHit = stream.readByte();
+		setBonusParameterFlags(act, stream.readUint16LE());
+		act->angle = stream.readUint16LE();
+		act->speed = stream.readUint16LE();
+		act->controlMode = (ControlMode)stream.readByte();
+		act->cropLeft = stream.readSint16LE();
+		act->delayInMillis = act->cropLeft; // TODO: this might not be needed
+		act->cropTop = stream.readSint16LE();
+		act->cropRight = stream.readSint16LE();
+		act->cropBottom = stream.readSint16LE();
+		act->followedActor = act->cropBottom; // TODO: is this needed? and valid?
+		act->bonusAmount = stream.readSint16LE();
+		act->talkColor = stream.readByte();
+		if (act->staticFlags.bHasSpriteAnim3D) {
+			/*act->spriteAnim3DNumber = */stream.readSint32LE();
+			/*act->spriteSizeHit = */stream.readSint16LE();
+			/*act->cropBottom = act->spriteSizeHit;*/
+		}
+		act->armor = stream.readByte();
+		act->life = stream.readByte();
+
+		act->moveScriptSize = stream.readUint16LE();
+		act->moveScript = currentScene + stream.pos();
+		stream.skip(act->moveScriptSize);
+
+		act->lifeScriptSize = stream.readUint16LE();
+		act->lifeScript = currentScene + stream.pos();
+		stream.skip(act->lifeScriptSize);
+
+		if (_engine->_debugScene->onlyLoadActor != -1 && _engine->_debugScene->onlyLoadActor != cnt) {
+			sceneNumActors--;
+			i--;
+		}
+	}
+
+	sceneNumZones = stream.readUint16LE();
+	for (int32 i = 0; i < sceneNumZones; i++) {
+		ZoneStruct *zone = &sceneZones[i];
+		zone->bottomLeft.x = stream.readSint32LE();
+		zone->bottomLeft.y = stream.readSint32LE();
+		zone->bottomLeft.z = stream.readSint32LE();
+
+		zone->topRight.x = stream.readSint32LE();
+		zone->topRight.y = stream.readSint32LE();
+		zone->topRight.z = stream.readSint32LE();
+
+		zone->infoData.generic.info0 = stream.readSint32LE();
+		zone->infoData.generic.info1 = stream.readSint32LE();
+		zone->infoData.generic.info2 = stream.readSint32LE();
+		zone->infoData.generic.info3 = stream.readSint32LE();
+		zone->infoData.generic.info4 = stream.readSint32LE();
+		zone->infoData.generic.info5 = stream.readSint32LE();
+		zone->infoData.generic.info6 = stream.readSint32LE();
+		zone->infoData.generic.info7 = stream.readSint32LE();
+
+		zone->type = stream.readUint16LE();
+		zone->snap = stream.readUint16LE();
+	}
+
+	sceneNumTracks = stream.readUint16LE();
+	for (int32 i = 0; i < sceneNumTracks; i++) {
+		ScenePoint *point = &sceneTracks[i];
+		point->x = stream.readSint32LE();
+		point->y = stream.readSint32LE();
+		point->z = stream.readSint32LE();
+	}
+
+	int32 sceneNumPatches = stream.readUint16LE();
+	for (int32 i = 0; i < sceneNumPatches; i++) {
+		/*size = */stream.readUint16LE();
+		/*offset = */stream.readUint16LE();
+	}
+
+	return true;
+}
+
 bool Scene::loadSceneLBA1() {
 	Common::MemoryReadStream stream(currentScene, _currentSceneSize);
 
@@ -143,21 +293,11 @@ bool Scene::loadSceneLBA1() {
 	betaLight = ClampAngle(stream.readUint16LE());
 	debug(2, "Using %i and %i as light vectors", alphaLight, betaLight);
 
-	_sampleAmbiance[0] = stream.readUint16LE();
-	_sampleRepeat[0] = stream.readUint16LE();
-	_sampleRound[0] = stream.readUint16LE();
-
-	_sampleAmbiance[1] = stream.readUint16LE();
-	_sampleRepeat[1] = stream.readUint16LE();
-	_sampleRound[1] = stream.readUint16LE();
-
-	_sampleAmbiance[2] = stream.readUint16LE();
-	_sampleRepeat[2] = stream.readUint16LE();
-	_sampleRound[2] = stream.readUint16LE();
-
-	_sampleAmbiance[3] = stream.readUint16LE();
-	_sampleRepeat[3] = stream.readUint16LE();
-	_sampleRound[3] = stream.readUint16LE();
+	for (int i = 0; i < 4; ++i) {
+		_sampleAmbiance[i] = stream.readUint16LE();
+		_sampleRepeat[i] = stream.readUint16LE();
+		_sampleRound[i] = stream.readUint16LE();
+	}
 
 	_sampleMinDelay = stream.readUint16LE();
 	_sampleMinDelayRnd = stream.readUint16LE();
@@ -267,6 +407,8 @@ bool Scene::initScene(int32 index) {
 
 	if (_engine->isLBA1()) {
 		return loadSceneLBA1();
+	} else if (_engine->isLBA2()) {
+		return loadSceneLBA2();
 	}
 
 	return false;
diff --git a/engines/twine/scene/scene.h b/engines/twine/scene/scene.h
index c24f2ec5f4..49ae694166 100644
--- a/engines/twine/scene/scene.h
+++ b/engines/twine/scene/scene.h
@@ -93,10 +93,14 @@ struct ZoneStruct {
 			int16 used;
 		} Bonus;
 		struct {
-			int16 info0;
-			int16 info1;
-			int16 info2;
-			int16 info3;
+			int32 info0;
+			int32 info1;
+			int32 info2;
+			int32 info3;
+			int32 info4;
+			int32 info5;
+			int32 info6;
+			int32 info7;
 		} generic;
 	} infoData;
 	int16 snap = 0;
@@ -266,9 +270,11 @@ private:
 
 	/** Process zone extra bonus */
 	void processZoneExtraBonus(ZoneStruct *zone);
-	void setActorStaticFlags(ActorStruct *act, uint16 staticFlags);
+	void setActorStaticFlags(ActorStruct *act, uint32 staticFlags);
 	void setBonusParameterFlags(ActorStruct *act, uint16 bonusFlags);
 	bool loadSceneLBA1();
+	bool loadSceneLBA2();
+
 	/** Initialize new scene */
 	bool initScene(int32 index);
 	/** Reset scene */
@@ -277,12 +283,15 @@ private:
 	// the first actor is the own hero
 	ActorStruct _sceneActors[NUM_MAX_ACTORS];
 	int32 _currentSceneSize = 0;
+	bool _isOutsideScene = false; // lba2
 
 	/** Timer for the next sample ambience in scene */
 	int32 _sampleAmbienceTime = 0;
 	int16 _sampleAmbiance[4]{0};
 	int16 _sampleRepeat[4]{0};
 	int16 _sampleRound[4]{0};
+	int16 _sampleFrequency[4]{0}; // lba2
+	int16 _sampleVolume[4]{0}; // lba2
 	int16 _sampleMinDelay = 0;
 	int16 _sampleMinDelayRnd = 0;
 


Commit: 61ae5fa0279c85c3653c95d62fc5d96a2c1a2c88
    https://github.com/scummvm/scummvm/commit/61ae5fa0279c85c3653c95d62fc5d96a2c1a2c88
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-30T14:16:23+01:00

Commit Message:
TWINE: renamed method

Changed paths:
    engines/twine/menu/menuoptions.cpp
    engines/twine/scene/scene.cpp
    engines/twine/script/script_life_v1.cpp
    engines/twine/text.cpp
    engines/twine/text.h
    engines/twine/twine.cpp


diff --git a/engines/twine/menu/menuoptions.cpp b/engines/twine/menu/menuoptions.cpp
index 2b6a65f975..f89e868e79 100644
--- a/engines/twine/menu/menuoptions.cpp
+++ b/engines/twine/menu/menuoptions.cpp
@@ -61,16 +61,16 @@ void MenuOptions::newGame() {
 	_engine->_text->textClipFull();
 	_engine->_text->setFontCrossColor(COLOR_WHITE);
 
-	bool aborted = _engine->_text->drawTextFullscreen(TextId::kIntroText1);
+	bool aborted = _engine->_text->drawTextProgressive(TextId::kIntroText1);
 
 	// intro screen 2
 	if (!aborted) {
 		_engine->_screens->loadImage(RESSHQR_INTROSCREEN2IMG, RESSHQR_INTROSCREEN2PAL);
-		aborted |= _engine->_text->drawTextFullscreen(TextId::kIntroText2);
+		aborted |= _engine->_text->drawTextProgressive(TextId::kIntroText2);
 
 		if (!aborted) {
 			_engine->_screens->loadImage(RESSHQR_INTROSCREEN3IMG, RESSHQR_INTROSCREEN3PAL);
-			aborted |= _engine->_text->drawTextFullscreen(TextId::kIntroText3);
+			aborted |= _engine->_text->drawTextProgressive(TextId::kIntroText3);
 		}
 	}
 	_engine->cfgfile.FlagDisplayText = tmpFlagDisplayText;
diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index a1f6fe73fb..491227444d 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -676,7 +676,7 @@ void Scene::processActorZones(int32 actorIdx) {
 					_engine->freezeTime();
 					_engine->_text->setFontCrossColor(zone->infoData.DisplayText.textColor);
 					talkingActor = actorIdx;
-					_engine->_text->drawTextFullscreen(zone->infoData.DisplayText.textIdx);
+					_engine->_text->drawTextProgressive(zone->infoData.DisplayText.textIdx);
 					_engine->unfreezeTime();
 					_engine->_redraw->redrawEngineActions(true);
 				}
diff --git a/engines/twine/script/script_life_v1.cpp b/engines/twine/script/script_life_v1.cpp
index ff6b8ed26b..43f8cb756b 100644
--- a/engines/twine/script/script_life_v1.cpp
+++ b/engines/twine/script/script_life_v1.cpp
@@ -651,7 +651,7 @@ static int32 lMESSAGE(TwinEEngine *engine, LifeScriptContext &ctx) {
 	}
 	engine->_text->setFontCrossColor(ctx.actor->talkColor);
 	engine->_scene->talkingActor = ctx.actorIdx;
-	engine->_text->drawTextFullscreen(textIdx);
+	engine->_text->drawTextProgressive(textIdx);
 	engine->unfreezeTime();
 	engine->_redraw->redrawEngineActions(true);
 
@@ -916,7 +916,7 @@ static int32 lMESSAGE_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
 	}
 	engine->_text->setFontCrossColor(engine->_scene->getActor(otherActorIdx)->talkColor);
 	engine->_scene->talkingActor = otherActorIdx;
-	engine->_text->drawTextFullscreen(textIdx);
+	engine->_text->drawTextProgressive(textIdx);
 	engine->unfreezeTime();
 	engine->_redraw->redrawEngineActions(true);
 
@@ -1302,7 +1302,7 @@ static int32 lBIG_MESSAGE(TwinEEngine *engine, LifeScriptContext &ctx) {
 	}
 	engine->_text->setFontCrossColor(ctx.actor->talkColor);
 	engine->_scene->talkingActor = ctx.actorIdx;
-	engine->_text->drawTextFullscreen(textIdx);
+	engine->_text->drawTextProgressive(textIdx);
 	engine->_text->textClipSmall();
 	engine->unfreezeTime();
 	engine->_redraw->redrawEngineActions(true);
@@ -1611,7 +1611,7 @@ static int32 lMESSAGE_SENDELL(TwinEEngine *engine, LifeScriptContext &ctx) {
 	engine->_text->drawTextBoxBackground = false;
 	const bool tmpFlagDisplayText = engine->cfgfile.FlagDisplayText;
 	engine->cfgfile.FlagDisplayText = true;
-	engine->_text->drawTextFullscreen(TextId::kSendell);
+	engine->_text->drawTextProgressive(TextId::kSendell);
 	engine->cfgfile.FlagDisplayText = tmpFlagDisplayText;
 	engine->_text->drawTextBoxBackground = true;
 	engine->_text->textClipSmall();
diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp
index c1f2a78982..33ff9dac20 100644
--- a/engines/twine/text.cpp
+++ b/engines/twine/text.cpp
@@ -658,7 +658,7 @@ bool Text::displayText(int32 index, bool showText, bool playVox, bool loop) {
 	return aborted;
 }
 
-bool Text::drawTextFullscreen(int32 index, bool playVox, bool loop) {
+bool Text::drawTextProgressive(int32 index, bool playVox, bool loop) {
 	_engine->_interface->saveClip();
 	_engine->_interface->resetClip();
 	_engine->_screens->copyScreen(_engine->frontVideoBuffer, _engine->workVideoBuffer);
@@ -786,7 +786,7 @@ void Text::drawHolomapLocation(int32 index) {
 	textClipSmall();
 	setFontCrossColor(COLOR_WHITE);
 	_engine->_interface->drawSplittedBox(_dialTextBox, COLOR_BLACK);
-	drawTextFullscreen(index, false, false);
+	drawTextProgressive(index, false, false);
 }
 
 } // namespace TwinE
diff --git a/engines/twine/text.h b/engines/twine/text.h
index 54fc2fd32f..fe3da4072b 100644
--- a/engines/twine/text.h
+++ b/engines/twine/text.h
@@ -273,7 +273,7 @@ public:
 	 */
 	void drawText(int32 x, int32 y, const char *dialogue);
 
-	bool drawTextFullscreen(int32 index, bool playVox = true, bool loop = true);
+	bool drawTextProgressive(int32 index, bool playVox = true, bool loop = true);
 
 	/**
 	 * Gets dialogue text width size
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index 3ea4d94727..f5b1a1623c 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -561,7 +561,7 @@ void TwinEEngine::processBookOfBu() {
 	_text->setFontCrossColor(COLOR_WHITE);
 	const bool tmpFlagDisplayText = cfgfile.FlagDisplayText;
 	cfgfile.FlagDisplayText = true;
-	_text->drawTextFullscreen(TextId::kBookOfBu);
+	_text->drawTextProgressive(TextId::kBookOfBu);
 	cfgfile.FlagDisplayText = tmpFlagDisplayText;
 	_text->textClipSmall();
 	_text->drawTextBoxBackground = true;
@@ -579,7 +579,7 @@ void TwinEEngine::processBonusList() {
 	_text->setFontCrossColor(COLOR_WHITE);
 	const bool tmpFlagDisplayText = cfgfile.FlagDisplayText;
 	cfgfile.FlagDisplayText = true;
-	_text->drawTextFullscreen(TextId::kBonusList);
+	_text->drawTextProgressive(TextId::kBonusList);
 	cfgfile.FlagDisplayText = tmpFlagDisplayText;
 	_text->textClipSmall();
 	_text->initSceneTextBank();


Commit: 4ca2d937dadcae733e48586d510862c1cd67bab5
    https://github.com/scummvm/scummvm/commit/4ca2d937dadcae733e48586d510862c1cd67bab5
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-30T14:35:12+01:00

Commit Message:
TWINE: renamed method

Changed paths:
    engines/twine/holomap.cpp
    engines/twine/menu/interface.cpp
    engines/twine/menu/interface.h
    engines/twine/menu/menu.cpp
    engines/twine/menu/menuoptions.cpp
    engines/twine/renderer/redraw.cpp
    engines/twine/script/script_life_v1.cpp
    engines/twine/text.cpp


diff --git a/engines/twine/holomap.cpp b/engines/twine/holomap.cpp
index cf02750a89..693b76f051 100644
--- a/engines/twine/holomap.cpp
+++ b/engines/twine/holomap.cpp
@@ -304,7 +304,7 @@ void Holomap::drawHolomapTrajectory(int32 trajectoryIndex) {
 		_engine->_renderer->setCameraAngle(0, 0, 0, 60, 128, 0, 30000);
 		_engine->_renderer->setLightVector(0xffffffc4, 128, 0);
 		const Common::Rect rect(0, 200, 199, 479);
-		_engine->_interface->drawSplittedBox(rect, COLOR_BLACK);
+		_engine->_interface->drawFilledRect(rect, COLOR_BLACK);
 		_engine->_renderer->renderIsoModel(0, 0, 0, 0, newAngle, 0, modelPtr);
 		_engine->copyBlockPhys(rect);
 		_engine->_renderer->setCameraPosition(400, 240, 128, 1024, 1024);
@@ -513,7 +513,7 @@ void Holomap::processHolomap() {
 		if (redraw) {
 			redraw = false;
 			const Common::Rect rect(170, 0, 470, 330);
-			_engine->_interface->drawSplittedBox(rect, COLOR_BLACK);
+			_engine->_interface->drawFilledRect(rect, COLOR_BLACK);
 			_engine->_renderer->setBaseRotation(xRot, yRot, 0);
 			_engine->_renderer->setLightVector(xRot, yRot, 0);
 			renderLocations(xRot, yRot, 0, false);
diff --git a/engines/twine/menu/interface.cpp b/engines/twine/menu/interface.cpp
index c95b05554b..ed39dac0b3 100644
--- a/engines/twine/menu/interface.cpp
+++ b/engines/twine/menu/interface.cpp
@@ -169,7 +169,7 @@ void Interface::drawTransparentBox(const Common::Rect &rect, int32 colorAdj) {
 	}
 }
 
-void Interface::drawSplittedBox(const Common::Rect &rect, uint8 colorIndex) {
+void Interface::drawFilledRect(const Common::Rect &rect, uint8 colorIndex) {
 	_engine->frontVideoBuffer.fillRect(rect, colorIndex);
 }
 
diff --git a/engines/twine/menu/interface.h b/engines/twine/menu/interface.h
index a46589dc4b..242dfd3cc6 100644
--- a/engines/twine/menu/interface.h
+++ b/engines/twine/menu/interface.h
@@ -66,7 +66,7 @@ public:
 	 */
 	void drawTransparentBox(const Common::Rect &rect, int32 colorAdj);
 
-	void drawSplittedBox(const Common::Rect &rect, uint8 colorIndex);
+	void drawFilledRect(const Common::Rect &rect, uint8 colorIndex);
 
 	void setClip(const Common::Rect &rect);
 	void saveClip(); // saveTextWindow
diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index 123d292fe2..177f1966a1 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -283,7 +283,7 @@ void Menu::drawButtonGfx(const MenuSettings *menuSettings, const Common::Rect &r
 			if (!(_engine->getRandomNumber() % 5)) {
 				plasmaEffectPtr[_engine->getRandomNumber() % 140 * 10 + 1900] = 255;
 			}
-			_engine->_interface->drawSplittedBox(Common::Rect(newWidth, rect.top, rect.right, rect.bottom), COLOR_RED);
+			_engine->_interface->drawFilledRect(Common::Rect(newWidth, rect.top, rect.right, rect.bottom), COLOR_RED);
 		} else {
 			processPlasmaEffect(rect, 64);
 			if (!(_engine->getRandomNumber() % 5)) {
@@ -806,7 +806,7 @@ void Menu::drawInfoMenu(int16 left, int16 top, int16 width) {
 	drawBox(rect);
 	Common::Rect splittedBoxRect(rect);
 	splittedBoxRect.grow(-1);
-	_engine->_interface->drawSplittedBox(splittedBoxRect, COLOR_BLACK);
+	_engine->_interface->drawFilledRect(splittedBoxRect, COLOR_BLACK);
 
 	const int32 newBoxLeft2 = left + 9;
 
@@ -818,7 +818,7 @@ void Menu::drawInfoMenu(int16 left, int16 top, int16 width) {
 
 	const int32 boxTop = top + 10;
 	const int32 boxBottom = top + 25;
-	_engine->_interface->drawSplittedBox(Common::Rect(newBoxLeft, boxTop, boxLeft, boxBottom), COLOR_91);
+	_engine->_interface->drawFilledRect(Common::Rect(newBoxLeft, boxTop, boxLeft, boxBottom), COLOR_91);
 	drawBox(newBoxLeft, boxTop, left + 324, boxTop + 14);
 
 	if (!_engine->_gameState->inventoryDisabled() && _engine->_gameState->hasItem(InventoryItems::kiTunic)) {
@@ -826,7 +826,7 @@ void Menu::drawInfoMenu(int16 left, int16 top, int16 width) {
 		if (_engine->_gameState->magicLevelIdx > 0) {
 			const int32 pointBoxRight = _engine->_screens->crossDot(newBoxLeft, boxRight, 80, _engine->_gameState->inventoryMagicPoints);
 			const Common::Rect pointsRect(newBoxLeft, top + 35, pointBoxRight, top + 50);
-			_engine->_interface->drawSplittedBox(pointsRect, COLOR_75);
+			_engine->_interface->drawFilledRect(pointsRect, COLOR_75);
 			drawBox(newBoxLeft, top + 35, newBoxLeft + _engine->_gameState->magicLevelIdx * 80, top + 35 + 15);
 		}
 	}
@@ -914,11 +914,11 @@ void Menu::drawBehaviour(HeroBehaviourType behaviour, int32 angle, bool cantDraw
 		const int32 titleBoxTop = boxRect.bottom + titleOffset;
 		const int32 titleBoxBottom = titleBoxTop + titleHeight;
 
-		_engine->_interface->drawSplittedBox(boxRect, COLOR_BRIGHT_BLUE2);
+		_engine->_interface->drawFilledRect(boxRect, COLOR_BRIGHT_BLUE2);
 
 		// behaviour menu title
 		const Common::Rect titleRect(titleBoxLeft, titleBoxTop, titleBoxRight, titleBoxBottom);
-		_engine->_interface->drawSplittedBox(titleRect, COLOR_BLACK);
+		_engine->_interface->drawFilledRect(titleRect, COLOR_BLACK);
 		drawBox(titleRect);
 
 		_engine->_text->setFontColor(COLOR_WHITE);
@@ -929,7 +929,7 @@ void Menu::drawBehaviour(HeroBehaviourType behaviour, int32 angle, bool cantDraw
 		_engine->_text->drawText(titleBoxCenter - _engine->_text->getTextSize(dialText) / 2, titleBoxTop + 1, dialText);
 		_engine->copyBlockPhys(titleRect);
 	} else {
-		_engine->_interface->drawSplittedBox(boxRect, COLOR_BLACK);
+		_engine->_interface->drawFilledRect(boxRect, COLOR_BLACK);
 	}
 
 	_engine->_renderer->renderBehaviourModel(boxRect, -600, angle, behaviourEntity);
@@ -1074,7 +1074,7 @@ void Menu::drawItem(int32 item, Common::Rect &dirtyRect) {
 	const int32 top = itemY - 32;
 	const int32 bottom = itemY + 32;
 	const Common::Rect rect(left, top, right, bottom);
-	_engine->_interface->drawSplittedBox(rect, inventorySelectedItem == item ? inventorySelectedColor : COLOR_BLACK);
+	_engine->_interface->drawFilledRect(rect, inventorySelectedItem == item ? inventorySelectedColor : COLOR_BLACK);
 
 	if (item < NUM_INVENTORY_ITEMS && _engine->_gameState->hasItem((InventoryItems)item) && !_engine->_gameState->inventoryDisabled()) {
 		itemAngle[item] += 8;
diff --git a/engines/twine/menu/menuoptions.cpp b/engines/twine/menu/menuoptions.cpp
index f89e868e79..0ac6ffc8aa 100644
--- a/engines/twine/menu/menuoptions.cpp
+++ b/engines/twine/menu/menuoptions.cpp
@@ -150,7 +150,7 @@ void MenuOptions::drawSelectableCharacter(int32 x, int32 y, Common::Rect &dirtyR
 
 	const bool selected = _onScreenKeyboardX == x && _onScreenKeyboardY == y;
 	if (selected) {
-		_engine->_interface->drawSplittedBox(rect, COLOR_91);
+		_engine->_interface->drawFilledRect(rect, COLOR_91);
 	} else {
 		_engine->_interface->blitBox(rect, _engine->workVideoBuffer, _engine->frontVideoBuffer);
 		_engine->_interface->drawTransparentBox(rect, 4);
diff --git a/engines/twine/renderer/redraw.cpp b/engines/twine/renderer/redraw.cpp
index 44945aa510..098490d35d 100644
--- a/engines/twine/renderer/redraw.cpp
+++ b/engines/twine/renderer/redraw.cpp
@@ -618,7 +618,7 @@ void Redraw::renderOverlays() {
 				const int32 item = overlay->info0;
 				const Common::Rect rect(10, 10, 69, 69);
 
-				_engine->_interface->drawSplittedBox(rect, COLOR_BLACK);
+				_engine->_interface->drawFilledRect(rect, COLOR_BLACK);
 				_engine->_interface->setClip(rect);
 
 				uint8* bodyPtr = _engine->_resources->inventoryTable[item];
diff --git a/engines/twine/script/script_life_v1.cpp b/engines/twine/script/script_life_v1.cpp
index 43f8cb756b..13e24e1257 100644
--- a/engines/twine/script/script_life_v1.cpp
+++ b/engines/twine/script/script_life_v1.cpp
@@ -1759,7 +1759,7 @@ static int32 lTEXT(TwinEEngine *engine, LifeScriptContext &ctx) {
 static int32 lCLEAR_TEXT(TwinEEngine *engine, LifeScriptContext &ctx) {
 	lTextYPos = 0;
 	const Common::Rect rect(0, 0, engine->width() - 1, engine->height() / 2);
-	engine->_interface->drawSplittedBox(rect, COLOR_BLACK);
+	engine->_interface->drawFilledRect(rect, COLOR_BLACK);
 	engine->copyBlockPhys(rect);
 	return 0;
 }
diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp
index 33ff9dac20..ba34c2ed86 100644
--- a/engines/twine/text.cpp
+++ b/engines/twine/text.cpp
@@ -785,7 +785,7 @@ void Text::drawAskQuestion(int32 index) {
 void Text::drawHolomapLocation(int32 index) {
 	textClipSmall();
 	setFontCrossColor(COLOR_WHITE);
-	_engine->_interface->drawSplittedBox(_dialTextBox, COLOR_BLACK);
+	_engine->_interface->drawFilledRect(_dialTextBox, COLOR_BLACK);
 	drawTextProgressive(index, false, false);
 }
 


Commit: 2697a9c3ec4121330251f23a5ace8cb894eb7fc0
    https://github.com/scummvm/scummvm/commit/2697a9c3ec4121330251f23a5ace8cb894eb7fc0
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-30T15:25:32+01:00

Commit Message:
TWINE: fixed missing holomap title after redraw

Changed paths:
    engines/twine/holomap.cpp


diff --git a/engines/twine/holomap.cpp b/engines/twine/holomap.cpp
index 693b76f051..d1ba8126e4 100644
--- a/engines/twine/holomap.cpp
+++ b/engines/twine/holomap.cpp
@@ -443,7 +443,6 @@ void Holomap::processHolomap() {
 	_engine->_text->initTextBank(TextBankId::Inventory_Intro_and_Holomap);
 	_engine->_text->setFontCrossColor(COLOR_9);
 
-	drawHolomapText(_engine->width() / 2, 25, "HoloMap");
 	int currentLocation = _engine->_scene->currentSceneIdx;
 	_engine->_text->drawHolomapLocation(_locations[currentLocation].textIndex);
 	_engine->flip();
@@ -514,6 +513,7 @@ void Holomap::processHolomap() {
 			redraw = false;
 			const Common::Rect rect(170, 0, 470, 330);
 			_engine->_interface->drawFilledRect(rect, COLOR_BLACK);
+			drawHolomapText(_engine->width() / 2, 25, "HoloMap");
 			_engine->_renderer->setBaseRotation(xRot, yRot, 0);
 			_engine->_renderer->setLightVector(xRot, yRot, 0);
 			renderLocations(xRot, yRot, 0, false);




More information about the Scummvm-git-logs mailing list