[Scummvm-git-logs] scummvm master -> 3c03b4bfc2d31744b43b318ab78623a78d5a2129

sev- sev at scummvm.org
Mon May 4 16:00:31 UTC 2020


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

Summary:
159186c353 DRAGONS: Init class variables
de5367bd7a DRAGONS: More class initializations
64da850234 DRAGONS: Init variables in minigame4
8663b76ab9 DRAGONS: Fix Acror class initialization
ae6d2ed689 DRAGONS: Init Credits class
0e0870632a DRAGONS: Init minigame2
0b2e2af350 DRAGONS: Init cursors
5e73d8d1af DRAGONS: Add constructor to scneneUpdater
163bfdd9ae DRAGONS: Init Talk class
d3cd15e48b DRAGONS: Refactored CutScene::changeBackgroundPosition()
0c221d479b DRAGONS: Fixed assert
ed05c3b760 DRAGONS: Fixed potential division by zero
1387a13922 DRAGONS: Added assert to potentially problematic place
436670ed4f DRAGONS: Untangled hyper-mess in cutscene.cpp
3c03b4bfc2 DRAGONS: Untangled minor mess in cutscenes too for consistency


Commit: 159186c353587c3f688c6f4e8259b1c3ac159ebc
    https://github.com/scummvm/scummvm/commit/159186c353587c3f688c6f4e8259b1c3ac159ebc
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T15:53:58+02:00

Commit Message:
DRAGONS: Init class variables

Changed paths:
    engines/dragons/dragons.cpp


diff --git a/engines/dragons/dragons.cpp b/engines/dragons/dragons.cpp
index b442de352d..e96ebb59b1 100644
--- a/engines/dragons/dragons.cpp
+++ b/engines/dragons/dragons.cpp
@@ -77,6 +77,19 @@ DragonsEngine::DragonsEngine(OSystem *syst, const ADGameDescription *desc) : Eng
 	_sceneUpdateFunction = nullptr;
 	_vsyncUpdateFunction = nullptr;
 
+	_dragonOBD = nullptr;
+	_dragonImg = nullptr;
+	_actorManager = nullptr;
+	_dragonINIResource = nullptr;
+	_scene = nullptr;
+	_sound = nullptr;
+	_isLoadingDialogAudio = false;
+	_sceneId1 = 0;
+	_dragonFLG = nullptr;
+	_dragonVAR = nullptr;
+	_flickerIdleCounter = 0;
+	_loadingScreenState = nullptr;
+
 	_leftMouseButtonUp = false;
 	_leftMouseButtonDown = false;
 	_rightMouseButtonUp = false;


Commit: de5367bd7a7e5b8b071f11120223fe4497d8a8e6
    https://github.com/scummvm/scummvm/commit/de5367bd7a7e5b8b071f11120223fe4497d8a8e6
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T15:57:21+02:00

Commit Message:
DRAGONS: More class initializations

Changed paths:
    engines/dragons/background.cpp
    engines/dragons/scene.cpp


diff --git a/engines/dragons/background.cpp b/engines/dragons/background.cpp
index 368a9d8def..9d4d5476ee 100644
--- a/engines/dragons/background.cpp
+++ b/engines/dragons/background.cpp
@@ -94,6 +94,8 @@ Background::Background() : _priorityLayer(0), _points2(0), _data(0) {
 	_layerAlphaMode[0] = NORMAL;
 	_layerAlphaMode[1] = NORMAL;
 	_layerAlphaMode[2] = NORMAL;
+
+	_tileDataOffset = nullptr;
 }
 
 Background::~Background() {
diff --git a/engines/dragons/scene.cpp b/engines/dragons/scene.cpp
index c34fa5b940..18027040e9 100644
--- a/engines/dragons/scene.cpp
+++ b/engines/dragons/scene.cpp
@@ -40,6 +40,8 @@ Scene::Scene(DragonsEngine *vm, Screen *screen, ScriptOpcodes *scriptOpcodes, Ac
 		: _vm(vm), _screen(screen), _scriptOpcodes(scriptOpcodes), _stage(0), _actorManager(actorManager), _dragonRMS(dragonRMS), _dragonINIResource(dragonINIResource), _backgroundLoader(backgroundResourceLoader) {
 	_mapTransitionEffectSceneID = 2;
 	_data_800633ee = 0;
+
+	_currentSceneId = -1;
 }
 void Scene::loadScene(uint32 sceneId, uint32 cameraPointId) {
 	if (!_vm->isFlagSet(ENGINE_FLAG_40)) {


Commit: 64da8502342b989860742633f224d0d778dcc339
    https://github.com/scummvm/scummvm/commit/64da8502342b989860742633f224d0d778dcc339
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T15:59:15+02:00

Commit Message:
DRAGONS: Init variables in minigame4

Changed paths:
    engines/dragons/minigame4.cpp


diff --git a/engines/dragons/minigame4.cpp b/engines/dragons/minigame4.cpp
index 42d9c13511..3bb0d305e3 100644
--- a/engines/dragons/minigame4.cpp
+++ b/engines/dragons/minigame4.cpp
@@ -32,7 +32,14 @@ namespace Dragons {
 
 static void videoUpdaterFunction();
 
-Minigame4::Minigame4(DragonsEngine *vm) : _vm(vm) {}
+Minigame4::Minigame4(DragonsEngine *vm) : _vm(vm) {
+	_flickerActor = nullptr;
+	_bruteActor = nullptr;
+	_ps1ControllerActor = nullptr;
+	_dat_80090438 = nullptr;
+	_dat_8009043c = nullptr;
+	_layer2XOffset = 0;
+}
 
 void Minigame4::run() {
 	uint16 uVar1;


Commit: 8663b76ab945967898dc2e9c5b8a5ba1eff99009
    https://github.com/scummvm/scummvm/commit/8663b76ab945967898dc2e9c5b8a5ba1eff99009
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T16:11:48+02:00

Commit Message:
DRAGONS: Fix Acror class initialization

Changed paths:
    engines/dragons/actor.cpp


diff --git a/engines/dragons/actor.cpp b/engines/dragons/actor.cpp
index 42889802d5..62100ba24c 100644
--- a/engines/dragons/actor.cpp
+++ b/engines/dragons/actor.cpp
@@ -146,6 +146,21 @@ Actor::Actor(uint16 id) : _actorID(id) {
 	_frame_flags = 0;
 	_frame = nullptr;
 	_surface = nullptr;
+
+	_actorFileDictionaryIndex = 0;
+	_sequenceTimerMaxValue = 0;
+	_scale = 0x100;
+	_sequenceTimer = 0;
+	_sequenceID = 0;
+	_direction = 0;
+	_xShl16 = 0;
+	_yShl16 = 0;
+	_walkSlopeX = 0;
+	_walkSlopeY = 0;
+	_walkPointsIndex = 0;
+	_finalWalkDestX = 0;
+	_finalWalkDestY = 0;
+	_field_7a = 0;
 }
 
 void Actor::init(ActorResource *resource, int16 x, int16 y, uint32 sequenceID) {


Commit: ae6d2ed6895db9cf65966bf8aa7f58d0d45290bc
    https://github.com/scummvm/scummvm/commit/ae6d2ed6895db9cf65966bf8aa7f58d0d45290bc
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T16:12:49+02:00

Commit Message:
DRAGONS: Init Credits class

Changed paths:
    engines/dragons/credits.cpp


diff --git a/engines/dragons/credits.cpp b/engines/dragons/credits.cpp
index 79048a46ce..54e4c7eefb 100644
--- a/engines/dragons/credits.cpp
+++ b/engines/dragons/credits.cpp
@@ -39,6 +39,10 @@ Credits::Credits(DragonsEngine *vm, FontManager *fontManager, BigfileArchive *bi
 	_updateCounter = 0;
 	_yOffset = 0;
 	_linesRemaining = 0x1a;
+
+	_creditsData = nullptr;
+	_dataLength = 0;
+	_curPosition = 0;
 }
 
 void Credits::start() {


Commit: 0e0870632a258b5d584503e526b8133055d65b5c
    https://github.com/scummvm/scummvm/commit/0e0870632a258b5d584503e526b8133055d65b5c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T16:15:59+02:00

Commit Message:
DRAGONS: Init minigame2

Changed paths:
    engines/dragons/minigame2.cpp


diff --git a/engines/dragons/minigame2.cpp b/engines/dragons/minigame2.cpp
index 8c6fcf1289..53c91cc6e6 100644
--- a/engines/dragons/minigame2.cpp
+++ b/engines/dragons/minigame2.cpp
@@ -34,7 +34,22 @@
 
 namespace Dragons {
 
-Minigame2::Minigame2(DragonsEngine *vm) : _vm(vm), _dat_80093c70(false), _dat_80093c72(false), _dat_80093c74(0), _dat_80093ca8(false) {}
+Minigame2::Minigame2(DragonsEngine *vm) : _vm(vm), _dat_80093c70(false), _dat_80093c72(false), _dat_80093c74(0), _dat_80093ca8(false) {
+	_dat_80093cb4 = 0;
+	_dat_80093cbc = 0;
+	_dat_80093cb8 = 0;
+	_dat_80093cc0 = 0;
+	_dat_80093ca4 = 0;
+	_dat_80093c90 = 0;
+	_dat_80093c94 = 0;
+	_dat_80093cac = 0;
+	_dat_80093cb0 = false;
+	_dat_80093c9c = 0;
+	_dat_80093c98 = 0;
+	_dat_80093ca0 = 0;
+	_dat_80093cc4 = 0;
+	_dat_80093cc8 = 0;
+}
 
 static const uint16 unkArray[5] = {
 	0xC, 0xA, 0x8, 0x6, 0x4


Commit: 0b2e2af3508a43856a7997e667ca80b1eb40ef1e
    https://github.com/scummvm/scummvm/commit/0b2e2af3508a43856a7997e667ca80b1eb40ef1e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T16:33:25+02:00

Commit Message:
DRAGONS: Init cursors

Changed paths:
    engines/dragons/cursor.cpp


diff --git a/engines/dragons/cursor.cpp b/engines/dragons/cursor.cpp
index 76a4c51a6c..10ae008340 100644
--- a/engines/dragons/cursor.cpp
+++ b/engines/dragons/cursor.cpp
@@ -35,6 +35,12 @@ namespace Dragons {
 
 Cursor::Cursor(DragonsEngine *vm): _vm(vm), _actor(0), _x(0), _y(0) {
 	_sequenceID = 0;
+	_data_800728b0_cursor_seqID = 0;
+	_iniUnderCursor = 0;
+	_performActionTargetINI = 0;
+	_objectInHandSequenceID = 0;
+	_cursorActivationSeqOffset = 0;
+	_iniItemInHand = 0;
 }
 
 void Cursor::init(ActorManager *actorManager, DragonINIResource *dragonINIResource) {


Commit: 5e73d8d1af9bc286c0c019e1a033b6a5b042f1f6
    https://github.com/scummvm/scummvm/commit/5e73d8d1af9bc286c0c019e1a033b6a5b042f1f6
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T16:39:21+02:00

Commit Message:
DRAGONS: Add constructor to scneneUpdater

Changed paths:
    engines/dragons/specialopcodes.h


diff --git a/engines/dragons/specialopcodes.h b/engines/dragons/specialopcodes.h
index 6784ce0cb1..a195e46494 100644
--- a/engines/dragons/specialopcodes.h
+++ b/engines/dragons/specialopcodes.h
@@ -41,7 +41,7 @@ public:
 	~SpecialOpcodes();
 	void run(int16 opcode);
 
-	struct {
+	struct SceneUpdater {
 		void *tbl;
 		uint16 counter;
 		int16 iniID;
@@ -54,6 +54,21 @@ public:
 		uint16 iniIDTbl[8][5];
 		uint16 sequenceIDTbl[8][5];
 		uint32 textTbl[8][5];
+
+		SceneUpdater() {
+			tbl = nullptr;
+			iniID = sequenceID = 0;
+			curSequence = curSequenceIndex = numTotalSequences = sequenceDuration = 0;
+
+			for (uint i = 0; i < 8; i++) {
+				numSteps[i] = 0;
+				for (int j = 0; j < 5; j++) {
+					iniIDTbl[i][j] = 0;
+					sequenceIDTbl[i][j] = 0;
+					textTbl[i][j] = 0;
+				}
+			}
+		}
 	} sceneUpdater;
 
 protected:


Commit: 163bfdd9ae99ada4e0289ac15a05c5e138c80d6d
    https://github.com/scummvm/scummvm/commit/163bfdd9ae99ada4e0289ac15a05c5e138c80d6d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T16:40:47+02:00

Commit Message:
DRAGONS: Init Talk class

Changed paths:
    engines/dragons/talk.cpp


diff --git a/engines/dragons/talk.cpp b/engines/dragons/talk.cpp
index a52f7a535a..d216d8b432 100644
--- a/engines/dragons/talk.cpp
+++ b/engines/dragons/talk.cpp
@@ -40,6 +40,12 @@ namespace Dragons {
 Talk::Talk(DragonsEngine *vm, BigfileArchive *bigfileArchive): _vm(vm), _bigfileArchive(bigfileArchive) {
 	_dat_800726ec_tfont_field0 = 1; //TODO source from font file
 	_dat_800726f0_tfont_field2 = 1; // TODO source from font file
+
+	_dat_8008e7e8_dialogBox_x1 = 0;
+	_dat_8008e844_dialogBox_y1 = 0;
+	_dat_8008e848_dialogBox_x2 = 0;
+	_dat_8008e874_dialogBox_y2 = 0;
+	_dat_800633f8_talkDialogFlag = 0;
 }
 
 void Talk::init() {


Commit: d3cd15e48b509ff5ef1ddf6d01e0afca4b590155
    https://github.com/scummvm/scummvm/commit/d3cd15e48b509ff5ef1ddf6d01e0afca4b590155
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T17:25:04+02:00

Commit Message:
DRAGONS: Refactored CutScene::changeBackgroundPosition()

Changed paths:
    engines/dragons/cutscene.cpp


diff --git a/engines/dragons/cutscene.cpp b/engines/dragons/cutscene.cpp
index fded3729fd..78fc4d918a 100644
--- a/engines/dragons/cutscene.cpp
+++ b/engines/dragons/cutscene.cpp
@@ -438,7 +438,16 @@ void CutScene::cursorInventoryClearFlag400() {
 }
 
 void CutScene::changeBackgroundPosition(uint16 newPosition, int16 sParm2) {
-	if (newPosition == 1) {
+	switch (newPosition) {
+	case 0:
+		_vm->_screen->loadPalette(0, _palettes + 0 * 512);
+		_vm->_scene->setMgLayerPriority(0);
+		_vm->_scene->setFgLayerPriority(0);
+		_vm->_scene->_camera.x = 0;
+		_vm->_scene->setBgLayerPriority(1);
+		break;
+
+	case 1:
 		_vm->_scene->setBgLayerPriority(0); //TODO investigate why this is 0 not 1
 		_vm->_scene->setMgLayerPriority(1); //TODO investigate why this is 1 not 2
 		_vm->_scene->_camera.x = sParm2 + 0x3c0;
@@ -448,32 +457,26 @@ void CutScene::changeBackgroundPosition(uint16 newPosition, int16 sParm2) {
 			Actor *actor = _vm->_actorManager->getActor(i);
 			actor->_x_pos += 0x3c0;
 		}
-	} else {
-		if (newPosition < 2) {
-			if (newPosition != 0) {
-				return;
-			}
-			_vm->_screen->loadPalette(0, _palettes + 0 * 512);
-			_vm->_scene->setMgLayerPriority(0);
-			_vm->_scene->setFgLayerPriority(0);
-			_vm->_scene->_camera.x = 0;
-		} else {
-			if (newPosition == 2) {
-				_vm->_screen->loadPalette(0, _palettes + 3 * 512);
-				_vm->_scene->setMgLayerPriority(2);
-				_vm->_scene->setFgLayerPriority(3);
-				_vm->_scene->_camera.x = 0;
-			} else {
-				if (newPosition != 3) {
-					return;
-				}
-				_vm->_screen->loadPalette(0, _palettes + 1 * 512);
-				_vm->_scene->setMgLayerPriority(2);
-				_vm->_scene->setFgLayerPriority(0);
-				_vm->_scene->_camera.x = sParm2;
-			}
-		}
+		break;
+
+	case 2:
+		_vm->_screen->loadPalette(0, _palettes + 3 * 512);
+		_vm->_scene->setMgLayerPriority(2);
+		_vm->_scene->setFgLayerPriority(3);
+		_vm->_scene->_camera.x = 0;
 		_vm->_scene->setBgLayerPriority(1);
+		break;
+
+	case 3:
+		_vm->_screen->loadPalette(0, _palettes + 1 * 512);
+		_vm->_scene->setMgLayerPriority(2);
+		_vm->_scene->setFgLayerPriority(0);
+		_vm->_scene->_camera.x = sParm2;
+		_vm->_scene->setBgLayerPriority(1);
+		break;
+
+	default:
+		break;
 	}
 }
 


Commit: 0c221d479b14d60ab422500895885689ba60fa9a
    https://github.com/scummvm/scummvm/commit/0c221d479b14d60ab422500895885689ba60fa9a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T17:28:39+02:00

Commit Message:
DRAGONS: Fixed assert

Changed paths:
    engines/dragons/background.cpp


diff --git a/engines/dragons/background.cpp b/engines/dragons/background.cpp
index 9d4d5476ee..3da2e5264f 100644
--- a/engines/dragons/background.cpp
+++ b/engines/dragons/background.cpp
@@ -396,7 +396,7 @@ uint16 ScaleLayer::getScale(uint16 y) {
 			if (local_v0_368 != 0) {
 				iVar3 = ((uVar5 & 0xffffu) - (uVar7 & 0xffffu)) * (uint)(uint16)(y - pSVar6->_y);
 
-				assert(((uint)(uint16)local_v0_368 != 0xffffffff) || (iVar3 != -0x80000000));
+				assert(((uint16)local_v0_368 != 0xffffu) || (iVar3 != -0x80000000));
 
 				return uVar7 + iVar3 / (int)(uint)(uint16)local_v0_368 & 0xffff;
 			}


Commit: ed05c3b76037251e6ed2a15117a364a70d916276
    https://github.com/scummvm/scummvm/commit/ed05c3b76037251e6ed2a15117a364a70d916276
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T17:30:48+02:00

Commit Message:
DRAGONS: Fixed potential division by zero

Changed paths:
    engines/dragons/scriptopcodes.cpp


diff --git a/engines/dragons/scriptopcodes.cpp b/engines/dragons/scriptopcodes.cpp
index 3451d1da31..4c11a026ac 100644
--- a/engines/dragons/scriptopcodes.cpp
+++ b/engines/dragons/scriptopcodes.cpp
@@ -1051,7 +1051,7 @@ void ScriptOpcodes::setVariable(ScriptOpCall &scriptOpCall) {
 					s2 -= s1;
 				} else {
 					if (fieldB == 3) {
-						s2 = _vm->getRand(s1);
+						s2 = _vm->getRand(MAX<int16>(1, s1));
 					}
 				}
 			}


Commit: 1387a13922a717c4b20ef3a8e99dddbd1c27c91d
    https://github.com/scummvm/scummvm/commit/1387a13922a717c4b20ef3a8e99dddbd1c27c91d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T17:32:55+02:00

Commit Message:
DRAGONS: Added assert to potentially problematic place

Changed paths:
    engines/dragons/talk.cpp


diff --git a/engines/dragons/talk.cpp b/engines/dragons/talk.cpp
index d216d8b432..889d7eeccb 100644
--- a/engines/dragons/talk.cpp
+++ b/engines/dragons/talk.cpp
@@ -716,6 +716,7 @@ TalkDialogEntry *Talk::displayTalkDialogMenu(Common::Array<TalkDialogEntry*> dia
 			uVar3 = (uint)x;
 		} while (x < numEntries);
 	}
+	assert(talkDialogEntry); // It could be zero if hasDialogEntries == 0. What to do then?
 	_vm->_cursor->updateActorPosition(0xf, (((uint16)talkDialogEntry->xPosMaybe + 0x18) - local_58) * 8 + 5);
 
 	if (!_vm->isFlagSet(ENGINE_FLAG_8)) {


Commit: 436670ed4fe3bbafa27e7558096b1d54971a087f
    https://github.com/scummvm/scummvm/commit/436670ed4fe3bbafa27e7558096b1d54971a087f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T17:50:40+02:00

Commit Message:
DRAGONS: Untangled hyper-mess in cutscene.cpp

Changed paths:
    engines/dragons/cutscene.cpp


diff --git a/engines/dragons/cutscene.cpp b/engines/dragons/cutscene.cpp
index 78fc4d918a..f993f79bad 100644
--- a/engines/dragons/cutscene.cpp
+++ b/engines/dragons/cutscene.cpp
@@ -72,238 +72,290 @@ void CutScene::scene1() {
 	_vm->waitForFrames(0x5a);
 	closeUpShotOnActor(0xd3, 0, 0x233, 0x17a); //close up on king
 	//playSoundFromTxtIndex(0x4e26);
-	if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 4, 0, 0x4e26, 0x2e01) != 2) {
+
+	while (1) {	// In order to avoid gotos
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 4, 0, 0x4e26, 0x2e01) == 2)
+			break;
+
 		fadeScreenAndResetActor(_actor_80072de8);
 		closeUpShotOnActor(0xd8, 0, 0xfd, 0x60); // cut to flicker
 		//playSoundFromTxtIndex(0x4ea2);
-		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 2, 0, 0x4ea2, 0x701) != 2) {
-			fadeScreenAndResetActor(_actor_80072de8);
-			closeUpShotOnActor(0xd3, 0, 0x233, 0x17a); //close up on king
-			//playSoundFromTxtIndex(0x4eec);
-			if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 5, 0, 0x4eec, 0x2e01) != 2) {
-				fadeScreenAndResetActor(_actor_80072de8);
-				wideAngleEveryoneAtTable();  // shot of whole room
-				if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 4, 0, 0x5000, 0x2e01) != 2 &&
-					_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_800830c0, 0x1d, 0x1c, 0x5074, 0x501) != 2 &&
-					_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072df0, 9, 5, 0x511c, 0xc01) != 2 &&
-					_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_800830c0, 0x1d, 0x1c, 0x5138, 0x501) != 2) {
-					closeUpShotOnActor(0xd7, 0, 0x312, 0x260); //close up on flame
-					//playSoundFromTxtIndex(0x5152);
-					if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 2, 0, 0x5152, 0x3e01) != 2) {
-						fadeScreenAndResetActor(_actor_80072de8);
-						closeUpShotOnActor(0xd8, 0, 0xfd, 0x60); //close up flicker
-						//playSoundFromTxtIndex(0x51fc);
-						if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 3, 0, 0x51fc, 0x701) != 2) {
-							_vm->playOrStopSound(0x8004);
-							_vm->waitForFrames(0x28);
-							_vm->playOrStopSound(0x8003);
-							fadeScreenAndResetActor(_actor_80072de8);
-							_actor_80063514 = _actor_80063514 | 0x40;
-							fun_8003d8e8(0xd6, 0, 0x37a, 0x280);
-							_actor_80072dec = _vm->_actorManager->loadActor(0xd5, 0, 0x2d6, 0xc6, 3); //load humans
-							_actor_80072df0 = _vm->_actorManager->loadActor(0xd3, 2, 0x87, 199, 3);
-							_vm->waitForFramesAllowSkip(4);
-							_vm->fadeFromBlack();
-							if (fun_8003dab8(0x52d6, 0, 0, 0x701, 1) != 2) {
-								// TODO callMaybeResetData();
-								//playSoundFromTxtIndex(0x530c);
-								if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 2, 0, 0x530c, 0x3c01) != 2) {
-									while (0x10 < _vm->_scene->_camera.x) {
-										_vm->_scene->_camera.x = _vm->_scene->_camera.x + -0x10;
-										_vm->waitForFrames(1);
-									}
-									_vm->_scene->_camera.x = 0;
-									//playSoundFromTxtIndex(0x54dc);
-									if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072df0, 6, 2, 0x54dc, 0x2e01) != 2) {
-										fadeScreenAndResetActor(_actor_80072de8);
-										fadeScreenAndResetActor(_actor_80072dec);
-										fadeScreenAndResetActor(_actor_80072df0);
-										wideAngleEveryoneAtTable();
-										if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072e08, 3, 2, 0x55d4, 0xc01) != 2) {
-											closeUpShotOnActor(0xd4, 0, 0x8a, 0); //close up chancellor
-											//playSoundFromTxtIndex(0x562c);
-											if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 2, 0, 0x562c, 0xc01) != 2) {
-												fadeScreenAndResetActor(_actor_80072de8);
-												fun_8003d8e8(0xd6, 0, 0x37a, 0x280);
-												_actor_80072dec = _vm->_actorManager->loadActor(0xd5, 4, 0x2d6, 0xc6, 3);
-												_vm->waitForFramesAllowSkip(4);
-												_vm->fadeFromBlack();
-												if (fun_8003dab8(0x5780, 0x14, 0, 0xc01, 1) != 2) {
-													_actor_80063514 = _actor_80063514 | 0x40;
-													fadeScreenAndResetActor(_actor_80072de8);
-													fadeScreenAndResetActor(_actor_80072dec);
-													closeUpShotOnActor(0xd7, 0, 0x312, 0x260); // close up flame
-													//playSoundFromTxtIndex(0x581c);
-													if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 3, 0, 0x581c, 0x3e01) != 2) {
-														fadeScreenAndResetActor(_actor_80072de8);
-														closeUpShotOnActor(0xd4, 0, 0x8a, 0); //close up chancellor
-														//playSoundFromTxtIndex(0x5942);
-														if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 4, 0, 0x5942, 0xc01) != 2) {
-															fadeScreenAndResetActor(_actor_80072de8);
-															closeUpShotOnActor(0xd3, 2, 0x87, 0); // close up king
-															//playSoundFromTxtIndex(0x5aaa);
-															if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 7, 2, 0x5aaa, 0x2e01) != 2) {
-																fadeScreenAndResetActor(_actor_80072de8);
-																fun_8003d8e8(0xd6, 0, 0x37a, 0x280);
-																_actor_80072dec = _vm->_actorManager->loadActor(0xd5, 0, 0x2d6, 0xc6, 3);
-																_vm->waitForFramesAllowSkip(4);
-																_vm->fadeFromBlack();
-																//playSoundFromTxtIndex(0x5afc);
-																if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 3, 0, 0x5afc, 0x3c01) != 2) {
-																	fadeScreenAndResetActor(_actor_80072de8);
-																	fadeScreenAndResetActor(_actor_80072dec);
-																	_actor_80063514 = _actor_80063514 & 0xffbf;
-																	closeUpKnightsAtTable(); // close up of knights at table.
-																	_vm->playOrStopSound(0x8003);
-																	//playSoundFromTxtIndex(0x5b96);
-																	if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 8, 4, 0x5b96, 0xc01) != 2) {
-																		//playSoundFromTxtIndex(0x5c4a);
-																		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 2, 0, 0x5c4a, 0x2e01) != 2) {
-																			//playSoundFromTxtIndex(0x5dc8);
-																			_actor_80072df0->updateSequence(0xf);
-																			_actor_80072df4->updateSequence(0xd);
-																			_actor_80072df8->updateSequence(0xe);
-																			if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 0xc, 4, 0x5dc8, 0xc01) != 2) {
-																				_actor_80072df0->updateSequence(6);
-																				_actor_80072df4->updateSequence(0);
-																				_actor_80072df8->updateSequence(2);
-																				fun_8003d8e8(0xd3, 2, 0x28d, 0x250);
-																				_actor_80072dec = _vm->_actorManager->loadActor(0xd7, 0, 0x348, 199, 3);
-																				_vm->waitForFramesAllowSkip(4); // close up of king and flame
-																				_vm->fadeFromBlack();
-																				//playSoundFromTxtIndex(0x5ef2);
-																				if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 4, 0, 0x5ef2, 0x3e01) != 2) {
-																					fadeScreenAndResetActor(_actor_80072de8);
-																					fadeScreenAndResetActor(_actor_80072dec);
-																					closeUpShotOnActor(0xd3, 0, 0x233,
-																									   0x17a); // close up of king
-																					//playSoundFromTxtIndex(0x6000);
-																					if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 8, 0, 0x6000, 0x2e01) != 2) {
-																						fadeScreenAndResetActor(_actor_80072de8);
-																						closeUpKnightsAtTable(); // close up knights at table
-																						//playSoundFromTxtIndex(0x7dcc);
-																						_actor_80072df0->updateSequence(0x13);
-																						_actor_80072df4->updateSequence(0x10);
-																						_actor_80072df8->updateSequence(0x11);
-																						if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 0x12, 6, 0x7dcc, 0xc01) != 2) {
-																							wideAngleEveryoneAtTable(); //whole room shot
-																							if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 0x17, 0x16, 0x60ee, 0x701) != 2) {
-																								closeUpKnightsAtTable();
-																								_actor_80072df0->updateSequence(6);
-																								_actor_80072df4->updateSequence(0);
-																								_actor_80072df8->updateSequence(2);
-																								_actor_80072dec->updateSequence(4);
-																								//playSoundFromTxtIndex(0x5de8);
-																								if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072df8, 0xb, 2, 0x5de8, 0xc01) != 2) {
-																									wideAngleEveryoneAtTable();
-																									_vm->playOrStopSound(1);
-																									_actor_80072df0->updateSequence(8);
-																									_actor_80072df4->updateSequence(0xd);
-																									_actor_80072df8->updateSequence(0x11);
-																									_actor_80072dfc->updateSequence(0x15);
-																									_actor_80072df0->waitUntilFlag8And4AreSet();
-																									_actor_80072df4->waitUntilFlag8And4AreSet();
-																									_actor_80072df8->waitUntilFlag8And4AreSet();
-																									_actor_80072dfc->waitUntilFlag8And4AreSet();
-																									// DisableVSyncEvent();
-																									// TODO load_actor_file(0x82);
-																									// EnableVSyncEvent();
-																									_vm->waitForFramesAllowSkip(0x3b);
-																									_vm->clearFlags(ENGINE_FLAG_20000);
-																									_vm->fadeToBlack();
-																									// DisableVSyncEvent();
-																									_vm->_scene->getScaleLayer()->clearAll();
-																									_vm->_scene->getScaleLayer()->setValue(0, 0, 17);
-																									_vm->_scene->getScaleLayer()->setValue(1, 199, 1);
-
-																									// EnableVSyncEvent();
-																									changeBackgroundPosition(
-																											2, 0);
-																									_vm->_actorManager->clearActorFlags(2);
-																									_actor_80072de8 = _vm->_actorManager->loadActor(0x82, 0, 0x60, 0x114, 1);
-																									_actor_80072dec = _vm->_actorManager->loadActor(0x82, 2, 0x91, 0x113, 1);
-																									_actor_80072df0 = _vm->_actorManager->loadActor(0x82, 1, 0xd0, 199, 1);
-																									_actor_80072df4 = _vm->_actorManager->loadActor(0x82, 3, 0xb6, 0x113, 1);
-																									_actor_80072de8 = _vm->_actorManager->loadActor(0x82, 4, 0x98, 0x40, 1);
-
-																									_actor_80072de8->setFlag(ACTOR_FLAG_100);
-																									_actor_80072de8->setFlag(ACTOR_FLAG_800);
-																									_actor_80072de8->setFlag(ACTOR_FLAG_8000);
-																									_actor_80072de8->_walkSpeed = 0x20000;
-																									_actor_80072de8->_priorityLayer = 3;
-
-																									_actor_80072dec->setFlag(ACTOR_FLAG_100);
-																									_actor_80072dec->setFlag(ACTOR_FLAG_800);
-																									_actor_80072dec->setFlag(ACTOR_FLAG_8000);
-																									_actor_80072dec->_walkSpeed = 0x18000;
-																									_actor_80072dec->_priorityLayer = 3;
-
-																									_actor_80072df0->setFlag(ACTOR_FLAG_100);
-																									_actor_80072df0->setFlag(ACTOR_FLAG_800);
-																									_actor_80072df0->setFlag(ACTOR_FLAG_8000);
-																									_actor_80072df0->_walkSpeed = 0x14000;
-																									_actor_80072df0->_priorityLayer = 3;
-
-																									_actor_80072df4->setFlag(ACTOR_FLAG_100);
-																									_actor_80072df4->setFlag(ACTOR_FLAG_800);
-																									_actor_80072df4->setFlag(ACTOR_FLAG_8000);
-																									_actor_80072df4->_walkSpeed = 0x1c000;
-																									_actor_80072df4->_priorityLayer = 3;
-
-																									_actor_80072df8->setFlag(ACTOR_FLAG_100);
-																									_actor_80072df8->setFlag(ACTOR_FLAG_800);
-																									_actor_80072df8->setFlag(ACTOR_FLAG_8000);
-																									_actor_80072df8->_priorityLayer = 3;
-
-																									_vm->waitForFramesAllowSkip(0xe);
-																									_vm->fadeFromBlack();
-																									_actor_80072df0->startWalk(0xe8, 0xa8, 2);
-																									_actor_80072df0->waitForWalkToFinish();
-																									_actor_80072de8->startWalk(0x97, 0x37, 2);
-																									_actor_80072dec->startWalk(0x97, 0x37, 2);
-																									_actor_80072df4->startWalk(0x97, 0x37, 2);
-																									_actor_80072df0->waitUntilFlag8SetThenSet1000AndWaitFor4();
-																									_actor_80072df0->updateSequence(6);
-																									uint16 dialog[2000];
-																									dialog[0] = 0;
-																									_vm->_talk->loadText(0x5ea2, dialog, 2000);
-
-																									_vm->_talk->displayDialogAroundPoint(dialog, 0x27, 0xc, 0xc01, 0, 0x5ea2);
-																									_actor_80072df0->waitUntilFlag8And4AreSet();
-																									_actor_80072df0->_x_pos = 0xcf;
-																									_actor_80072df0->_y_pos = 0x90;
-																									_actor_80072df0->startWalk(0x97, 0x37, 2);
-																									_actor_80072df0->updateSequence(7);
-																									_vm->_talk->FUN_8001a7c4_clearDialogBoxMaybe();
-
-																									dialog[0] = 0;
-																									_vm->_talk->loadText(0x5ecc, dialog, 2000);
-																									_vm->_talk->displayDialogAroundPoint(dialog, 0x14, 6, 0xc01, 0, 0x5ecc);
-																									_vm->waitForFrames(0x3c);
-																								}
-																							}
-																						}
-																					}
-																				}
-																			}
-																		}
-																	}
-																}
-															}
-														}
-													}
-												}
-											}
-										}
-									}
-								}
-							}
-						}
-					}
-				}
-			}
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 2, 0, 0x4ea2, 0x701) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		closeUpShotOnActor(0xd3, 0, 0x233, 0x17a); //close up on king
+		//playSoundFromTxtIndex(0x4eec);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 5, 0, 0x4eec, 0x2e01) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		wideAngleEveryoneAtTable();  // shot of whole room
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 4, 0, 0x5000, 0x2e01) == 2 ||
+			_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_800830c0, 0x1d, 0x1c, 0x5074, 0x501) == 2 ||
+			_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072df0, 9, 5, 0x511c, 0xc01) == 2 ||
+			_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_800830c0, 0x1d, 0x1c, 0x5138, 0x501) == 2)
+			break;
+
+		closeUpShotOnActor(0xd7, 0, 0x312, 0x260); //close up on flame
+		//playSoundFromTxtIndex(0x5152);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 2, 0, 0x5152, 0x3e01) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		closeUpShotOnActor(0xd8, 0, 0xfd, 0x60); //close up flicker
+		//playSoundFromTxtIndex(0x51fc);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 3, 0, 0x51fc, 0x701) == 2)
+			break;
+
+		_vm->playOrStopSound(0x8004);
+		_vm->waitForFrames(0x28);
+		_vm->playOrStopSound(0x8003);
+		fadeScreenAndResetActor(_actor_80072de8);
+		_actor_80063514 = _actor_80063514 | 0x40;
+		fun_8003d8e8(0xd6, 0, 0x37a, 0x280);
+		_actor_80072dec = _vm->_actorManager->loadActor(0xd5, 0, 0x2d6, 0xc6, 3); //load humans
+		_actor_80072df0 = _vm->_actorManager->loadActor(0xd3, 2, 0x87, 199, 3);
+		_vm->waitForFramesAllowSkip(4);
+		_vm->fadeFromBlack();
+
+		if (fun_8003dab8(0x52d6, 0, 0, 0x701, 1) == 2)
+			break;
+
+		// TODO callMaybeResetData();
+		//playSoundFromTxtIndex(0x530c);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 2, 0, 0x530c, 0x3c01) == 2)
+			break;
+
+		while (0x10 < _vm->_scene->_camera.x) {
+			_vm->_scene->_camera.x = _vm->_scene->_camera.x + -0x10;
+			_vm->waitForFrames(1);
 		}
+
+		_vm->_scene->_camera.x = 0;
+		//playSoundFromTxtIndex(0x54dc);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072df0, 6, 2, 0x54dc, 0x2e01) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		fadeScreenAndResetActor(_actor_80072dec);
+		fadeScreenAndResetActor(_actor_80072df0);
+		wideAngleEveryoneAtTable();
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072e08, 3, 2, 0x55d4, 0xc01) == 2)
+			break;
+
+		closeUpShotOnActor(0xd4, 0, 0x8a, 0); //close up chancellor
+		//playSoundFromTxtIndex(0x562c);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 2, 0, 0x562c, 0xc01) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		fun_8003d8e8(0xd6, 0, 0x37a, 0x280);
+		_actor_80072dec = _vm->_actorManager->loadActor(0xd5, 4, 0x2d6, 0xc6, 3);
+		_vm->waitForFramesAllowSkip(4);
+		_vm->fadeFromBlack();
+
+		if (fun_8003dab8(0x5780, 0x14, 0, 0xc01, 1) == 2)
+			break;
+
+		_actor_80063514 = _actor_80063514 | 0x40;
+		fadeScreenAndResetActor(_actor_80072de8);
+		fadeScreenAndResetActor(_actor_80072dec);
+		closeUpShotOnActor(0xd7, 0, 0x312, 0x260); // close up flame
+		//playSoundFromTxtIndex(0x581c);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 3, 0, 0x581c, 0x3e01) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		closeUpShotOnActor(0xd4, 0, 0x8a, 0); //close up chancellor
+		//playSoundFromTxtIndex(0x5942);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 4, 0, 0x5942, 0xc01) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		closeUpShotOnActor(0xd3, 2, 0x87, 0); // close up king
+		//playSoundFromTxtIndex(0x5aaa);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 7, 2, 0x5aaa, 0x2e01) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		fun_8003d8e8(0xd6, 0, 0x37a, 0x280);
+		_actor_80072dec = _vm->_actorManager->loadActor(0xd5, 0, 0x2d6, 0xc6, 3);
+		_vm->waitForFramesAllowSkip(4);
+		_vm->fadeFromBlack();
+		//playSoundFromTxtIndex(0x5afc);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 3, 0, 0x5afc, 0x3c01) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		fadeScreenAndResetActor(_actor_80072dec);
+		_actor_80063514 = _actor_80063514 & 0xffbf;
+		closeUpKnightsAtTable(); // close up of knights at table.
+		_vm->playOrStopSound(0x8003);
+		//playSoundFromTxtIndex(0x5b96);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 8, 4, 0x5b96, 0xc01) == 2)
+			break;
+
+		//playSoundFromTxtIndex(0x5c4a);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 2, 0, 0x5c4a, 0x2e01) == 2)
+			break;
+
+		//playSoundFromTxtIndex(0x5dc8);
+		_actor_80072df0->updateSequence(0xf);
+		_actor_80072df4->updateSequence(0xd);
+		_actor_80072df8->updateSequence(0xe);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 0xc, 4, 0x5dc8, 0xc01) == 2)
+			break;
+
+		_actor_80072df0->updateSequence(6);
+		_actor_80072df4->updateSequence(0);
+		_actor_80072df8->updateSequence(2);
+		fun_8003d8e8(0xd3, 2, 0x28d, 0x250);
+		_actor_80072dec = _vm->_actorManager->loadActor(0xd7, 0, 0x348, 199, 3);
+		_vm->waitForFramesAllowSkip(4); // close up of king and flame
+		_vm->fadeFromBlack();
+		//playSoundFromTxtIndex(0x5ef2);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 4, 0, 0x5ef2, 0x3e01) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		fadeScreenAndResetActor(_actor_80072dec);
+		closeUpShotOnActor(0xd3, 0, 0x233, 0x17a); // close up of king
+		//playSoundFromTxtIndex(0x6000);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 8, 0, 0x6000, 0x2e01) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		closeUpKnightsAtTable(); // close up knights at table
+		//playSoundFromTxtIndex(0x7dcc);
+		_actor_80072df0->updateSequence(0x13);
+		_actor_80072df4->updateSequence(0x10);
+		_actor_80072df8->updateSequence(0x11);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 0x12, 6, 0x7dcc, 0xc01) == 2)
+			break;
+
+		wideAngleEveryoneAtTable(); //whole room shot
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 0x17, 0x16, 0x60ee, 0x701) == 2)
+			break;
+
+		closeUpKnightsAtTable();
+		_actor_80072df0->updateSequence(6);
+		_actor_80072df4->updateSequence(0);
+		_actor_80072df8->updateSequence(2);
+		_actor_80072dec->updateSequence(4);
+		//playSoundFromTxtIndex(0x5de8);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072df8, 0xb, 2, 0x5de8, 0xc01) == 2)
+			break;
+
+		wideAngleEveryoneAtTable();
+		_vm->playOrStopSound(1);
+		_actor_80072df0->updateSequence(8);
+		_actor_80072df4->updateSequence(0xd);
+		_actor_80072df8->updateSequence(0x11);
+		_actor_80072dfc->updateSequence(0x15);
+		_actor_80072df0->waitUntilFlag8And4AreSet();
+		_actor_80072df4->waitUntilFlag8And4AreSet();
+		_actor_80072df8->waitUntilFlag8And4AreSet();
+		_actor_80072dfc->waitUntilFlag8And4AreSet();
+		// DisableVSyncEvent();
+		// TODO load_actor_file(0x82);
+		// EnableVSyncEvent();
+		_vm->waitForFramesAllowSkip(0x3b);
+		_vm->clearFlags(ENGINE_FLAG_20000);
+		_vm->fadeToBlack();
+		// DisableVSyncEvent();
+		_vm->_scene->getScaleLayer()->clearAll();
+		_vm->_scene->getScaleLayer()->setValue(0, 0, 17);
+		_vm->_scene->getScaleLayer()->setValue(1, 199, 1);
+
+		// EnableVSyncEvent();
+		changeBackgroundPosition(2, 0);
+		_vm->_actorManager->clearActorFlags(2);
+		_actor_80072de8 = _vm->_actorManager->loadActor(0x82, 0, 0x60, 0x114, 1);
+		_actor_80072dec = _vm->_actorManager->loadActor(0x82, 2, 0x91, 0x113, 1);
+		_actor_80072df0 = _vm->_actorManager->loadActor(0x82, 1, 0xd0, 199, 1);
+		_actor_80072df4 = _vm->_actorManager->loadActor(0x82, 3, 0xb6, 0x113, 1);
+		_actor_80072de8 = _vm->_actorManager->loadActor(0x82, 4, 0x98, 0x40, 1);
+
+		_actor_80072de8->setFlag(ACTOR_FLAG_100);
+		_actor_80072de8->setFlag(ACTOR_FLAG_800);
+		_actor_80072de8->setFlag(ACTOR_FLAG_8000);
+		_actor_80072de8->_walkSpeed = 0x20000;
+		_actor_80072de8->_priorityLayer = 3;
+
+		_actor_80072dec->setFlag(ACTOR_FLAG_100);
+		_actor_80072dec->setFlag(ACTOR_FLAG_800);
+		_actor_80072dec->setFlag(ACTOR_FLAG_8000);
+		_actor_80072dec->_walkSpeed = 0x18000;
+		_actor_80072dec->_priorityLayer = 3;
+
+		_actor_80072df0->setFlag(ACTOR_FLAG_100);
+		_actor_80072df0->setFlag(ACTOR_FLAG_800);
+		_actor_80072df0->setFlag(ACTOR_FLAG_8000);
+		_actor_80072df0->_walkSpeed = 0x14000;
+		_actor_80072df0->_priorityLayer = 3;
+
+		_actor_80072df4->setFlag(ACTOR_FLAG_100);
+		_actor_80072df4->setFlag(ACTOR_FLAG_800);
+		_actor_80072df4->setFlag(ACTOR_FLAG_8000);
+		_actor_80072df4->_walkSpeed = 0x1c000;
+		_actor_80072df4->_priorityLayer = 3;
+
+		_actor_80072df8->setFlag(ACTOR_FLAG_100);
+		_actor_80072df8->setFlag(ACTOR_FLAG_800);
+		_actor_80072df8->setFlag(ACTOR_FLAG_8000);
+		_actor_80072df8->_priorityLayer = 3;
+
+		_vm->waitForFramesAllowSkip(0xe);
+		_vm->fadeFromBlack();
+		_actor_80072df0->startWalk(0xe8, 0xa8, 2);
+		_actor_80072df0->waitForWalkToFinish();
+		_actor_80072de8->startWalk(0x97, 0x37, 2);
+		_actor_80072dec->startWalk(0x97, 0x37, 2);
+		_actor_80072df4->startWalk(0x97, 0x37, 2);
+		_actor_80072df0->waitUntilFlag8SetThenSet1000AndWaitFor4();
+		_actor_80072df0->updateSequence(6);
+		uint16 dialog[2000];
+		dialog[0] = 0;
+		_vm->_talk->loadText(0x5ea2, dialog, 2000);
+
+		_vm->_talk->displayDialogAroundPoint(dialog, 0x27, 0xc, 0xc01, 0, 0x5ea2);
+		_actor_80072df0->waitUntilFlag8And4AreSet();
+		_actor_80072df0->_x_pos = 0xcf;
+		_actor_80072df0->_y_pos = 0x90;
+		_actor_80072df0->startWalk(0x97, 0x37, 2);
+		_actor_80072df0->updateSequence(7);
+		_vm->_talk->FUN_8001a7c4_clearDialogBoxMaybe();
+
+		dialog[0] = 0;
+		_vm->_talk->loadText(0x5ecc, dialog, 2000);
+		_vm->_talk->displayDialogAroundPoint(dialog, 0x14, 6, 0xc01, 0, 0x5ecc);
+		_vm->waitForFrames(0x3c);
+
+		break;	// we do not need to loop in fact
 	}
+
 	_vm->_talk->FUN_8001a7c4_clearDialogBoxMaybe();
 	_vm->fadeToBlack();
 	_vm->clearFlags(ENGINE_FLAG_20000);


Commit: 3c03b4bfc2d31744b43b318ab78623a78d5a2129
    https://github.com/scummvm/scummvm/commit/3c03b4bfc2d31744b43b318ab78623a78d5a2129
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-04T17:59:54+02:00

Commit Message:
DRAGONS: Untangled minor mess in cutscenes too for consistency

Changed paths:
    engines/dragons/cutscene.cpp


diff --git a/engines/dragons/cutscene.cpp b/engines/dragons/cutscene.cpp
index f993f79bad..8e3054599d 100644
--- a/engines/dragons/cutscene.cpp
+++ b/engines/dragons/cutscene.cpp
@@ -615,62 +615,86 @@ void CutScene::knightsSavedBackAtCastle() {
 	_vm->setFlags(ENGINE_FLAG_20000);
 	closeUpKnightsAtTable();
 //	playSoundFromTxtIndex(0x7854);
-	if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 10, 4, 0x7854, 0xc01) != 2) {
+
+	while (1) {	// In order to avoid gotos
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 10, 4, 0x7854, 0xc01) == 2)
+			break;
+
 		closeUpShotOnActor(0xd8, 0, 0xfd, 0x60);
-//		playSoundFromTxtIndex(0x78c6);
-		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 4, 0, 0x78c6, 0x701) != 2) {
-			fadeScreenAndResetActor(_actor_80072de8);
-			closeUpKnightsAtTable();
-//			playSoundFromTxtIndex(0x78e8);
-			if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 3, 0, 0x78e8, 0x2e01) != 2) {
-				wideAngleEveryoneAtTable();
-				if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_flameActor, 0x1a, 0x19, 0x7a1e, 0x3e01) != 2) {
-					_flameActor->_walkSpeed = 0x10000;
-					_flameActor->setFlag(ACTOR_FLAG_800);
-					_flameActor->updateSequence(0x21);
-					_flameActor->startWalk(0x13f, 0x6e, 2);
-					// wait for pathfinding to complete
-					_flameActor->waitForWalkToFinish();
-					_actor_80063514 = _actor_80063514 | 1;
-					closeUpShotOnActor(0xd3, 0, 0x233, 0x17a);
-//					playSoundFromTxtIndex(0x7aba);
-					if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 9, 0, 0x7aba, 0x2e01) != 2) {
-						fadeScreenAndResetActor(_actor_80072de8);
-						closeUpShotOnActor(0xd8, 0, 0xfd, 0x60);
-//						playSoundFromTxtIndex(0x7b60);
-						if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 5, 0, 0x7b60, 0x701) != 2) {
-							fadeScreenAndResetActor(_actor_80072de8);
-							wideAngleEveryoneAtTable();
-							if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072df0, 9, 5, 0x7c20, 0xc01) != 2) {
-								if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 0x17, 0x16, 0x7c9c, 0x701) != 2) {
-									_vm->playOrStopSound(0x800f);
-									_vm->waitForFrames(10);
-									if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 0x17, 0x16, 0x7cf2, 0x701) != 2) {
-										closeUpKnightsAtTable();
-//										playSoundFromTxtIndex(0x7dcc);
-										_actor_80072df0->updateSequence(0x13);
-										_actor_80072df4->updateSequence(0x10);
-										_actor_80072df8->updateSequence(0x11);
-										actorId = _vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 0x12, 6, 0x7dcc, 0xc01);
-										if ((actorId & 0xffff) != 2) {
-											closeUpShotOnActor(0xd3, 0, 0x233, 0x17a);
-//											playSoundFromTxtIndex(0x7e1a);
-											if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 10, 0, 0x7e1a, 0x2e01) != 2) {
-												fadeScreenAndResetActor(_actor_80072de8);
-												wideAngleEveryoneAtTable();
-												if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 4, 0, 0x7e96, 0x2e01) != 2) {
-													_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 0x17, 0x16, 0x7f0a, 0x701);
-												}
-											}
-										}
-									}
-								}
-							}
-						}
-					}
-				}
-			}
-		}
+		//playSoundFromTxtIndex(0x78c6);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 4, 0, 0x78c6, 0x701) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		closeUpKnightsAtTable();
+		//playSoundFromTxtIndex(0x78e8);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 3, 0, 0x78e8, 0x2e01) == 2)
+			break;
+
+		wideAngleEveryoneAtTable();
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_flameActor, 0x1a, 0x19, 0x7a1e, 0x3e01) == 2)
+			break;
+
+		_flameActor->_walkSpeed = 0x10000;
+		_flameActor->setFlag(ACTOR_FLAG_800);
+		_flameActor->updateSequence(0x21);
+		_flameActor->startWalk(0x13f, 0x6e, 2);
+		// wait for pathfinding to complete
+		_flameActor->waitForWalkToFinish();
+		_actor_80063514 = _actor_80063514 | 1;
+		closeUpShotOnActor(0xd3, 0, 0x233, 0x17a);
+		//playSoundFromTxtIndex(0x7aba);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 9, 0, 0x7aba, 0x2e01) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		closeUpShotOnActor(0xd8, 0, 0xfd, 0x60);
+		//playSoundFromTxtIndex(0x7b60);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 5, 0, 0x7b60, 0x701) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		wideAngleEveryoneAtTable();
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072df0, 9, 5, 0x7c20, 0xc01) == 2 ||
+			_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 0x17, 0x16, 0x7c9c, 0x701) == 2)
+			break;
+
+		_vm->playOrStopSound(0x800f);
+		_vm->waitForFrames(10);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 0x17, 0x16, 0x7cf2, 0x701) == 2)
+			break;
+
+		closeUpKnightsAtTable();
+		//playSoundFromTxtIndex(0x7dcc);
+		_actor_80072df0->updateSequence(0x13);
+		_actor_80072df4->updateSequence(0x10);
+		_actor_80072df8->updateSequence(0x11);
+		actorId = _vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 0x12, 6, 0x7dcc, 0xc01);
+
+		if ((actorId & 0xffff) == 2)
+			break;
+
+		closeUpShotOnActor(0xd3, 0, 0x233, 0x17a);
+		//playSoundFromTxtIndex(0x7e1a);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 10, 0, 0x7e1a, 0x2e01) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		wideAngleEveryoneAtTable();
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 4, 0, 0x7e96, 0x2e01) == 2)
+			break;
+
+		_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 0x17, 0x16, 0x7f0a, 0x701);
+
+		break; // we do not want to loop
 	}
 	_vm->fadeToBlack();
 	//DisableVSyncEvent();
@@ -729,35 +753,50 @@ void CutScene::flameReturnsCutScene() {
 	_flameActor->setFlag(ACTOR_FLAG_800);
 	_vm->fadeFromBlack();
 	_vm->setFlags(ENGINE_FLAG_20000);
-	if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 4, 0, 0x8ab2, 0x2e01) != 2) {
+
+	while (1) {	// In order to avoid gotos
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 4, 0, 0x8ab2, 0x2e01) == 2)
+			break;
+
 		_actor_80072de8->updateSequence(0x1e);
 		_actor_80072de8->startWalk(0xb0, 0x6b, 2);
 		_actor_80072de8->waitForWalkToFinish();
 		_actor_80072de8->updateSequence(0x1f);
-		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 4, 0, 0x8b40, 0x2e01) != 2) {
-			_flameActor->updateSequence(0x1b);
-			_flameActor->startWalk(0xd5, 0x6b, 2);
-			_flameActor->waitForWalkToFinish();
-			if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_flameActor, 0x1a, 0x19, 0x8bb6, 0x3e01) != 2) {
-				if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 4, 0, 0x8bd8, 0x2e01) != 2) {
-					closeUpShotOnActor(0xd8, 0, 0xfd, 0x60);
-//					playSoundFromTxtIndex(0x8c70);
-					if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 7, 0, 0x8c70, 0x701) != 2) {
-						fadeScreenAndResetActor(_actor_80072de8);
-						closeUpShotOnActor(0xd3, 0, 0x233, 0x17a);
-//						playSoundFromTxtIndex(0x8cd2);
-						if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 0xc, 0, 0x8cd2, 0x2e01) != 2) {
-							fadeScreenAndResetActor(_actor_80072de8);
-							closeUpShotOnActor(0xd7, 0, 0x312, 0x260);
-//							playSoundFromTxtIndex(0x8e1e);
-							if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 5, 0, 0x8e1e, 0x3e01) != 2) {
-								fadeScreenAndResetActor(_actor_80072de8);
-							}
-						}
-					}
-				}
-			}
-		}
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 4, 0, 0x8b40, 0x2e01) == 2)
+			break;
+
+		_flameActor->updateSequence(0x1b);
+		_flameActor->startWalk(0xd5, 0x6b, 2);
+		_flameActor->waitForWalkToFinish();
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_flameActor, 0x1a, 0x19, 0x8bb6, 0x3e01) == 2 ||
+			_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 4, 0, 0x8bd8, 0x2e01) == 2)
+			break;
+
+		closeUpShotOnActor(0xd8, 0, 0xfd, 0x60);
+		//playSoundFromTxtIndex(0x8c70);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 7, 0, 0x8c70, 0x701) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		closeUpShotOnActor(0xd3, 0, 0x233, 0x17a);
+		//playSoundFromTxtIndex(0x8cd2);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 0xc, 0, 0x8cd2, 0x2e01) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		closeUpShotOnActor(0xd7, 0, 0x312, 0x260);
+		//playSoundFromTxtIndex(0x8e1e);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 5, 0, 0x8e1e, 0x3e01) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+
+		break; // We do not want to loop
 	}
 	_vm->fadeToBlack();
 //	DisableVSyncEvent();
@@ -800,44 +839,62 @@ void CutScene::knightsSavedAgain() {
 	_vm->waitForFramesAllowSkip(0x3b);
 	closeUpShotOnActor(0xd3, 0, 0x233, 0x17a);
 	//playSoundFromTxtIndex(0x9000);
-	if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 0xd, 0, 0x9000, 0x2e01) != 2) {
+
+	while (1) {	// In order to avoid gotos
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 0xd, 0, 0x9000, 0x2e01) == 2)
+			break;
+
 		fadeScreenAndResetActor(_actor_80072de8);
 		closeUpKnightsAtTable();
-//		playSoundFromTxtIndex(0x90de);
-		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 4, 0, 0x90de, 0x2e01) != 2) {
-			closeUpShotOnActor(0xd8, 0, 0xfd, 0x60);
-//			playSoundFromTxtIndex(0x921c);
-			if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 8, 0, 0x921c, 0x701) != 2) {
-				fadeScreenAndResetActor(_actor_80072de8);
-				closeUpKnightsAtTable();
-//				playSoundFromTxtIndex(0x92aa);
-				if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 9, 4, 0x92aa, 0xc01) != 2) {
-					closeUpShotOnActor(0xd7, 0, 0x312, 0x260);
-//					playSoundFromTxtIndex(0x932c);
-					if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 6, 0, 0x932c, 0x3e01) != 2) {
-						fadeScreenAndResetActor(_actor_80072de8);
-						closeUpShotOnActor(0xd3, 2, 0x87, 0);
-//						playSoundFromTxtIndex(0x93d6);
-						if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 0xe, 2, 0x93d6, 0x2e01) != 2) {
-							fadeScreenAndResetActor(_actor_80072de8);
-							closeUpKnightsAtTable();
-//							playSoundFromTxtIndex(0x7dcc);
-							_actor_80072df0->updateSequence(0x13);
-							_actor_80072df4->updateSequence(0x10);
-							_actor_80072df8->updateSequence(0x11);
-							if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 0x12, 6, 0x7dcc, 0xc01) != 2) {
-								closeUpShotOnActor(0xd8, 0, 0xfd, 0x60);
-//								playSoundFromTxtIndex(0x948c);
-								if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 9, 0, 0x948c, 0x701) != 2) {
-									fadeScreenAndResetActor(_actor_80072de8);
-									_vm->waitForFramesAllowSkip(0x3b);
-								}
-							}
-						}
-					}
-				}
-			}
-		}
+		//playSoundFromTxtIndex(0x90de);
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 4, 0, 0x90de, 0x2e01) == 2)
+			break;
+
+		closeUpShotOnActor(0xd8, 0, 0xfd, 0x60);
+		//playSoundFromTxtIndex(0x921c);
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 8, 0, 0x921c, 0x701) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		closeUpKnightsAtTable();
+
+		//playSoundFromTxtIndex(0x92aa);
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 9, 4, 0x92aa, 0xc01) == 2)
+			break;
+
+		closeUpShotOnActor(0xd7, 0, 0x312, 0x260);
+		//playSoundFromTxtIndex(0x932c);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 6, 0, 0x932c, 0x3e01) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		closeUpShotOnActor(0xd3, 2, 0x87, 0);
+		//playSoundFromTxtIndex(0x93d6);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 0xe, 2, 0x93d6, 0x2e01) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		closeUpKnightsAtTable();
+		//playSoundFromTxtIndex(0x7dcc);
+		_actor_80072df0->updateSequence(0x13);
+		_actor_80072df4->updateSequence(0x10);
+		_actor_80072df8->updateSequence(0x11);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072dec, 0x12, 6, 0x7dcc, 0xc01) == 2)
+			break;
+
+		closeUpShotOnActor(0xd8, 0, 0xfd, 0x60);
+		//playSoundFromTxtIndex(0x948c);
+
+		if (_vm->_talk->somethingTextAndSpeechAndAnimRelated(_actor_80072de8, 9, 0, 0x948c, 0x701) == 2)
+			break;
+
+		fadeScreenAndResetActor(_actor_80072de8);
+		_vm->waitForFramesAllowSkip(0x3b);
+
+		break; // We do not want to loop
 	}
 	_vm->fadeToBlack();
 //	DisableVSyncEvent();




More information about the Scummvm-git-logs mailing list