[Scummvm-git-logs] scummvm master -> 683eee24bd65ee655d6721a4a02af913c4478840
mgerhardy
martin.gerhardy at gmail.com
Wed Sep 8 17:54:12 UTC 2021
This automated email contains information about 9 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
359c1ba2cf TWINE: fixed holomap arrow clipping
8de73274a7 TWINE: fixed typos
5119ab26c4 TWINE: todo comment for life script
333d1e55d3 TWINE: added godmode debug command
0b858f01db TWINE: converted todo comment into not-compiling code
7c67ce0bc4 TWINE: moved script fix into proper location
665f408b01 TWINE: doChangeScene is using ScenePositionType::kScene
a4c717c585 TWINE: moved script patch boolean into scene class
683eee24bd TWINE: fixed dotemu achievement for talking to the star wars fanboy
Commit: 359c1ba2cf18547fbf5b2c28837bbe5afe2b3f51
https://github.com/scummvm/scummvm/commit/359c1ba2cf18547fbf5b2c28837bbe5afe2b3f51
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-09-08T19:53:53+02:00
Commit Message:
TWINE: fixed holomap arrow clipping
Changed paths:
engines/twine/holomap.cpp
engines/twine/renderer/renderer.cpp
engines/twine/renderer/renderer.h
diff --git a/engines/twine/holomap.cpp b/engines/twine/holomap.cpp
index e6871ac940..c2a3ef8e03 100644
--- a/engines/twine/holomap.cpp
+++ b/engines/twine/holomap.cpp
@@ -451,9 +451,9 @@ void Holomap::renderLocations(int xRot, int yRot, int zRot, bool lower) {
const IVec3 &destPos4 = _engine->_renderer->getBaseRotationPosition(destPos2);
bool visible;
if (lower) {
- visible = destPos4.z <= destPos3.z;
- } else {
visible = destPos3.z <= destPos4.z;
+ } else {
+ visible = destPos4.z <= destPos3.z;
}
if (!visible) {
continue;
diff --git a/engines/twine/renderer/renderer.cpp b/engines/twine/renderer/renderer.cpp
index 680d468fdf..3c0a8a3b9b 100644
--- a/engines/twine/renderer/renderer.cpp
+++ b/engines/twine/renderer/renderer.cpp
@@ -56,13 +56,11 @@ void Renderer::init(int32 w, int32 h) {
_polyTab = (int16 *)malloc(_polyTabSize * sizeof(int16));
_colorProgressionBuffer = (int16 *)malloc(_polyTabSize * sizeof(int16));
_holomap_polytab_1_1 = &_polyTab[_engine->height() * 0];
+ _holomap_polytab_2_1 = &_polyTab[_engine->height() * 1];
_holomap_polytab_1_2 = &_polyTab[_engine->height() * 2];
- _holomap_polytab_1_3 = &_polyTab[_engine->height() * 3];
+ _holomap_polytab_2_2 = &_polyTab[_engine->height() * 3];
+ _holomap_polytab_1_3 = &_polyTab[_engine->height() * 4];
_holomap_polytab_2_3 = &_polyTab[_engine->height() * 5];
- _holomap_polytab_2_2 = &_polyTab[_engine->height() * 4];
- _holomap_polytab_2_1 = &_polyTab[_engine->height() * 1];
- _holomap_polytab_1_2_ptr = _holomap_polytab_1_2;
- _holomap_polytab_1_3_ptr = _holomap_polytab_1_3;
}
IVec3 &Renderer::projectPositionOnScreen(int32 cX, int32 cY, int32 cZ) {
diff --git a/engines/twine/renderer/renderer.h b/engines/twine/renderer/renderer.h
index 0f660bdb11..1e3ff1c62d 100644
--- a/engines/twine/renderer/renderer.h
+++ b/engines/twine/renderer/renderer.h
@@ -180,8 +180,6 @@ private:
int16* _holomap_polytab_2_3 = nullptr;
int16* _holomap_polytab_2_2 = nullptr;
int16* _holomap_polytab_2_1 = nullptr;
- int16* _holomap_polytab_1_2_ptr = nullptr;
- int16* _holomap_polytab_1_3_ptr = nullptr;
bool _isUsingOrthoProjection = false;
Commit: 8de73274a7f7f5755f800c3760e3491bf8dc2dca
https://github.com/scummvm/scummvm/commit/8de73274a7f7f5755f800c3760e3491bf8dc2dca
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-09-08T19:53:53+02:00
Commit Message:
TWINE: fixed typos
Changed paths:
engines/twine/scene/grid.cpp
engines/twine/script/script_life_v1.cpp
diff --git a/engines/twine/scene/grid.cpp b/engines/twine/scene/grid.cpp
index 23187efe6c..287dd9bc18 100644
--- a/engines/twine/scene/grid.cpp
+++ b/engines/twine/scene/grid.cpp
@@ -838,7 +838,7 @@ void Grid::centerScreenOnActor() {
_engine->_renderer->projectPositionOnScreen(actor->_pos.x - (_newCamera.x * BRICK_SIZE),
actor->_pos.y - (_newCamera.y * BRICK_HEIGHT),
actor->_pos.z - (_newCamera.z * BRICK_SIZE));
- // TODO: these border values should get scaled for hiher resolutions
+ // TODO: these border values should get scaled for higher resolutions
if (_engine->_renderer->_projPos.x < 80 || _engine->_renderer->_projPos.x >= _engine->width() - 60 || _engine->_renderer->_projPos.y < 80 || _engine->_renderer->_projPos.y >= _engine->height() - 50) {
_newCamera.x = ((actor->_pos.x + BRICK_HEIGHT) / BRICK_SIZE) + (((actor->_pos.x + BRICK_HEIGHT) / BRICK_SIZE) - _newCamera.x) / 2;
_newCamera.y = actor->_pos.y / BRICK_HEIGHT;
diff --git a/engines/twine/script/script_life_v1.cpp b/engines/twine/script/script_life_v1.cpp
index 870f7309fc..7647b6ff9a 100644
--- a/engines/twine/script/script_life_v1.cpp
+++ b/engines/twine/script/script_life_v1.cpp
@@ -131,7 +131,7 @@ enum LifeScriptConditions {
};
/**
- * Returns @c 1 Condition value size (1 byte), @c 2 Condition value size (2 byes)
+ * Returns @c 1 Condition value size (1 byte), @c 2 Condition value size (2 bytes)
*/
static int32 processLifeConditions(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 conditionValueSize = 1;
Commit: 5119ab26c4c829b26b42d86f4b8a2852fc8b2621
https://github.com/scummvm/scummvm/commit/5119ab26c4c829b26b42d86f4b8a2852fc8b2621
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-09-08T19:53:53+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 7647b6ff9a..71efbd66e6 100644
--- a/engines/twine/script/script_life_v1.cpp
+++ b/engines/twine/script/script_life_v1.cpp
@@ -1027,6 +1027,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: 333d1e55d355931ee8f380964b299295cb3542c4
https://github.com/scummvm/scummvm/commit/333d1e55d355931ee8f380964b299295cb3542c4
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-09-08T19:53:53+02:00
Commit Message:
TWINE: added godmode debug command
Changed paths:
engines/twine/debugger/console.cpp
engines/twine/debugger/console.h
engines/twine/debugger/debug_scene.h
engines/twine/scene/actor.cpp
engines/twine/scene/animations.cpp
engines/twine/scene/collision.cpp
engines/twine/script/script_life_v1.cpp
diff --git a/engines/twine/debugger/console.cpp b/engines/twine/debugger/console.cpp
index 0bf0245b24..dff8d60355 100644
--- a/engines/twine/debugger/console.cpp
+++ b/engines/twine/debugger/console.cpp
@@ -50,6 +50,7 @@ TwinEConsole::TwinEConsole(TwinEEngine *engine) : _engine(engine), GUI::Debugger
registerCmd("toggle_debug", WRAP_METHOD(TwinEConsole, doToggleDebug));
registerCmd("toggle_zones", WRAP_METHOD(TwinEConsole, doToggleZoneRendering));
registerCmd("toggle_tracks", WRAP_METHOD(TwinEConsole, doToggleTrackRendering));
+ registerCmd("toggle_godmode", WRAP_METHOD(TwinEConsole, doToggleGodMode));
registerCmd("toggle_autoagressive", WRAP_METHOD(TwinEConsole, doToggleAutoAggressive));
registerCmd("toggle_actors", WRAP_METHOD(TwinEConsole, doToggleActorRendering));
registerCmd("toggle_clips", WRAP_METHOD(TwinEConsole, doToggleClipRendering));
@@ -98,6 +99,11 @@ bool TwinEConsole::doToggleTrackRendering(int argc, const char **argv) {
return true;
}
+bool TwinEConsole::doToggleGodMode(int argc, const char **argv) {
+ TOGGLE_DEBUG(_engine->_debugScene->_godMode, "god mode\n")
+ return true;
+}
+
bool TwinEConsole::doToggleScenePatches(int argc, const char **argv) {
TOGGLE_DEBUG(_engine->_debugScene->_useScenePatches, "use scene patches\n")
return true;
diff --git a/engines/twine/debugger/console.h b/engines/twine/debugger/console.h
index 6da6016ff7..2ea8092961 100644
--- a/engines/twine/debugger/console.h
+++ b/engines/twine/debugger/console.h
@@ -54,6 +54,7 @@ private:
bool doToggleClipRendering(int argc, const char **argv);
bool doToggleActorRendering(int argc, const char **argv);
bool doToggleTrackRendering(int argc, const char **argv);
+ bool doToggleGodMode(int argc, const char **argv);
bool doToggleScenePatches(int argc, const char **argv);
bool doToggleFreeCamera(int argc, const char **argv);
bool doToggleSceneChanges(int argc, const char **argv);
diff --git a/engines/twine/debugger/debug_scene.h b/engines/twine/debugger/debug_scene.h
index 7f510c7d65..5111b59af8 100644
--- a/engines/twine/debugger/debug_scene.h
+++ b/engines/twine/debugger/debug_scene.h
@@ -76,6 +76,7 @@ public:
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/actor.cpp b/engines/twine/scene/actor.cpp
index 3c8afe1540..172fc4439a 100644
--- a/engines/twine/scene/actor.cpp
+++ b/engines/twine/scene/actor.cpp
@@ -25,6 +25,7 @@
#include "common/system.h"
#include "common/textconsole.h"
#include "twine/audio/sound.h"
+#include "twine/debugger/debug_scene.h"
#include "twine/parser/entity.h"
#include "twine/renderer/renderer.h"
#include "twine/renderer/screens.h"
@@ -36,6 +37,7 @@
#include "twine/scene/grid.h"
#include "twine/scene/movements.h"
#include "twine/scene/scene.h"
+#include "twine/shared.h"
#include "twine/twine.h"
namespace TwinE {
@@ -153,7 +155,7 @@ int32 Actor::initBody(BodyType bodyIdx, int32 actorIdx, ActorBoundingBox &actorB
return -1;
}
ActorStruct *actor = _engine->_scene->getActor(actorIdx);
- const EntityBody* body = actor->_entityDataPtr->getBody((int)bodyIdx);
+ const EntityBody *body = actor->_entityDataPtr->getBody((int)bodyIdx);
if (body == nullptr) {
return -1;
}
@@ -307,6 +309,10 @@ void Actor::hitActor(int32 actorIdx, int32 actorIdxAttacked, int32 strengthOfHit
return;
}
+ if (IS_HERO(actorIdxAttacked) && _engine->_debugScene->_godMode) {
+ return;
+ }
+
actor->_hitBy = actorIdx;
if (actor->_armor <= strengthOfHit) {
@@ -380,7 +386,7 @@ void ActorStruct::loadModel(int32 modelIndex, bool lba1) {
if (!_staticFlags.bIsSpriteActor) {
debug(1, "Init actor with model %i", modelIndex);
if (!_entityData.loadFromHQR(Resources::HQR_FILE3D_FILE, modelIndex, lba1)) {
- error("Failed to load entity data for index %i", modelIndex);
+ error("Failed to load entity data for index %i", modelIndex);
}
_entityDataPtr = &_entityData;
} else {
diff --git a/engines/twine/scene/animations.cpp b/engines/twine/scene/animations.cpp
index 52377a68df..1aed4f5c2c 100644
--- a/engines/twine/scene/animations.cpp
+++ b/engines/twine/scene/animations.cpp
@@ -26,6 +26,7 @@
#include "common/stream.h"
#include "common/util.h"
#include "twine/audio/sound.h"
+#include "twine/debugger/debug_scene.h"
#include "twine/parser/anim.h"
#include "twine/parser/entity.h"
#include "twine/renderer/renderer.h"
@@ -695,7 +696,9 @@ void Animations::processActorAnimations(int32 actorIdx) {
_engine->_movements->_heroMoved = true;
}
- actor->addLife(-1);
+ if (!_engine->_debugScene->_godMode) {
+ actor->addLife(-1);
+ }
}
}
}
@@ -713,7 +716,9 @@ void Animations::processActorAnimations(int32 actorIdx) {
_engine->_extra->addExtraSpecial(actor->_pos.x, actor->_pos.y + 1000, actor->_pos.z, ExtraSpecialType::kHitStars);
initAnim(AnimationTypes::kBigHit, AnimType::kAnimationType_2, AnimationTypes::kStanding, _currentlyProcessedActorIdx);
_engine->_movements->_heroMoved = true;
- actor->addLife(-1);
+ if (!_engine->_debugScene->_godMode) {
+ actor->addLife(-1);
+ }
}
// no Z coordinate issue
diff --git a/engines/twine/scene/collision.cpp b/engines/twine/scene/collision.cpp
index c7b42b6ca0..c166e9ac3a 100644
--- a/engines/twine/scene/collision.cpp
+++ b/engines/twine/scene/collision.cpp
@@ -24,6 +24,7 @@
#include "common/debug.h"
#include "common/memstream.h"
#include "common/util.h"
+#include "twine/debugger/debug_scene.h"
#include "twine/renderer/renderer.h"
#include "twine/resources/resources.h"
#include "twine/scene/actor.h"
@@ -380,7 +381,9 @@ void Collision::stopFalling() { // ReceptionObj()
if (fall >= BRICK_HEIGHT * 16) {
_engine->_actor->_processActorPtr->setLife(0);
} else {
- _engine->_actor->_processActorPtr->addLife(-1);
+ if (!_engine->_debugScene->_godMode) {
+ _engine->_actor->_processActorPtr->addLife(-1);
+ }
}
_engine->_animations->initAnim(AnimationTypes::kLandingHit, AnimType::kAnimationType_2, AnimationTypes::kStanding, _engine->_animations->_currentlyProcessedActorIdx);
} else if (fall > 10) {
diff --git a/engines/twine/script/script_life_v1.cpp b/engines/twine/script/script_life_v1.cpp
index 71efbd66e6..f5f3201ccf 100644
--- a/engines/twine/script/script_life_v1.cpp
+++ b/engines/twine/script/script_life_v1.cpp
@@ -23,6 +23,7 @@
#include "twine/script/script_life_v1.h"
#include "common/memstream.h"
#include "common/stream.h"
+#include "twine/debugger/debug_scene.h"
#include "twine/scene/actor.h"
#include "twine/scene/animations.h"
#include "twine/audio/music.h"
@@ -1168,9 +1169,11 @@ static int32 lSUB_LIFE_POINT_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 lifeValue = ctx.stream.readByte();
ActorStruct *otherActor = engine->_scene->getActor(otherActorIdx);
- otherActor->addLife(-lifeValue);
- if (otherActor->_life < 0) {
- otherActor->setLife(0);
+ if (!engine->_debugScene->_godMode) {
+ otherActor->addLife(-lifeValue);
+ if (otherActor->_life < 0) {
+ otherActor->setLife(0);
+ }
}
return 0;
Commit: 0b858f01db15859d9ea7567ca74475470840809b
https://github.com/scummvm/scummvm/commit/0b858f01db15859d9ea7567ca74475470840809b
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-09-08T19:53:53+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 f5f3201ccf..a577d90661 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: 7c67ce0bc4356f66931f5158e16d1f0ebe567dd1
https://github.com/scummvm/scummvm/commit/7c67ce0bc4356f66931f5158e16d1f0ebe567dd1
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-09-08T19:53:53+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 a577d90661..2ad389be68 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: 665f408b01c4c5c385a19ac19d02c7847d2580d7
https://github.com/scummvm/scummvm/commit/665f408b01c4c5c385a19ac19d02c7847d2580d7
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-09-08T19:53:53+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: a4c717c585aaec69129df870f0b32a8664f194bc
https://github.com/scummvm/scummvm/commit/a4c717c585aaec69129df870f0b32a8664f194bc
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-09-08T19:53:53+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;
Commit: 683eee24bd65ee655d6721a4a02af913c4478840
https://github.com/scummvm/scummvm/commit/683eee24bd65ee655d6721a4a02af913c4478840
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-09-08T19:53:53+02:00
Commit Message:
TWINE: fixed dotemu achievement for talking to the star wars fanboy
Changed paths:
engines/twine/script/script_life_v1.cpp
engines/twine/shared.h
diff --git a/engines/twine/script/script_life_v1.cpp b/engines/twine/script/script_life_v1.cpp
index 2ad389be68..c29db44ecd 100644
--- a/engines/twine/script/script_life_v1.cpp
+++ b/engines/twine/script/script_life_v1.cpp
@@ -658,7 +658,7 @@ static int32 lMESSAGE(TwinEEngine *engine, LifeScriptContext &ctx) {
engine->_text->setFontCrossColor(ctx.actor->_talkColor);
engine->_scene->_talkingActor = ctx.actorIdx;
engine->_text->drawTextProgressive(textIdx);
- if (engine->_scene->_currentSceneIdx == LBA1SceneId::Principal_Island_Library && engine->_scene->_talkingActor == 8)/* && (*(short *)lifeScriptPosition == 0xe2 [226])*/ {
+ if (engine->_scene->_currentSceneIdx == LBA1SceneId::Principal_Island_Library && engine->_scene->_talkingActor == 8 && textIdx == TextId::kStarWarsFanBoy) {
engine->unlockAchievement("LBA_ACH_008");
}
engine->_redraw->redrawEngineActions(true);
diff --git a/engines/twine/shared.h b/engines/twine/shared.h
index 5bcbcfc792..0413874398 100644
--- a/engines/twine/shared.h
+++ b/engines/twine/shared.h
@@ -524,6 +524,7 @@ enum class TextId : int16 {
kIntroText3 = 152,
kBookOfBu = 161,
kBonusList = 162,
+ kStarWarsFanBoy = 226,
kDetailsPolygonsLow = 231,
kShadowsDisabled = 232,
kNoSceneryZoom = 233,
More information about the Scummvm-git-logs
mailing list