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

mgerhardy martin.gerhardy at gmail.com
Tue Jan 26 17:56:20 UTC 2021


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

Summary:
382bafb256 TWINE: extended debug command to set holomap flags
61b0633468 TWINE: more color constants
d5472d1d55 TWINE: refactored translateGroup
4daad49b3a TWINE: groop matrix multiplication methods
2ecab25c55 TWINE: renamed members
16236c02cc TWINE: added new debug command to dump files
c30e8a5b1e TWINE: reduced visibility
0f4406e8ee TWINE: replaced magic number
09341ff55a TWINE: allow to execute a debug command file via debugger instance
f08b7cd376 TWINE: allow to faster entering the game


Commit: 382bafb2560408001e99c065bdac3ad09293dc02
    https://github.com/scummvm/scummvm/commit/382bafb2560408001e99c065bdac3ad09293dc02
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-26T18:55:52+01:00

Commit Message:
TWINE: extended debug command to set holomap flags

Changed paths:
    engines/twine/debugger/console.cpp


diff --git a/engines/twine/debugger/console.cpp b/engines/twine/debugger/console.cpp
index b930ddafad..03b75efb16 100644
--- a/engines/twine/debugger/console.cpp
+++ b/engines/twine/debugger/console.cpp
@@ -134,12 +134,23 @@ bool TwinEConsole::doSetInventoryFlag(int argc, const char **argv) {
 
 bool TwinEConsole::doSetHolomapFlag(int argc, const char **argv) {
 	if (argc <= 1) {
-		debugPrintf("Expected to get a holomap flag index as first parameter\n");
+		debugPrintf("Expected to get a holomap flag index as first parameter. Use -1 to set all flags\n");
 		return true;
 	}
 
-	const uint8 idx = atoi(argv[1]);
-	if (idx >= NUM_LOCATIONS) {
+	GameState* state = _engine->_gameState;
+	state->setGameFlag(InventoryItems::kiHolomap, 1);
+	state->inventoryFlags[InventoryItems::kiHolomap] = 1;
+	state->setGameFlag(GAMEFLAG_INVENTORY_DISABLED, 0);
+
+	const int idx = atoi(argv[1]);
+	if (idx == -1) {
+		for (int i = 0; i < NUM_LOCATIONS; ++i) {
+			_engine->_holomap->setHolomapPosition(i);
+		}
+		return true;
+	}
+	if (idx >= 0 && idx >= NUM_LOCATIONS) {
 		debugPrintf("given index exceeds the max allowed value of %i\n", NUM_LOCATIONS - 1);
 		return true;
 	}


Commit: 61b06334689dc2dee0e691e57bcd1762c31f73d0
    https://github.com/scummvm/scummvm/commit/61b06334689dc2dee0e691e57bcd1762c31f73d0
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-26T18:55:52+01:00

Commit Message:
TWINE: more color constants

Changed paths:
    engines/twine/holomap.cpp
    engines/twine/menu/menu.cpp
    engines/twine/menu/menuoptions.cpp
    engines/twine/renderer/redraw.cpp
    engines/twine/scene/actor.h
    engines/twine/scene/extra.cpp
    engines/twine/scene/gamestate.cpp
    engines/twine/script/script_life_v1.cpp
    engines/twine/text.cpp
    engines/twine/text.h


diff --git a/engines/twine/holomap.cpp b/engines/twine/holomap.cpp
index 3424ad6e03..cf02750a89 100644
--- a/engines/twine/holomap.cpp
+++ b/engines/twine/holomap.cpp
@@ -441,7 +441,7 @@ void Holomap::processHolomap() {
 	_engine->_renderer->setCameraPosition(_engine->width() / 2, 190, 128, 1024, 1024);
 
 	_engine->_text->initTextBank(TextBankId::Inventory_Intro_and_Holomap);
-	_engine->_text->setFontCrossColor(9);
+	_engine->_text->setFontCrossColor(COLOR_9);
 
 	drawHolomapText(_engine->width() / 2, 25, "HoloMap");
 	int currentLocation = _engine->_scene->currentSceneIdx;
diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index 92d8d0ca81..1465bf5ec3 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -237,10 +237,10 @@ void Menu::processPlasmaEffect(const Common::Rect &rect, int32 color) {
 }
 
 void Menu::drawBox(const Common::Rect &rect) {
-	_engine->_interface->drawLine(rect.left, rect.top, rect.right, rect.top, 79);           // top line
-	_engine->_interface->drawLine(rect.left, rect.top, rect.left, rect.bottom, 79);         // left line
-	_engine->_interface->drawLine(rect.right, rect.top + 1, rect.right, rect.bottom, 73);   // right line
-	_engine->_interface->drawLine(rect.left + 1, rect.bottom, rect.right, rect.bottom, 73); // bottom line
+	_engine->_interface->drawLine(rect.left, rect.top, rect.right, rect.top, COLOR_79);           // top line
+	_engine->_interface->drawLine(rect.left, rect.top, rect.left, rect.bottom, COLOR_79);         // left line
+	_engine->_interface->drawLine(rect.right, rect.top + 1, rect.right, rect.bottom, COLOR_73);   // right line
+	_engine->_interface->drawLine(rect.left + 1, rect.bottom, rect.right, rect.bottom, COLOR_73); // bottom line
 }
 
 void Menu::drawBox(int32 left, int32 top, int32 right, int32 bottom) {
@@ -283,11 +283,11 @@ 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), 68);
+			_engine->_interface->drawSplittedBox(Common::Rect(newWidth, rect.top, rect.right, rect.bottom), COLOR_RED);
 		} else {
 			processPlasmaEffect(rect, 64);
 			if (!(_engine->getRandomNumber() % 5)) {
-				plasmaEffectPtr[_engine->getRandomNumber() % 320 * 10 + 6400] = 255;
+				plasmaEffectPtr[_engine->getRandomNumber() % PLASMA_WIDTH * 10 + 6400] = 255;
 			}
 		}
 	} else {
@@ -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, 0);
+	_engine->_interface->drawSplittedBox(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), 91);
+	_engine->_interface->drawSplittedBox(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, 75);
+			_engine->_interface->drawSplittedBox(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, 69);
+		_engine->_interface->drawSplittedBox(boxRect, COLOR_BRIGHT_BLUE2);
 
 		// behaviour menu title
 		const Common::Rect titleRect(titleBoxLeft, titleBoxTop, titleBoxRight, titleBoxBottom);
-		_engine->_interface->drawSplittedBox(titleRect, 0);
+		_engine->_interface->drawSplittedBox(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, 0);
+		_engine->_interface->drawSplittedBox(boxRect, COLOR_BLACK);
 	}
 
 	_engine->_renderer->renderBehaviourModel(boxRect, -600, angle, behaviourEntity);
diff --git a/engines/twine/menu/menuoptions.cpp b/engines/twine/menu/menuoptions.cpp
index 0a574fc4f1..2b6a65f975 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, 91);
+		_engine->_interface->drawSplittedBox(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 6e2b128df2..69f981874f 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, 0);
+				_engine->_interface->drawSplittedBox(rect, COLOR_BLACK);
 				_engine->_interface->setClip(rect);
 
 				uint8* bodyPtr = _engine->_resources->inventoryTable[item];
diff --git a/engines/twine/scene/actor.h b/engines/twine/scene/actor.h
index fb33dcfc9e..0249944ace 100644
--- a/engines/twine/scene/actor.h
+++ b/engines/twine/scene/actor.h
@@ -27,6 +27,7 @@
 #include "twine/parser/body.h"
 #include "twine/parser/entity.h"
 #include "twine/shared.h"
+#include "twine/text.h"
 
 namespace TwinE {
 
@@ -203,7 +204,7 @@ public:
 	int32 cropBottom = 0;
 	int32 followedActor = 0; // same as info3
 	int32 bonusAmount = 0;   // field_12
-	int32 talkColor = 0;
+	int32 talkColor = COLOR_BLACK;
 	int32 armor = 0; // field_14
 	int32 life = 0;
 
diff --git a/engines/twine/scene/extra.cpp b/engines/twine/scene/extra.cpp
index 475ed1d270..cad2fdefea 100644
--- a/engines/twine/scene/extra.cpp
+++ b/engines/twine/scene/extra.cpp
@@ -518,7 +518,7 @@ void Extra::drawExtraSpecial(int32 extraIdx, int32 x, int32 y) {
 
 	switch (specialType) {
 	case ExtraSpecialType::kHitStars:
-		drawSpecialShape(hitStarsShapeTable, x, y, 15, (_engine->lbaTime * 32) & ANGLE_270, 4);
+		drawSpecialShape(hitStarsShapeTable, x, y, COLOR_WHITE, (_engine->lbaTime * 32) & ANGLE_270, 4);
 		break;
 	case ExtraSpecialType::kExplodeCloud: {
 		int32 cloudTime = 1 + _engine->lbaTime - extra->spawnTime;
@@ -527,7 +527,7 @@ void Extra::drawExtraSpecial(int32 extraIdx, int32 x, int32 y) {
 			cloudTime = 32;
 		}
 
-		drawSpecialShape(explodeCloudShapeTable, x, y, 15, 0, cloudTime);
+		drawSpecialShape(explodeCloudShapeTable, x, y, COLOR_WHITE, 0, cloudTime);
 		break;
 	}
 	}
diff --git a/engines/twine/scene/gamestate.cpp b/engines/twine/scene/gamestate.cpp
index eeb69010ed..98cefc279f 100644
--- a/engines/twine/scene/gamestate.cpp
+++ b/engines/twine/scene/gamestate.cpp
@@ -87,7 +87,7 @@ void GameState::initGameStateVars() {
 }
 
 void GameState::initHeroVars() {
-	_engine->_actor->resetActor(0); // reset Hero
+	_engine->_actor->resetActor(OWN_ACTOR_SCENE_INDEX); // reset Hero
 
 	magicBallIdx = -1;
 
@@ -101,7 +101,7 @@ void GameState::initHeroVars() {
 
 	_engine->_scene->sceneHero->body = 0;
 	_engine->_scene->sceneHero->life = 50;
-	_engine->_scene->sceneHero->talkColor = 4;
+	_engine->_scene->sceneHero->talkColor = COLOR_BRIGHT_BLUE;
 }
 
 void GameState::initEngineVars() {
diff --git a/engines/twine/script/script_life_v1.cpp b/engines/twine/script/script_life_v1.cpp
index a5b8496ad7..d63c890cd9 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, 0);
+	engine->_interface->drawSplittedBox(rect, COLOR_BLACK);
 	engine->copyBlockPhys(rect);
 	return 0;
 }
diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp
index 037f56ca16..c1f2a78982 100644
--- a/engines/twine/text.cpp
+++ b/engines/twine/text.cpp
@@ -170,7 +170,7 @@ void Text::initSceneTextBank() {
 	initTextBank(_engine->_scene->sceneTextBank + TextBankId::Citadel_Island);
 }
 
-void Text::drawCharacter(int32 x, int32 y, uint8 character) { // drawCharacter
+void Text::drawCharacter(int32 x, int32 y, uint8 character) {
 	Common::MemoryReadStream stream(_engine->_resources->fontPtr, _engine->_resources->fontBufSize);
 	stream.seek(character * 4);
 	stream.seek(stream.readSint16LE());
@@ -214,7 +214,7 @@ void Text::drawCharacter(int32 x, int32 y, uint8 character) { // drawCharacter
 	}
 }
 
-void Text::drawCharacterShadow(int32 x, int32 y, uint8 character, int32 color, Common::Rect &dirtyRect) { // drawDoubleLetter
+void Text::drawCharacterShadow(int32 x, int32 y, uint8 character, int32 color, Common::Rect &dirtyRect) {
 	if (character == ' ') {
 		return;
 	}
@@ -260,7 +260,7 @@ void Text::drawText(int32 x, int32 y, const char *dialogue) {
 	} while (1);
 }
 
-int32 Text::getTextSize(const char *dialogue) { // SizeFont
+int32 Text::getTextSize(const char *dialogue) {
 	int32 dialTextSize = 0;
 
 	do {
@@ -280,7 +280,7 @@ int32 Text::getTextSize(const char *dialogue) { // SizeFont
 	return dialTextSize;
 }
 
-void Text::initDialogueBox() { // InitDialWindow
+void Text::initDialogueBox() {
 	_engine->_interface->blitBox(_dialTextBox, _engine->workVideoBuffer, _engine->frontVideoBuffer);
 
 	if (drawTextBoxBackground) {
@@ -295,7 +295,7 @@ void Text::initDialogueBox() { // InitDialWindow
 	_engine->_interface->blitBox(_dialTextBox, _engine->frontVideoBuffer, _engine->workVideoBuffer);
 }
 
-void Text::initInventoryDialogueBox() { // SecondInitDialWindow
+void Text::initInventoryDialogueBox() {
 	_engine->_interface->blitBox(_dialTextBox, _engine->workVideoBuffer, _engine->frontVideoBuffer);
 	_engine->copyBlockPhys(_dialTextBox);
 	_fadeInCharactersPos = 0;
@@ -303,7 +303,6 @@ void Text::initInventoryDialogueBox() { // SecondInitDialWindow
 
 void Text::initInventoryText(int index) {
 	// 100 if the offset for the inventory item descriptions
-	//
 	initText(100 + index);
 }
 
@@ -311,7 +310,6 @@ void Text::initItemFoundText(int index) {
 	initText(100 + index);
 }
 
-// TODO: refactor this code
 void Text::initText(int32 index) {
 	if (!getText(index)) {
 		_hasValidTextHandle = false;
diff --git a/engines/twine/text.h b/engines/twine/text.h
index f6db63b1cb..54fc2fd32f 100644
--- a/engines/twine/text.h
+++ b/engines/twine/text.h
@@ -109,6 +109,13 @@ enum _TextId {
 
 #define COLOR_BLACK 0
 #define COLOR_BRIGHT_BLUE 4
+#define COLOR_9 9
+#define COLOR_RED 68
+#define COLOR_73 73
+#define COLOR_75 75
+#define COLOR_79 79
+#define COLOR_91 91
+#define COLOR_BRIGHT_BLUE2 69
 #define COLOR_WHITE 15
 #define COLOR_GOLD 155
 


Commit: d5472d1d553a3c10aaf923ba16b6c07f6ab5c574
    https://github.com/scummvm/scummvm/commit/d5472d1d553a3c10aaf923ba16b6c07f6ab5c574
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-26T18:55:52+01:00

Commit Message:
TWINE: refactored translateGroup

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


diff --git a/engines/twine/renderer/renderer.cpp b/engines/twine/renderer/renderer.cpp
index 9abd1faae2..190c96323f 100644
--- a/engines/twine/renderer/renderer.cpp
+++ b/engines/twine/renderer/renderer.cpp
@@ -152,6 +152,12 @@ void Renderer::getCameraAnglePositions(int32 x, int32 y, int32 z) {
 	destZ = (baseMatrix.row1[2] * x + baseMatrix.row2[2] * y + baseMatrix.row3[2] * z) / SCENE_SIZE_HALF;
 }
 
+void Renderer::translateGroup(int32 x, int32 y, int32 z) {
+	destX = (shadeMatrix.row1[0] * x + shadeMatrix.row1[1] * y + shadeMatrix.row1[2] * z) / SCENE_SIZE_HALF;
+	destY = (shadeMatrix.row2[0] * x + shadeMatrix.row2[1] * y + shadeMatrix.row2[2] * z) / SCENE_SIZE_HALF;
+	destZ = destY;
+}
+
 void Renderer::setCameraAngle(int32 transPosX, int32 transPosY, int32 transPosZ, int32 rotPosX, int32 rotPosY, int32 rotPosZ, int32 param6) {
 	baseTransPosX = transPosX;
 	baseTransPosY = transPosY;
@@ -329,36 +335,6 @@ void Renderer::processTranslatedElement(Matrix *targetMatrix, const pointTab *po
 	applyPointsTranslation(&pointsPtr[elemPtr->firstPoint / sizeof(pointTab)], elemPtr->numOfPoints, &modelData->computedPoints[elemPtr->firstPoint / sizeof(pointTab)], targetMatrix);
 }
 
-void Renderer::translateGroup(int16 ax, int16 bx, int16 cx) {
-	const int32 ebp = ax;
-	const int32 ebx = bx;
-	const int32 ecx = cx;
-
-	int32 edi = shadeMatrix.row1[0];
-	int32 eax = shadeMatrix.row1[1];
-	edi *= ebp;
-	eax *= ebx;
-	edi += eax;
-	eax = shadeMatrix.row1[2];
-	eax *= ecx;
-	eax += edi;
-	eax /= SCENE_SIZE_HALF;
-
-	destX = eax;
-
-	edi = shadeMatrix.row2[0];
-	eax = shadeMatrix.row2[1];
-	edi *= ebp;
-	eax *= ebx;
-	edi += eax;
-	eax = shadeMatrix.row2[2];
-	eax *= ecx;
-	eax += edi;
-	eax /= SCENE_SIZE_HALF;
-	destY = eax;
-	destZ = eax;
-}
-
 void Renderer::setLightVector(int32 angleX, int32 angleY, int32 angleZ) {
 	// TODO: RECHECK THIS
 	/*_cameraAngleX = angleX;
diff --git a/engines/twine/renderer/renderer.h b/engines/twine/renderer/renderer.h
index 3dbc3638e8..4164c38084 100644
--- a/engines/twine/renderer/renderer.h
+++ b/engines/twine/renderer/renderer.h
@@ -326,7 +326,7 @@ private:
 	void processRotatedElement(Matrix *targetMatrix, const pointTab *pointsPtr, int32 rotZ, int32 rotY, int32 rotX, const elementEntry *elemPtr, ModelData *modelData);
 	void applyPointsTranslation(const pointTab *pointsPtr, int32 numPoints, pointTab *destPoints, const Matrix *translationMatrix);
 	void processTranslatedElement(Matrix *targetMatrix, const pointTab *pointsPtr, int32 rotX, int32 rotY, int32 rotZ, const elementEntry *elemPtr, ModelData *modelData);
-	void translateGroup(int16 ax, int16 bx, int16 cx);
+	void translateGroup(int32 x, int32 y, int32 z);
 
 	// ---- variables ----
 


Commit: 4daad49b3a093e74dec40b7153dfd2ca261117e6
    https://github.com/scummvm/scummvm/commit/4daad49b3a093e74dec40b7153dfd2ca261117e6
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-26T18:55:52+01:00

Commit Message:
TWINE: groop matrix multiplication methods

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


diff --git a/engines/twine/renderer/renderer.cpp b/engines/twine/renderer/renderer.cpp
index 190c96323f..f5912bb7a0 100644
--- a/engines/twine/renderer/renderer.cpp
+++ b/engines/twine/renderer/renderer.cpp
@@ -110,12 +110,6 @@ void Renderer::setOrthoProjection(int32 x, int32 y, int32 z) {
 	isUsingOrthoProjection = true;
 }
 
-void Renderer::getBaseRotationPosition(int32 x, int32 y, int32 z) {
-	destX = (baseMatrix.row1[0] * x + baseMatrix.row1[1] * y + baseMatrix.row1[2] * z) / SCENE_SIZE_HALF;
-	destY = (baseMatrix.row2[0] * x + baseMatrix.row2[1] * y + baseMatrix.row2[2] * z) / SCENE_SIZE_HALF;
-	destZ = (baseMatrix.row3[0] * x + baseMatrix.row3[1] * y + baseMatrix.row3[2] * z) / SCENE_SIZE_HALF;
-}
-
 void Renderer::setBaseRotation(int32 x, int32 y, int32 z) {
 	const double Xradians = (double)((ANGLE_90 - x) % ANGLE_360) * 2 * M_PI / ANGLE_360;
 	const double Yradians = (double)((ANGLE_90 - y) % ANGLE_360) * 2 * M_PI / ANGLE_360;
@@ -146,6 +140,12 @@ void Renderer::setBaseRotation(int32 x, int32 y, int32 z) {
 	baseRotPosZ = destZ;
 }
 
+void Renderer::getBaseRotationPosition(int32 x, int32 y, int32 z) {
+	destX = (baseMatrix.row1[0] * x + baseMatrix.row1[1] * y + baseMatrix.row1[2] * z) / SCENE_SIZE_HALF;
+	destY = (baseMatrix.row2[0] * x + baseMatrix.row2[1] * y + baseMatrix.row2[2] * z) / SCENE_SIZE_HALF;
+	destZ = (baseMatrix.row3[0] * x + baseMatrix.row3[1] * y + baseMatrix.row3[2] * z) / SCENE_SIZE_HALF;
+}
+
 void Renderer::getCameraAnglePositions(int32 x, int32 y, int32 z) {
 	destX = (baseMatrix.row1[0] * x + baseMatrix.row2[0] * y + baseMatrix.row3[0] * z) / SCENE_SIZE_HALF;
 	destY = (baseMatrix.row1[1] * x + baseMatrix.row2[1] * y + baseMatrix.row3[1] * z) / SCENE_SIZE_HALF;


Commit: 2ecab25c553994c443bac80240276a197206bff6
    https://github.com/scummvm/scummvm/commit/2ecab25c553994c443bac80240276a197206bff6
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-26T18:55:52+01:00

Commit Message:
TWINE: renamed members

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


diff --git a/engines/twine/renderer/renderer.cpp b/engines/twine/renderer/renderer.cpp
index f5912bb7a0..138083fc03 100644
--- a/engines/twine/renderer/renderer.cpp
+++ b/engines/twine/renderer/renderer.cpp
@@ -74,24 +74,24 @@ int32 Renderer::projectPositionOnScreen(int32 cX, int32 cY, int32 cZ) {
 		return 0;
 	}
 
-	int32 posZ = cZ + cameraPosX;
+	int32 posZ = cZ + cameraDepthOffset;
 	if (posZ < 0) {
 		posZ = 0x7FFF;
 	}
 
-	projPosX = (cX * cameraPosY) / posZ + orthoProjX;
-	projPosY = (-cY * cameraPosZ) / posZ + orthoProjY;
+	projPosX = (cX * cameraScaleY) / posZ + orthoProjX;
+	projPosY = (-cY * cameraScaleZ) / posZ + orthoProjY;
 	projPosZ = posZ;
 	return -1;
 }
 
-void Renderer::setCameraPosition(int32 x, int32 y, int32 cX, int32 cY, int32 cZ) {
+void Renderer::setCameraPosition(int32 x, int32 y, int32 depthOffset, int32 scaleY, int32 scaleZ) {
 	orthoProjX = x;
 	orthoProjY = y;
 
-	cameraPosX = cX;
-	cameraPosY = cY;
-	cameraPosZ = cZ;
+	cameraDepthOffset = depthOffset;
+	cameraScaleY = scaleY;
+	cameraScaleZ = scaleZ;
 
 	isUsingOrthoProjection = false;
 }
@@ -1162,7 +1162,7 @@ bool Renderer::renderModelElements(int32 numOfPrimitives, const uint8 *polygonPt
 			//if (isUsingOrthoProjection) {
 				radius = (radius * 34) / 512;
 			//} else {
-			//	radius = (radius * cameraPosY) / (cameraPosX + *(const int16 *)pointer); // TODO: this does not make sense.
+			//	radius = (radius * cameraScaleY) / (cameraDepthOffset + *(const int16 *)pointer); // TODO: this does not make sense.
 			//}
 
 			radius += 3;
@@ -1268,7 +1268,7 @@ bool Renderer::renderAnimatedModel(ModelData *modelData, const uint8 *bodyPtr, R
 			int32 coY = pointPtr->y + renderY;
 			int32 coZ = -(pointPtr->z + renderZ);
 
-			coZ += cameraPosX;
+			coZ += cameraDepthOffset;
 
 			if (coZ <= 0) {
 				coZ = 0x7FFFFFFF;
@@ -1276,7 +1276,7 @@ bool Renderer::renderAnimatedModel(ModelData *modelData, const uint8 *bodyPtr, R
 
 			// X projection
 			{
-				coX = orthoProjX + ((coX * cameraPosY) / coZ);
+				coX = orthoProjX + ((coX * cameraScaleY) / coZ);
 
 				if (coX > 0xFFFF) {
 					coX = 0x7FFF;
@@ -1295,7 +1295,7 @@ bool Renderer::renderAnimatedModel(ModelData *modelData, const uint8 *bodyPtr, R
 
 			// Y projection
 			{
-				coY = orthoProjY + ((-coY * cameraPosZ) / coZ);
+				coY = orthoProjY + ((-coY * cameraScaleZ) / coZ);
 
 				if (coY > 0xFFFF) {
 					coY = 0x7FFF;
diff --git a/engines/twine/renderer/renderer.h b/engines/twine/renderer/renderer.h
index 4164c38084..4114707d6b 100644
--- a/engines/twine/renderer/renderer.h
+++ b/engines/twine/renderer/renderer.h
@@ -334,9 +334,9 @@ private:
 	int32 baseTransPosY = 0; // setSomething2Var2
 	int32 baseTransPosZ = 0; // setSomething2Var3
 
-	int32 cameraPosX = 0; // cameraVar1
-	int32 cameraPosY = 0; // cameraVar2
-	int32 cameraPosZ = 0; // cameraVar3
+	int32 cameraDepthOffset = 0; // cameraVar1
+	int32 cameraScaleY = 0; // cameraVar2
+	int32 cameraScaleZ = 0; // cameraVar3
 
 	// ---
 
@@ -416,7 +416,7 @@ public:
 	void renderPolygons(const CmdRenderPolygon &polygon, Vertex *vertices);
 
 	int32 projectPositionOnScreen(int32 cX, int32 cY, int32 cZ);
-	void setCameraPosition(int32 x, int32 y, int32 cX, int32 cY, int32 cZ);
+	void setCameraPosition(int32 x, int32 y, int32 depthOffset, int32 scaleY, int32 scaleZ);
 	void setCameraAngle(int32 transPosX, int32 transPosY, int32 transPosZ, int32 rotPosX, int32 rotPosY, int32 rotPosZ, int32 param6);
 	void setBaseTranslation(int32 x, int32 y, int32 z);
 	void setBaseRotation(int32 x, int32 y, int32 z);


Commit: 16236c02cc356b701362dd88ba23dc2b721d2e14
    https://github.com/scummvm/scummvm/commit/16236c02cc356b701362dd88ba23dc2b721d2e14
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-26T18:55:52+01:00

Commit Message:
TWINE: added new debug command to dump files

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


diff --git a/engines/twine/debugger/console.cpp b/engines/twine/debugger/console.cpp
index 03b75efb16..0546c19f66 100644
--- a/engines/twine/debugger/console.cpp
+++ b/engines/twine/debugger/console.cpp
@@ -26,6 +26,7 @@
 #include "twine/debugger/debug_grid.h"
 #include "twine/debugger/debug_scene.h"
 #include "twine/holomap.h"
+#include "twine/resources/hqr.h"
 #include "twine/scene/gamestate.h"
 #include "twine/scene/scene.h"
 #include "twine/text.h"
@@ -42,6 +43,7 @@ TwinEConsole::TwinEConsole(TwinEEngine *engine) : _engine(engine), GUI::Debugger
 	registerCmd("play_video", WRAP_METHOD(TwinEConsole, doPlayVideo));
 	registerCmd("change_scene", WRAP_METHOD(TwinEConsole, doChangeScene));
 	registerCmd("magic_points", WRAP_METHOD(TwinEConsole, doAddMagicPoints));
+	registerCmd("dumpfile", WRAP_METHOD(TwinEConsole, doDumpFile));
 	registerCmd("list_menutext", WRAP_METHOD(TwinEConsole, doListMenuText));
 	registerCmd("toggle_debug", WRAP_METHOD(TwinEConsole, doToggleDebug));
 	registerCmd("toggle_zones", WRAP_METHOD(TwinEConsole, doToggleZoneRendering));
@@ -304,6 +306,18 @@ bool TwinEConsole::doChangeScene(int argc, const char **argv) {
 	return true;
 }
 
+bool TwinEConsole::doDumpFile(int argc, const char **argv) {
+	if (argc <= 2) {
+		debugPrintf("Expected to get a a hqr file and an index\n");
+		return true;
+	}
+	const char *hqr = argv[0];
+	const int index = atoi(argv[1]);
+	const Common::String &targetFileName = Common::String::format("dumps/%03i-%s.dump", index, hqr);
+	HQR::dumpEntry(hqr, index, targetFileName.c_str());
+	return true;
+}
+
 static const char *ItemNames[] = {
 	"Holomap",
 	"MagicBall",
diff --git a/engines/twine/debugger/console.h b/engines/twine/debugger/console.h
index 1311b9e864..7586f54cf8 100644
--- a/engines/twine/debugger/console.h
+++ b/engines/twine/debugger/console.h
@@ -56,6 +56,7 @@ private:
 	bool doSetInventoryFlag(int argc, const char **argv);
 	bool doSetHolomapFlag(int argc, const char **argv);
 	bool doAddMagicPoints(int argc, const char **argv);
+	bool doDumpFile(int argc, const char **argv);
 public:
 	TwinEConsole(TwinEEngine *engine);
 	~TwinEConsole() override;


Commit: c30e8a5b1e11f1cec8b8ce8b955c245259a1321a
    https://github.com/scummvm/scummvm/commit/c30e8a5b1e11f1cec8b8ce8b955c245259a1321a
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-26T18:55:52+01:00

Commit Message:
TWINE: reduced visibility

Changed paths:
    engines/twine/twine.h


diff --git a/engines/twine/twine.h b/engines/twine/twine.h
index 31c042def9..0aa215c40c 100644
--- a/engines/twine/twine.h
+++ b/engines/twine/twine.h
@@ -196,6 +196,14 @@ private:
 	/** recenter screen on followed actor automatically */
 	void centerScreenOnActor();
 
+	void initConfigurations();
+	/** Initialize all needed stuffs at first time running engine */
+	void initAll();
+	void initEngine();
+	void processActorSamplePosition(int32 actorIdx);
+	/** Allocate video memory, both front and back buffers */
+	void allocVideoMemory(int32 w, int32 h);
+
 	Common::String _queuedFlaMovie;
 
 public:
@@ -256,24 +264,16 @@ public:
 	int height() const;
 	Common::Rect rect() const;
 
-	/** Initialize LBA engine */
-	void initEngine();
 	void initMCGA();
 	void initSVGA();
 
 	void queueMovie(const char *filename);
 
-	void initConfigurations();
-	/** Initialize all needed stuffs at first time running engine */
-	void initAll();
-	void processActorSamplePosition(int32 actorIdx);
 	/**
 	 * Game engine main loop
 	 * @return true if we want to show credit sequence
 	 */
 	int32 runGameEngine();
-	/** Allocate video memory, both front and back buffers */
-	void allocVideoMemory(int32 w, int32 h);
 	/**
 	 * @return A random value between [0-max)
 	 */


Commit: 0f4406e8ee30a54f6125939782f8e0390e7811a8
    https://github.com/scummvm/scummvm/commit/0f4406e8ee30a54f6125939782f8e0390e7811a8
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-26T18:55:52+01:00

Commit Message:
TWINE: replaced magic number

Changed paths:
    engines/twine/scene/actor.cpp
    engines/twine/scene/animations.cpp
    engines/twine/scene/collision.cpp
    engines/twine/scene/movements.cpp
    engines/twine/scene/scene.cpp
    engines/twine/script/script_life_v1.cpp
    engines/twine/script/script_move_v1.cpp


diff --git a/engines/twine/scene/actor.cpp b/engines/twine/scene/actor.cpp
index 67b0f29832..fb16abb826 100644
--- a/engines/twine/scene/actor.cpp
+++ b/engines/twine/scene/actor.cpp
@@ -146,7 +146,7 @@ void Actor::setBehaviour(HeroBehaviourType behaviour) {
 	sceneHero->anim = AnimationTypes::kAnimNone;
 	sceneHero->animType = 0;
 
-	_engine->_animations->initAnim(AnimationTypes::kStanding, 0, AnimationTypes::kAnimInvalid, 0);
+	_engine->_animations->initAnim(AnimationTypes::kStanding, kAnimationTypeLoop, AnimationTypes::kAnimInvalid, 0);
 }
 
 void Actor::initSpriteActor(int32 actorIdx) {
@@ -336,7 +336,7 @@ void Actor::initActor(int16 actorIdx) {
 		actor->animType = 0;
 
 		if (actor->entity != -1) {
-			_engine->_animations->initAnim(actor->anim, 0, AnimationTypes::kAnimInvalid, actorIdx);
+			_engine->_animations->initAnim(actor->anim, kAnimationTypeLoop, AnimationTypes::kAnimInvalid, actorIdx);
 		}
 
 		_engine->_movements->setActorAngleSafe(actor->angle, actor->angle, ANGLE_0, &actor->move);
diff --git a/engines/twine/scene/animations.cpp b/engines/twine/scene/animations.cpp
index 64a908b482..f673f5b761 100644
--- a/engines/twine/scene/animations.cpp
+++ b/engines/twine/scene/animations.cpp
@@ -829,7 +829,7 @@ void Animations::processActorAnimations(int32 actorIdx) { // DoAnim
 							_engine->_scene->heroYBeforeFall = _engine->_movements->processActorY;
 						}
 
-						initAnim(AnimationTypes::kFall, 0, AnimationTypes::kAnimInvalid, actorIdx);
+						initAnim(AnimationTypes::kFall, kAnimationTypeLoop, AnimationTypes::kAnimInvalid, actorIdx);
 					}
 				}
 			}
diff --git a/engines/twine/scene/collision.cpp b/engines/twine/scene/collision.cpp
index bc9c221d73..f7d67ffa0a 100644
--- a/engines/twine/scene/collision.cpp
+++ b/engines/twine/scene/collision.cpp
@@ -457,7 +457,7 @@ void Collision::stopFalling() { // ReceptionObj()
 		} else if (fall > 10) {
 			_engine->_animations->initAnim(AnimationTypes::kLanding, 2, AnimationTypes::kStanding, _engine->_animations->currentlyProcessedActorIdx);
 		} else {
-			_engine->_animations->initAnim(AnimationTypes::kStanding, 0, AnimationTypes::kStanding, _engine->_animations->currentlyProcessedActorIdx);
+			_engine->_animations->initAnim(AnimationTypes::kStanding, kAnimationTypeLoop, AnimationTypes::kStanding, _engine->_animations->currentlyProcessedActorIdx);
 		}
 
 		_engine->_scene->heroYBeforeFall = 0;
diff --git a/engines/twine/scene/movements.cpp b/engines/twine/scene/movements.cpp
index 7a7155acd8..8068d50762 100644
--- a/engines/twine/scene/movements.cpp
+++ b/engines/twine/scene/movements.cpp
@@ -258,7 +258,7 @@ bool Movements::processBehaviourExecution(int actorIdx) {
 		}
 		break;
 	case HeroBehaviourType::kDiscrete:
-		_engine->_animations->initAnim(AnimationTypes::kHide, 0, AnimationTypes::kAnimInvalid, actorIdx);
+		_engine->_animations->initAnim(AnimationTypes::kHide, kAnimationTypeLoop, AnimationTypes::kAnimInvalid, actorIdx);
 		break;
 	case HeroBehaviourType::kProtoPack:
 		break;
@@ -302,7 +302,7 @@ void Movements::processMovementExecution(int actorIdx) {
 		// if walking should get stopped
 		if (!_engine->_input->isActionActive(TwinEActionType::MoveForward) && !_engine->_input->isActionActive(TwinEActionType::MoveBackward)) {
 			if (heroMoved && (heroActionKey != previousLoopActionKey || changedCursorKeys != previousChangedCursorKeys)) {
-				_engine->_animations->initAnim(AnimationTypes::kStanding, 0, AnimationTypes::kAnimInvalid, actorIdx);
+				_engine->_animations->initAnim(AnimationTypes::kStanding, kAnimationTypeLoop, AnimationTypes::kAnimInvalid, actorIdx);
 			}
 		}
 
@@ -310,17 +310,17 @@ void Movements::processMovementExecution(int actorIdx) {
 
 		if (_engine->_input->isActionActive(TwinEActionType::MoveForward)) {
 			if (!_engine->_scene->currentActorInZone) {
-				_engine->_animations->initAnim(AnimationTypes::kForward, 0, AnimationTypes::kAnimInvalid, actorIdx);
+				_engine->_animations->initAnim(AnimationTypes::kForward, kAnimationTypeLoop, AnimationTypes::kAnimInvalid, actorIdx);
 			}
 			heroMoved = true;
 		} else if (_engine->_input->isActionActive(TwinEActionType::MoveBackward)) {
-			_engine->_animations->initAnim(AnimationTypes::kBackward, 0, AnimationTypes::kAnimInvalid, actorIdx);
+			_engine->_animations->initAnim(AnimationTypes::kBackward, kAnimationTypeLoop, AnimationTypes::kAnimInvalid, actorIdx);
 			heroMoved = true;
 		}
 
 		if (_engine->_input->isActionActive(TwinEActionType::TurnLeft)) {
 			if (actor->anim == AnimationTypes::kStanding) {
-				_engine->_animations->initAnim(AnimationTypes::kTurnLeft, 0, AnimationTypes::kAnimInvalid, actorIdx);
+				_engine->_animations->initAnim(AnimationTypes::kTurnLeft, kAnimationTypeLoop, AnimationTypes::kAnimInvalid, actorIdx);
 			} else {
 				if (!actor->dynamicFlags.bIsRotationByAnim) {
 					actor->angle = actor->move.getRealAngle(_engine->lbaTime);
@@ -329,7 +329,7 @@ void Movements::processMovementExecution(int actorIdx) {
 			heroMoved = true;
 		} else if (_engine->_input->isActionActive(TwinEActionType::TurnRight)) {
 			if (actor->anim == AnimationTypes::kStanding) {
-				_engine->_animations->initAnim(AnimationTypes::kTurnRight, 0, AnimationTypes::kAnimInvalid, actorIdx);
+				_engine->_animations->initAnim(AnimationTypes::kTurnRight, kAnimationTypeLoop, AnimationTypes::kAnimInvalid, actorIdx);
 			} else {
 				if (!actor->dynamicFlags.bIsRotationByAnim) {
 					actor->angle = actor->move.getRealAngle(_engine->lbaTime);
@@ -399,11 +399,11 @@ void Movements::processRandomAction(int actorIdx) {
 	if (actor->brickCausesDamage()) {
 		moveActor(actor->angle, ClampAngle((_engine->getRandomNumber() & ANGLE_90) + (actor->angle - ANGLE_90)), actor->speed, &actor->move);
 		actor->delayInMillis = _engine->getRandomNumber(300) + _engine->lbaTime + 300;
-		_engine->_animations->initAnim(AnimationTypes::kStanding, 0, AnimationTypes::kAnimInvalid, actorIdx);
+		_engine->_animations->initAnim(AnimationTypes::kStanding, kAnimationTypeLoop, AnimationTypes::kAnimInvalid, actorIdx);
 	}
 
 	if (!actor->move.numOfStep) {
-		_engine->_animations->initAnim(AnimationTypes::kForward, 0, AnimationTypes::kAnimInvalid, actorIdx);
+		_engine->_animations->initAnim(AnimationTypes::kForward, kAnimationTypeLoop, AnimationTypes::kAnimInvalid, actorIdx);
 		if (_engine->lbaTime > actor->delayInMillis) {
 			moveActor(actor->angle, ClampAngle((_engine->getRandomNumber() & ANGLE_90) + (actor->angle - ANGLE_90)), actor->speed, &actor->move);
 			actor->delayInMillis = _engine->getRandomNumber(300) + _engine->lbaTime + 300;
diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index 60fdedbee2..2195da4e72 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -547,7 +547,7 @@ void Scene::processActorZones(int32 actorIdx) {
 							if (actor->y >= ABS(zone->bottomLeft.y + zone->topRight.y) / 2) {
 								_engine->_animations->initAnim(AnimationTypes::kTopLadder, 2, AnimationTypes::kStanding, actorIdx); // reached end of ladder
 							} else {
-								_engine->_animations->initAnim(AnimationTypes::kClimbLadder, 0, AnimationTypes::kAnimInvalid, actorIdx); // go up in ladder
+								_engine->_animations->initAnim(AnimationTypes::kClimbLadder, kAnimationTypeLoop, AnimationTypes::kAnimInvalid, actorIdx); // go up in ladder
 							}
 						}
 					}
diff --git a/engines/twine/script/script_life_v1.cpp b/engines/twine/script/script_life_v1.cpp
index d63c890cd9..68a11a0a0c 100644
--- a/engines/twine/script/script_life_v1.cpp
+++ b/engines/twine/script/script_life_v1.cpp
@@ -585,7 +585,7 @@ static int32 lBODY_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
  */
 static int32 lANIM(TwinEEngine *engine, LifeScriptContext &ctx) {
 	AnimationTypes animIdx = (AnimationTypes)ctx.stream.readByte();
-	engine->_animations->initAnim(animIdx, 0, AnimationTypes::kStanding, ctx.actorIdx);
+	engine->_animations->initAnim(animIdx, kAnimationTypeLoop, AnimationTypes::kStanding, ctx.actorIdx);
 	return 0;
 }
 
@@ -596,7 +596,7 @@ static int32 lANIM(TwinEEngine *engine, LifeScriptContext &ctx) {
 static int32 lANIM_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
 	int32 otherActorIdx = ctx.stream.readByte();
 	AnimationTypes otherAnimIdx = (AnimationTypes)ctx.stream.readByte();
-	engine->_animations->initAnim(otherAnimIdx, 0, AnimationTypes::kStanding, otherActorIdx);
+	engine->_animations->initAnim(otherAnimIdx, kAnimationTypeLoop, AnimationTypes::kStanding, otherActorIdx);
 	return 0;
 }
 
@@ -727,7 +727,7 @@ static int32 lCAM_FOLLOW(TwinEEngine *engine, LifeScriptContext &ctx) {
 static int32 lSET_BEHAVIOUR(TwinEEngine *engine, LifeScriptContext &ctx) {
 	const HeroBehaviourType behavior = (HeroBehaviourType)ctx.stream.readByte();
 
-	engine->_animations->initAnim(AnimationTypes::kStanding, 0, AnimationTypes::kAnimInvalid, 0);
+	engine->_animations->initAnim(AnimationTypes::kStanding, kAnimationTypeLoop, AnimationTypes::kAnimInvalid, 0);
 	engine->_actor->setBehaviour(behavior);
 
 	return 0;
@@ -1630,7 +1630,7 @@ static int32 lANIM_SET(TwinEEngine *engine, LifeScriptContext &ctx) {
 
 	ctx.actor->anim = AnimationTypes::kAnimNone;
 	ctx.actor->previousAnimIdx = -1;
-	engine->_animations->initAnim(animIdx, 0, AnimationTypes::kStanding, ctx.actorIdx);
+	engine->_animations->initAnim(animIdx, kAnimationTypeLoop, AnimationTypes::kStanding, ctx.actorIdx);
 
 	return 0;
 }
diff --git a/engines/twine/script/script_move_v1.cpp b/engines/twine/script/script_move_v1.cpp
index 2a242336f8..adc02cf6c3 100644
--- a/engines/twine/script/script_move_v1.cpp
+++ b/engines/twine/script/script_move_v1.cpp
@@ -102,7 +102,7 @@ static int32 mBODY(TwinEEngine *engine, MoveScriptContext &ctx) {
  */
 static int32 mANIM(TwinEEngine *engine, MoveScriptContext &ctx) {
 	AnimationTypes animIdx = (AnimationTypes)ctx.stream.readByte();
-	if (engine->_animations->initAnim(animIdx, 0, AnimationTypes::kStanding, ctx.actorIdx)) {
+	if (engine->_animations->initAnim(animIdx, kAnimationTypeLoop, AnimationTypes::kStanding, ctx.actorIdx)) {
 		return 0;
 	}
 	ctx.undo(1);


Commit: 09341ff55aa732f4265b97cf7385472d6ad0bfca
    https://github.com/scummvm/scummvm/commit/09341ff55aa732f4265b97cf7385472d6ad0bfca
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-26T18:55:52+01:00

Commit Message:
TWINE: allow to execute a debug command file via debugger instance

Changed paths:
    engines/twine/debugger/console.h


diff --git a/engines/twine/debugger/console.h b/engines/twine/debugger/console.h
index 7586f54cf8..7b9e9f7672 100644
--- a/engines/twine/debugger/console.h
+++ b/engines/twine/debugger/console.h
@@ -61,6 +61,10 @@ public:
 	TwinEConsole(TwinEEngine *engine);
 	~TwinEConsole() override;
 
+	bool exec(const char *file) {
+		const char *argv[] = {"", file};
+		return cmdExecFile(2, argv);
+	}
 };
 
 } // End of namespace TwinE


Commit: f08b7cd376c6525a6575f131381c19145caab455
    https://github.com/scummvm/scummvm/commit/f08b7cd376c6525a6575f131381c19145caab455
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-26T18:55:52+01:00

Commit Message:
TWINE: allow to faster entering the game

Changed paths:
    engines/twine/twine.cpp


diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index 7ef8c74f26..fc08c4337c 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -278,7 +278,19 @@ Common::Error TwinEEngine::run() {
 			_state = EngineState::Menu;
 			break;
 		case EngineState::Menu:
+		#if 0
+			// this will enter the game and execute the commands in the file "debug"
+			_gameState->initEngineVars();
+			_text->textClipSmall();
+			_text->drawTextBoxBackground = true;
+			_text->renderTextTriangle = false;
+			if (!((TwinEConsole*)getDebugger())->exec("debug")) {
+				debug("Failed to execute debug file before entering the scene");
+			}
+			gameEngineLoop();
+		#else
 			_state = _menu->run();
+		#endif
 			break;
 		}
 	}




More information about the Scummvm-git-logs mailing list