[Scummvm-git-logs] scummvm master -> 87bac099e49adcd504db5abc336b44915b56853e

mgerhardy martin.gerhardy at gmail.com
Mon Feb 8 20:28:26 UTC 2021


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

Summary:
9d6ef5e2d3 TWINE: added missing break
44131e20d2 TWINE: restore music when leaving the options menu
115c5de54e TWINE: add some potential script fixes
e3450e8865 TWINE: show cloverleafs even if inventory is disabled
bb1f3735e5 TWINE: ensure that the clip is set for rendering the inventory items
51cdf05bbe TWINE: removed todo comment
64bea2f296 TWINE: parse unknown animation data
bc44193748 TWINE: handle ACTION_UNKNOWN_21 animation type
ff75b1112a TWINE: extract to local variables
07a38ce768 TWINE: unified z position for addExtraAiming animation call
87bac099e4 TWINE: fixed camera-center-issue


Commit: 9d6ef5e2d310c04bdaa6d4fa26adea0c97e57dd2
    https://github.com/scummvm/scummvm/commit/9d6ef5e2d310c04bdaa6d4fa26adea0c97e57dd2
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-02-08T19:40:45+01:00

Commit Message:
TWINE: added missing break

even if unused...

Changed paths:
    engines/twine/flamovies.cpp


diff --git a/engines/twine/flamovies.cpp b/engines/twine/flamovies.cpp
index 4645f7b63c..721cae7081 100644
--- a/engines/twine/flamovies.cpp
+++ b/engines/twine/flamovies.cpp
@@ -208,6 +208,7 @@ void FlaMovies::processFrame() {
 				break;
 			case 4:
 				_engine->_music->stopMidiMusic();
+				break;
 			}
 			break;
 		}


Commit: 44131e20d2f145e0cf828ff05a74ab9412fd0174
    https://github.com/scummvm/scummvm/commit/44131e20d2f145e0cf828ff05a74ab9412fd0174
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-02-08T19:40:45+01:00

Commit Message:
TWINE: restore music when leaving the options menu

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


diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index 96dddce15c..12e12ac9eb 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -670,7 +670,7 @@ int32 Menu::optionsMenu() {
 	_engine->flip();
 
 	_engine->_sound->stopSamples();
-	//_engine->_music->playTrackMusic(9);
+	_engine->_music->playTrackMusic(9);
 
 	ScopedCursor scoped(_engine);
 	for (;;) {
diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index 491227444d..14d750e22d 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -554,6 +554,14 @@ void Scene::initSceneVars() {
 	sceneNumTracks = 0;
 }
 
+void Scene::playSceneMusic() {
+	if (currentSceneIdx == LBA1SceneId::Tippet_Island_Twinsun_Cafe && _engine->_gameState->hasGameFlag(90)) {
+		_engine->_music->playMidiMusic(8);
+	} else {
+		_engine->_music->playMidiMusic(_sceneMusic);
+	}
+}
+
 void Scene::processEnvironmentSound() {
 	if (_engine->lbaTime >= _sampleAmbienceTime) {
 		int16 currentAmb = _engine->getRandomNumber(4); // random ambiance
diff --git a/engines/twine/scene/scene.h b/engines/twine/scene/scene.h
index 49ae694166..9f15e19314 100644
--- a/engines/twine/scene/scene.h
+++ b/engines/twine/scene/scene.h
@@ -312,6 +312,8 @@ public:
 	Scene(TwinEEngine *engine) : _engine(engine) {}
 	~Scene();
 
+	void playSceneMusic();
+
 	void reloadCurrentScene();
 	uint8 *currentScene = nullptr;
 
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index f5b1a1623c..a9c210d5ce 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -676,7 +676,7 @@ void TwinEEngine::processOptionsMenu() {
 	ScopedEngineFreeze scoped(this);
 	_sound->pauseSamples();
 	_menu->inGameOptionsMenu();
-	// TODO: play music
+	_scene->playSceneMusic();
 	_sound->resumeSamples();
 	_redraw->redrawEngineActions(true);
 }


Commit: 115c5de54eb625bdbf02e07869d72384502e64d5
    https://github.com/scummvm/scummvm/commit/115c5de54eb625bdbf02e07869d72384502e64d5
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-02-08T19:40:45+01:00

Commit Message:
TWINE: add some potential script fixes

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


diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index 14d750e22d..8ce4f75d59 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -395,6 +395,27 @@ bool Scene::loadSceneLBA1() {
 		point->z = stream.readUint16LE();
 	}
 
+#if 0
+	// TODO: these were found in the disassembly and might be some script fixes - check me and activate me
+	switch (currentSceneIdx) {
+	case LBA1SceneId::Hamalayi_Mountains_landing_place:
+		assert(sceneNumActors >= 22);
+		_sceneActors[21].x = _sceneActors[21].collisionX = 0x1b00;
+		_sceneActors[21].z = _sceneActors[21].collisionZ = 0x300;
+		break;
+	case Principal_Island_outside_the_fortress:
+		assert(sceneNumActors >= 30);
+		_sceneActors[29].z = _sceneActors[29].collisionZ = 0x703;
+		break;
+	case Tippet_Island_Secret_passage_scene_1:
+		(ushort*)puVar4[78] = 0xe20;
+		break;
+	case Principal_Island_inside_the_fortress:
+		(ushort*)puVar4[140] = 0x32;
+		break;
+	}
+#endif
+
 	return true;
 }
 


Commit: e3450e8865053cf77c1b7bfc7d86c41df04aeb42
    https://github.com/scummvm/scummvm/commit/e3450e8865053cf77c1b7bfc7d86c41df04aeb42
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-02-08T19:40:45+01:00

Commit Message:
TWINE: show cloverleafs even if inventory is disabled

found in disassembly

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


diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index 12e12ac9eb..72a624bcc0 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -1085,7 +1085,7 @@ void Menu::drawItem(int32 item, Common::Rect &dirtyRect) {
 	const Common::Rect rect(left, top, right, bottom);
 	_engine->_interface->drawFilledRect(rect, inventorySelectedItem == item ? inventorySelectedColor : COLOR_BLACK);
 
-	if (item < NUM_INVENTORY_ITEMS && _engine->_gameState->hasItem((InventoryItems)item) && !_engine->_gameState->inventoryDisabled()) {
+	if (item < NUM_INVENTORY_ITEMS && _engine->_gameState->hasItem((InventoryItems)item) && (!_engine->_gameState->inventoryDisabled() || item == InventoryItems::kiCloverLeaf)) {
 		itemAngle[item] += 8;
 		_engine->_renderer->renderInventoryItem(itemX, itemY, _engine->_resources->inventoryTable[item], itemAngle[item], 15000);
 


Commit: bb1f3735e5ba72e99154c6839511cccf9765bd7a
    https://github.com/scummvm/scummvm/commit/bb1f3735e5ba72e99154c6839511cccf9765bd7a
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-02-08T19:40:45+01:00

Commit Message:
TWINE: ensure that the clip is set for rendering the inventory items

found in disassembly

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


diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index 72a624bcc0..55ce625b3b 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -1087,8 +1087,9 @@ void Menu::drawItem(int32 item, Common::Rect &dirtyRect) {
 
 	if (item < NUM_INVENTORY_ITEMS && _engine->_gameState->hasItem((InventoryItems)item) && (!_engine->_gameState->inventoryDisabled() || item == InventoryItems::kiCloverLeaf)) {
 		itemAngle[item] += 8;
+		_engine->_interface->setClip(rect);
 		_engine->_renderer->renderInventoryItem(itemX, itemY, _engine->_resources->inventoryTable[item], itemAngle[item], 15000);
-
+		_engine->_interface->resetClip();
 		if (item == InventoryItems::kGasItem) { // has GAS
 			_engine->_text->setFontColor(COLOR_WHITE);
 			Common::String inventoryNumGas = Common::String::format("%d", _engine->_gameState->inventoryNumGas);


Commit: 51cdf05bbe1710d3ecc8858f82c5874543d00cde
    https://github.com/scummvm/scummvm/commit/51cdf05bbe1710d3ecc8858f82c5874543d00cde
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-02-08T19:40:46+01:00

Commit Message:
TWINE: removed todo comment

this is the posType in the original binary

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


diff --git a/engines/twine/renderer/redraw.cpp b/engines/twine/renderer/redraw.cpp
index 098490d35d..2ab72a0951 100644
--- a/engines/twine/renderer/redraw.cpp
+++ b/engines/twine/renderer/redraw.cpp
@@ -180,8 +180,6 @@ void Redraw::updateOverlayTypePosition(int16 x1, int16 y1, int16 x2, int16 y2) {
 
 	for (int32 i = 0; i < ARRAYSIZE(overlayList); i++) {
 		OverlayListStruct *overlay = &overlayList[i];
-		// TODO: this comparison is wrong - either posType or koNumber
-		//if (overlay->type == OverlayPosType::koFollowActor) {
 		if (overlay->posType == OverlayPosType::koFollowActor) {
 			overlay->x = newX;
 			overlay->y = newY;


Commit: 64bea2f2961556aa93ec82d30ab324b04975a1ff
    https://github.com/scummvm/scummvm/commit/64bea2f2961556aa93ec82d30ab324b04975a1ff
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-02-08T21:05:07+01:00

Commit Message:
TWINE: parse unknown animation data

original opcode 0x10

Changed paths:
    engines/twine/parser/entity.cpp
    engines/twine/shared.h


diff --git a/engines/twine/parser/entity.cpp b/engines/twine/parser/entity.cpp
index cc1b9988f9..7db28cae35 100644
--- a/engines/twine/parser/entity.cpp
+++ b/engines/twine/parser/entity.cpp
@@ -135,6 +135,15 @@ bool EntityData::loadAnim(Common::SeekableReadStream &stream) {
 			action.finalAngle = ToAngle(stream.readSint16LE());
 			action.strength = stream.readByte();
 			break;
+		case ACTION_UNKNOWN_21:
+			action.animFrame = stream.readByte();
+			action.distanceX = stream.readSint16LE();
+			action.distanceY = stream.readSint16LE();
+			action.distanceZ = stream.readSint16LE();
+			action.xAngle = stream.readSint16LE();
+			action.yAngle = stream.readSint16LE();
+			action.finalAngle = stream.readByte();
+			break;
 		case ActionType::ACTION_ZV:
 		default:
 			break;
diff --git a/engines/twine/shared.h b/engines/twine/shared.h
index bb211eae8b..198d85ad3e 100644
--- a/engines/twine/shared.h
+++ b/engines/twine/shared.h
@@ -76,6 +76,7 @@ enum ActionType {
 	ACTION_THROW_3D = 18,
 	ACTION_THROW_3D_ALPHA = 19,
 	ACTION_THROW_3D_SEARCH = 20,
+	ACTION_UNKNOWN_21 = 21,
 	ACTION_LAST
 };
 


Commit: bc441937483ec24342bf83938c57c4f05d95890c
    https://github.com/scummvm/scummvm/commit/bc441937483ec24342bf83938c57c4f05d95890c
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-02-08T21:05:50+01:00

Commit Message:
TWINE: handle ACTION_UNKNOWN_21 animation type

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


diff --git a/engines/twine/scene/animations.cpp b/engines/twine/scene/animations.cpp
index d4aeb3812b..71fa87be36 100644
--- a/engines/twine/scene/animations.cpp
+++ b/engines/twine/scene/animations.cpp
@@ -421,6 +421,15 @@ void Animations::processAnimActions(int32 actorIdx) {
 				                                action.targetActor, action.finalAngle, action.strength);
 			}
 			break;
+		case ActionType::ACTION_UNKNOWN_21:
+			if (_engine->_gameState->magicBallIdx == -1 && action.animFrame == actor->animPosition) {
+				_engine->_movements->rotateActor(action.distanceX, action.distanceZ, actor->angle);
+				const int32 x = actor->x + _engine->_renderer->destX;
+				const int32 y = actor->y + action.distanceY;
+				const int32 z = actor->z + _engine->_renderer->destZ;
+				_engine->_extra->addExtraThrowMagicball(x, y, z, action.xAngle, actor->angle, action.yAngle, action.finalAngle);
+			}
+			break;
 		case ActionType::ACTION_ZV:
 		default:
 			break;


Commit: ff75b1112ab27fe2b09ce111866f63258c33c8bc
    https://github.com/scummvm/scummvm/commit/ff75b1112ab27fe2b09ce111866f63258c33c8bc
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-02-08T21:06:32+01:00

Commit Message:
TWINE: extract to local variables

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


diff --git a/engines/twine/scene/animations.cpp b/engines/twine/scene/animations.cpp
index 71fa87be36..223b06822d 100644
--- a/engines/twine/scene/animations.cpp
+++ b/engines/twine/scene/animations.cpp
@@ -417,7 +417,10 @@ void Animations::processAnimActions(int32 actorIdx) {
 		case ActionType::ACTION_THROW_3D_SEARCH:
 			if (action.animFrame == actor->animPosition) {
 				_engine->_movements->rotateActor(action.distanceX, action.distanceZ, actor->angle);
-				_engine->_extra->addExtraAiming(actorIdx, actor->x + _engine->_renderer->destX, actor->y + action.distanceY, actor->z + action.distanceZ, action.spriteIndex,
+				const int32 x = actor->x + _engine->_renderer->destX;
+				const int32 y = actor->y + action.distanceY;
+				const int32 z = actor->z + action.distanceZ;
+				_engine->_extra->addExtraAiming(actorIdx, x, y, z, action.spriteIndex,
 				                                action.targetActor, action.finalAngle, action.strength);
 			}
 			break;


Commit: 07a38ce768bfd0e0d95491a2f654cb2620975baf
    https://github.com/scummvm/scummvm/commit/07a38ce768bfd0e0d95491a2f654cb2620975baf
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-02-08T21:07:07+01:00

Commit Message:
TWINE: unified z position for addExtraAiming animation call

... with findings from disassembly

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


diff --git a/engines/twine/scene/animations.cpp b/engines/twine/scene/animations.cpp
index 223b06822d..f845e5a66a 100644
--- a/engines/twine/scene/animations.cpp
+++ b/engines/twine/scene/animations.cpp
@@ -419,7 +419,7 @@ void Animations::processAnimActions(int32 actorIdx) {
 				_engine->_movements->rotateActor(action.distanceX, action.distanceZ, actor->angle);
 				const int32 x = actor->x + _engine->_renderer->destX;
 				const int32 y = actor->y + action.distanceY;
-				const int32 z = actor->z + action.distanceZ;
+				const int32 z = actor->z + _engine->_renderer->destZ;
 				_engine->_extra->addExtraAiming(actorIdx, x, y, z, action.spriteIndex,
 				                                action.targetActor, action.finalAngle, action.strength);
 			}


Commit: 87bac099e49adcd504db5abc336b44915b56853e
    https://github.com/scummvm/scummvm/commit/87bac099e49adcd504db5abc336b44915b56853e
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-02-08T21:25:36+01:00

Commit Message:
TWINE: fixed camera-center-issue

introduced in 219daa614645f0f518b4b01e85d914283823b546

the lba2 scene is using int32 for the infodata unions. lba1 is
using int16 - so we had to switch every single member to int32.

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


diff --git a/engines/twine/scene/scene.h b/engines/twine/scene/scene.h
index 9f15e19314..b08f7b81a0 100644
--- a/engines/twine/scene/scene.h
+++ b/engines/twine/scene/scene.h
@@ -60,37 +60,37 @@ struct ZoneStruct {
 	int16 type = 0;
 	union {
 		struct {
-			int16 newSceneIdx;
-			int16 x;
-			int16 y;
-			int16 z;
+			int32 newSceneIdx;
+			int32 x;
+			int32 y;
+			int32 z;
 		} ChangeScene;
 		struct {
-			int16 dummy;
-			int16 x;
-			int16 y;
-			int16 z;
+			int32 dummy;
+			int32 x;
+			int32 y;
+			int32 z;
 		} CameraView;
 		struct {
-			int16 zoneIdx;
+			int32 zoneIdx;
 		} Sceneric;
 		struct {
-			int16 newGrid;
+			int32 newGrid;
 		} CeillingGrid;
 
 		/** show a text (e.g. when reading a sign) */
 		struct {
-			int16 textIdx;   /*!< text index in the current active text bank */
-			int16 textColor; /*!< text color (see @c ActorStruct::talkColor) */
+			int32 textIdx;   /*!< text index in the current active text bank */
+			int32 textColor; /*!< text color (see @c ActorStruct::talkColor) */
 		} DisplayText;
 		struct {
-			int16 info0;
+			int32 info0;
 			BonusParameter typesFlag;
-			int16 amount;
+			int32 amount;
 			/**
 			 * Already used
 			 */
-			int16 used;
+			int32 used;
 		} Bonus;
 		struct {
 			int32 info0;




More information about the Scummvm-git-logs mailing list