[Scummvm-git-logs] scummvm branch-2-3 -> 6875cea3fa9df5766ed5d481457d8c18356eef79
mgerhardy
martin.gerhardy at gmail.com
Wed Sep 8 18:09:07 UTC 2021
This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
8c9f90eacf TWINE: todo comment for life script
c777d01322 TWINE: converted todo comment into not-compiling code
f2ba82cb9a TWINE: moved script fix into proper location
e133830deb TWINE: doChangeScene is using ScenePositionType::kScene
6875cea3fa TWINE: moved script patch boolean into scene class
Commit: 8c9f90eacffdb7e3bf5cc9b21ff5bc708249dd8a
https://github.com/scummvm/scummvm/commit/8c9f90eacffdb7e3bf5cc9b21ff5bc708249dd8a
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-09-08T20:08:26+02:00
Commit Message:
TWINE: todo comment for life script
Changed paths:
engines/twine/script/script_life_v1.cpp
diff --git a/engines/twine/script/script_life_v1.cpp b/engines/twine/script/script_life_v1.cpp
index c29db44ecd..8743373e5e 100644
--- a/engines/twine/script/script_life_v1.cpp
+++ b/engines/twine/script/script_life_v1.cpp
@@ -1028,6 +1028,13 @@ static int32 lCHANGE_CUBE(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 sceneIdx = ctx.stream.readByte();
engine->_scene->_needChangeScene = sceneIdx;
engine->_scene->_heroPositionType = ScenePositionType::kScene;
+ // TODO: dotemu _currentSceneIdx == 6 and _needChangeScene == 11 (harbours) and sceneNumZones > 14
+ // they have changed position type to kZone and use zone index 15 and scene track index 8 to place
+ // the actor - this looks like the harbour door entrance
+ // herox = zone.info1 - zone.mins.x + track.x
+ // heroy = zone.info2 - (unknown) + unknown
+ // heroz = zone.info3 - zone.mins.z + track.z
+ // heroPositionType = ScenePositionType::kZone;
return 0;
}
Commit: c777d01322c631c3fcad027c8cf1e054ecbd6e25
https://github.com/scummvm/scummvm/commit/c777d01322c631c3fcad027c8cf1e054ecbd6e25
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-09-08T20:08:29+02:00
Commit Message:
TWINE: converted todo comment into not-compiling code
Changed paths:
engines/twine/script/script_life_v1.cpp
diff --git a/engines/twine/script/script_life_v1.cpp b/engines/twine/script/script_life_v1.cpp
index 8743373e5e..ce4c13d7ea 100644
--- a/engines/twine/script/script_life_v1.cpp
+++ b/engines/twine/script/script_life_v1.cpp
@@ -1028,13 +1028,23 @@ static int32 lCHANGE_CUBE(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 sceneIdx = ctx.stream.readByte();
engine->_scene->_needChangeScene = sceneIdx;
engine->_scene->_heroPositionType = ScenePositionType::kScene;
- // TODO: dotemu _currentSceneIdx == 6 and _needChangeScene == 11 (harbours) and sceneNumZones > 14
- // they have changed position type to kZone and use zone index 15 and scene track index 8 to place
- // the actor - this looks like the harbour door entrance
- // herox = zone.info1 - zone.mins.x + track.x
- // heroy = zone.info2 - (unknown) + unknown
- // heroz = zone.info3 - zone.mins.z + track.z
- // heroPositionType = ScenePositionType::kZone;
+#if 0
+ if (engine->_debugScene->_useScenePatches) {
+ // TODO: dotemu _currentSceneIdx == 6 and _needChangeScene == 11 (harbours) and sceneNumZones > 14
+ // they have changed position type to kZone and use zone index 15 and scene track index 8 to place
+ // the actor - this looks like the harbour door entrance
+ if (engine->_scene->_currentSceneIdx == LBA1SceneId::Citadel_Island_Harbor && engine->_scene->_needChangeScene == LBA1SceneId::Principal_Island_Harbor && engine->_scene->_sceneNumZones > 14) {
+ ZoneStruct *zone = &engine->_scene->_sceneZones[15];
+ const IVec3 &track = engine->_scene->_sceneTracks[8];
+ engine->_scene->_zoneHeroPos.x = (zone->infoData.generic.info1 - zone->mins.x) + track.x;
+ engine->_scene->_zoneHeroPos.y = (zone->infoData.generic.info2 - zone->mins.field_0x2) + track.field_0x2;
+ engine->_scene->_zoneHeroPos.z = (zone->infoData.generic.info3 - zone->mins.z) + track.z;
+ engine->_scene->_heroPositionType = ScenePositionType::kZone;
+ // otherActorIdx = lactorIdx;
+ }
+ }
+#endif
+
return 0;
}
Commit: f2ba82cb9ac1b5c57c542bee7750288748221596
https://github.com/scummvm/scummvm/commit/f2ba82cb9ac1b5c57c542bee7750288748221596
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-09-08T20:08:32+02:00
Commit Message:
TWINE: moved script fix into proper location
Changed paths:
engines/twine/scene/scene.cpp
engines/twine/script/script_life_v1.cpp
diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index 57ab187e93..c626f5f31c 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -468,6 +468,20 @@ void Scene::reloadCurrentScene() {
}
void Scene::changeScene() {
+ if (_engine->_debugScene->_useScenePatches) {
+ if (_currentSceneIdx == LBA1SceneId::Citadel_Island_Harbor && _needChangeScene == LBA1SceneId::Principal_Island_Harbor && _sceneNumZones > 14) {
+ const ZoneStruct *zone = &_sceneZones[15];
+ const IVec3 &track = _sceneTracks[8];
+ IVec3 &pos = _zoneHeroPos;
+ pos.x = zone->infoData.ChangeScene.x - zone->mins.x + track.x;
+ pos.y = zone->infoData.ChangeScene.y - zone->mins.y + track.y;
+ pos.z = zone->infoData.ChangeScene.z - zone->mins.z + track.z;
+ _engine->_scene->_heroPositionType = ScenePositionType::kZone;
+ // otherActorIdx = lactorIdx;
+ debug(3, "Using zone position %i:%i:%i", pos.x, pos.y, pos.z);
+ }
+ }
+
// change twinsen house destroyed hard-coded
if (_needChangeScene == LBA1SceneId::Citadel_Island_near_twinsens_house && _engine->_gameState->hasOpenedFunfrocksSafe()) {
_needChangeScene = LBA1SceneId::Citadel_Island_Twinsens_house_destroyed;
diff --git a/engines/twine/script/script_life_v1.cpp b/engines/twine/script/script_life_v1.cpp
index ce4c13d7ea..c29db44ecd 100644
--- a/engines/twine/script/script_life_v1.cpp
+++ b/engines/twine/script/script_life_v1.cpp
@@ -1028,23 +1028,6 @@ static int32 lCHANGE_CUBE(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 sceneIdx = ctx.stream.readByte();
engine->_scene->_needChangeScene = sceneIdx;
engine->_scene->_heroPositionType = ScenePositionType::kScene;
-#if 0
- if (engine->_debugScene->_useScenePatches) {
- // TODO: dotemu _currentSceneIdx == 6 and _needChangeScene == 11 (harbours) and sceneNumZones > 14
- // they have changed position type to kZone and use zone index 15 and scene track index 8 to place
- // the actor - this looks like the harbour door entrance
- if (engine->_scene->_currentSceneIdx == LBA1SceneId::Citadel_Island_Harbor && engine->_scene->_needChangeScene == LBA1SceneId::Principal_Island_Harbor && engine->_scene->_sceneNumZones > 14) {
- ZoneStruct *zone = &engine->_scene->_sceneZones[15];
- const IVec3 &track = engine->_scene->_sceneTracks[8];
- engine->_scene->_zoneHeroPos.x = (zone->infoData.generic.info1 - zone->mins.x) + track.x;
- engine->_scene->_zoneHeroPos.y = (zone->infoData.generic.info2 - zone->mins.field_0x2) + track.field_0x2;
- engine->_scene->_zoneHeroPos.z = (zone->infoData.generic.info3 - zone->mins.z) + track.z;
- engine->_scene->_heroPositionType = ScenePositionType::kZone;
- // otherActorIdx = lactorIdx;
- }
- }
-#endif
-
return 0;
}
Commit: e133830debca31a87176585f32323cae74048603
https://github.com/scummvm/scummvm/commit/e133830debca31a87176585f32323cae74048603
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-09-08T20:08:37+02:00
Commit Message:
TWINE: doChangeScene is using ScenePositionType::kScene
Changed paths:
engines/twine/debugger/console.cpp
diff --git a/engines/twine/debugger/console.cpp b/engines/twine/debugger/console.cpp
index dff8d60355..9b9e44e265 100644
--- a/engines/twine/debugger/console.cpp
+++ b/engines/twine/debugger/console.cpp
@@ -355,6 +355,7 @@ bool TwinEConsole::doChangeScene(int argc, const char **argv) {
return true;
}
_engine->_scene->_needChangeScene = atoi(argv[1]);
+ _engine->_scene->_heroPositionType = ScenePositionType::kScene;
_engine->_scene->changeScene();
return true;
}
Commit: 6875cea3fa9df5766ed5d481457d8c18356eef79
https://github.com/scummvm/scummvm/commit/6875cea3fa9df5766ed5d481457d8c18356eef79
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-09-08T20:08:40+02:00
Commit Message:
TWINE: moved script patch boolean into scene class
... and activated it by default
Changed paths:
engines/twine/debugger/console.cpp
engines/twine/debugger/debug_scene.h
engines/twine/scene/scene.cpp
engines/twine/scene/scene.h
diff --git a/engines/twine/debugger/console.cpp b/engines/twine/debugger/console.cpp
index 9b9e44e265..dbe078a7b8 100644
--- a/engines/twine/debugger/console.cpp
+++ b/engines/twine/debugger/console.cpp
@@ -105,7 +105,7 @@ bool TwinEConsole::doToggleGodMode(int argc, const char **argv) {
}
bool TwinEConsole::doToggleScenePatches(int argc, const char **argv) {
- TOGGLE_DEBUG(_engine->_debugScene->_useScenePatches, "use scene patches\n")
+ TOGGLE_DEBUG(_engine->_scene->_useScenePatches, "use scene patches\n")
return true;
}
diff --git a/engines/twine/debugger/debug_scene.h b/engines/twine/debugger/debug_scene.h
index 5111b59af8..c976bc90b7 100644
--- a/engines/twine/debugger/debug_scene.h
+++ b/engines/twine/debugger/debug_scene.h
@@ -75,7 +75,6 @@ public:
bool _showingActors = false;
bool _showingTracks = false;
bool _showingClips = false;
- bool _useScenePatches = false;
bool _godMode = false;
int32 _typeZones = 127; // all zones on as default
int16 _onlyLoadActor = -1;
diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index c626f5f31c..a07fed9230 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -392,7 +392,8 @@ bool Scene::loadSceneLBA1() {
point->z = (int16)stream.readUint16LE();
}
- if (_engine->_debugScene->_useScenePatches) {
+ if (_useScenePatches) {
+#if 0
// TODO: these were found in the disassembly and might be some script fixes - check me and activate me
switch (_currentSceneIdx) {
case LBA1SceneId::Hamalayi_Mountains_landing_place:
@@ -400,7 +401,6 @@ bool Scene::loadSceneLBA1() {
_sceneActors[21]._pos.x = _sceneActors[21]._collisionPos.x = 0x1b00;
_sceneActors[21]._pos.z = _sceneActors[21]._collisionPos.z = 0x300;
break;
-#if 0
case LBA1SceneId::Principal_Island_outside_the_fortress:
assert(sceneNumActors >= 30);
_sceneActors[29].pos.z = _sceneActors[29].collisionPos.z = 0x703;
@@ -426,8 +426,8 @@ bool Scene::loadSceneLBA1() {
case LBA1SceneId::Principal_Island_inside_the_fortress:
//(ushort*)puVar4[140] = 0x32;
break;
-#endif
}
+#endif
}
return true;
@@ -468,7 +468,7 @@ void Scene::reloadCurrentScene() {
}
void Scene::changeScene() {
- if (_engine->_debugScene->_useScenePatches) {
+ if (_useScenePatches) {
if (_currentSceneIdx == LBA1SceneId::Citadel_Island_Harbor && _needChangeScene == LBA1SceneId::Principal_Island_Harbor && _sceneNumZones > 14) {
const ZoneStruct *zone = &_sceneZones[15];
const IVec3 &track = _sceneTracks[8];
diff --git a/engines/twine/scene/scene.h b/engines/twine/scene/scene.h
index bea8be8e8c..487f26cca1 100644
--- a/engines/twine/scene/scene.h
+++ b/engines/twine/scene/scene.h
@@ -195,6 +195,7 @@ public:
int16 _currentlyFollowedActor = OWN_ACTOR_SCENE_INDEX;
/** Current actor in zone - climbing a ladder */
bool _currentActorInZone = false;
+ bool _useScenePatches = true;
/** Current actor manipulated in scripts */
int16 _currentScriptValue = 0;
More information about the Scummvm-git-logs
mailing list