[Scummvm-git-logs] scummvm master -> 4f49b2c8127444e6d50885cc672fb29311bd03c0
mgerhardy
noreply at scummvm.org
Fri Oct 11 15:30:25 UTC 2024
This automated email contains information about 7 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
f2afa31897 TWINE: added new log categories and improved logging
3d1c23ce81 TWINE: removed ImGuiTreeNodeFlags_DefaultOpen because it uses the full screen on small displays
39722ab56e TWINE: print the current timer value to the debugger menu
e3b8cf864c TWINE: renamed struct and members to match the original sources
ea4b8fb64f TWINE: do the imgui debugger registration as early as possible
8d972b2535 TWINE: header inclusion cleanup
4f49b2c812 TWINE: renamed variables to match the original sources
Commit: f2afa318979ec48e8af6b30c48a8d5c957b2d8cd
https://github.com/scummvm/scummvm/commit/f2afa318979ec48e8af6b30c48a8d5c957b2d8cd
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-11T17:29:25+02:00
Commit Message:
TWINE: added new log categories and improved logging
Changed paths:
engines/twine/detection.cpp
engines/twine/holomap_v1.cpp
engines/twine/input.cpp
engines/twine/menu/menu.cpp
engines/twine/movies.cpp
engines/twine/parser/text.cpp
engines/twine/renderer/screens.cpp
engines/twine/resources/hqr.cpp
engines/twine/resources/resources.cpp
engines/twine/scene/collision.cpp
engines/twine/scene/gamestate.cpp
engines/twine/scene/scene.cpp
engines/twine/script/script_life.cpp
engines/twine/script/script_life_v1.cpp
engines/twine/script/script_life_v2.cpp
engines/twine/script/script_move.cpp
engines/twine/script/script_move_v2.cpp
engines/twine/shared.h
engines/twine/twine.cpp
diff --git a/engines/twine/detection.cpp b/engines/twine/detection.cpp
index 6f955933caf..6f3bde84bde 100644
--- a/engines/twine/detection.cpp
+++ b/engines/twine/detection.cpp
@@ -35,9 +35,14 @@ static const PlainGameDescriptor twineGames[] = {
};
static const DebugChannelDef debugFlagList[] = {
- {TwinE::kDebugScripts, "scripts", "Scripts debugging"},
- {TwinE::kDebugTime, "time", "Time debugging"},
+ {TwinE::kDebugScriptsMove, "scriptsmove", "Move script debugging"},
+ {TwinE::kDebugScriptsLife, "scriptslife", "Life script debugging"},
+ {TwinE::kDebugResources, "resources", "Resources debugging"},
+ {TwinE::kDebugTimers, "timers", "Timer debugging"},
{TwinE::kDebugImGui, "imgui", "UI for debugging"},
+ {TwinE::kDebugInput, "input", "Input debugging"},
+ {TwinE::kDebugMovies, "movies", "Movies debugging"},
+ {TwinE::kDebugPalette, "palette", "Palette debugging"},
DEBUG_CHANNEL_END
};
diff --git a/engines/twine/holomap_v1.cpp b/engines/twine/holomap_v1.cpp
index 4463185f13b..ceeea9c2742 100644
--- a/engines/twine/holomap_v1.cpp
+++ b/engines/twine/holomap_v1.cpp
@@ -429,7 +429,7 @@ void HolomapV1::holoTraj(int32 trajectoryIndex) {
_engine->_screens->fadeToPal(_engine->_screens->_palettePcx);
}
++_engine->timerRef;
- debugC(3, kDebugLevels::kDebugTime, "Holomap time: %i", _engine->timerRef);
+ debugC(3, kDebugLevels::kDebugTimers, "Holomap time: %i", _engine->timerRef);
}
_engine->_screens->clearScreen();
@@ -680,7 +680,7 @@ void HolomapV1::holoMap() {
}
++_engine->timerRef;
- debugC(3, kDebugLevels::kDebugTime, "Holomap time: %i", _engine->timerRef);
+ debugC(3, kDebugLevels::kDebugTimers, "Holomap time: %i", _engine->timerRef);
if (flagpal) {
flagpal = false;
diff --git a/engines/twine/input.cpp b/engines/twine/input.cpp
index 3839a3d7e2a..d8f99926032 100644
--- a/engines/twine/input.cpp
+++ b/engines/twine/input.cpp
@@ -120,17 +120,17 @@ void Input::enableKeyMap(const char *id) {
}
}
_currentKeyMap = id;
- debug("enable keymap %s", id);
+ debugC(1, TwinE::kDebugInput, "enable keymap %s", id);
}
void Input::processCustomEngineEventStart(const Common::Event &event) {
_actionStates[event.customType] = 1 + event.kbdRepeat;
- debug(3, "twine custom event type start: %i", event.customType);
+ debugC(2, TwinE::kDebugInput, "twine custom event type start: %i", event.customType);
}
void Input::processCustomEngineEventEnd(const Common::Event &event) {
_actionStates[event.customType] = 0;
- debug(3, "twine custom event type end: %i", event.customType);
+ debugC(2, TwinE::kDebugInput, "twine custom event type end: %i", event.customType);
}
void Input::readKeys() {
diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index 36aff35f050..e781528751a 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -1288,7 +1288,7 @@ void Menu::processBehaviourMenu(bool behaviourMenu) {
// increase the timer to play the animations
_engine->timerRef++;
- debugC(3, kDebugLevels::kDebugTime, "Behaviour time: %i", _engine->timerRef);
+ debugC(3, kDebugLevels::kDebugTimers, "Behaviour time: %i", _engine->timerRef);
}
_engine->timerRef = tmpTime;
diff --git a/engines/twine/movies.cpp b/engines/twine/movies.cpp
index e691b8a2f98..c8f4975f9cb 100644
--- a/engines/twine/movies.cpp
+++ b/engines/twine/movies.cpp
@@ -20,6 +20,7 @@
*/
#include "twine/movies.h"
+#include "common/debug.h"
#include "common/endian.h"
#include "common/file.h"
#include "common/language.h"
@@ -311,7 +312,7 @@ void Movies::prepareGIF(int index) {
Graphics::ManagedSurface& target = _engine->_frontVideoBuffer;
const Common::Rect surfaceBounds(0, 0, surface->w, surface->h);
target.transBlitFrom(*surface, surfaceBounds, target.getBounds(), 0, false, 0, 0xff, nullptr, true);
- debug(2, "Show gif with id %i from %s", index, Resources::HQR_FLAGIF_FILE);
+ debugC(1, TwinE::kDebugMovies, "Show gif with id %i from %s", index, Resources::HQR_FLAGIF_FILE);
delete stream;
_engine->delaySkip(5000);
_engine->setPalette(_engine->_screens->_ptrPal);
@@ -326,7 +327,7 @@ void Movies::playGIFMovie(const char *flaName) {
Common::String name(flaName);
name.toLowercase();
- debug(1, "Play gif %s", name.c_str());
+ debugC(1, TwinE::kDebugMovies, "Play gif %s", name.c_str());
// TODO: use the HQR 23th entry (movies informations)
// TODO: there are gifs [1-18]
if (name == FLA_INTROD) {
@@ -412,7 +413,7 @@ bool Movies::playMovie(const char *name) { // PlayAnimFla
if (version == MKTAG('V', '1', '.', '3')) {
int32 currentFrame = 0;
- debug("Play fla: %s", name);
+ debugC(1, TwinE::kDebugMovies, "Play fla: %s", name);
ScopedKeyMap scopedKeyMap(_engine, cutsceneKeyMapId);
@@ -508,10 +509,10 @@ bool Movies::playSmkMovie(const char *name, int index) {
}
}
const int speechVolume = _engine->_system->getMixer()->getVolumeForSoundType(Audio::Mixer::kSpeechSoundType);
- debug(3, "Play additional speech track: %i (of %i tracks)", additionalAudioTrack, decoder.getAudioTrackCount());
+ debugC(1, TwinE::kDebugMovies, "Play additional speech track: %i (of %i tracks)", additionalAudioTrack, decoder.getAudioTrackCount());
decoder.enableLanguage(additionalAudioTrack, speechVolume);
} else {
- debug(3, "Disabled smacker speech");
+ debugC(1, TwinE::kDebugMovies, "Disabled smacker speech");
}
for (;;) {
diff --git a/engines/twine/parser/text.cpp b/engines/twine/parser/text.cpp
index b0f556ce211..a3d58815acb 100644
--- a/engines/twine/parser/text.cpp
+++ b/engines/twine/parser/text.cpp
@@ -79,7 +79,7 @@ bool TextData::loadFromHQR(const char *name, TextBankId textBankId, int language
result += c;
}
add(textBankId, TextEntry{result, entry, textIdx});
- debug(5, "index: %i (bank %i), text: %s", (int)textIdx, (int)textBankId, result.c_str());
+ debugC(2, TwinE::kDebugResources, "index: %i (bank %i), text: %s", (int)textIdx, (int)textBankId, result.c_str());
offsetStream->seek(offsetPos);
if (end >= offsetStream->size()) {
break;
@@ -99,7 +99,7 @@ const TextEntry *TextData::getText(TextBankId textBankId, TextId textIndex) cons
return &entries[i];
}
}
- debug(1, "Failed to find text entry for bank id %i with text index %i", (int)textBankId, (int)textIndex);
+ debugC(1, TwinE::kDebugResources, "Failed to find text entry for bank id %i with text index %i", (int)textBankId, (int)textIndex);
return nullptr;
}
diff --git a/engines/twine/renderer/screens.cpp b/engines/twine/renderer/screens.cpp
index 1da3a56efcd..0b3920ef60f 100644
--- a/engines/twine/renderer/screens.cpp
+++ b/engines/twine/renderer/screens.cpp
@@ -72,7 +72,6 @@ void Screens::loadCustomPalette(const TwineResource &resource) {
if (_palettePcx.size() != NUMOFCOLORS) {
warning("Unexpected palette size %s:%i", resource.hqr, resource.index);
}
- debug(3, "palette %s:%i with %u colors", resource.hqr, resource.index, _palettePcx.size());
}
void Screens::loadImage(TwineImage image, bool fadeIn) {
@@ -81,7 +80,7 @@ void Screens::loadImage(TwineImage image, bool fadeIn) {
warning("Failed to load image with index %i", image.image.index);
return;
}
- debug(0, "Load image: %i", image.image.index);
+ debugC(1, TwinE::kDebugResources, "Load image: %i", image.image.index);
Graphics::ManagedSurface& target = _engine->_frontVideoBuffer;
target.transBlitFrom(src, src.getBounds(), target.getBounds(), 0, false, 0, 0xff, nullptr, true);
const Graphics::Palette *pal = &_ptrPal;
diff --git a/engines/twine/resources/hqr.cpp b/engines/twine/resources/hqr.cpp
index ffb49fcf7b0..538062732cd 100644
--- a/engines/twine/resources/hqr.cpp
+++ b/engines/twine/resources/hqr.cpp
@@ -153,7 +153,7 @@ int32 getEntry(uint8 *ptr, const char *filename, int32 index) {
decompressEntry(ptr, compDataPtr, compSize, realSize, mode);
free(compDataPtr);
}
-
+ debugC(1, TwinE::kDebugResources, "Loaded entry from %s for index %i with %i bytes", filename, index, realSize);
return realSize;
}
@@ -239,7 +239,7 @@ Common::SeekableReadStream *makeReadStream(const char *filename, int index) {
if (mode != 0) {
stream = new LzssReadStream(stream, mode, realSize);
}
-
+ debugC(1, TwinE::kDebugResources, "Loaded entry from %s for index %i with %i bytes", filename, index, realSize);
return stream;
}
@@ -333,7 +333,7 @@ int32 getVoxEntry(uint8 *ptr, const char *filename, int32 index, int32 hiddenInd
decompressEntry(ptr, compDataPtr, compSize, realSize, mode);
free(compDataPtr);
}
-
+ debugC(1, TwinE::kDebugResources, "Loaded vox entry from %s for index %i with %i bytes", filename, index, realSize);
return realSize;
}
@@ -341,9 +341,12 @@ bool getPaletteEntry(Graphics::Palette &palette, const char *filename, int32 ind
byte paletteBuffer[NUMOFCOLORS * 3];
int32 size = HQR::getEntry(paletteBuffer, filename, index);
if (size <= 0) {
+ debugC(1, TwinE::kDebugResources, "Failed to load palette from %s for index %i", filename, index);
return false;
}
palette = Graphics::Palette(paletteBuffer, size / 3);
+ debugC(1, TwinE::kDebugResources, "Loaded palette from %s for index %i with %i color entries", filename, index, (int)palette.size());
+ debugC(1, TwinE::kDebugPalette, "Loaded palette from %s for index %i with %i color entries", filename, index, (int)palette.size());
return true;
}
diff --git a/engines/twine/resources/resources.cpp b/engines/twine/resources/resources.cpp
index a99422d67bf..0c6659089a0 100644
--- a/engines/twine/resources/resources.cpp
+++ b/engines/twine/resources/resources.cpp
@@ -92,7 +92,7 @@ void Resources::preloadSprites() {
if (numEntries > maxSprites) {
error("Max allowed sprites exceeded: %i/%i", numEntries, maxSprites);
}
- debug("preload %i sprites", numEntries);
+ debugC(1, TwinE::kDebugResources, "preload %i sprites", numEntries);
for (int32 i = 0; i < numEntries; i++) {
_spriteSizeTable[i] = HQR::getAllocEntry(&_spriteTable[i], Resources::HQR_SPRITES_FILE, i);
if (!_spriteData[i].loadFromBuffer(_spriteTable[i], _spriteSizeTable[i], _engine->isLBA1())) {
@@ -107,7 +107,7 @@ void Resources::preloadAnimations() {
if (numEntries > maxAnims) {
error("Max allowed animations exceeded: %i/%i", numEntries, maxAnims);
}
- debug("preload %i animations", numEntries);
+ debugC(1, TwinE::kDebugResources, "preload %i animations", numEntries);
for (int32 i = 0; i < numEntries; i++) {
_animData[i].loadFromHQR(Resources::HQR_ANIM_FILE, i, _engine->isLBA1());
}
@@ -130,7 +130,7 @@ void Resources::preloadSamples() {
if (numEntries > maxSamples) {
error("Max allowed samples exceeded: %i/%i", numEntries, maxSamples);
}
- debug("preload %i samples", numEntries);
+ debugC(1, TwinE::kDebugResources, "preload %i samples", numEntries);
for (int32 i = 0; i < numEntries; i++) {
if (_engine->isLBA1() && isLba1BlankSampleEntry(i)) {
_samplesSizeTable[i] = 0;
@@ -144,7 +144,7 @@ void Resources::preloadSamples() {
}
// Fix incorrect sample files first byte
if (*_samplesTable[i] != 'C') {
- debug("Sample %i has incorrect magic id (size: %u)", i, _samplesSizeTable[i]);
+ debugC(1, TwinE::kDebugResources, "Sample %i has incorrect magic id (size: %u)", i, _samplesSizeTable[i]);
*_samplesTable[i] = 'C';
}
}
@@ -159,7 +159,7 @@ void Resources::preloadInventoryItems() {
if (numEntries > NUM_INVENTORY_ITEMS) {
error("Max allowed inventory items exceeded: %i/%i", numEntries, NUM_INVENTORY_ITEMS);
}
- debug("preload %i inventory items", numEntries);
+ debugC(1, TwinE::kDebugResources, "preload %i inventory items", numEntries);
for (int32 i = 0; i < numEntries; i++) {
_inventoryTable[i].loadFromHQR(Resources::HQR_INVOBJ_FILE, i, _engine->isLBA1());
}
@@ -214,7 +214,7 @@ void Resources::initResources() {
if (!_trajectories.loadFromHQR(TwineResource(Resources::HQR_RESS_FILE, RESSHQR_HOLOPOINTANIM), _engine->isLBA1())) {
error("Failed to parse trajectory data");
}
- debug("preload %i trajectories", (int)_trajectories.getTrajectories().size());
+ debugC(1, TwinE::kDebugResources, "preload %i trajectories", (int)_trajectories.getTrajectories().size());
} else if (_engine->isLBA2()) {
preloadAnim3DS();
}
@@ -232,7 +232,7 @@ void Resources::initResources() {
error("HQR ERROR: Parsing textbank %i failed", i);
}
}
- debug("Loaded %i text banks", textEntryCount / 2);
+ debugC(1, TwinE::kDebugResources, "Loaded %i text banks", textEntryCount / 2);
}
const TextEntry *Resources::getText(TextBankId textBankId, TextId index) const {
@@ -263,7 +263,7 @@ void Resources::loadMovieInfo() {
}
const Common::String str((const char *)content, size);
free(content);
- debug(3, "movie info:\n%s", str.c_str());
+ debugC(2, TwinE::kDebugResources, "movie info:\n%s", str.c_str());
Common::StringTokenizer tok(str, "\r\n");
int videoIndex = 0;
while (!tok.empty()) {
@@ -289,7 +289,7 @@ void Resources::loadMovieInfo() {
line = line.substr(0, line.size() - 4);
}
_movieInfo.setVal(line, info);
- debug(4, "movie name %s mapped to hqr index %i", line.c_str(), videoIndex);
+ debugC(1, TwinE::kDebugResources, "movie name %s mapped to hqr index %i", line.c_str(), videoIndex);
++videoIndex;
}
}
diff --git a/engines/twine/scene/collision.cpp b/engines/twine/scene/collision.cpp
index 86991391731..ba45a2c2e43 100644
--- a/engines/twine/scene/collision.cpp
+++ b/engines/twine/scene/collision.cpp
@@ -20,8 +20,6 @@
*/
#include "twine/scene/collision.h"
-#include "common/debug.h"
-#include "common/memstream.h"
#include "common/util.h"
#include "twine/debugger/debug_state.h"
#include "twine/renderer/renderer.h"
diff --git a/engines/twine/scene/gamestate.cpp b/engines/twine/scene/gamestate.cpp
index 477db2f6ea4..86e3ebcaee8 100644
--- a/engines/twine/scene/gamestate.cpp
+++ b/engines/twine/scene/gamestate.cpp
@@ -454,7 +454,7 @@ void GameState::doFoundObj(InventoryItems item) {
// advance the timer to play animations
_engine->timerRef++;
- debugC(3, kDebugLevels::kDebugTime, "FoundObj time: %i", _engine->timerRef);
+ debugC(3, kDebugLevels::kDebugTimers, "FoundObj time: %i", _engine->timerRef);
}
while (_engine->_text->playVoxSimple(_engine->_text->_currDialTextEntry)) {
@@ -546,7 +546,7 @@ void GameState::processGameoverAnimation() {
_engine->_renderer->affObjetIso(0, 0, 0, LBAAngles::ANGLE_0, LBAAngles::ANGLE_0, LBAAngles::ANGLE_0, gameOverPtr, dummy);
_engine->timerRef++;
- debugC(3, kDebugLevels::kDebugTime, "GameOver time: %i", _engine->timerRef);
+ debugC(3, kDebugLevels::kDebugTimers, "GameOver time: %i", _engine->timerRef);
}
_engine->_sound->playSample(Samples::Explode);
diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index 38235ef2fb2..421afcbcb79 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -545,7 +545,7 @@ void Scene::changeCube() {
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;
- debug(3, "Using zone position %i:%i:%i", pos.x, pos.y, pos.z);
+ debug(2, "Using zone position %i:%i:%i", pos.x, pos.y, pos.z);
}
}
}
diff --git a/engines/twine/script/script_life.cpp b/engines/twine/script/script_life.cpp
index ead3416fc1f..792eca40868 100644
--- a/engines/twine/script/script_life.cpp
+++ b/engines/twine/script/script_life.cpp
@@ -127,7 +127,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
} else {
engine->_scene->_currentScriptValue = ctx.actor->_objCol;
}
- debugCN(3, kDebugLevels::kDebugScripts, "collision(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "collision(");
break;
case kcCOL_OBJ: {
int32 actorIdx = ctx.stream.readByte();
@@ -136,12 +136,12 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
} else {
engine->_scene->_currentScriptValue = engine->_scene->getActor(actorIdx)->_objCol;
}
- debugCN(3, kDebugLevels::kDebugScripts, "col_obj(%i", actorIdx);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "col_obj(%i", actorIdx);
break;
}
case kcDISTANCE: {
int32 actorIdx = ctx.stream.readByte();
- debugCN(3, kDebugLevels::kDebugScripts, "distance(%i", actorIdx);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "distance(%i", actorIdx);
conditionValueSize = ReturnType::RET_S16;
ActorStruct *otherActor = engine->_scene->getActor(actorIdx);
if (otherActor->_workFlags.bIsDead) {
@@ -163,7 +163,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
}
case kcDISTANCE_3D: {
int32 targetActorIdx = ctx.stream.readByte();
- debugCN(3, kDebugLevels::kDebugScripts, "distance_3d(%i", targetActorIdx);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "distance_3d(%i", targetActorIdx);
ActorStruct *targetActor = engine->_scene->getActor(targetActorIdx);
conditionValueSize = ReturnType::RET_S16;
@@ -184,7 +184,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
case kcCONE_VIEW: {
int32 newAngle = 0;
int32 targetActorIdx = ctx.stream.readByte();
- debugCN(3, kDebugLevels::kDebugScripts, "cone_view(%i", targetActorIdx);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "cone_view(%i", targetActorIdx);
ActorStruct *targetActor = engine->_scene->getActor(targetActorIdx);
conditionValueSize = ReturnType::RET_S16;
@@ -227,70 +227,70 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
break;
}
case kcZONE:
- debugCN(3, kDebugLevels::kDebugScripts, "zone(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "zone(");
engine->_scene->_currentScriptValue = ctx.actor->_zoneSce;
break;
case kcZONE_OBJ: {
int32 actorIdx = ctx.stream.readByte();
- debugCN(3, kDebugLevels::kDebugScripts, "zone_obj(%i", actorIdx);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "zone_obj(%i", actorIdx);
engine->_scene->_currentScriptValue = engine->_scene->getActor(actorIdx)->_zoneSce;
break;
}
case kcBODY:
- debugCN(3, kDebugLevels::kDebugScripts, "body(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "body(");
engine->_scene->_currentScriptValue = (int16)ctx.actor->_genBody;
break;
case kcBODY_OBJ: {
int32 actorIdx = ctx.stream.readByte();
- debugCN(3, kDebugLevels::kDebugScripts, "body_obj(%i", actorIdx);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "body_obj(%i", actorIdx);
engine->_scene->_currentScriptValue = (int16)engine->_scene->getActor(actorIdx)->_genBody;
break;
}
case kcANIM:
- debugCN(3, kDebugLevels::kDebugScripts, "anim(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "anim(");
engine->_scene->_currentScriptValue = (int16)ctx.actor->_genAnim;
break;
case kcANIM_OBJ: {
int32 actorIdx = ctx.stream.readByte();
- debugCN(3, kDebugLevels::kDebugScripts, "anim_obj(%i", actorIdx);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "anim_obj(%i", actorIdx);
engine->_scene->_currentScriptValue = (int16)engine->_scene->getActor(actorIdx)->_genAnim;
break;
}
case kcL_TRACK:
- debugCN(3, kDebugLevels::kDebugScripts, "track(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "track(");
conditionValueSize = ReturnType::RET_U8;
engine->_scene->_currentScriptValue = ctx.actor->_labelTrack;
break;
case kcL_TRACK_OBJ: {
int32 actorIdx = ctx.stream.readByte();
- debugCN(3, kDebugLevels::kDebugScripts, "track_obj(%i", actorIdx);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "track_obj(%i", actorIdx);
engine->_scene->_currentScriptValue = engine->_scene->getActor(actorIdx)->_labelTrack;
break;
}
case kcFLAG_CUBE: {
int32 flagIdx = ctx.stream.readByte();
- debugCN(3, kDebugLevels::kDebugScripts, "flag_cube(%i", flagIdx);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "flag_cube(%i", flagIdx);
conditionValueSize = ReturnType::RET_U8;
engine->_scene->_currentScriptValue = engine->_scene->_listFlagCube[flagIdx];
break;
}
case kcHIT_BY:
- debugCN(3, kDebugLevels::kDebugScripts, "hit_by(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "hit_by(");
engine->_scene->_currentScriptValue = ctx.actor->_hitBy;
break;
case kcHIT_OBJ_BY: {
int32 actorIdx = ctx.stream.readByte();
engine->_scene->_currentScriptValue = engine->_scene->getActor(actorIdx)->_hitBy;
- debugCN(3, kDebugLevels::kDebugScripts, "hit_by(%i", actorIdx);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "hit_by(%i", actorIdx);
break;
}
case kcACTION:
- debugCN(3, kDebugLevels::kDebugScripts, "action(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "action(");
engine->_scene->_currentScriptValue = engine->_movements->shouldExecuteAction() ? 1 : 0;
break;
case kcFLAG_GAME: {
int32 flagIdx = ctx.stream.readByte();
- debugCN(3, kDebugLevels::kDebugScripts, "flag_game(%i", flagIdx);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "flag_game(%i", flagIdx);
if (!engine->_gameState->inventoryDisabled() ||
(engine->_gameState->inventoryDisabled() && flagIdx >= MaxInventoryItems)) {
engine->_scene->_currentScriptValue = engine->_gameState->hasGameFlag(flagIdx);
@@ -305,7 +305,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
break;
}
case kcLIFE_POINT:
- debugCN(3, kDebugLevels::kDebugScripts, "life_point(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "life_point(");
if (engine->isLBA2()) {
conditionValueSize = ReturnType::RET_S16;
}
@@ -313,16 +313,16 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
break;
case kcLIFE_POINT_OBJ: {
int32 actorIdx = ctx.stream.readByte();
- debugCN(3, kDebugLevels::kDebugScripts, "life_point_obj(%i", actorIdx);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "life_point_obj(%i", actorIdx);
engine->_scene->_currentScriptValue = engine->_scene->getActor(actorIdx)->_lifePoint;
break;
}
case kcNUM_LITTLE_KEYS:
- debugCN(3, kDebugLevels::kDebugScripts, "num_little_keys(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "num_little_keys(");
engine->_scene->_currentScriptValue = engine->_gameState->_inventoryNumKeys;
break;
case kcNUM_GOLD_PIECES:
- debugCN(3, kDebugLevels::kDebugScripts, "num_gold_pieces(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "num_gold_pieces(");
conditionValueSize = ReturnType::RET_S16;
if (engine->_scene->_planet > 2) {
engine->_scene->_currentScriptValue = engine->_gameState->_zlitosPieces;
@@ -331,24 +331,24 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
}
break;
case kcBEHAVIOUR:
- debugCN(3, kDebugLevels::kDebugScripts, "behaviour(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "behaviour(");
engine->_scene->_currentScriptValue = (int16)engine->_actor->_heroBehaviour;
break;
case kcCHAPTER:
- debugCN(3, kDebugLevels::kDebugScripts, "chapter(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "chapter(");
engine->_scene->_currentScriptValue = engine->_gameState->getChapter();
break;
case kcMAGIC_LEVEL:
- debugCN(3, kDebugLevels::kDebugScripts, "magic_level(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "magic_level(");
engine->_scene->_currentScriptValue = engine->_gameState->_magicLevelIdx;
break;
case kcMAGIC_POINTS:
- debugCN(3, kDebugLevels::kDebugScripts, "magic_points(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "magic_points(");
engine->_scene->_currentScriptValue = engine->_gameState->_magicPoint;
break;
case kcUSE_INVENTORY: {
int32 item = ctx.stream.readByte();
- debugCN(3, kDebugLevels::kDebugScripts, "use_inventory(%i", item);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "use_inventory(%i", item);
if (engine->_gameState->inventoryDisabled()) {
engine->_scene->_currentScriptValue = 0;
@@ -370,70 +370,70 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
break;
}
case kcCHOICE:
- debugCN(3, kDebugLevels::kDebugScripts, "choice(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "choice(");
conditionValueSize = ReturnType::RET_S16;
engine->_scene->_currentScriptValue = (int16)engine->_gameState->_gameChoice;
break;
case kcFUEL:
- debugCN(3, kDebugLevels::kDebugScripts, "fuel(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "fuel(");
if (engine->isLBA2()) {
conditionValueSize = ReturnType::RET_S16;
}
engine->_scene->_currentScriptValue = engine->_gameState->_inventoryNumGas;
break;
case kcCARRIED_BY:
- debugCN(3, kDebugLevels::kDebugScripts, "carried_by(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "carried_by(");
engine->_scene->_currentScriptValue = ctx.actor->_carryBy;
break;
case kcCDROM:
// used in lba1 scenes 80 and 117
- debugCN(3, kDebugLevels::kDebugScripts, "cdrom(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "cdrom(");
engine->_scene->_currentScriptValue = engine->isCDROM();
break;
case kcCARRY_OBJ_BY: {
int32 actorIdx = ctx.stream.readByte();
engine->_scene->_currentScriptValue = engine->_scene->getActor(actorIdx)->_carryBy;
- debugCN(3, kDebugLevels::kDebugScripts, "carried_by(%i", actorIdx);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "carried_by(%i", actorIdx);
break;
}
case kcRND: {
int32 val = ctx.stream.readByte();
engine->_scene->_currentScriptValue = engine->getRandomNumber(val);
- debugCN(3, kDebugLevels::kDebugScripts, "rand(%i", val);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "rand(%i", val);
conditionValueSize = ReturnType::RET_U8;
break;
}
case kcBETA:
engine->_scene->_currentScriptValue = ctx.actor->_beta;
- debugCN(3, kDebugLevels::kDebugScripts, "beta(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "beta(");
conditionValueSize = ReturnType::RET_S16;
break;
case kcBETA_OBJ: {
int32 actorIdx = ctx.stream.readByte();
- debugCN(3, kDebugLevels::kDebugScripts, "beta_obj(%i", actorIdx);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "beta_obj(%i", actorIdx);
engine->_scene->_currentScriptValue = engine->_scene->getActor(actorIdx)->_beta;
conditionValueSize = ReturnType::RET_S16;
break;
}
case kcDEMO:
- debugCN(3, kDebugLevels::kDebugScripts, "isdemo(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "isdemo(");
engine->_scene->_currentScriptValue = engine->isDemo() ? 1 : 0; // TODO: slide demo is 2
break;
case kcOBJECT_DISPLAYED: {
int32 actorIdx = ctx.stream.readByte();
- debugCN(3, kDebugLevels::kDebugScripts, "drawn_obj(%i", actorIdx);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "drawn_obj(%i", actorIdx);
engine->_scene->_currentScriptValue = engine->_scene->getActor(actorIdx)->_workFlags.bWasDrawn ? 1 : 0;
break;
}
case kcPROCESSOR:
// TODO psx = 2, pentium = 0, 486 = 1
- debugCN(3, kDebugLevels::kDebugScripts, "processor(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "processor(");
engine->_scene->_currentScriptValue = 0;
break;
case kcANGLE: {
conditionValueSize = ReturnType::RET_S16;
int32 actorIdx = ctx.stream.readByte();
- debugCN(3, kDebugLevels::kDebugScripts, "angle(%i, %i", ctx.actorIdx, actorIdx);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "angle(%i, %i", ctx.actorIdx, actorIdx);
ActorStruct *otherActor = engine->_scene->getActor(actorIdx);
if (otherActor->_workFlags.bIsDead) {
engine->_scene->_currentScriptValue = MAX_TARGET_ACTOR_DISTANCE;
@@ -449,7 +449,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
case kcANGLE_OBJ: {
conditionValueSize = ReturnType::RET_S16;
int32 actorIdx = ctx.stream.readByte();
- debugCN(3, kDebugLevels::kDebugScripts, "angle_obj(%i, %i", actorIdx, ctx.actorIdx);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "angle_obj(%i, %i", actorIdx, ctx.actorIdx);
ActorStruct *otherActor = engine->_scene->getActor(actorIdx);
if (otherActor->_workFlags.bIsDead) {
engine->_scene->_currentScriptValue = MAX_TARGET_ACTOR_DISTANCE;
@@ -465,7 +465,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
case kcREAL_ANGLE: {
conditionValueSize = ReturnType::RET_S16;
int32 actorIdx = ctx.stream.readByte();
- debugCN(3, kDebugLevels::kDebugScripts, "real_angle(%i", actorIdx);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "real_angle(%i", actorIdx);
ActorStruct *otherActor = engine->_scene->getActor(actorIdx);
if (otherActor->_workFlags.bIsDead) {
engine->_scene->_currentScriptValue = MAX_TARGET_ACTOR_DISTANCE;
@@ -481,7 +481,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
break;
}
case kcCOL_DECORS:
- debugCN(3, kDebugLevels::kDebugScripts, "col_decors(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "col_decors(");
if (ctx.actor->_workFlags.bIsDead) {
engine->_scene->_currentScriptValue = 255;
break;
@@ -491,7 +491,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
break;
case kcCOL_DECORS_OBJ: {
int32 actorIdx = ctx.stream.readByte();
- debugCN(3, kDebugLevels::kDebugScripts, "col_decors_obj(%i", actorIdx);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "col_decors_obj(%i", actorIdx);
ActorStruct *otherActor = engine->_scene->getActor(actorIdx);
if (otherActor->_workFlags.bIsDead) {
engine->_scene->_currentScriptValue = 255;
@@ -503,7 +503,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
}
case kcLADDER: {
int32 num = ctx.stream.readByte();
- debugCN(3, kDebugLevels::kDebugScripts, "ladder(%i", num);
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "ladder(%i", num);
int n = 0;
engine->_scene->_currentScriptValue = 2;
while (engine->_scene->_currentScriptValue == 2 && n < engine->_scene->_sceneNumZones) {
@@ -605,37 +605,37 @@ static int32 processLifeOperators(TwinEEngine *engine, LifeScriptContext &ctx, R
switch (operatorCode) {
case kEqualTo:
- debugCN(3, kDebugLevels::kDebugScripts, ")[%i] == %i)", engine->_scene->_currentScriptValue, conditionValue);
+ debugC(3, kDebugLevels::kDebugScriptsLife, ")[%i] == %i)", engine->_scene->_currentScriptValue, conditionValue);
if (engine->_scene->_currentScriptValue == conditionValue) {
return 1;
}
break;
case kGreaterThan:
- debugCN(3, kDebugLevels::kDebugScripts, ")[%i] > %i)", engine->_scene->_currentScriptValue, conditionValue);
+ debugC(3, kDebugLevels::kDebugScriptsLife, ")[%i] > %i)", engine->_scene->_currentScriptValue, conditionValue);
if (engine->_scene->_currentScriptValue > conditionValue) {
return 1;
}
break;
case kLessThan:
- debugCN(3, kDebugLevels::kDebugScripts, ")[%i] < %i)", engine->_scene->_currentScriptValue, conditionValue);
+ debugC(3, kDebugLevels::kDebugScriptsLife, ")[%i] < %i)", engine->_scene->_currentScriptValue, conditionValue);
if (engine->_scene->_currentScriptValue < conditionValue) {
return 1;
}
break;
case kGreaterThanOrEqualTo:
- debugCN(3, kDebugLevels::kDebugScripts, ")[%i] >= %i)", engine->_scene->_currentScriptValue, conditionValue);
+ debugC(3, kDebugLevels::kDebugScriptsLife, ")[%i] >= %i)", engine->_scene->_currentScriptValue, conditionValue);
if (engine->_scene->_currentScriptValue >= conditionValue) {
return 1;
}
break;
case kLessThanOrEqualTo:
- debugCN(3, kDebugLevels::kDebugScripts, ")[%i] <= %i)", engine->_scene->_currentScriptValue, conditionValue);
+ debugC(3, kDebugLevels::kDebugScriptsLife, ")[%i] <= %i)", engine->_scene->_currentScriptValue, conditionValue);
if (engine->_scene->_currentScriptValue <= conditionValue) {
return 1;
}
break;
case kNotEqualTo:
- debugCN(3, kDebugLevels::kDebugScripts, ")[%i] != %i)", engine->_scene->_currentScriptValue, conditionValue);
+ debugC(3, kDebugLevels::kDebugScriptsLife, ")[%i] != %i)", engine->_scene->_currentScriptValue, conditionValue);
if (engine->_scene->_currentScriptValue != conditionValue) {
return 1;
}
@@ -655,7 +655,7 @@ static int32 processLifeOperators(TwinEEngine *engine, LifeScriptContext &ctx, R
* For unused opcodes
*/
int32 ScriptLife::lEMPTY(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::EMPTY()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::EMPTY()");
return 0;
}
@@ -664,7 +664,7 @@ int32 ScriptLife::lEMPTY(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x00
*/
int32 ScriptLife::lEND(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::END()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::END()");
ctx.actor->_offsetLife = -1;
return 1; // break script
}
@@ -674,7 +674,7 @@ int32 ScriptLife::lEND(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x01
*/
int32 ScriptLife::lNOP(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::NOP()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::NOP()");
ctx.stream.skip(1);
return 0;
}
@@ -685,12 +685,12 @@ int32 ScriptLife::lNOP(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lSNIF(TwinEEngine *engine, LifeScriptContext &ctx) {
const ReturnType valueType = processLifeConditions(engine, ctx);
- debugCN(3, kDebugLevels::kDebugScripts, "LIFE::IF(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "LIFE::IF(");
if (!processLifeOperators(engine, ctx, valueType)) {
ctx.setOpcode(0x0D); // SWIF
}
const int16 offset = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, ", %i)", offset);
+ debugC(3, kDebugLevels::kDebugScriptsLife, ", %i)", offset);
ctx.stream.seek(offset); // condition offset
return 0;
}
@@ -701,7 +701,7 @@ int32 ScriptLife::lSNIF(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lOFFSET(TwinEEngine *engine, LifeScriptContext &ctx) {
const int16 offset = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::LABEL(%i)", (int)offset);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::LABEL(%i)", (int)offset);
ctx.stream.seek(offset); // offset
return 0;
}
@@ -711,11 +711,11 @@ int32 ScriptLife::lOFFSET(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x04
*/
int32 ScriptLife::lNEVERIF(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugCN(3, kDebugLevels::kDebugScripts, "LIFE::IF(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "LIFE::IF(");
const ReturnType valueType = processLifeConditions(engine, ctx);
processLifeOperators(engine, ctx, valueType);
const int16 offset = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, ", %i)", offset);
+ debugC(3, kDebugLevels::kDebugScriptsLife, ", %i)", offset);
ctx.stream.seek(offset); // condition offset
return 0;
}
@@ -725,7 +725,7 @@ int32 ScriptLife::lNEVERIF(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x06
*/
int32 ScriptLife::lNO_IF(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::NO_IF()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::NO_IF()");
return 0;
}
@@ -734,7 +734,7 @@ int32 ScriptLife::lNO_IF(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x0A
*/
int32 ScriptLife::lLABEL(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::LABEL(x)");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::LABEL(x)");
ctx.stream.skip(1); // label id - script offset
return 0;
}
@@ -744,7 +744,7 @@ int32 ScriptLife::lLABEL(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x0B
*/
int32 ScriptLife::lRETURN(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::RETURN()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::RETURN()");
return 1; // break script
}
@@ -753,15 +753,15 @@ int32 ScriptLife::lRETURN(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x0C
*/
int32 ScriptLife::lIF(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugCN(3, kDebugLevels::kDebugScripts, "LIFE::IF(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "LIFE::IF(");
const ReturnType valueType = processLifeConditions(engine, ctx);
if (!processLifeOperators(engine, ctx, valueType)) {
const int16 offset = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, ", %i)", offset);
+ debugC(3, kDebugLevels::kDebugScriptsLife, ", %i)", offset);
ctx.stream.seek(offset); // condition offset
} else {
ctx.stream.skip(2);
- debugC(3, kDebugLevels::kDebugScripts, ")");
+ debugC(3, kDebugLevels::kDebugScriptsLife, ")");
}
return 0;
@@ -772,16 +772,16 @@ int32 ScriptLife::lIF(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x0D
*/
int32 ScriptLife::lSWIF(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugCN(3, kDebugLevels::kDebugScripts, "LIFE::SWIF(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "LIFE::SWIF(");
const ReturnType valueType = processLifeConditions(engine, ctx);
if (!processLifeOperators(engine, ctx, valueType)) {
const int16 offset = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, ", %i)", offset);
+ debugC(3, kDebugLevels::kDebugScriptsLife, ", %i)", offset);
ctx.stream.seek(offset); // condition offset
} else {
ctx.stream.skip(2);
ctx.setOpcode(0x02); // SNIF
- debugC(3, kDebugLevels::kDebugScripts, ")");
+ debugC(3, kDebugLevels::kDebugScriptsLife, ")");
}
return 0;
@@ -792,16 +792,16 @@ int32 ScriptLife::lSWIF(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x0E
*/
int32 ScriptLife::lONEIF(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugCN(3, kDebugLevels::kDebugScripts, "LIFE::ONEIF(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "LIFE::ONEIF(");
const ReturnType valueType = processLifeConditions(engine, ctx);
if (!processLifeOperators(engine, ctx, valueType)) {
const int16 offset = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, ", %i)", offset);
+ debugC(3, kDebugLevels::kDebugScriptsLife, ", %i)", offset);
ctx.stream.seek(offset); // condition offset
} else {
ctx.stream.skip(2);
ctx.setOpcode(0x04); // NEVERIF
- debugC(3, kDebugLevels::kDebugScripts, ")");
+ debugC(3, kDebugLevels::kDebugScriptsLife, ")");
}
return 0;
@@ -813,7 +813,7 @@ int32 ScriptLife::lONEIF(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lELSE(TwinEEngine *engine, LifeScriptContext &ctx) {
const int16 offset = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::ELSE(%i)", (int)offset);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::ELSE(%i)", (int)offset);
ctx.stream.seek(offset); // offset
return 0;
}
@@ -824,7 +824,7 @@ int32 ScriptLife::lELSE(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lBODY(TwinEEngine *engine, LifeScriptContext &ctx) {
const BodyType bodyIdx = (BodyType)ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::BODY(%i)", (int)bodyIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::BODY(%i)", (int)bodyIdx);
engine->_actor->initBody(bodyIdx, ctx.actorIdx);
return 0;
}
@@ -836,7 +836,7 @@ int32 ScriptLife::lBODY(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLife::lBODY_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 otherActorIdx = ctx.stream.readByte();
const BodyType otherBodyIdx = (BodyType)ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::BODY_OBJ(%i, %i)", (int)otherActorIdx, (int)otherBodyIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::BODY_OBJ(%i, %i)", (int)otherActorIdx, (int)otherBodyIdx);
engine->_actor->initBody(otherBodyIdx, otherActorIdx);
return 0;
}
@@ -847,7 +847,7 @@ int32 ScriptLife::lBODY_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lANIM(TwinEEngine *engine, LifeScriptContext &ctx) {
const AnimationTypes animIdx = (AnimationTypes)ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::ANIM(%i)", (int)animIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::ANIM(%i)", (int)animIdx);
engine->_animations->initAnim(animIdx, AnimType::kAnimationTypeRepeat, AnimationTypes::kStanding, ctx.actorIdx);
return 0;
}
@@ -859,7 +859,7 @@ int32 ScriptLife::lANIM(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLife::lANIM_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 otherActorIdx = ctx.stream.readByte();
const AnimationTypes otherAnimIdx = (AnimationTypes)ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::ANIM_OBJ(%i, %i)", (int)otherActorIdx, (int)otherAnimIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::ANIM_OBJ(%i, %i)", (int)otherActorIdx, (int)otherAnimIdx);
engine->_animations->initAnim(otherAnimIdx, AnimType::kAnimationTypeRepeat, AnimationTypes::kStanding, otherActorIdx);
return 0;
}
@@ -870,7 +870,7 @@ int32 ScriptLife::lANIM_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lSET_LIFE(TwinEEngine *engine, LifeScriptContext &ctx) {
const int16 offset = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_LIFE(%i)", (int)offset);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_LIFE(%i)", (int)offset);
ctx.actor->_offsetLife = offset;
return 0;
}
@@ -882,7 +882,7 @@ int32 ScriptLife::lSET_LIFE(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLife::lSET_LIFE_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 otherActorIdx = ctx.stream.readByte();
const int16 offset = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_LIFE_OBJ(%i, %i)", (int)otherActorIdx, (int)offset);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_LIFE_OBJ(%i, %i)", (int)otherActorIdx, (int)offset);
engine->_scene->getActor(otherActorIdx)->_offsetLife = offset;
return 0;
}
@@ -894,7 +894,7 @@ int32 ScriptLife::lSET_LIFE_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLife::lSET_TRACK(TwinEEngine *engine, LifeScriptContext &ctx) {
const int16 offset = ctx.stream.readSint16LE();
ctx.actor->_offsetTrack = offset;
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_TRACK(%i)", (int)offset);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_TRACK(%i)", (int)offset);
return 0;
}
@@ -906,7 +906,7 @@ int32 ScriptLife::lSET_TRACK_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 otherActorIdx = ctx.stream.readByte();
const int16 offset = ctx.stream.readSint16LE();
engine->_scene->getActor(otherActorIdx)->_offsetTrack = offset;
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_TRACK_OBJ(%i, %i)", (int)otherActorIdx, (int)offset);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_TRACK_OBJ(%i, %i)", (int)otherActorIdx, (int)offset);
return 0;
}
@@ -916,7 +916,7 @@ int32 ScriptLife::lSET_TRACK_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lMESSAGE(TwinEEngine *engine, LifeScriptContext &ctx) {
const TextId textIdx = (TextId)ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::MESSAGE(%i)", (int)textIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::MESSAGE(%i)", (int)textIdx);
ScopedEngineFreeze scopedFreeze(engine);
engine->testRestoreModeSVGA(true);
@@ -950,7 +950,7 @@ int32 ScriptLife::lMESSAGE(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLife::lFALLABLE(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 flag = ctx.stream.readByte();
ctx.actor->_staticFlags.bObjFallable = flag & 1;
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::FALLABLE(%i)", (int)flag);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::FALLABLE(%i)", (int)flag);
return 0;
}
@@ -964,9 +964,9 @@ int32 ScriptLife::lSET_DIRMODE(TwinEEngine *engine, LifeScriptContext &ctx) {
ctx.actor->_controlMode = (ControlMode)controlMode;
if (ctx.actor->_controlMode == ControlMode::kFollow) {
ctx.actor->_followedActor = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_DIRMODE(%i, %i)", (int)controlMode, (int)ctx.actor->_followedActor);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_DIRMODE(%i, %i)", (int)controlMode, (int)ctx.actor->_followedActor);
} else {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_DIRMODE(%i)", (int)controlMode);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_DIRMODE(%i)", (int)controlMode);
}
return 0;
@@ -985,9 +985,9 @@ int32 ScriptLife::lSET_DIRMODE_OBJ(TwinEEngine *engine, LifeScriptContext &ctx)
// TODO: should ControlMode::kSameXZ be taken into account, too - see processSameXZAction
if (otherActor->_controlMode == ControlMode::kFollow || ctx.actor->_controlMode == ControlMode::kFollow2) {
otherActor->_followedActor = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_DIRMODE_OBJ(%i, %i, %i)", (int)otherActorIdx, (int)controlMode, (int)otherActor->_followedActor);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_DIRMODE_OBJ(%i, %i, %i)", (int)otherActorIdx, (int)controlMode, (int)otherActor->_followedActor);
} else {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_DIRMODE_OBJ(%i, %i)", (int)otherActorIdx, (int)controlMode);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_DIRMODE_OBJ(%i, %i)", (int)otherActorIdx, (int)controlMode);
}
return 0;
@@ -999,7 +999,7 @@ int32 ScriptLife::lSET_DIRMODE_OBJ(TwinEEngine *engine, LifeScriptContext &ctx)
*/
int32 ScriptLife::lCAM_FOLLOW(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 followedActorIdx = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::CAM_FOLLOW(%i)", (int)followedActorIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::CAM_FOLLOW(%i)", (int)followedActorIdx);
if (engine->_scene->_currentlyFollowedActor != followedActorIdx) {
const ActorStruct *followedActor = engine->_scene->getActor(followedActorIdx);
engine->_grid->centerOnActor(followedActor);
@@ -1015,7 +1015,7 @@ int32 ScriptLife::lCAM_FOLLOW(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lSET_BEHAVIOUR(TwinEEngine *engine, LifeScriptContext &ctx) {
const HeroBehaviourType behavior = (HeroBehaviourType)ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_BEHAVIOUR(%i)", (int)behavior);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_BEHAVIOUR(%i)", (int)behavior);
engine->_animations->initAnim(AnimationTypes::kStanding, AnimType::kAnimationTypeRepeat, AnimationTypes::kAnimInvalid, OWN_ACTOR_SCENE_INDEX);
engine->_actor->setBehaviour(behavior);
@@ -1030,7 +1030,7 @@ int32 ScriptLife::lSET_BEHAVIOUR(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLife::lSET_FLAG_CUBE(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 flagIdx = ctx.stream.readByte();
const int32 flagValue = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_FLAG_CUBE(%i, %i)", (int)flagIdx, (int)flagValue);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_FLAG_CUBE(%i, %i)", (int)flagIdx, (int)flagValue);
engine->_scene->_listFlagCube[flagIdx] = flagValue;
@@ -1044,7 +1044,7 @@ int32 ScriptLife::lSET_FLAG_CUBE(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lCOMPORTEMENT(TwinEEngine *engine, LifeScriptContext &ctx) {
ctx.stream.skip(1);
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::COMPORTEMENT()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::COMPORTEMENT()");
return 0;
}
@@ -1054,7 +1054,7 @@ int32 ScriptLife::lCOMPORTEMENT(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lSET_COMPORTEMENT(TwinEEngine *engine, LifeScriptContext &ctx) {
ctx.actor->_offsetLife = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_COMPORTEMENT(%i)", (int)ctx.actor->_offsetLife);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_COMPORTEMENT(%i)", (int)ctx.actor->_offsetLife);
return 0;
}
@@ -1065,7 +1065,7 @@ int32 ScriptLife::lSET_COMPORTEMENT(TwinEEngine *engine, LifeScriptContext &ctx)
int32 ScriptLife::lSET_COMPORTEMENT_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 otherActorIdx = ctx.stream.readByte();
const int16 pos = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_COMPORTEMENT_OBJ(%i, %i)", (int)otherActorIdx, (int)pos);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_COMPORTEMENT_OBJ(%i, %i)", (int)otherActorIdx, (int)pos);
engine->_scene->getActor(otherActorIdx)->_offsetLife = pos;
return 0;
}
@@ -1075,7 +1075,7 @@ int32 ScriptLife::lSET_COMPORTEMENT_OBJ(TwinEEngine *engine, LifeScriptContext &
* @note Opcode @c 0x23
*/
int32 ScriptLife::lEND_COMPORTEMENT(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::END_COMPORTEMENT()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::END_COMPORTEMENT()");
return 1; // break
}
@@ -1085,7 +1085,7 @@ int32 ScriptLife::lEND_COMPORTEMENT(TwinEEngine *engine, LifeScriptContext &ctx)
*/
int32 ScriptLife::lKILL_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 otherActorIdx = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lKILL_OBJ(%i)", (int)otherActorIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lKILL_OBJ(%i)", (int)otherActorIdx);
engine->_actor->checkCarrier(otherActorIdx);
ActorStruct *otherActor = engine->_scene->getActor(otherActorIdx);
@@ -1102,7 +1102,7 @@ int32 ScriptLife::lKILL_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x26
*/
int32 ScriptLife::lSUICIDE(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SUICIDE()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SUICIDE()");
engine->_actor->checkCarrier(ctx.actorIdx);
ctx.actor->_workFlags.bIsDead = 1;
ctx.actor->_body = -1;
@@ -1117,7 +1117,7 @@ int32 ScriptLife::lSUICIDE(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x27
*/
int32 ScriptLife::lUSE_ONE_LITTLE_KEY(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::USE_ONE_LITTLE_KEY()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::USE_ONE_LITTLE_KEY()");
engine->_gameState->addKeys(-1);
engine->_redraw->addOverlay(OverlayType::koSprite, SPRITEHQR_KEY, 0, 0, 0, OverlayPosType::koFollowActor, 1);
@@ -1132,7 +1132,7 @@ int32 ScriptLife::lGIVE_GOLD_PIECES(TwinEEngine *engine, LifeScriptContext &ctx)
const int16 oldNumKashes = engine->_gameState->_goldPieces;
bool hideRange = false;
const int16 kashes = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::GIVE_GOLD_PIECES(%i)", (int)kashes);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::GIVE_GOLD_PIECES(%i)", (int)kashes);
engine->_gameState->addKashes(-kashes);
@@ -1161,7 +1161,7 @@ int32 ScriptLife::lGIVE_GOLD_PIECES(TwinEEngine *engine, LifeScriptContext &ctx)
* @note Opcode @c 0x29
*/
int32 ScriptLife::lEND_LIFE(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::END_LIFE()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::END_LIFE()");
ctx.actor->_offsetLife = -1;
return 1; // break;
}
@@ -1171,7 +1171,7 @@ int32 ScriptLife::lEND_LIFE(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x2A
*/
int32 ScriptLife::lSTOP_L_TRACK(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::STOP_L_TRACK(%i)", (int)ctx.actor->_offsetLabelTrack);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::STOP_L_TRACK(%i)", (int)ctx.actor->_offsetLabelTrack);
ctx.actor->_memoLabelTrack = ctx.actor->_offsetLabelTrack;
ctx.actor->_offsetTrack = -1;
return 0;
@@ -1182,7 +1182,7 @@ int32 ScriptLife::lSTOP_L_TRACK(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x2B
*/
int32 ScriptLife::lRESTORE_L_TRACK(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::RESTORE_L_TRACK(%i)", (int)ctx.actor->_memoLabelTrack);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::RESTORE_L_TRACK(%i)", (int)ctx.actor->_memoLabelTrack);
ctx.actor->_offsetTrack = ctx.actor->_memoLabelTrack;
return 0;
}
@@ -1194,7 +1194,7 @@ int32 ScriptLife::lRESTORE_L_TRACK(TwinEEngine *engine, LifeScriptContext &ctx)
int32 ScriptLife::lMESSAGE_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 otherActorIdx = ctx.stream.readByte();
const TextId textIdx = (TextId)ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::MESSAGE_OBJ(%i, %i)", (int)otherActorIdx, (int)textIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::MESSAGE_OBJ(%i, %i)", (int)otherActorIdx, (int)textIdx);
ScopedEngineFreeze scopedFreeze(engine);
engine->testRestoreModeSVGA(true);
@@ -1214,7 +1214,7 @@ int32 ScriptLife::lMESSAGE_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x2D
*/
int32 ScriptLife::lINC_CHAPTER(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::INC_CHAPTER()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::INC_CHAPTER()");
engine->_gameState->setChapter(engine->_gameState->getChapter() + 1);
debug("Switched chapter to %i", engine->_gameState->getChapter());
return 0;
@@ -1226,7 +1226,7 @@ int32 ScriptLife::lINC_CHAPTER(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lFOUND_OBJECT(TwinEEngine *engine, LifeScriptContext &ctx) {
const InventoryItems item = (InventoryItems)ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::FOUND_OBJECT(%i)", (int)item);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::FOUND_OBJECT(%i)", (int)item);
ScopedEngineFreeze scopedFreeze(engine);
engine->testRestoreModeSVGA(true);
@@ -1242,7 +1242,7 @@ int32 ScriptLife::lFOUND_OBJECT(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lSET_DOOR_LEFT(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 distance = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_DOOR_LEFT(%i)", (int)distance);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_DOOR_LEFT(%i)", (int)distance);
ctx.actor->_beta = LBAAngles::ANGLE_270;
ctx.actor->_posObj.x = ctx.actor->_animStep.x - distance;
@@ -1258,7 +1258,7 @@ int32 ScriptLife::lSET_DOOR_LEFT(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lSET_DOOR_RIGHT(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 distance = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_DOOR_RIGHT(%i)", (int)distance);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_DOOR_RIGHT(%i)", (int)distance);
ctx.actor->_beta = LBAAngles::ANGLE_90;
ctx.actor->_posObj.x = ctx.actor->_animStep.x + distance;
@@ -1274,7 +1274,7 @@ int32 ScriptLife::lSET_DOOR_RIGHT(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lSET_DOOR_UP(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 distance = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_DOOR_UP(%i)", (int)distance);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_DOOR_UP(%i)", (int)distance);
ctx.actor->_beta = LBAAngles::ANGLE_180;
ctx.actor->_posObj.z = ctx.actor->_animStep.z - distance;
@@ -1290,7 +1290,7 @@ int32 ScriptLife::lSET_DOOR_UP(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lSET_DOOR_DOWN(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 distance = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_DOOR_DOWN(%i)", (int)distance);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_DOOR_DOWN(%i)", (int)distance);
ctx.actor->_beta = LBAAngles::ANGLE_0;
ctx.actor->_posObj.z = ctx.actor->_animStep.z + distance;
@@ -1306,7 +1306,7 @@ int32 ScriptLife::lSET_DOOR_DOWN(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lGIVE_BONUS(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 flag = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::GIVE_BONUS(%i)", (int)flag);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::GIVE_BONUS(%i)", (int)flag);
if (ctx.actor->_bonusParameter.cloverleaf || ctx.actor->_bonusParameter.kashes || ctx.actor->_bonusParameter.key || ctx.actor->_bonusParameter.lifepoints || ctx.actor->_bonusParameter.magicpoints) {
engine->_actor->giveExtraBonus(ctx.actorIdx);
@@ -1325,7 +1325,7 @@ int32 ScriptLife::lGIVE_BONUS(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lCHANGE_CUBE(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 sceneIdx = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::CHANGE_CUBE(%i)", (int)sceneIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::CHANGE_CUBE(%i)", (int)sceneIdx);
engine->_scene->_newCube = sceneIdx;
engine->_scene->_heroPositionType = ScenePositionType::kScene;
return 0;
@@ -1337,7 +1337,7 @@ int32 ScriptLife::lCHANGE_CUBE(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lOBJ_COL(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 collision = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::OBJ_COL(%i)", (int)collision);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::OBJ_COL(%i)", (int)collision);
if (collision != 0) {
ctx.actor->_staticFlags.bComputeCollisionWithObj = 1;
} else {
@@ -1352,7 +1352,7 @@ int32 ScriptLife::lOBJ_COL(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lBRICK_COL(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 collision = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::BRICK_COL(%i)", (int)collision);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::BRICK_COL(%i)", (int)collision);
ctx.actor->_staticFlags.bComputeCollisionWithBricks = 0;
ctx.actor->_staticFlags.bComputeLowCollision = 0;
@@ -1371,15 +1371,15 @@ int32 ScriptLife::lBRICK_COL(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x37
*/
int32 ScriptLife::lOR_IF(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugCN(3, kDebugLevels::kDebugScripts, "LIFE::OR_IF(");
+ debugCN(3, kDebugLevels::kDebugScriptsLife, "LIFE::OR_IF(");
const ReturnType valueType = processLifeConditions(engine, ctx);
if (processLifeOperators(engine, ctx, valueType)) {
const int16 offset = ctx.stream.readSint16LE();
ctx.stream.seek(offset); // condition offset
- debugC(3, kDebugLevels::kDebugScripts, ", %i)", offset);
+ debugC(3, kDebugLevels::kDebugScriptsLife, ", %i)", offset);
} else {
ctx.stream.skip(2);
- debugC(3, kDebugLevels::kDebugScripts, ")");
+ debugC(3, kDebugLevels::kDebugScriptsLife, ")");
}
return 0;
@@ -1391,7 +1391,7 @@ int32 ScriptLife::lOR_IF(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lINVISIBLE(TwinEEngine *engine, LifeScriptContext &ctx) {
ctx.actor->_staticFlags.bIsInvisible = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::INVISIBLE(%i)", (int)ctx.actor->_staticFlags.bIsInvisible);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::INVISIBLE(%i)", (int)ctx.actor->_staticFlags.bIsInvisible);
return 0;
}
@@ -1401,7 +1401,7 @@ int32 ScriptLife::lINVISIBLE(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lZOOM(TwinEEngine *engine, LifeScriptContext &ctx) {
const int zoomScreen = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::ZOOM(%i)", zoomScreen);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::ZOOM(%i)", zoomScreen);
if (zoomScreen && !engine->_redraw->_flagMCGA && engine->_cfgfile.SceZoom) {
engine->_screens->fadeToBlack(engine->_screens->_ptrPal);
@@ -1425,7 +1425,7 @@ int32 ScriptLife::lZOOM(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lPOS_POINT(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 trackIdx = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::POS_POINT(%i)", (int)trackIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::POS_POINT(%i)", (int)trackIdx);
if (engine->_scene->_enableEnhancements) {
if (IS_HERO(ctx.actorIdx) && engine->_scene->_numCube == LBA1SceneId::Citadel_Island_Harbor && trackIdx == 8) {
ctx.stream.rewind(2);
@@ -1445,7 +1445,7 @@ int32 ScriptLife::lPOS_POINT(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lSET_MAGIC_LEVEL(TwinEEngine *engine, LifeScriptContext &ctx) {
engine->_gameState->_magicLevelIdx = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_MAGIC_LEVEL(%i)", (int)engine->_gameState->_magicLevelIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_MAGIC_LEVEL(%i)", (int)engine->_gameState->_magicLevelIdx);
engine->_gameState->setMaxMagicPoints();
return 0;
}
@@ -1456,7 +1456,7 @@ int32 ScriptLife::lSET_MAGIC_LEVEL(TwinEEngine *engine, LifeScriptContext &ctx)
*/
int32 ScriptLife::lSUB_MAGIC_POINT(TwinEEngine *engine, LifeScriptContext &ctx) {
const int16 magicPoints = (int16)ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_MAGIC_POINT(%i)", (int)magicPoints);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_MAGIC_POINT(%i)", (int)magicPoints);
engine->_gameState->addMagicPoints(-magicPoints);
return 0;
}
@@ -1468,7 +1468,7 @@ int32 ScriptLife::lSUB_MAGIC_POINT(TwinEEngine *engine, LifeScriptContext &ctx)
int32 ScriptLife::lSET_LIFE_POINT_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 otherActorIdx = ctx.stream.readByte();
const int32 lifeValue = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_LIFE_POINT_OBJ(%i, %i)", (int)otherActorIdx, (int)lifeValue);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_LIFE_POINT_OBJ(%i, %i)", (int)otherActorIdx, (int)lifeValue);
engine->_scene->getActor(otherActorIdx)->setLife(lifeValue);
@@ -1482,7 +1482,7 @@ int32 ScriptLife::lSET_LIFE_POINT_OBJ(TwinEEngine *engine, LifeScriptContext &ct
int32 ScriptLife::lSUB_LIFE_POINT_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 otherActorIdx = ctx.stream.readByte();
const int32 lifeValue = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SUB_LIFE_POINT_OBJ(%i, %i)", (int)otherActorIdx, (int)lifeValue);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SUB_LIFE_POINT_OBJ(%i, %i)", (int)otherActorIdx, (int)lifeValue);
ActorStruct *otherActor = engine->_scene->getActor(otherActorIdx);
otherActor->addLife(-lifeValue);
@@ -1500,7 +1500,7 @@ int32 ScriptLife::lSUB_LIFE_POINT_OBJ(TwinEEngine *engine, LifeScriptContext &ct
int32 ScriptLife::lHIT_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 otherActorIdx = ctx.stream.readByte();
const int32 strengthOfHit = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::HIT_OBJ(%i, %i)", (int)otherActorIdx, (int)strengthOfHit);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::HIT_OBJ(%i, %i)", (int)otherActorIdx, (int)strengthOfHit);
engine->_actor->hitObj(ctx.actorIdx, otherActorIdx, strengthOfHit, engine->_scene->getActor(otherActorIdx)->_beta);
return 0;
}
@@ -1523,7 +1523,7 @@ int32 ScriptLife::lPLAY_FLA(TwinEEngine *engine, LifeScriptContext &ctx) {
error("Max string size exceeded for fla name");
}
} while (true);
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::PLAY_FLA(%s)", movie);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::PLAY_FLA(%s)", movie);
engine->_movie->playMovie(movie);
engine->setPalette(engine->_screens->_ptrPal);
@@ -1537,7 +1537,7 @@ int32 ScriptLife::lPLAY_FLA(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x42
*/
int32 ScriptLife::lINC_CLOVER_BOX(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::INC_CLOVER_BOX()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::INC_CLOVER_BOX()");
engine->_gameState->addLeafBoxes(1);
return 0;
}
@@ -1548,7 +1548,7 @@ int32 ScriptLife::lINC_CLOVER_BOX(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lSET_USED_INVENTORY(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 item = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_USED_INVENTORY(%i)", (int)item);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_USED_INVENTORY(%i)", (int)item);
// Only up to keypad. lbawin and dotemu are doing this, too
if (item < InventoryItems::kKeypad) {
engine->_gameState->_inventoryFlags[item] = 1;
@@ -1562,7 +1562,7 @@ int32 ScriptLife::lSET_USED_INVENTORY(TwinEEngine *engine, LifeScriptContext &ct
*/
int32 ScriptLife::lADD_CHOICE(TwinEEngine *engine, LifeScriptContext &ctx) {
const TextId choiceIdx = (TextId)ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::ADD_CHOICE(%i)", (int)choiceIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::ADD_CHOICE(%i)", (int)choiceIdx);
engine->_gameState->_gameListChoice[engine->_gameState->_gameNbChoices++] = choiceIdx;
return 0;
}
@@ -1573,7 +1573,7 @@ int32 ScriptLife::lADD_CHOICE(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lASK_CHOICE(TwinEEngine *engine, LifeScriptContext &ctx) {
const TextId choiceIdx = (TextId)ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::ASK_CHOICE(%i)", (int)choiceIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::ASK_CHOICE(%i)", (int)choiceIdx);
ScopedEngineFreeze scopedFreeze(engine);
engine->testRestoreModeSVGA(true);
@@ -1594,7 +1594,7 @@ int32 ScriptLife::lASK_CHOICE(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lBIG_MESSAGE(TwinEEngine *engine, LifeScriptContext &ctx) {
const TextId textIdx = (TextId)ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::BIG_MESSAGE(%i)", (int)textIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::BIG_MESSAGE(%i)", (int)textIdx);
ScopedEngineFreeze scopedFreeze(engine);
engine->testRestoreModeSVGA(true);
@@ -1617,7 +1617,7 @@ int32 ScriptLife::lBIG_MESSAGE(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lINIT_PINGOUIN(TwinEEngine *engine, LifeScriptContext &ctx) {
const int16 penguinActor = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::INIT_PINGOUIN(%i)", (int)penguinActor);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::INIT_PINGOUIN(%i)", (int)penguinActor);
engine->_scene->_mecaPenguinIdx = penguinActor;
ActorStruct *penguin = engine->_scene->getActor(penguinActor);
penguin->_workFlags.bIsDead = 1;
@@ -1632,7 +1632,7 @@ int32 ScriptLife::lINIT_PINGOUIN(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lSET_HOLO_POS(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 location = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_HOLO_POS(%i)", (int)location);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_HOLO_POS(%i)", (int)location);
if (engine->_holomap->setHoloPos(location)) {
if (engine->_gameState->hasItem(InventoryItems::kiHolomap)) {
engine->_redraw->addOverlay(OverlayType::koInventoryItem, InventoryItems::kiHolomap, 0, 0, 0, OverlayPosType::koNormal, 3);
@@ -1647,7 +1647,7 @@ int32 ScriptLife::lSET_HOLO_POS(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lCLR_HOLO_POS(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 location = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::CLR_HOLO_POS(%i)", (int)location);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::CLR_HOLO_POS(%i)", (int)location);
engine->_holomap->clrHoloPos(location);
return 0;
}
@@ -1658,7 +1658,7 @@ int32 ScriptLife::lCLR_HOLO_POS(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lADD_FUEL(TwinEEngine *engine, LifeScriptContext &ctx) {
const int16 value = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::ADD_FUEL(%i)", (int)value);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::ADD_FUEL(%i)", (int)value);
if (engine->isLBA2()) {
return 0;
}
@@ -1672,7 +1672,7 @@ int32 ScriptLife::lADD_FUEL(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lSUB_FUEL(TwinEEngine *engine, LifeScriptContext &ctx) {
const int16 value = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SUB_FUEL(%i)", (int)value);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SUB_FUEL(%i)", (int)value);
if (engine->isLBA2()) {
return 0;
}
@@ -1686,7 +1686,7 @@ int32 ScriptLife::lSUB_FUEL(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lSET_GRM(TwinEEngine *engine, LifeScriptContext &ctx) {
engine->_grid->_cellingGridIdx = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_GRM(%i)", (int)engine->_grid->_cellingGridIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_GRM(%i)", (int)engine->_grid->_cellingGridIdx);
engine->_grid->initCellingGrid(engine->_grid->_cellingGridIdx);
return 0;
}
@@ -1697,7 +1697,7 @@ int32 ScriptLife::lSET_GRM(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lSAY_MESSAGE(TwinEEngine *engine, LifeScriptContext &ctx) {
const TextId textEntry = (TextId)ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SAY_MESSAGE(%i)", (int)textEntry);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SAY_MESSAGE(%i)", (int)textEntry);
engine->_redraw->addOverlay(OverlayType::koText, (int16)textEntry, 0, 0, ctx.actorIdx, OverlayPosType::koFollowActor, 2);
@@ -1714,7 +1714,7 @@ int32 ScriptLife::lSAY_MESSAGE(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLife::lSAY_MESSAGE_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 otherActorIdx = ctx.stream.readByte();
const TextId textEntry = (TextId)ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SAY_MESSAGE_OBJ(%i, %i)", (int)otherActorIdx, (int)textEntry);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SAY_MESSAGE_OBJ(%i, %i)", (int)otherActorIdx, (int)textEntry);
engine->_redraw->addOverlay(OverlayType::koText, (int16)textEntry, 0, 0, otherActorIdx, OverlayPosType::koFollowActor, 2);
@@ -1729,7 +1729,7 @@ int32 ScriptLife::lSAY_MESSAGE_OBJ(TwinEEngine *engine, LifeScriptContext &ctx)
* @note Opcode @c 0x4F
*/
int32 ScriptLife::lFULL_POINT(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::FULL_POINT()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::FULL_POINT()");
engine->_scene->_sceneHero->setLife(engine->getMaxLife());
engine->_gameState->setMaxMagicPoints();
return 0;
@@ -1741,7 +1741,7 @@ int32 ScriptLife::lFULL_POINT(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lBETA(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 newAngle = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::BETA(%i)", (int)newAngle);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::BETA(%i)", (int)newAngle);
ctx.actor->_beta = ToAngle(newAngle);
engine->_movements->clearRealAngle(ctx.actor);
return 0;
@@ -1752,7 +1752,7 @@ int32 ScriptLife::lBETA(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x51
*/
int32 ScriptLife::lGRM_OFF(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::GRM_OFF()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::GRM_OFF()");
if (engine->_grid->_cellingGridIdx != -1) {
engine->_grid->_useCellingGrid = -1;
engine->_grid->_cellingGridIdx = -1;
@@ -1768,7 +1768,7 @@ int32 ScriptLife::lGRM_OFF(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x52
*/
int32 ScriptLife::lFADE_PAL_RED(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::FADE_PAL_RED()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::FADE_PAL_RED()");
ScopedEngineFreeze scoped(engine);
engine->_screens->fadeToRed(engine->_screens->_ptrPal);
engine->_screens->_flagPalettePcx = false;
@@ -1780,7 +1780,7 @@ int32 ScriptLife::lFADE_PAL_RED(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x53
*/
int32 ScriptLife::lFADE_ALARM_RED(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::FADE_ALARM_RED()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::FADE_ALARM_RED()");
ScopedEngineFreeze scoped(engine);
HQR::getPaletteEntry(engine->_screens->_palettePcx, Resources::HQR_RESS_FILE, RESSHQR_ALARMREDPAL);
engine->_screens->fadeToRed(engine->_screens->_palettePcx);
@@ -1793,7 +1793,7 @@ int32 ScriptLife::lFADE_ALARM_RED(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x54
*/
int32 ScriptLife::lFADE_ALARM_PAL(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::FADE_ALARM_PAL()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::FADE_ALARM_PAL()");
ScopedEngineFreeze scoped(engine);
HQR::getPaletteEntry(engine->_screens->_palettePcx, Resources::HQR_RESS_FILE, RESSHQR_ALARMREDPAL);
engine->_screens->fadePalToPal(engine->_screens->_palettePcx, engine->_screens->_ptrPal);
@@ -1806,7 +1806,7 @@ int32 ScriptLife::lFADE_ALARM_PAL(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x55
*/
int32 ScriptLife::lFADE_RED_PAL(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::FADE_RED_PAL()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::FADE_RED_PAL()");
ScopedEngineFreeze scoped(engine);
engine->_screens->fadeRedToPal(engine->_screens->_ptrPal);
engine->_screens->_flagPalettePcx = false;
@@ -1818,7 +1818,7 @@ int32 ScriptLife::lFADE_RED_PAL(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x56
*/
int32 ScriptLife::lFADE_RED_ALARM(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::FADE_RED_ALARM()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::FADE_RED_ALARM()");
ScopedEngineFreeze scoped(engine);
HQR::getPaletteEntry(engine->_screens->_palettePcx, Resources::HQR_RESS_FILE, RESSHQR_ALARMREDPAL);
engine->_screens->fadeRedToPal(engine->_screens->_palettePcx);
@@ -1831,7 +1831,7 @@ int32 ScriptLife::lFADE_RED_ALARM(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x57
*/
int32 ScriptLife::lFADE_PAL_ALARM(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::FADE_PAL_ALARM()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::FADE_PAL_ALARM()");
ScopedEngineFreeze scoped(engine);
HQR::getPaletteEntry(engine->_screens->_palettePcx, Resources::HQR_RESS_FILE, RESSHQR_ALARMREDPAL);
engine->_screens->fadePalToPal(engine->_screens->_ptrPal, engine->_screens->_palettePcx);
@@ -1845,7 +1845,7 @@ int32 ScriptLife::lFADE_PAL_ALARM(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lEXPLODE_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 otherActorIdx = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::EXPLODE_OBJ(%i)", (int)otherActorIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::EXPLODE_OBJ(%i)", (int)otherActorIdx);
const ActorStruct *otherActor = engine->_scene->getActor(otherActorIdx);
IVec3 pos = otherActor->posObj();
@@ -1863,7 +1863,7 @@ int32 ScriptLife::lEXPLODE_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLife::lASK_CHOICE_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 otherActorIdx = ctx.stream.readByte();
const TextId choiceIdx = (TextId)ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::ASK_CHOICE_OBJ(%i, %i)", (int)otherActorIdx, (int)choiceIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::ASK_CHOICE_OBJ(%i, %i)", (int)otherActorIdx, (int)choiceIdx);
ScopedEngineFreeze freeze(engine);
engine->testRestoreModeSVGA(true);
@@ -1883,7 +1883,7 @@ int32 ScriptLife::lASK_CHOICE_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x5C
*/
int32 ScriptLife::lSET_DARK_PAL(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_DARK_PAL()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_DARK_PAL()");
ScopedEngineFreeze scoped(engine);
if (!HQR::getPaletteEntry(engine->_screens->_palettePcx, Resources::HQR_RESS_FILE, RESSHQR_DARKPAL)) {
error("Failed to get palette entry for dark palette");
@@ -1901,7 +1901,7 @@ int32 ScriptLife::lSET_DARK_PAL(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x5D
*/
int32 ScriptLife::lSET_NORMAL_PAL(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_NORMAL_PAL()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_NORMAL_PAL()");
engine->_screens->_flagPalettePcx = false;
if (!engine->_screens->_flagFade) {
// reset the palette hard if it should not get faded
@@ -1915,7 +1915,7 @@ int32 ScriptLife::lSET_NORMAL_PAL(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x5E
*/
int32 ScriptLife::lMESSAGE_SENDELL(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::MESSAGE_SENDELL()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::MESSAGE_SENDELL()");
ScopedEngineFreeze scoped(engine);
engine->testRestoreModeSVGA(true);
engine->_screens->fadeToBlack(engine->_screens->_ptrPal);
@@ -1941,7 +1941,7 @@ int32 ScriptLife::lMESSAGE_SENDELL(TwinEEngine *engine, LifeScriptContext &ctx)
*/
int32 ScriptLife::lANIM_SET(TwinEEngine *engine, LifeScriptContext &ctx) {
const AnimationTypes animIdx = (AnimationTypes)ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::ANIM_SET(%i)", (int)animIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::ANIM_SET(%i)", (int)animIdx);
ctx.actor->_genAnim = AnimationTypes::kAnimNone;
ctx.actor->_anim = -1;
@@ -1956,7 +1956,7 @@ int32 ScriptLife::lANIM_SET(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lHOLOMAP_TRAJ(TwinEEngine *engine, LifeScriptContext &ctx) {
engine->_scene->_numHolomapTraj = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::HOLOMAP_TRAJ(%i)", (int)engine->_scene->_numHolomapTraj);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::HOLOMAP_TRAJ(%i)", (int)engine->_scene->_numHolomapTraj);
return 0;
}
@@ -1968,7 +1968,7 @@ int32 ScriptLife::lGAME_OVER(TwinEEngine *engine, LifeScriptContext &ctx) {
engine->_scene->_sceneHero->_workFlags.bAnimEnded = 1;
engine->_scene->_sceneHero->setLife(0);
engine->_gameState->setLeafs(0);
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::GAME_OVER()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::GAME_OVER()");
return 1; // break
}
@@ -1977,7 +1977,7 @@ int32 ScriptLife::lGAME_OVER(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x62
*/
int32 ScriptLife::lTHE_END(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::THE_END()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::THE_END()");
engine->_sceneLoopState = SceneLoopState::Finished;
engine->_gameState->setLeafs(0);
engine->_scene->_sceneHero->setLife(engine->getMaxLife());
@@ -1997,7 +1997,7 @@ int32 ScriptLife::lTHE_END(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lPLAY_CD_TRACK(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 track = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::PLAY_CD_TRACK(%i)", (int)track);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::PLAY_CD_TRACK(%i)", (int)track);
engine->_music->playCdTrack(track);
return 0;
}
@@ -2007,7 +2007,7 @@ int32 ScriptLife::lPLAY_CD_TRACK(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x65
*/
int32 ScriptLife::lPROJ_ISO(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::PROJ_ISO()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::PROJ_ISO()");
engine->_gameState->init3DGame();
return 0;
}
@@ -2017,7 +2017,7 @@ int32 ScriptLife::lPROJ_ISO(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x66
*/
int32 ScriptLife::lPROJ_3D(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::PROJ_3D()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::PROJ_3D()");
// TODO: only used for credits scene? If not, then move the credits related code into the menu->showCredits method
engine->_screens->copyScreen(engine->_frontVideoBuffer, engine->_workVideoBuffer);
engine->_scene->_enableGridTileRendering = false;
@@ -2037,7 +2037,7 @@ int32 ScriptLife::lPROJ_3D(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lTEXT(TwinEEngine *engine, LifeScriptContext &ctx) {
TextId textIdx = (TextId)ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::TEXT(%i)", (int)textIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::TEXT(%i)", (int)textIdx);
const int32 textHeight = 40;
if (lTextYPos < engine->height() - textHeight) {
@@ -2071,7 +2071,7 @@ int32 ScriptLife::lTEXT(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x68
*/
int32 ScriptLife::lCLEAR_TEXT(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::CLEAR_TEXT()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::CLEAR_TEXT()");
lTextYPos = 0;
const Common::Rect rect(0, 0, engine->width() - 1, engine->height() / 2);
engine->_interface->box(rect, COLOR_BLACK);
@@ -2083,7 +2083,7 @@ int32 ScriptLife::lCLEAR_TEXT(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x69
*/
int32 ScriptLife::lBRUTAL_EXIT(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::BRUTAL_EXIT()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::BRUTAL_EXIT()");
engine->_sceneLoopState = SceneLoopState::ReturnToMenu;
return 1; // break
}
@@ -2097,11 +2097,11 @@ void ScriptLife::doLife(int32 actorIdx) {
int32 end = -2;
LifeScriptContext ctx(actorIdx, actor);
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::BEGIN(%i)", actorIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::BEGIN(%i)", actorIdx);
do {
const byte scriptOpcode = ctx.stream.readByte();
if (scriptOpcode < _functionMapSize) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::EXEC(%s, %i)", _functionMap[scriptOpcode].name, actorIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::EXEC(%s, %i)", _functionMap[scriptOpcode].name, actorIdx);
end = _functionMap[scriptOpcode].function(_engine, ctx);
} else {
error("Actor %d with wrong offset/opcode in life script - Offset: %d/%d (opcode: %i)", actorIdx, (int)ctx.stream.pos() - 1, (int)ctx.stream.size(), scriptOpcode);
@@ -2110,11 +2110,11 @@ void ScriptLife::doLife(int32 actorIdx) {
if (end < 0) {
warning("Actor %d Life script [%s] not implemented", actorIdx, _functionMap[scriptOpcode].name);
} else if (end == 1) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::BREAK(%i)", actorIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::BREAK(%i)", actorIdx);
}
ctx.updateOpcodePos();
} while (end != 1);
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::END(%i)", actorIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::END(%i)", actorIdx);
}
} // namespace TwinE
diff --git a/engines/twine/script/script_life_v1.cpp b/engines/twine/script/script_life_v1.cpp
index 0461d1f606b..dcca87fb2d3 100644
--- a/engines/twine/script/script_life_v1.cpp
+++ b/engines/twine/script/script_life_v1.cpp
@@ -33,7 +33,7 @@ namespace TwinE {
* @note Opcode @c 0x59
*/
int32 ScriptLifeV1::lBUBBLE_ON(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::BUBBLE_ON()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::BUBBLE_ON()");
engine->_text->_showDialogueBubble = true;
return 0;
}
@@ -43,7 +43,7 @@ int32 ScriptLifeV1::lBUBBLE_ON(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x5A
*/
int32 ScriptLifeV1::lBUBBLE_OFF(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::BUBBLE_OFF()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::BUBBLE_OFF()");
engine->_text->_showDialogueBubble = false;
return 0;
}
@@ -55,7 +55,7 @@ int32 ScriptLifeV1::lBUBBLE_OFF(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV1::lPLAY_MIDI(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 midiIdx = ctx.stream.readByte();
engine->_music->playMusic(midiIdx);
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::PLAY_MIDI(%i)", (int)midiIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::PLAY_MIDI(%i)", (int)midiIdx);
return 0;
}
@@ -64,7 +64,7 @@ int32 ScriptLifeV1::lPLAY_MIDI(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x63
*/
int32 ScriptLifeV1::lMIDI_OFF(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::MIDI_OFF()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::MIDI_OFF()");
engine->_music->stopMusicMidi();
return 0;
}
@@ -76,7 +76,7 @@ int32 ScriptLifeV1::lMIDI_OFF(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV1::lSET_FLAG_GAME(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 flagIdx = ctx.stream.readByte();
const uint8 flagValue = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_FLAG_GAME(%i, %i)", (int)flagIdx, (int)flagValue);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_FLAG_GAME(%i, %i)", (int)flagIdx, (int)flagValue);
engine->_gameState->setGameFlag(flagIdx, flagValue);
return 0;
}
diff --git a/engines/twine/script/script_life_v2.cpp b/engines/twine/script/script_life_v2.cpp
index f8c2f676cd4..a5dae2ec1a6 100644
--- a/engines/twine/script/script_life_v2.cpp
+++ b/engines/twine/script/script_life_v2.cpp
@@ -200,7 +200,7 @@ static const ScriptLifeFunction function_map[] = {
int32 ScriptLifeV2::lPALETTE(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 palIndex = engine->_screens->mapLba2Palette(ctx.stream.readByte());
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::PALETTE(%i)", palIndex);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::PALETTE(%i)", palIndex);
ScopedEngineFreeze scoped(engine);
HQR::getPaletteEntry(engine->_screens->_ptrPal, Resources::HQR_RESS_FILE, palIndex);
engine->setPalette(engine->_screens->_ptrPal);
@@ -210,13 +210,13 @@ int32 ScriptLifeV2::lPALETTE(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lFADE_TO_PAL(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 palIndex = engine->_screens->mapLba2Palette(ctx.stream.readByte());
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::FADE_TO_PAL(%i)", palIndex);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::FADE_TO_PAL(%i)", palIndex);
// TODO: implement
return -1;
}
int32 ScriptLifeV2::lPLAY_MUSIC(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lPLAY_MUSIC()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lPLAY_MUSIC()");
const int32 val = lPLAY_CD_TRACK(engine, ctx);
if (engine->isLBA2()) {
engine->_scene->_cubeJingle = 255;
@@ -230,7 +230,7 @@ int32 ScriptLifeV2::lPLAY_MUSIC(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lTRACK_TO_VAR_GAME(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 num = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lTRACK_TO_VAR_GAME(%i)", (int)num);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lTRACK_TO_VAR_GAME(%i)", (int)num);
engine->_gameState->setGameFlag(num, MAX<int32>(0, ctx.actor->_labelTrack));
return 0;
}
@@ -426,7 +426,7 @@ int32 ScriptLifeV2::lVAR_GAME_TO_TRACK(TwinEEngine *engine, LifeScriptContext &c
cleanTrack(ctx.actor);
const uint8 num = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lVAR_GAME_TO_TRACK(%i)", (int)num);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lVAR_GAME_TO_TRACK(%i)", (int)num);
ctx.actor->_offsetTrack = searchOffsetTrack(ctx.actor,
engine->_gameState->hasGameFlag(num));
@@ -439,27 +439,27 @@ int32 ScriptLifeV2::lVAR_GAME_TO_TRACK(TwinEEngine *engine, LifeScriptContext &c
int32 ScriptLifeV2::lANIM_TEXTURE(TwinEEngine *engine, LifeScriptContext &ctx) {
engine->_interface->_animateTexture = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lANIM_TEXTURE(%i)", (int)engine->_interface->_animateTexture);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lANIM_TEXTURE(%i)", (int)engine->_interface->_animateTexture);
return 0;
}
int32 ScriptLifeV2::lADD_MESSAGE_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const TextId textIdx = (TextId)ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lADD_MESSAGE_OBJ(%i)", (int)textIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lADD_MESSAGE_OBJ(%i)", (int)textIdx);
// TODO: implement me
return -1;
}
int32 ScriptLifeV2::lADD_MESSAGE(TwinEEngine *engine, LifeScriptContext &ctx) {
const TextId textIdx = (TextId)ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lADD_MESSAGE(%i)", (int)textIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lADD_MESSAGE(%i)", (int)textIdx);
// TODO: implement me
return -1;
}
int32 ScriptLifeV2::lCAMERA_CENTER(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 angle = ClampAngle(ToAngle(ctx.stream.readByte() * 1024));
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lCAMERA_CENTER(%i)", (int)angle);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lCAMERA_CENTER(%i)", (int)angle);
// TODO: implement me - see centerOnActor in grid
// AddBetaCam = num ;
// CameraCenter( 2 ) ;
@@ -469,26 +469,26 @@ int32 ScriptLifeV2::lCAMERA_CENTER(TwinEEngine *engine, LifeScriptContext &ctx)
int32 ScriptLifeV2::lBUBBLE(TwinEEngine *engine, LifeScriptContext &ctx) {
engine->_text->_showDialogueBubble = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::BUBBLE(%s)", engine->_text->_showDialogueBubble ? "true" : "false");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::BUBBLE(%s)", engine->_text->_showDialogueBubble ? "true" : "false");
return 0;
}
int32 ScriptLifeV2::lNO_CHOC(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 val = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lNO_CHOC(%i)", (int)val);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lNO_CHOC(%i)", (int)val);
ctx.actor->_staticFlags.bNoElectricShock = val;
return 0;
}
int32 ScriptLifeV2::lCINEMA_MODE(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 val = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lCINEMA_MODE(%i)", (int)val);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lCINEMA_MODE(%i)", (int)val);
// TODO: implement me
return -1;
}
int32 ScriptLifeV2::lSAVE_HERO(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SAVE_HERO()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SAVE_HERO()");
engine->_actor->_saveHeroBehaviour = engine->_actor->_heroBehaviour;
ActorStruct *actor = engine->_scene->getActor(OWN_ACTOR_SCENE_INDEX);
actor->_saveGenBody = actor->_genBody;
@@ -496,7 +496,7 @@ int32 ScriptLifeV2::lSAVE_HERO(TwinEEngine *engine, LifeScriptContext &ctx) {
}
int32 ScriptLifeV2::lRESTORE_HERO(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::RESTORE_HERO()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::RESTORE_HERO()");
engine->_actor->setBehaviour(engine->_actor->_saveHeroBehaviour);
ActorStruct *actor = engine->_scene->getActor(OWN_ACTOR_SCENE_INDEX);
engine->_actor->initBody(actor->_saveGenBody, OWN_ACTOR_SCENE_INDEX);
@@ -505,7 +505,7 @@ int32 ScriptLifeV2::lRESTORE_HERO(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lRAIN(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 num = (int)ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lRAIN(%i)", (int)num);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lRAIN(%i)", (int)num);
int32 n = engine->_redraw->addOverlay(OverlayType::koRain, 0, 0, 0, 0, OverlayPosType::koNormal, 1);
if (n != -1) {
// Rain n/10s
@@ -519,7 +519,7 @@ int32 ScriptLifeV2::lRAIN(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lESCALATOR(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 num = ctx.stream.readByte();
const uint8 info1 = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lESCALATOR(%i, %i)", (int)num, (int)info1);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lESCALATOR(%i, %i)", (int)num, (int)info1);
for (int n = 0; n < engine->_scene->_sceneNumZones; n++) {
ZoneStruct &zone = engine->_scene->_sceneZones[n];
if (zone.type == ZoneType::kEscalator && zone.num == num) {
@@ -532,7 +532,7 @@ int32 ScriptLifeV2::lESCALATOR(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lSET_CAMERA(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 num = ctx.stream.readByte();
const uint8 info7 = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lSET_CAMERA(%i, %i)", (int)num, (int)info7);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lSET_CAMERA(%i, %i)", (int)num, (int)info7);
for (int n = 0; n < engine->_scene->_sceneNumZones; n++) {
ZoneStruct &zone = engine->_scene->_sceneZones[n];
if (zone.type == ZoneType::kCamera && zone.num == num) {
@@ -562,7 +562,7 @@ int32 ScriptLifeV2::lPLAY_ACF(TwinEEngine *engine, LifeScriptContext &ctx) {
error("Max string size exceeded for acf name");
}
} while (true);
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lPLAY_ACF(%s)", movie);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lPLAY_ACF(%s)", movie);
engine->_movie->playMovie(movie);
// TODO: lba2 is doing more stuff here - reset the cinema mode, init the scene and palette stuff
@@ -575,7 +575,7 @@ int32 ScriptLifeV2::lPLAY_ACF(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lSHADOW_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const int actorIdx = ctx.stream.readByte();
const bool castShadow = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SHADOW_OBJ(%i, %s)", actorIdx, castShadow ? "true" : "false");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SHADOW_OBJ(%i, %s)", actorIdx, castShadow ? "true" : "false");
ActorStruct *actor = engine->_scene->getActor(actorIdx);
if (actor->_lifePoint > 0) {
actor->_staticFlags.bNoShadow = !castShadow;
@@ -585,7 +585,7 @@ int32 ScriptLifeV2::lSHADOW_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lECLAIR(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 num = (int)ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lECLAIR(%i)", (int)num);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lECLAIR(%i)", (int)num);
int32 n = engine->_redraw->addOverlay(OverlayType::koFlash, 0, 0, 0, 0, OverlayPosType::koNormal, 1);
if (n != -1) {
// Eclair n/10s
@@ -596,14 +596,14 @@ int32 ScriptLifeV2::lECLAIR(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lINIT_BUGGY(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 num = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lINIT_BUGGY(%i)", (int)num);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lINIT_BUGGY(%i)", (int)num);
engine->_buggy->initBuggy(ctx.actorIdx, num);
return 0;
}
int32 ScriptLifeV2::lMEMO_ARDOISE(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 num = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lMEMO_ARDOISE(%i)", (int)num);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lMEMO_ARDOISE(%i)", (int)num);
if (engine->_gameState->hasGameFlag(GAMEFLAG_ARDOISE)) {
// TODO: implement me
}
@@ -613,7 +613,7 @@ int32 ScriptLifeV2::lMEMO_ARDOISE(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lSET_CHANGE_CUBE(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 num = ctx.stream.readByte();
const uint8 info = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lSET_CHANGE_CUBE(%i, %i)", (int)num, (int)info);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lSET_CHANGE_CUBE(%i, %i)", (int)num, (int)info);
int n = 0;
while (n < engine->_scene->_sceneNumZones) {
ZoneStruct &zone = engine->_scene->_sceneZones[n];
@@ -631,20 +631,20 @@ int32 ScriptLifeV2::lSET_CHANGE_CUBE(TwinEEngine *engine, LifeScriptContext &ctx
int32 ScriptLifeV2::lMESSAGE_ZOE(TwinEEngine *engine, LifeScriptContext &ctx) {
const int16 textIdx = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lMESSAGE_ZOE(%i)", (int)textIdx);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lMESSAGE_ZOE(%i)", (int)textIdx);
// TODO: implement me
return -1;
}
int32 ScriptLifeV2::lACTION(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::ACTION()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::ACTION()");
engine->_movements->setActionNormal(true);
return 0;
}
int32 ScriptLifeV2::lSET_FRAME(TwinEEngine *engine, LifeScriptContext &ctx) {
const int frame = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lSET_FRAME(%i)", (int)frame);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lSET_FRAME(%i)", (int)frame);
if (!ctx.actor->_staticFlags.bSprite3D) {
// TODO: ObjectSetFrame(ctx.actorIdx, frame);
}
@@ -653,7 +653,7 @@ int32 ScriptLifeV2::lSET_FRAME(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lSET_SPRITE(TwinEEngine *engine, LifeScriptContext &ctx) {
const int16 num = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lSET_SPRITE(%i)", (int)num);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lSET_SPRITE(%i)", (int)num);
if (ctx.actor->_staticFlags.bSprite3D) {
engine->_actor->initSprite(num, ctx.actorIdx);
}
@@ -662,7 +662,7 @@ int32 ScriptLifeV2::lSET_SPRITE(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lSET_FRAME_3DS(TwinEEngine *engine, LifeScriptContext &ctx) {
int sprite = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lSET_FRAME_3DS(%i)", (int)sprite);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lSET_FRAME_3DS(%i)", (int)sprite);
if (ctx.actor->_staticFlags.bHasSpriteAnim3D) {
const T_ANIM_3DS *anim = engine->_resources->getAnim(ctx.actor->A3DS.Num);
if (sprite >= anim->Fin - anim->Deb) {
@@ -678,7 +678,7 @@ int32 ScriptLifeV2::lIMPACT_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 num = ctx.stream.readByte();
const uint16 n = ctx.stream.readUint16LE();
const int16 y = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lIMPACT_OBJ(%i, %i, %i)", (int)num, (int)n, (int)y);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lIMPACT_OBJ(%i, %i, %i)", (int)num, (int)n, (int)y);
ActorStruct *otherActor = engine->_scene->getActor(num);
if (otherActor->_lifePoint > 0) {
// TODO: DoImpact(n, otherActor->_pos.x, otherActor->_pos.y + y, otherActor->_pos.z, num);
@@ -689,7 +689,7 @@ int32 ScriptLifeV2::lIMPACT_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lIMPACT_POINT(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 brickTrackId = ctx.stream.readByte();
const uint16 n = ctx.stream.readUint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lIMPACT_POINT(%i, %i)", (int)brickTrackId, (int)n);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lIMPACT_POINT(%i, %i)", (int)brickTrackId, (int)n);
// const IVec3 &pos = engine->_scene->_sceneTracks[brickTrackId];
// int16 x0 = pos.x;
// int16 y0 = pos.y;
@@ -702,7 +702,7 @@ int32 ScriptLifeV2::lIMPACT_POINT(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lLADDER(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 num = ctx.stream.readByte();
const uint8 info = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lLADDER(%i, %i)", (int)num, (int)info);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lLADDER(%i, %i)", (int)num, (int)info);
int n = 0;
while (n < engine->_scene->_sceneNumZones) {
ZoneStruct &zone = engine->_scene->_sceneZones[n];
@@ -717,7 +717,7 @@ int32 ScriptLifeV2::lLADDER(TwinEEngine *engine, LifeScriptContext &ctx) {
// SET_ARMURE
int32 ScriptLifeV2::lSET_ARMOR(TwinEEngine *engine, LifeScriptContext &ctx) {
const int8 armor = ctx.stream.readSByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lSET_ARMOR(%i)", (int)armor);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lSET_ARMOR(%i)", (int)armor);
ctx.actor->_armor = (int32)armor;
return 0;
}
@@ -726,7 +726,7 @@ int32 ScriptLifeV2::lSET_ARMOR(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lSET_ARMOR_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 num = ctx.stream.readByte();
const int8 armor = ctx.stream.readSByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lSET_ARMOR_OBJ(%i, %i)", (int)num, (int)armor);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lSET_ARMOR_OBJ(%i, %i)", (int)num, (int)armor);
if (ActorStruct *actor = engine->_scene->getActor(num)) {
actor->_armor = (int32)armor;
}
@@ -749,7 +749,7 @@ int32 ScriptLifeV2::lADD_LIFE_POINT_OBJ(TwinEEngine *engine, LifeScriptContext &
int32 ScriptLifeV2::lSTATE_INVENTORY(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 num = ctx.stream.readByte(); // num vargame
const uint8 idObj3D = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lSTATE_INVENTORY(%i, %i)", (int)num, (int)idObj3D);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lSTATE_INVENTORY(%i, %i)", (int)num, (int)idObj3D);
// TODO: TabInv[num].IdObj3D = idObj3D;
return -1;
}
@@ -785,7 +785,7 @@ int32 ScriptLifeV2::lEND_SWITCH(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lSET_HIT_ZONE(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 num = ctx.stream.readByte();
const uint8 info1 = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lSET_HIT_ZONE(%i, %i)", (int)num, (int)info1);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lSET_HIT_ZONE(%i, %i)", (int)num, (int)info1);
for (int n = 0; n < engine->_scene->_sceneNumZones; n++) {
ZoneStruct &zone = engine->_scene->_sceneZones[n];
if (zone.type == ZoneType::kHit && zone.num == num) {
@@ -796,41 +796,41 @@ int32 ScriptLifeV2::lSET_HIT_ZONE(TwinEEngine *engine, LifeScriptContext &ctx) {
}
int32 ScriptLifeV2::lSAVE_COMPORTEMENT(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lSAVE_COMPORTEMENT()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lSAVE_COMPORTEMENT()");
ctx.actor->_saveOffsetLife = ctx.actor->_offsetLife;
return 0;
}
int32 ScriptLifeV2::lRESTORE_COMPORTEMENT(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lRESTORE_COMPORTEMENT()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lRESTORE_COMPORTEMENT()");
ctx.actor->_offsetLife = ctx.actor->_saveOffsetLife;
return 0;
}
int32 ScriptLifeV2::lSAMPLE(TwinEEngine *engine, LifeScriptContext &ctx) {
const int16 sample = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lSAMPLE(%i)", (int)sample);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lSAMPLE(%i)", (int)sample);
// TODO: HQ_3D_MixSample(sample, 0x1000, 0, 1, ctx.actor->posObj());
return -1;
}
int32 ScriptLifeV2::lSAMPLE_RND(TwinEEngine *engine, LifeScriptContext &ctx) {
const int16 sample = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lSAMPLE_RND(%i)", (int)sample);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lSAMPLE_RND(%i)", (int)sample);
// TODO: HQ_3D_MixSample(sample, 0x800, 0x1000, 1, ctx.actor->posObj());
return -1;
}
int32 ScriptLifeV2::lSAMPLE_ALWAYS(TwinEEngine *engine, LifeScriptContext &ctx) {
const int16 sample = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lSAMPLE_ALWAYS(%i)", (int)sample);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lSAMPLE_ALWAYS(%i)", (int)sample);
// TODO:
return -1;
}
int32 ScriptLifeV2::lSAMPLE_STOP(TwinEEngine *engine, LifeScriptContext &ctx) {
const int16 sample = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lSAMPLE_STOP(%i)", (int)sample);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lSAMPLE_STOP(%i)", (int)sample);
// TODO:
return -1;
}
@@ -838,7 +838,7 @@ int32 ScriptLifeV2::lSAMPLE_STOP(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lREPEAT_SAMPLE(TwinEEngine *engine, LifeScriptContext &ctx) {
const int16 sample = ctx.stream.readSint16LE();
uint8 repeat = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lREPEAT_SAMPLE(%i, %i)", (int)sample, (int)repeat);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lREPEAT_SAMPLE(%i, %i)", (int)sample, (int)repeat);
// TODO: HQ_3D_MixSample(sample, 0x1000, 0, repeat, ctx.actor->posObj());
return -1;
}
@@ -850,7 +850,7 @@ int32 ScriptLifeV2::lBACKGROUND(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lSET_FLAG_GAME(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 num = ctx.stream.readByte();
const int16 val = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::SET_FLAG_GAME(%i, %i)", (int)num, (int)val);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_FLAG_GAME(%i, %i)", (int)num, (int)val);
engine->_gameState->setGameFlag(num, val);
if (num == GAMEFLAG_MONEY) {
@@ -867,7 +867,7 @@ int32 ScriptLifeV2::lSET_FLAG_GAME(TwinEEngine *engine, LifeScriptContext &ctx)
int32 ScriptLifeV2::lADD_VAR_GAME(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 num = ctx.stream.readByte();
const int16 val = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lADD_VAR_GAME(%i, %i)", (int)num, (int)val);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lADD_VAR_GAME(%i, %i)", (int)num, (int)val);
int16 currentVal = engine->_gameState->hasGameFlag(num);
if ((int)currentVal + (int)val < 32767) {
currentVal += val;
@@ -889,7 +889,7 @@ int32 ScriptLifeV2::lADD_VAR_GAME(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lSUB_VAR_GAME(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 num = ctx.stream.readByte();
const int16 val = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lADD_VAR_GAME(%i, %i)", (int)num, (int)val);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lADD_VAR_GAME(%i, %i)", (int)num, (int)val);
int16 currentVal = engine->_gameState->hasGameFlag(num);
if ((int)currentVal - (int)val > -32768) {
currentVal -= val;
@@ -911,7 +911,7 @@ int32 ScriptLifeV2::lSUB_VAR_GAME(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lADD_VAR_CUBE(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 num = ctx.stream.readByte();
const uint8 amount = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lADD_VAR_CUBE(%i, %i)", (int)num, (int)amount);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lADD_VAR_CUBE(%i, %i)", (int)num, (int)amount);
uint8 ¤t = engine->_scene->_listFlagCube[num];
if ((int16)current + (int16)amount < 255) {
current += amount;
@@ -924,7 +924,7 @@ int32 ScriptLifeV2::lADD_VAR_CUBE(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lSUB_VAR_CUBE(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 num = ctx.stream.readByte();
const uint8 amount = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lSUB_VAR_CUBE(%i, %i)", (int)num, (int)amount);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lSUB_VAR_CUBE(%i, %i)", (int)num, (int)amount);
uint8 ¤t = engine->_scene->_listFlagCube[num];
if ((int16)current - (int16)amount > 0) {
current -= amount;
@@ -937,7 +937,7 @@ int32 ScriptLifeV2::lSUB_VAR_CUBE(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lSET_RAIL(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 num = ctx.stream.readByte();
const uint8 info1 = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lSET_RAIL(%i, %i)", (int)num, (int)info1);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lSET_RAIL(%i, %i)", (int)num, (int)info1);
for (int n = 0; n < engine->_scene->_sceneNumZones; n++) {
ZoneStruct &zone = engine->_scene->_sceneZones[n];
if (zone.type == ZoneType::kRail && zone.num == num) {
@@ -971,7 +971,7 @@ int32 ScriptLifeV2::lINVERSE_BETA(TwinEEngine *engine, LifeScriptContext &ctx) {
}
int32 ScriptLifeV2::lNO_BODY(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lNO_BODY()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lNO_BODY()");
engine->_actor->initBody(BodyType::btNone, ctx.actorIdx);
return 0;
}
@@ -1005,7 +1005,7 @@ int32 ScriptLifeV2::lDEBUG_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
}
int32 ScriptLifeV2::lPOPCORN(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lPOPCORN()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lPOPCORN()");
// empty on purpose
return 0;
}
@@ -1027,14 +1027,14 @@ int32 ScriptLifeV2::lPCX(TwinEEngine *engine, LifeScriptContext &ctx) {
}
int32 ScriptLifeV2::lEND_MESSAGE(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lEND_MESSAGE()");
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lEND_MESSAGE()");
// empty on purpose
return 0;
}
int32 ScriptLifeV2::lEND_MESSAGE_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const uint8 num = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::lEND_MESSAGE_OBJ(%i)", (int)num);
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::lEND_MESSAGE_OBJ(%i)", (int)num);
return 0;
}
diff --git a/engines/twine/script/script_move.cpp b/engines/twine/script/script_move.cpp
index 314d763bd96..8151cd5957c 100644
--- a/engines/twine/script/script_move.cpp
+++ b/engines/twine/script/script_move.cpp
@@ -39,7 +39,7 @@ namespace TwinE {
* For unused opcodes
*/
int32 ScriptMove::mEMPTY(TwinEEngine *engine, MoveScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::EMPTY()");
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::EMPTY()");
return 0;
}
@@ -48,7 +48,7 @@ int32 ScriptMove::mEMPTY(TwinEEngine *engine, MoveScriptContext &ctx) {
* @note Opcode @c 0x00
*/
int32 ScriptMove::mEND(TwinEEngine *engine, MoveScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::END()");
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::END()");
ctx.actor->_offsetTrack = -1;
return 1;
}
@@ -58,7 +58,7 @@ int32 ScriptMove::mEND(TwinEEngine *engine, MoveScriptContext &ctx) {
* @note Opcode @c 0x01
*/
int32 ScriptMove::mNOP(TwinEEngine *engine, MoveScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::NOP()");
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::NOP()");
return 0;
}
@@ -69,7 +69,7 @@ int32 ScriptMove::mNOP(TwinEEngine *engine, MoveScriptContext &ctx) {
int32 ScriptMove::mBODY(TwinEEngine *engine, MoveScriptContext &ctx) {
BodyType bodyIdx = (BodyType)ctx.stream.readByte();
engine->_actor->initBody(bodyIdx, ctx.actorIdx);
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::BODY(%i)", (int)bodyIdx);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::BODY(%i)", (int)bodyIdx);
return 0;
}
@@ -79,7 +79,7 @@ int32 ScriptMove::mBODY(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
int32 ScriptMove::mANIM(TwinEEngine *engine, MoveScriptContext &ctx) {
AnimationTypes animIdx = (AnimationTypes)ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::ANIM(%i)", (int)animIdx);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::ANIM(%i)", (int)animIdx);
if (engine->_animations->initAnim(animIdx, AnimType::kAnimationTypeRepeat, AnimationTypes::kStanding, ctx.actorIdx)) {
return 0;
}
@@ -93,7 +93,7 @@ int32 ScriptMove::mANIM(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
int32 ScriptMove::mGOTO_POINT(TwinEEngine *engine, MoveScriptContext &ctx) {
engine->_scene->_currentScriptValue = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::GOTO_POINT(%i)", (int)engine->_scene->_currentScriptValue);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::GOTO_POINT(%i)", (int)engine->_scene->_currentScriptValue);
const IVec3 &sp = engine->_scene->_sceneTracks[engine->_scene->_currentScriptValue];
const int32 newAngle = engine->_movements->getAngle(ctx.actor->_posObj.x, ctx.actor->_posObj.z, sp.x, sp.z);
@@ -117,7 +117,7 @@ int32 ScriptMove::mGOTO_POINT(TwinEEngine *engine, MoveScriptContext &ctx) {
* @note Opcode @c 0x05
*/
int32 ScriptMove::mWAIT_ANIM(TwinEEngine *engine, MoveScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::WAIT_ANIM()");
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::WAIT_ANIM()");
if (!ctx.actor->_workFlags.bAnimEnded) {
ctx.undo(0);
} else {
@@ -133,7 +133,7 @@ int32 ScriptMove::mWAIT_ANIM(TwinEEngine *engine, MoveScriptContext &ctx) {
int32 ScriptMove::mLOOP(TwinEEngine *engine, MoveScriptContext &ctx) {
ctx.actor->_offsetTrack = 0;
ctx.stream.seek(0);
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::LOOP()");
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::LOOP()");
return 0;
}
@@ -143,7 +143,7 @@ int32 ScriptMove::mLOOP(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
int32 ScriptMove::mANGLE(TwinEEngine *engine, MoveScriptContext &ctx) {
const int16 angle = ToAngle(ctx.stream.readSint16LE());
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::ANGLE(%i)", (int)angle);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::ANGLE(%i)", (int)angle);
if (ctx.actor->_staticFlags.bSprite3D) {
return 0;
}
@@ -165,7 +165,7 @@ int32 ScriptMove::mANGLE(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
int32 ScriptMove::mPOS_POINT(TwinEEngine *engine, MoveScriptContext &ctx) {
engine->_scene->_currentScriptValue = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::POS_POINT(%i)", (int)engine->_scene->_currentScriptValue);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::POS_POINT(%i)", (int)engine->_scene->_currentScriptValue);
const IVec3 &sp = engine->_scene->_sceneTracks[engine->_scene->_currentScriptValue];
if (ctx.actor->_staticFlags.bSprite3D) {
@@ -184,7 +184,7 @@ int32 ScriptMove::mPOS_POINT(TwinEEngine *engine, MoveScriptContext &ctx) {
int32 ScriptMove::mLABEL(TwinEEngine *engine, MoveScriptContext &ctx) {
ctx.actor->_labelTrack = ctx.stream.readByte();
ctx.actor->_offsetLabelTrack = ctx.stream.pos() - 2;
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::LABEL(%i)", (int)ctx.actor->_labelTrack);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::LABEL(%i)", (int)ctx.actor->_labelTrack);
if (engine->_scene->_numCube == LBA1SceneId::Proxima_Island_Museum && ctx.actor->_actorIdx == 2 &&
(ctx.actor->_labelTrack == 0 || ctx.actor->_labelTrack == 1)) {
engine->unlockAchievement("LBA_ACH_004");
@@ -198,7 +198,7 @@ int32 ScriptMove::mLABEL(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
int32 ScriptMove::mGOTO(TwinEEngine *engine, MoveScriptContext &ctx) {
const int16 pos = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::GOTO(%i)", (int)pos);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::GOTO(%i)", (int)pos);
if (pos == -1) {
ctx.actor->_offsetTrack = -1;
return 1;
@@ -212,7 +212,7 @@ int32 ScriptMove::mGOTO(TwinEEngine *engine, MoveScriptContext &ctx) {
* @note Opcode @c 0x0B
*/
int32 ScriptMove::mSTOP(TwinEEngine *engine, MoveScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::STOP()");
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::STOP()");
ctx.actor->_offsetTrack = -1;
return 1;
}
@@ -223,7 +223,7 @@ int32 ScriptMove::mSTOP(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
int32 ScriptMove::mGOTO_SYM_POINT(TwinEEngine *engine, MoveScriptContext &ctx) {
engine->_scene->_currentScriptValue = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::GOTO_SYM_POINT(%i)", (int)engine->_scene->_currentScriptValue);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::GOTO_SYM_POINT(%i)", (int)engine->_scene->_currentScriptValue);
const IVec3 &sp = engine->_scene->_sceneTracks[engine->_scene->_currentScriptValue];
const int32 newAngle = LBAAngles::ANGLE_180 + engine->_movements->getAngle(ctx.actor->_posObj, sp);
@@ -250,7 +250,7 @@ int32 ScriptMove::mWAIT_NUM_ANIM(TwinEEngine *engine, MoveScriptContext &ctx) {
bool abortMove = false;
const int32 animRepeats = ctx.stream.readByte();
int32 animPos = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::WAIT_NUM_ANIM(%i, %i)", (int)animRepeats, animPos);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::WAIT_NUM_ANIM(%i, %i)", (int)animRepeats, animPos);
if (ctx.actor->_workFlags.bAnimEnded) {
animPos++;
@@ -279,7 +279,7 @@ int32 ScriptMove::mWAIT_NUM_ANIM(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
int32 ScriptMove::mSAMPLE(TwinEEngine *engine, MoveScriptContext &ctx) {
int32 sampleIdx = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::SAMPLE(%i)", (int)sampleIdx);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::SAMPLE(%i)", (int)sampleIdx);
engine->_sound->playSample(sampleIdx, 1, ctx.actor->posObj(), ctx.actorIdx);
return 0;
}
@@ -290,7 +290,7 @@ int32 ScriptMove::mSAMPLE(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
int32 ScriptMove::mGOTO_POINT_3D(TwinEEngine *engine, MoveScriptContext &ctx) {
const int32 trackId = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::GOTO_POINT_3D(%i)", (int)trackId);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::GOTO_POINT_3D(%i)", (int)trackId);
if (!ctx.actor->_staticFlags.bSprite3D) {
return 0;
}
@@ -316,7 +316,7 @@ int32 ScriptMove::mGOTO_POINT_3D(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
int32 ScriptMove::mSPEED(TwinEEngine *engine, MoveScriptContext &ctx) {
ctx.actor->_speed = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::SPEED(%i)", (int)ctx.actor->_speed);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::SPEED(%i)", (int)ctx.actor->_speed);
if (ctx.actor->_staticFlags.bSprite3D) {
engine->_movements->setActorAngle(LBAAngles::ANGLE_0, ctx.actor->_speed, LBAAngles::ANGLE_17, &ctx.actor->realAngle);
@@ -331,7 +331,7 @@ int32 ScriptMove::mSPEED(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
int32 ScriptMove::mBACKGROUND(TwinEEngine *engine, MoveScriptContext &ctx) {
const uint8 val = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::BACKGROUND(%i)", (int)val);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::BACKGROUND(%i)", (int)val);
if (val != 0) {
if (!ctx.actor->_staticFlags.bIsBackgrounded) {
ctx.actor->_staticFlags.bIsBackgrounded = 1;
@@ -358,7 +358,7 @@ int32 ScriptMove::mBACKGROUND(TwinEEngine *engine, MoveScriptContext &ctx) {
int32 ScriptMove::mWAIT_NUM_SECOND(TwinEEngine *engine, MoveScriptContext &ctx) {
const int32 numSeconds = ctx.stream.readByte();
int32 currentTime = ctx.stream.readSint32LE();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::WAIT_NUM_SECOND(%i, %i)", (int)numSeconds, currentTime);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::WAIT_NUM_SECOND(%i, %i)", (int)numSeconds, currentTime);
if (currentTime == 0) {
currentTime = engine->timerRef + engine->toSeconds(numSeconds);
@@ -382,7 +382,7 @@ int32 ScriptMove::mWAIT_NUM_SECOND(TwinEEngine *engine, MoveScriptContext &ctx)
* @note Opcode @c 0x13
*/
int32 ScriptMove::mNO_BODY(TwinEEngine *engine, MoveScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::NO_BODY()");
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::NO_BODY()");
engine->_actor->initBody(BodyType::btNone, ctx.actorIdx);
return 0;
}
@@ -393,7 +393,7 @@ int32 ScriptMove::mNO_BODY(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
int32 ScriptMove::mBETA(TwinEEngine *engine, MoveScriptContext &ctx) {
const int16 beta = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::BETA(%i)", (int)beta);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::BETA(%i)", (int)beta);
ctx.actor->_beta = beta;
@@ -406,7 +406,7 @@ int32 ScriptMove::mBETA(TwinEEngine *engine, MoveScriptContext &ctx) {
int32 ScriptMove::mOPEN_GENERIC(TwinEEngine *engine, MoveScriptContext &ctx, int32 angle) {
const int16 doorStatus = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::OPEN(%i, %i)", (int)doorStatus, angle);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::OPEN(%i, %i)", (int)doorStatus, angle);
if (ctx.actor->_staticFlags.bSprite3D && ctx.actor->_staticFlags.bSpriteClip) {
ctx.actor->_beta = angle;
ctx.actor->_doorWidth = doorStatus;
@@ -459,7 +459,7 @@ int32 ScriptMove::mOPEN_DOWN(TwinEEngine *engine, MoveScriptContext &ctx) {
* @note Opcode @c 0x19
*/
int32 ScriptMove::mCLOSE(TwinEEngine *engine, MoveScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::CLOSE()");
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::CLOSE()");
if (ctx.actor->_staticFlags.bSprite3D && ctx.actor->_staticFlags.bSpriteClip) {
ctx.actor->_doorWidth = 0;
ctx.actor->_workFlags.bIsSpriteMoving = 1;
@@ -474,7 +474,7 @@ int32 ScriptMove::mCLOSE(TwinEEngine *engine, MoveScriptContext &ctx) {
* @note Opcode @c 0x1A
*/
int32 ScriptMove::mWAIT_DOOR(TwinEEngine *engine, MoveScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::WAIT_DOOR()");
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::WAIT_DOOR()");
if (ctx.actor->_staticFlags.bSprite3D && ctx.actor->_staticFlags.bSpriteClip) {
if (ctx.actor->_speed) {
ctx.undo(0);
@@ -490,7 +490,7 @@ int32 ScriptMove::mWAIT_DOOR(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
int32 ScriptMove::mSAMPLE_RND(TwinEEngine *engine, MoveScriptContext &ctx) {
int32 sampleIdx = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::SAMPLE_RND(%i)", (int)sampleIdx);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::SAMPLE_RND(%i)", (int)sampleIdx);
engine->_sound->playSample(sampleIdx, 1, ctx.actor->posObj(), ctx.actorIdx);
return 0;
}
@@ -501,7 +501,7 @@ int32 ScriptMove::mSAMPLE_RND(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
int32 ScriptMove::mSAMPLE_ALWAYS(TwinEEngine *engine, MoveScriptContext &ctx) {
int32 sampleIdx = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::SAMPLE_ALWAYS(%i)", (int)sampleIdx);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::SAMPLE_ALWAYS(%i)", (int)sampleIdx);
if (!engine->_sound->isSamplePlaying(sampleIdx)) { // if its not playing
engine->_sound->playSample(sampleIdx, -1, ctx.actor->posObj(), ctx.actorIdx);
}
@@ -514,7 +514,7 @@ int32 ScriptMove::mSAMPLE_ALWAYS(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
int32 ScriptMove::mSAMPLE_STOP(TwinEEngine *engine, MoveScriptContext &ctx) {
int32 sampleIdx = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::SAMPLE_STOP(%i)", (int)sampleIdx);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::SAMPLE_STOP(%i)", (int)sampleIdx);
engine->_sound->stopSample(sampleIdx);
return 0;
}
@@ -537,7 +537,7 @@ int32 ScriptMove::mPLAY_FLA(TwinEEngine *engine, MoveScriptContext &ctx) {
}
} while (true);
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::PLAY_FLA(%s)", movie);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::PLAY_FLA(%s)", movie);
engine->_movie->playMovie(movie);
engine->setPalette(engine->_screens->_ptrPal);
engine->_screens->clearScreen();
@@ -550,7 +550,7 @@ int32 ScriptMove::mPLAY_FLA(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
int32 ScriptMove::mREPEAT_SAMPLE(TwinEEngine *engine, MoveScriptContext &ctx) {
ctx.numRepeatSample = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::REPEAT_SAMPLE(%i)", (int)ctx.numRepeatSample);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::REPEAT_SAMPLE(%i)", (int)ctx.numRepeatSample);
return 0;
}
@@ -560,7 +560,7 @@ int32 ScriptMove::mREPEAT_SAMPLE(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
int32 ScriptMove::mSIMPLE_SAMPLE(TwinEEngine *engine, MoveScriptContext &ctx) {
int32 sampleIdx = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::SIMPLE_SAMPLE(%i)", (int)sampleIdx);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::SIMPLE_SAMPLE(%i)", (int)sampleIdx);
engine->_sound->playSample(sampleIdx, ctx.numRepeatSample, ctx.actor->posObj(), ctx.actorIdx);
ctx.numRepeatSample = 1;
return 0;
@@ -572,7 +572,7 @@ int32 ScriptMove::mSIMPLE_SAMPLE(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
int32 ScriptMove::mFACE_HERO(TwinEEngine *engine, MoveScriptContext &ctx) {
const int16 angle = ToAngle(ctx.stream.readSint16LE());
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::FACE_HERO(%i)", (int)angle);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::FACE_HERO(%i)", (int)angle);
if (ctx.actor->_staticFlags.bSprite3D) {
return 0;
}
@@ -601,7 +601,7 @@ int32 ScriptMove::mFACE_HERO(TwinEEngine *engine, MoveScriptContext &ctx) {
int32 ScriptMove::mANGLE_RND(TwinEEngine *engine, MoveScriptContext &ctx) {
const int16 val1 = ctx.stream.readSint16LE();
const int16 val2 = ctx.stream.readSint16LE();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::LBAAngles::ANGLE_RND(%i, %i)", (int)val1, (int)val2);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::LBAAngles::ANGLE_RND(%i, %i)", (int)val1, (int)val2);
if (ctx.actor->_staticFlags.bSprite3D) {
return 0;
}
@@ -641,11 +641,11 @@ void ScriptMove::doTrack(int32 actorIdx) {
int32 end = -2;
MoveScriptContext ctx(actorIdx, actor);
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::BEGIN(%i)", actorIdx);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::BEGIN(%i)", actorIdx);
do {
const byte scriptOpcode = ctx.stream.readByte();
if (scriptOpcode < _functionMapSize) {
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::EXEC(%s, %i)", _functionMap[scriptOpcode].name, actorIdx);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::EXEC(%s, %i)", _functionMap[scriptOpcode].name, actorIdx);
end = _functionMap[scriptOpcode].function(_engine, ctx);
} else {
error("Actor %d with wrong offset/opcode in move script - Offset: %d/%d (opcode: %u)", actorIdx, (int)ctx.stream.pos() - 1, (int)ctx.stream.size(), scriptOpcode);
@@ -654,14 +654,14 @@ void ScriptMove::doTrack(int32 actorIdx) {
if (end < 0) {
warning("Actor %d Life script [%s] not implemented", actorIdx, _functionMap[scriptOpcode].name);
} else if (end == 1) {
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::BREAK(%i)", actorIdx);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::BREAK(%i)", actorIdx);
}
if (ctx.actor->_offsetTrack != -1) {
actor->_offsetTrack = ctx.stream.pos();
}
} while (end != 1);
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::END(%i)", actorIdx);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::END(%i)", actorIdx);
}
} // namespace TwinE
diff --git a/engines/twine/script/script_move_v2.cpp b/engines/twine/script/script_move_v2.cpp
index 760247d2bb1..b1cdabe6e42 100644
--- a/engines/twine/script/script_move_v2.cpp
+++ b/engines/twine/script/script_move_v2.cpp
@@ -84,7 +84,7 @@ static const ScriptMoveFunction function_map[] = {
int32 ScriptMoveV2::mWAIT_NB_DIZIEME(TwinEEngine *engine, MoveScriptContext &ctx) {
const int32 numSeconds = ctx.stream.readByte();
int32 currentTime = ctx.stream.readSint32LE();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::WAIT_NB_DIZIEME(%i, %i)", (int)numSeconds, currentTime);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::WAIT_NB_DIZIEME(%i, %i)", (int)numSeconds, currentTime);
if (currentTime == 0) {
currentTime = engine->timerRef + engine->toSeconds(numSeconds) / 10;
@@ -106,7 +106,7 @@ int32 ScriptMoveV2::mWAIT_NB_DIZIEME(TwinEEngine *engine, MoveScriptContext &ctx
int32 ScriptMoveV2::mWAIT_NB_DIZIEME_RND(TwinEEngine *engine, MoveScriptContext &ctx) {
const int32 numSeconds = engine->getRandomNumber(ctx.stream.readByte());
int32 currentTime = ctx.stream.readSint32LE();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::WAIT_NB_DIZIEME(%i, %i)", (int)numSeconds, currentTime);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::WAIT_NB_DIZIEME(%i, %i)", (int)numSeconds, currentTime);
if (currentTime == 0) {
currentTime = engine->timerRef + engine->toSeconds(numSeconds) / 10;
@@ -128,7 +128,7 @@ int32 ScriptMoveV2::mWAIT_NB_DIZIEME_RND(TwinEEngine *engine, MoveScriptContext
int32 ScriptMoveV2::mWAIT_NB_SECOND_RND(TwinEEngine *engine, MoveScriptContext &ctx) {
const int32 numSeconds = engine->getRandomNumber(ctx.stream.readByte());
int32 currentTime = ctx.stream.readSint32LE();
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::WAIT_NB_SECOND_RND(%i, %i)", (int)numSeconds, currentTime);
+ debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::WAIT_NB_SECOND_RND(%i, %i)", (int)numSeconds, currentTime);
if (currentTime == 0) {
currentTime = engine->timerRef + engine->toSeconds(numSeconds);
diff --git a/engines/twine/shared.h b/engines/twine/shared.h
index 4aa3de90575..4b830e9d6ea 100644
--- a/engines/twine/shared.h
+++ b/engines/twine/shared.h
@@ -31,7 +31,7 @@
/** Number of colors used in the game */
#define NUMOFCOLORS 256
-#define MAX_HOLO_POS 150 /* lba1 */
+#define MAX_HOLO_POS 150 /* lba1 */
#define MAX_HOLO_POS_2 334 /* lba2 */
#define NUM_INVENTORY_ITEMS 28
@@ -106,13 +106,13 @@ struct IVec2 {
int32 x;
int32 y;
- inline IVec2& operator+=(const IVec2 &other) {
+ inline IVec2 &operator+=(const IVec2 &other) {
x += other.x;
y += other.y;
return *this;
}
- inline IVec2& operator-=(const IVec2 &other) {
+ inline IVec2 &operator-=(const IVec2 &other) {
x -= other.x;
y -= other.y;
return *this;
@@ -126,21 +126,21 @@ struct IVec3 {
int32 y;
int32 z;
- inline IVec3 &operator=(const I16Vec3& other) {
+ inline IVec3 &operator=(const I16Vec3 &other) {
x = other.x;
y = other.y;
z = other.z;
return *this;
}
- inline IVec3& operator+=(const IVec3 &other) {
+ inline IVec3 &operator+=(const IVec3 &other) {
x += other.x;
y += other.y;
z += other.z;
return *this;
}
- inline IVec3& operator-=(const IVec3 &other) {
+ inline IVec3 &operator-=(const IVec3 &other) {
x -= other.x;
y -= other.y;
z -= other.z;
@@ -347,11 +347,11 @@ enum class AnimType {
* @note The values must match the @c TextId indices
*/
enum class HeroBehaviourType {
- kNormal = 0, // C_NORMAL
- kAthletic = 1, // C_SPORTIF
- kAggressive = 2, // C_AGRESSIF
- kDiscrete = 3, // C_DISCRET
- kProtoPack = 4, // C_PROTOPACK
+ kNormal = 0, // C_NORMAL
+ kAthletic = 1, // C_SPORTIF
+ kAggressive = 2, // C_AGRESSIF
+ kDiscrete = 3, // C_DISCRET
+ kProtoPack = 4, // C_PROTOPACK
#if 0
kDOUBLE = 5, // C_DOUBLE Twinsen + Zoé
kCONQUE = 6, // C_CONQUE Conque
@@ -367,8 +367,8 @@ enum class HeroBehaviourType {
};
// lba2
-#define CUBE_INTERIEUR 0
-#define CUBE_EXTERIEUR 1
+#define CUBE_INTERIEUR 0
+#define CUBE_EXTERIEUR 1
/**
* 0: tunic + medallion
@@ -599,7 +599,7 @@ enum class TextId : int16 {
kVolumeSettings = 30,
kDetailsPolygonsHigh = 31,
kDetailsShadowHigh = 32,
- //kSceneryZoomOn = 33, // duplicate with 133 - TODO check if this is the same in all languages
+ // kSceneryZoomOn = 33, // duplicate with 133 - TODO check if this is the same in all languages
kCreateNewPlayer = 40,
kCreateSaveGame = 41,
kEnterYourName = 42,
@@ -783,11 +783,11 @@ inline constexpr T bits(T value, uint8 offset, uint8 bits) {
// color 20 - 24 = orange to yellow
// color 25 orange
// color 26 - 30 = bright gray or white
-#define COlOR_31 31 // green dark
-#define COlOR_47 47 // green bright
-#define COLOR_48 48 // brown dark
-#define COLOR_63 63 // brown bright
-#define COLOR_64 64 // blue dark
+#define COlOR_31 31 // green dark
+#define COlOR_47 47 // green bright
+#define COLOR_48 48 // brown dark
+#define COLOR_63 63 // brown bright
+#define COLOR_64 64 // blue dark
#define COLOR_SELECT_MENU 68 // blue
// TODO #define COLOR_SELECT_MENU 166 // blue lba2
#define COLOR_73 73 // blue
@@ -801,11 +801,16 @@ inline constexpr T bits(T value, uint8 offset, uint8 bits) {
#define COLOR_158 158
enum kDebugLevels {
- kDebugScripts = 1 << 0,
- kDebugTime = 1 << 1,
- kDebugImGui = 1 << 2
+ kDebugScriptsMove = 1 << 0,
+ kDebugScriptsLife = 1 << 1,
+ kDebugTimers = 1 << 2,
+ kDebugResources = 1 << 3,
+ kDebugImGui = 1 << 4,
+ kDebugInput = 1 << 5,
+ kDebugMovies = 1 << 6,
+ kDebugPalette = 1 << 7
};
-}
+} // namespace TwinE
#endif
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index 41d5dceea1d..0a80120b299 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -710,20 +710,20 @@ int TwinEEngine::getRandomNumber(uint max) {
void TwinEEngine::freezeTime(bool pause) {
if (_isTimeFreezed == 0) {
_saveFreezedTime = timerRef;
- debugC(3, kDebugLevels::kDebugTime, "freezeTime: timer %i", timerRef);
+ debugC(3, kDebugLevels::kDebugTimers, "freezeTime: timer %i", timerRef);
if (pause)
_pauseToken = pauseEngine();
}
_isTimeFreezed++;
- debugC(3, kDebugLevels::kDebugTime, "freezeTime: %i", _isTimeFreezed);
+ debugC(3, kDebugLevels::kDebugTimers, "freezeTime: %i", _isTimeFreezed);
}
void TwinEEngine::unfreezeTime() {
--_isTimeFreezed;
- debugC(3, kDebugLevels::kDebugTime, "unfreezeTime: %i", _isTimeFreezed);
+ debugC(3, kDebugLevels::kDebugTimers, "unfreezeTime: %i", _isTimeFreezed);
if (_isTimeFreezed == 0) {
timerRef = _saveFreezedTime;
- debugC(3, kDebugLevels::kDebugTime, "unfreezeTime: time %i", timerRef);
+ debugC(3, kDebugLevels::kDebugTimers, "unfreezeTime: time %i", timerRef);
if (_pauseToken.isActive()) {
_pauseToken.clear();
}
@@ -1274,6 +1274,7 @@ void TwinEEngine::blitFrontToWork(const Common::Rect &rect) {
}
void TwinEEngine::setPalette(const Graphics::Palette &palette, uint startColor) {
+ debugC(1, TwinE::kDebugPalette, "Change palette (%i colors, starting at %i)", (int)palette.size(), (int)startColor);
_frontVideoBuffer.setPalette(palette, startColor);
}
@@ -1282,6 +1283,7 @@ void TwinEEngine::setPalette(uint startColor, uint numColors, const byte *palett
warning("Could not set palette");
return;
}
+ debugC(1, TwinE::kDebugPalette, "Change palette (%i colors, starting at %i)", (int)numColors, (int)startColor);
_frontVideoBuffer.setPalette(palette, startColor, numColors);
}
Commit: 3d1c23ce81e7f15822298f55fd7e44b45c110896
https://github.com/scummvm/scummvm/commit/3d1c23ce81e7f15822298f55fd7e44b45c110896
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-11T17:29:25+02:00
Commit Message:
TWINE: removed ImGuiTreeNodeFlags_DefaultOpen because it uses the full screen on small displays
... when imgui does the initial window auto sizing
Changed paths:
engines/twine/debugger/debugtools.cpp
diff --git a/engines/twine/debugger/debugtools.cpp b/engines/twine/debugger/debugtools.cpp
index e162129d17b..ff7a042ed2b 100644
--- a/engines/twine/debugger/debugtools.cpp
+++ b/engines/twine/debugger/debugtools.cpp
@@ -556,7 +556,7 @@ static void actorDetailsWindow(int &actorIdx, TwinEEngine *engine) {
}
}
- if (ImGui::CollapsingHeader("Work Flags", ImGuiTreeNodeFlags_DefaultOpen)) {
+ if (ImGui::CollapsingHeader("Work Flags")) {
static const char *Names[] = {
"WAIT_HIT_FRAME",
"OK_HIT",
@@ -590,7 +590,7 @@ static void actorDetailsWindow(int &actorIdx, TwinEEngine *engine) {
ImGui::EndTable();
}
}
- if (ImGui::CollapsingHeader("Flags", ImGuiTreeNodeFlags_DefaultOpen)) {
+ if (ImGui::CollapsingHeader("Flags")) {
static const char *Names[] = {
"CHECK_OBJ_COL",
"CHECK_BRICK_COL",
Commit: 39722ab56e9bfdf90baaf3951415f636b49afae8
https://github.com/scummvm/scummvm/commit/39722ab56e9bfdf90baaf3951415f636b49afae8
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-11T17:29:25+02:00
Commit Message:
TWINE: print the current timer value to the debugger menu
Changed paths:
engines/twine/debugger/debugtools.cpp
diff --git a/engines/twine/debugger/debugtools.cpp b/engines/twine/debugger/debugtools.cpp
index ff7a042ed2b..1375c2fec9a 100644
--- a/engines/twine/debugger/debugtools.cpp
+++ b/engines/twine/debugger/debugtools.cpp
@@ -760,6 +760,7 @@ static void gridMenu(TwinEEngine *engine) {
static void debuggerMenu(TwinEEngine *engine) {
if (ImGui::BeginMenu("Debugger")) {
+ ImGui::Text("Timer: %i", (int)engine->timerRef);
if (ImGui::MenuItem("Logs")) {
engine->_debugState->_loggerWindow = true;
}
Commit: e3b8cf864c968cb4359e3b93299821711a985ca1
https://github.com/scummvm/scummvm/commit/e3b8cf864c968cb4359e3b93299821711a985ca1
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-11T17:29:25+02:00
Commit Message:
TWINE: renamed struct and members to match the original sources
Changed paths:
engines/twine/holomap.h
engines/twine/holomap_v1.cpp
engines/twine/holomap_v1.h
engines/twine/menu/menu.h
engines/twine/renderer/renderer.cpp
engines/twine/renderer/renderer.h
engines/twine/scene/actor.cpp
engines/twine/scene/actor.h
engines/twine/scene/animations.cpp
engines/twine/scene/extra.cpp
engines/twine/scene/extra.h
engines/twine/scene/movements.cpp
engines/twine/scene/movements.h
engines/twine/script/script_move.cpp
engines/twine/twine.cpp
engines/twine/twine.h
diff --git a/engines/twine/holomap.h b/engines/twine/holomap.h
index a6d4fb18f19..f070c8932ad 100644
--- a/engines/twine/holomap.h
+++ b/engines/twine/holomap.h
@@ -34,7 +34,7 @@ namespace TwinE {
class TwinEEngine;
class BodyData;
class AnimData;
-struct ActorMoveStruct;
+struct RealValue;
struct Vertex;
struct AnimTimerDataStruct;
diff --git a/engines/twine/holomap_v1.cpp b/engines/twine/holomap_v1.cpp
index ceeea9c2742..db4b5b1ed0f 100644
--- a/engines/twine/holomap_v1.cpp
+++ b/engines/twine/holomap_v1.cpp
@@ -307,10 +307,10 @@ void HolomapV1::drawHoloObj(const IVec3 &angle, int32 alpha, int32 beta, int16 s
_engine->copyBlockPhys(dirtyRect);
}
-void HolomapV1::renderHolomapVehicle(uint &frameNumber, ActorMoveStruct &move, AnimTimerDataStruct &animTimerData, BodyData &bodyData, AnimData &animData) {
- const int16 vbeta = move.getRealAngle(_engine->timerRef);
- if (move.timeValue == 0) {
- _engine->_movements->initRealAngle(LBAAngles::ANGLE_0, -LBAAngles::ANGLE_90, 500, &move);
+void HolomapV1::renderHolomapVehicle(uint &frameNumber, RealValue &realRot, AnimTimerDataStruct &animTimerData, BodyData &bodyData, AnimData &animData) {
+ const int16 vbeta = realRot.getRealAngle(_engine->timerRef);
+ if (realRot.timeValue == 0) {
+ _engine->_movements->initRealAngle(LBAAngles::ANGLE_0, -LBAAngles::ANGLE_90, 500, &realRot);
}
if (_engine->_animations->setInterAnimObjet(frameNumber, animData, bodyData, &animTimerData)) {
@@ -369,7 +369,7 @@ void HolomapV1::holoTraj(int32 trajectoryIndex) {
const Location &loc = _listHoloPos[data->locationIdx];
drawHoloObj(data->angle, loc.alpha, loc.beta, 0);
- ActorMoveStruct move;
+ RealValue move;
AnimTimerDataStruct animTimerData;
AnimData animData;
animData.loadFromHQR(Resources::HQR_RESS_FILE, data->getAnimation(), _engine->isLBA1());
diff --git a/engines/twine/holomap_v1.h b/engines/twine/holomap_v1.h
index 6bfc614b42c..2cbb96aa972 100644
--- a/engines/twine/holomap_v1.h
+++ b/engines/twine/holomap_v1.h
@@ -85,7 +85,7 @@ private:
void computeCoorMapping();
void computeGlobeProj();
void drawHoloMap(uint8 *holomapImage, uint32 holomapImageSize);
- void renderHolomapVehicle(uint &frameNumber, ActorMoveStruct &move, AnimTimerDataStruct &animTimerData, BodyData &bodyData, AnimData &animData);
+ void renderHolomapVehicle(uint &frameNumber, RealValue &move, AnimTimerDataStruct &animTimerData, BodyData &bodyData, AnimData &animData);
/**
* Controls the size/zoom of the holomap planet
diff --git a/engines/twine/menu/menu.h b/engines/twine/menu/menu.h
index 392127e5bb5..5c91a5a323d 100644
--- a/engines/twine/menu/menu.h
+++ b/engines/twine/menu/menu.h
@@ -163,7 +163,7 @@ private:
// objectRotation
int16 _itemAngle[NUM_INVENTORY_ITEMS];
/** Behaviour menu move pointer */
- ActorMoveStruct _moveMenu;
+ RealValue _moveMenu;
/**
* Draws main menu button
diff --git a/engines/twine/renderer/renderer.cpp b/engines/twine/renderer/renderer.cpp
index a8d94773da3..0580e997828 100644
--- a/engines/twine/renderer/renderer.cpp
+++ b/engines/twine/renderer/renderer.cpp
@@ -1748,7 +1748,7 @@ bool Renderer::affObjetIso(int32 x, int32 y, int32 z, int32 alpha, int32 beta, i
return true;
}
-void Renderer::drawObj3D(const Common::Rect &rect, int32 y, int32 angle, const BodyData &bodyData, ActorMoveStruct &move) {
+void Renderer::drawObj3D(const Common::Rect &rect, int32 y, int32 angle, const BodyData &bodyData, RealValue &move) {
int32 boxLeft = rect.left;
int32 boxTop = rect.top;
int32 boxRight = rect.right;
diff --git a/engines/twine/renderer/renderer.h b/engines/twine/renderer/renderer.h
index 3242164a8bd..d22a109c1c6 100644
--- a/engines/twine/renderer/renderer.h
+++ b/engines/twine/renderer/renderer.h
@@ -285,11 +285,11 @@ public:
/**
* @param angle A value of @c -1 means that the model is automatically rotated
*/
- void renderBehaviourModel(int32 boxLeft, int32 boxTop, int32 boxRight, int32 boxBottom, int32 y, int32 angle, const BodyData &bodyData, ActorMoveStruct &move);
+ void renderBehaviourModel(int32 boxLeft, int32 boxTop, int32 boxRight, int32 boxBottom, int32 y, int32 angle, const BodyData &bodyData, RealValue &move);
/**
* @param angle A value of @c -1 means that the model is automatically rotated
*/
- void drawObj3D(const Common::Rect &rect, int32 y, int32 angle, const BodyData &bodyData, ActorMoveStruct &move);
+ void drawObj3D(const Common::Rect &rect, int32 y, int32 angle, const BodyData &bodyData, RealValue &move);
/**
* @brief Render an inventory item
diff --git a/engines/twine/scene/actor.cpp b/engines/twine/scene/actor.cpp
index bd22829a440..8ff7f511eea 100644
--- a/engines/twine/scene/actor.cpp
+++ b/engines/twine/scene/actor.cpp
@@ -493,7 +493,7 @@ void Actor::posObjectAroundAnother(uint8 numsrc, uint8 numtopos) {
#endif
}
-int16 ActorMoveStruct::getRealValueFromTime(int32 time) {
+int16 RealValue::getRealValueFromTime(int32 time) {
if (timeValue) {
const int32 delta = time - memoTicks;
@@ -511,7 +511,7 @@ int16 ActorMoveStruct::getRealValueFromTime(int32 time) {
return endValue;
}
-int16 ActorMoveStruct::getRealAngle(int32 time) {
+int16 RealValue::getRealAngle(int32 time) {
if (timeValue) {
int32 delta = time - memoTicks;
if (delta < timeValue) {
diff --git a/engines/twine/scene/actor.h b/engines/twine/scene/actor.h
index 2f3e9c55d63..ab8364533ca 100644
--- a/engines/twine/scene/actor.h
+++ b/engines/twine/scene/actor.h
@@ -37,7 +37,7 @@ namespace TwinE {
#define NUM_BODIES 469 // 131 for lba1
/** Actors move structure */
-struct ActorMoveStruct {
+struct RealValue {
int16 startValue = 0;
int16 endValue = 0;
int16 timeValue = 0;
@@ -247,7 +247,7 @@ public:
int16 SizeSHit; // lba2 - always square
BoundingBox _boundingBox; // Xmin, YMin, Zmin, Xmax, Ymax, Zmax
- ActorMoveStruct realAngle;
+ RealValue realAngle;
AnimTimerDataStruct _animTimerData;
};
diff --git a/engines/twine/scene/animations.cpp b/engines/twine/scene/animations.cpp
index 4b5e0ca47f2..bb5451b5676 100644
--- a/engines/twine/scene/animations.cpp
+++ b/engines/twine/scene/animations.cpp
@@ -497,7 +497,7 @@ void Animations::doAnim(int32 actorIdx) {
processActor.x = actor->_posObj.x + destPos.x;
processActor.z = actor->_posObj.z + destPos.y;
- _engine->_movements->setActorAngle(LBAAngles::ANGLE_0, actor->_speed, LBAAngles::ANGLE_17, &actor->realAngle);
+ _engine->_movements->initRealValue(LBAAngles::ANGLE_0, actor->_speed, LBAAngles::ANGLE_17, &actor->realAngle);
if (actor->_workFlags.bIsSpriteMoving) {
if (actor->_doorWidth) { // open door
diff --git a/engines/twine/scene/extra.cpp b/engines/twine/scene/extra.cpp
index 37e648b4455..33c55efb5b6 100644
--- a/engines/twine/scene/extra.cpp
+++ b/engines/twine/scene/extra.cpp
@@ -94,7 +94,7 @@ int32 Extra::extraSearch(int32 actorIdx, int32 x, int32 y, int32 z, int32 sprite
extra->destPos.z = maxSpeed;
extra->strengthOfHit = strengthOfHit;
- _engine->_movements->setActorAngle(LBAAngles::ANGLE_0, maxSpeed, LBAAngles::ANGLE_17, &extra->trackActorMove);
+ _engine->_movements->initRealValue(LBAAngles::ANGLE_0, maxSpeed, LBAAngles::ANGLE_17, &extra->trackActorMove);
const ActorStruct *actor = _engine->_scene->getActor(targetActor);
extra->angle = _engine->_movements->getAngle(extra->pos, actor->posObj());
return i;
@@ -290,7 +290,7 @@ int32 Extra::addExtraAiming(int32 actorIdx, int32 x, int32 y, int32 z, int32 spr
extra->spawnTime = targetActorIdx;
extra->destPos.z = finalAngle;
extra->strengthOfHit = strengthOfHit;
- _engine->_movements->setActorAngle(LBAAngles::ANGLE_0, finalAngle, LBAAngles::ANGLE_17, &extra->trackActorMove);
+ _engine->_movements->initRealValue(LBAAngles::ANGLE_0, finalAngle, LBAAngles::ANGLE_17, &extra->trackActorMove);
const ActorStruct *actor = _engine->_scene->getActor(targetActorIdx);
extra->angle = _engine->_movements->getAngle(extra->pos, actor->posObj());
@@ -326,7 +326,7 @@ int32 Extra::extraSearchKey(int32 actorIdx, int32 x, int32 y, int32 z, int32 spr
extra->payload.extraIdx = extraIdx;
extra->destPos.z = 4000;
extra->strengthOfHit = 0;
- _engine->_movements->setActorAngle(LBAAngles::ANGLE_0, 4000, LBAAngles::ANGLE_17, &extra->trackActorMove);
+ _engine->_movements->initRealValue(LBAAngles::ANGLE_0, 4000, LBAAngles::ANGLE_17, &extra->trackActorMove);
extra->angle = _engine->_movements->getAngle(extra->pos, _extraList[extraIdx].pos);
return i;
@@ -591,7 +591,7 @@ void Extra::gereExtras() {
extra->pos.x += destPos.x;
extra->pos.z += destPos.y;
- _engine->_movements->setActorAngle(LBAAngles::ANGLE_0, extra->destPos.z, LBAAngles::ANGLE_17, &extra->trackActorMove);
+ _engine->_movements->initRealValue(LBAAngles::ANGLE_0, extra->destPos.z, LBAAngles::ANGLE_17, &extra->trackActorMove);
if (actorIdxAttacked == _engine->_collision->extraCheckObjCol(extra, actorIdx)) {
if (i == _engine->_gameState->_magicBall) {
@@ -641,7 +641,7 @@ void Extra::gereExtras() {
extra->pos.x += destPos.x;
extra->pos.z += destPos.y;
- _engine->_movements->setActorAngle(LBAAngles::ANGLE_0, extra->destPos.z, LBAAngles::ANGLE_17, &extra->trackActorMove);
+ _engine->_movements->initRealValue(LBAAngles::ANGLE_0, extra->destPos.z, LBAAngles::ANGLE_17, &extra->trackActorMove);
if (extraIdx == _engine->_collision->extraCheckExtraCol(extra, _engine->_gameState->_magicBall)) {
_engine->_sound->playSample(Samples::ItemFound, 1, _engine->_scene->_sceneHero->posObj(), OWN_ACTOR_SCENE_INDEX);
diff --git a/engines/twine/scene/extra.h b/engines/twine/scene/extra.h
index 6befd01572f..71532904287 100644
--- a/engines/twine/scene/extra.h
+++ b/engines/twine/scene/extra.h
@@ -67,7 +67,7 @@ struct ExtraListStruct {
IVec3 lastPos;
IVec3 destPos;
- ActorMoveStruct trackActorMove;
+ RealValue trackActorMove;
uint16 type = 0; /**< ExtraType bitmask */
int16 angle = 0; // weight
diff --git a/engines/twine/scene/movements.cpp b/engines/twine/scene/movements.cpp
index 11ed074956c..f3826db8c70 100644
--- a/engines/twine/scene/movements.cpp
+++ b/engines/twine/scene/movements.cpp
@@ -56,7 +56,7 @@ IVec3 Movements::getShadow(const IVec3 &pos) { // GetShadow
return shadowCoord;
}
-void Movements::initRealAngle(int16 startAngle, int16 endAngle, int16 stepAngle, ActorMoveStruct *movePtr) {
+void Movements::initRealAngle(int16 startAngle, int16 endAngle, int16 stepAngle, RealValue *movePtr) {
movePtr->startValue = ClampAngle(startAngle);
movePtr->endValue = ClampAngle(endAngle);
movePtr->timeValue = ClampAngle(stepAngle);
@@ -67,7 +67,7 @@ void Movements::clearRealAngle(ActorStruct *actorPtr) {
initRealAngle(actorPtr->_beta, actorPtr->_beta, LBAAngles::ANGLE_0, &actorPtr->realAngle);
}
-void Movements::setActorAngle(int16 startAngle, int16 endAngle, int16 stepAngle, ActorMoveStruct *movePtr) {
+void Movements::initRealValue(int16 startAngle, int16 endAngle, int16 stepAngle, RealValue *movePtr) {
movePtr->startValue = startAngle;
movePtr->endValue = endAngle;
movePtr->timeValue = stepAngle;
@@ -182,7 +182,7 @@ int32 Movements::getAngle(int32 x0, int32 z0, int32 x1, int32 z1) {
#endif
}
-void Movements::initRealAngleConst(int32 start, int32 end, int32 duration, ActorMoveStruct *movePtr) const { // ManualRealAngle
+void Movements::initRealAngleConst(int32 start, int32 end, int32 duration, RealValue *movePtr) const { // ManualRealAngle
const int16 cstart = ClampAngle(start);
const int16 cend = ClampAngle(end);
diff --git a/engines/twine/scene/movements.h b/engines/twine/scene/movements.h
index 8651b7960ed..d25d20ea54e 100644
--- a/engines/twine/scene/movements.h
+++ b/engines/twine/scene/movements.h
@@ -29,7 +29,7 @@ namespace TwinE {
class TwinEEngine;
class ActorStruct;
-struct ActorMoveStruct;
+struct RealValue;
class Movements {
private:
@@ -148,7 +148,7 @@ public:
* @param stepAngle number of steps
* @param movePtr time pointer to update
*/
- void initRealAngle(int16 startAngle, int16 endAngle, int16 stepAngle, ActorMoveStruct *movePtr);
+ void initRealAngle(int16 startAngle, int16 endAngle, int16 stepAngle, RealValue *movePtr);
/**
* Clear actors safe angle
@@ -163,7 +163,7 @@ public:
* @param stepAngle number of steps
* @param movePtr time pointer to update
*/
- void setActorAngle(int16 startAngle, int16 endAngle, int16 stepAngle, ActorMoveStruct *movePtr);
+ void initRealValue(int16 startAngle, int16 endAngle, int16 stepAngle, RealValue *movePtr);
/**
* Get actor angle
@@ -185,7 +185,7 @@ public:
* @param duration Rotate speed
* @param movePtr Pointer to process movements
*/
- void initRealAngleConst(int32 start, int32 end, int32 duration, ActorMoveStruct *movePtr) const;
+ void initRealAngleConst(int32 start, int32 end, int32 duration, RealValue *movePtr) const;
void doDir(int32 actorIdx);
};
diff --git a/engines/twine/script/script_move.cpp b/engines/twine/script/script_move.cpp
index 8151cd5957c..71fc280afff 100644
--- a/engines/twine/script/script_move.cpp
+++ b/engines/twine/script/script_move.cpp
@@ -319,7 +319,7 @@ int32 ScriptMove::mSPEED(TwinEEngine *engine, MoveScriptContext &ctx) {
debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::SPEED(%i)", (int)ctx.actor->_speed);
if (ctx.actor->_staticFlags.bSprite3D) {
- engine->_movements->setActorAngle(LBAAngles::ANGLE_0, ctx.actor->_speed, LBAAngles::ANGLE_17, &ctx.actor->realAngle);
+ engine->_movements->initRealValue(LBAAngles::ANGLE_0, ctx.actor->_speed, LBAAngles::ANGLE_17, &ctx.actor->realAngle);
}
return 0;
@@ -412,7 +412,7 @@ int32 ScriptMove::mOPEN_GENERIC(TwinEEngine *engine, MoveScriptContext &ctx, int
ctx.actor->_doorWidth = doorStatus;
ctx.actor->_workFlags.bIsSpriteMoving = 1;
ctx.actor->_speed = 1000;
- engine->_movements->setActorAngle(LBAAngles::ANGLE_0, LBAAngles::ANGLE_351, LBAAngles::ANGLE_17, &ctx.actor->realAngle);
+ engine->_movements->initRealValue(LBAAngles::ANGLE_0, LBAAngles::ANGLE_351, LBAAngles::ANGLE_17, &ctx.actor->realAngle);
}
if (engine->_scene->_numCube == LBA1SceneId::Proxima_Island_Museum && ctx.actor->_actorIdx == 16) {
engine->unlockAchievement("LBA_ACH_009");
@@ -464,7 +464,7 @@ int32 ScriptMove::mCLOSE(TwinEEngine *engine, MoveScriptContext &ctx) {
ctx.actor->_doorWidth = 0;
ctx.actor->_workFlags.bIsSpriteMoving = 1;
ctx.actor->_speed = -1000;
- engine->_movements->setActorAngle(LBAAngles::ANGLE_0, -LBAAngles::ANGLE_351, LBAAngles::ANGLE_17, &ctx.actor->realAngle);
+ engine->_movements->initRealValue(LBAAngles::ANGLE_0, -LBAAngles::ANGLE_351, LBAAngles::ANGLE_17, &ctx.actor->realAngle);
}
return 0;
}
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index 0a80120b299..d4e26b1d2fa 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -1047,12 +1047,12 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
}
}
- _stepFalling = _loopMovePtr.getRealValueFromTime(timerRef);
+ _stepFalling = _realFalling.getRealValueFromTime(timerRef);
if (!_stepFalling) {
_stepFalling = 1;
}
- _movements->setActorAngle(LBAAngles::ANGLE_0, -LBAAngles::ANGLE_90, LBAAngles::ANGLE_1, &_loopMovePtr);
+ _movements->initRealValue(LBAAngles::ANGLE_0, -LBAAngles::ANGLE_90, LBAAngles::ANGLE_1, &_realFalling);
_disableScreenRecenter = false;
_scene->processEnvironmentSound();
@@ -1224,7 +1224,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
bool TwinEEngine::gameEngineLoop() {
_redraw->_firstTime = true;
_screens->_flagFade = true;
- _movements->setActorAngle(LBAAngles::ANGLE_0, -LBAAngles::ANGLE_90, LBAAngles::ANGLE_1, &_loopMovePtr);
+ _movements->initRealValue(LBAAngles::ANGLE_0, -LBAAngles::ANGLE_90, LBAAngles::ANGLE_1, &_realFalling);
while (_sceneLoopState == SceneLoopState::Continue) {
if (runGameEngine()) {
diff --git a/engines/twine/twine.h b/engines/twine/twine.h
index 0c46e51332b..75d2efacff6 100644
--- a/engines/twine/twine.h
+++ b/engines/twine/twine.h
@@ -217,7 +217,7 @@ private:
int32 _isTimeFreezed = 0;
int32 _saveFreezedTime = 0;
int32 _mouseCursorState = 0;
- ActorMoveStruct _loopMovePtr; // mainLoopVar1
+ RealValue _realFalling; // mainLoopVar1
PauseToken _pauseToken;
TwineGameType _gameType;
EngineState _state = EngineState::Menu;
Commit: ea4b8fb64fdf0de4492c0fcbeba0c1a1e7da947f
https://github.com/scummvm/scummvm/commit/ea4b8fb64fdf0de4492c0fcbeba0c1a1e7da947f
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-11T17:29:25+02:00
Commit Message:
TWINE: do the imgui debugger registration as early as possible
this allows us to use it already during the intro
Changed paths:
engines/twine/twine.cpp
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index d4e26b1d2fa..b5053588f4b 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -293,6 +293,15 @@ void TwinEEngine::popMouseCursorVisible() {
}
Common::Error TwinEEngine::run() {
+#ifdef USE_IMGUI
+ ImGuiCallbacks callbacks;
+ bool drawImGui = debugChannelSet(-1, kDebugImGui);
+ callbacks.init = TwinE::onImGuiInit;
+ callbacks.render = drawImGui ? TwinE::onImGuiRender : nullptr;
+ callbacks.cleanup = TwinE::onImGuiCleanup;
+ _system->setImGuiCallbacks(callbacks);
+#endif
+
debug("Based on TwinEngine v0.2.2");
debug("(c) 2002 The TwinEngine team.");
debug("(c) 2020-2022 The ScummVM team.");
@@ -355,15 +364,6 @@ Common::Error TwinEEngine::run() {
}
}
-#ifdef USE_IMGUI
- ImGuiCallbacks callbacks;
- bool drawImGui = debugChannelSet(-1, kDebugImGui);
- callbacks.init = TwinE::onImGuiInit;
- callbacks.render = drawImGui ? TwinE::onImGuiRender : nullptr;
- callbacks.cleanup = TwinE::onImGuiCleanup;
- _system->setImGuiCallbacks(callbacks);
-#endif
-
bool quitGame = false;
while (!quitGame && !shouldQuit()) {
readKeys();
Commit: 8d972b2535d20e29a019aab4640acdd27a724e5f
https://github.com/scummvm/scummvm/commit/8d972b2535d20e29a019aab4640acdd27a724e5f
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-11T17:29:25+02:00
Commit Message:
TWINE: header inclusion cleanup
Changed paths:
engines/twine/audio/music.cpp
engines/twine/audio/sound.cpp
engines/twine/detection.cpp
engines/twine/holomap.h
engines/twine/holomap_v1.h
engines/twine/input.cpp
engines/twine/metaengine.cpp
engines/twine/movies.cpp
engines/twine/scene/actor.cpp
engines/twine/scene/animations.cpp
engines/twine/scene/extra.cpp
engines/twine/scene/gamestate.cpp
engines/twine/scene/gamestate.h
engines/twine/scene/scene.cpp
engines/twine/scene/scene.h
engines/twine/script/script_life.cpp
engines/twine/slideshow.cpp
engines/twine/text.cpp
engines/twine/twine.h
diff --git a/engines/twine/audio/music.cpp b/engines/twine/audio/music.cpp
index f68a2ac0828..ac952a40ad4 100644
--- a/engines/twine/audio/music.cpp
+++ b/engines/twine/audio/music.cpp
@@ -27,7 +27,6 @@
#include "common/debug.h"
#include "common/system.h"
#include "common/textconsole.h"
-#include "twine/detection.h"
#include "twine/resources/hqr.h"
#include "twine/resources/resources.h"
#include "twine/twine.h"
diff --git a/engines/twine/audio/sound.cpp b/engines/twine/audio/sound.cpp
index 6c3445194bf..a8c5bcdf566 100644
--- a/engines/twine/audio/sound.cpp
+++ b/engines/twine/audio/sound.cpp
@@ -22,6 +22,7 @@
#include "twine/audio/sound.h"
#include "audio/audiostream.h"
#include "audio/decoders/voc.h"
+#include "common/config-manager.h"
#include "common/memstream.h"
#include "common/system.h"
#include "common/text-to-speech.h"
diff --git a/engines/twine/detection.cpp b/engines/twine/detection.cpp
index 6f3bde84bde..c73da32d881 100644
--- a/engines/twine/detection.cpp
+++ b/engines/twine/detection.cpp
@@ -19,7 +19,6 @@
*
*/
-#include "common/config-manager.h"
#include "common/language.h"
#include "common/translation.h"
#include "engines/advancedDetector.h"
diff --git a/engines/twine/holomap.h b/engines/twine/holomap.h
index f070c8932ad..ba82f579475 100644
--- a/engines/twine/holomap.h
+++ b/engines/twine/holomap.h
@@ -22,7 +22,6 @@
#ifndef TWINE_HOLOMAP_H
#define TWINE_HOLOMAP_H
-#include "twine/shared.h"
#include "common/scummsys.h"
namespace Common {
diff --git a/engines/twine/holomap_v1.h b/engines/twine/holomap_v1.h
index 2cbb96aa972..eef8097cbe5 100644
--- a/engines/twine/holomap_v1.h
+++ b/engines/twine/holomap_v1.h
@@ -23,6 +23,7 @@
#define TWINE_HOLOMAPV1_H
#include "twine/holomap.h"
+#include "twine/shared.h"
#define NUM_HOLOMAPCOLORS 32
#define HOLOMAP_PALETTE_INDEX (12*16)
diff --git a/engines/twine/input.cpp b/engines/twine/input.cpp
index d8f99926032..89e6a89157d 100644
--- a/engines/twine/input.cpp
+++ b/engines/twine/input.cpp
@@ -22,7 +22,6 @@
#include "twine/input.h"
#include "backends/keymapper/keymapper.h"
#include "common/events.h"
-#include "common/keyboard.h"
#include "common/system.h"
#include "twine/scene/actor.h"
#include "twine/twine.h"
diff --git a/engines/twine/metaengine.cpp b/engines/twine/metaengine.cpp
index 75ef796647e..4a69f8510e6 100644
--- a/engines/twine/metaengine.cpp
+++ b/engines/twine/metaengine.cpp
@@ -20,10 +20,8 @@
*/
#include "backends/keymapper/action.h"
-#include "backends/keymapper/standard-actions.h"
+#include "backends/keymapper/keymap.h"
#include "base/plugins.h"
-#include "common/fs.h"
-#include "common/savefile.h"
#include "common/system.h"
#include "common/translation.h"
#include "engines/advancedDetector.h"
diff --git a/engines/twine/movies.cpp b/engines/twine/movies.cpp
index c8f4975f9cb..7e703b4c365 100644
--- a/engines/twine/movies.cpp
+++ b/engines/twine/movies.cpp
@@ -20,6 +20,7 @@
*/
#include "twine/movies.h"
+#include "common/config-manager.h"
#include "common/debug.h"
#include "common/endian.h"
#include "common/file.h"
diff --git a/engines/twine/scene/actor.cpp b/engines/twine/scene/actor.cpp
index 8ff7f511eea..ff9394cbed4 100644
--- a/engines/twine/scene/actor.cpp
+++ b/engines/twine/scene/actor.cpp
@@ -20,8 +20,6 @@
*/
#include "twine/scene/actor.h"
-#include "common/memstream.h"
-#include "common/system.h"
#include "common/textconsole.h"
#include "twine/audio/sound.h"
#include "twine/debugger/debug_state.h"
diff --git a/engines/twine/scene/animations.cpp b/engines/twine/scene/animations.cpp
index bb5451b5676..6d8364adc6d 100644
--- a/engines/twine/scene/animations.cpp
+++ b/engines/twine/scene/animations.cpp
@@ -20,9 +20,6 @@
*/
#include "twine/scene/animations.h"
-#include "common/endian.h"
-#include "common/memstream.h"
-#include "common/stream.h"
#include "common/util.h"
#include "twine/audio/sound.h"
#include "twine/debugger/debug_state.h"
diff --git a/engines/twine/scene/extra.cpp b/engines/twine/scene/extra.cpp
index 33c55efb5b6..258a9365fb7 100644
--- a/engines/twine/scene/extra.cpp
+++ b/engines/twine/scene/extra.cpp
@@ -20,7 +20,6 @@
*/
#include "twine/scene/extra.h"
-#include "common/memstream.h"
#include "common/util.h"
#include "twine/audio/sound.h"
#include "twine/input.h"
diff --git a/engines/twine/scene/gamestate.cpp b/engines/twine/scene/gamestate.cpp
index 86e3ebcaee8..e1ef8d0ecd8 100644
--- a/engines/twine/scene/gamestate.cpp
+++ b/engines/twine/scene/gamestate.cpp
@@ -20,7 +20,6 @@
*/
#include "twine/scene/gamestate.h"
-#include "common/file.h"
#include "common/rect.h"
#include "common/str.h"
#include "common/system.h"
diff --git a/engines/twine/scene/gamestate.h b/engines/twine/scene/gamestate.h
index d77b8eaafd6..872c07d0546 100644
--- a/engines/twine/scene/gamestate.h
+++ b/engines/twine/scene/gamestate.h
@@ -22,7 +22,6 @@
#ifndef TWINE_SCENE_GAMESTATE_H
#define TWINE_SCENE_GAMESTATE_H
-#include "common/savefile.h"
#include "common/scummsys.h"
#include "twine/menu/menu.h"
#include "twine/shared.h"
diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index 421afcbcb79..809553ee973 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -20,9 +20,9 @@
*/
#include "twine/scene/scene.h"
+#include "common/config-manager.h"
#include "common/file.h"
#include "common/memstream.h"
-#include "common/stream.h"
#include "common/util.h"
#include "twine/audio/music.h"
#include "twine/audio/sound.h"
diff --git a/engines/twine/scene/scene.h b/engines/twine/scene/scene.h
index 465a5252f9e..8288b1fe2b6 100644
--- a/engines/twine/scene/scene.h
+++ b/engines/twine/scene/scene.h
@@ -23,7 +23,6 @@
#define TWINE_SCENE_SCENE_H
#include "common/scummsys.h"
-#include "common/util.h"
#include "twine/scene/actor.h"
#include "twine/shared.h"
diff --git a/engines/twine/script/script_life.cpp b/engines/twine/script/script_life.cpp
index 792eca40868..4023daa365f 100644
--- a/engines/twine/script/script_life.cpp
+++ b/engines/twine/script/script_life.cpp
@@ -21,7 +21,6 @@
#include "twine/script/script_life.h"
#include "common/memstream.h"
-#include "common/stream.h"
#include "twine/debugger/debug_state.h"
#include "twine/scene/actor.h"
#include "twine/scene/animations.h"
@@ -34,7 +33,6 @@
#include "twine/holomap.h"
#include "twine/input.h"
#include "twine/menu/interface.h"
-#include "twine/menu/menu.h"
#include "twine/scene/movements.h"
#include "twine/renderer/redraw.h"
#include "twine/renderer/renderer.h"
diff --git a/engines/twine/slideshow.cpp b/engines/twine/slideshow.cpp
index 2d7f6db16a7..59b8751ced0 100644
--- a/engines/twine/slideshow.cpp
+++ b/engines/twine/slideshow.cpp
@@ -21,7 +21,6 @@
#include "twine/slideshow.h"
#include "common/file.h"
-#include "common/tokenizer.h"
#include "graphics/palette.h"
#include "image/pcx.h"
#include "twine/movies.h"
diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp
index 9c0f6264774..7ae5c8c2408 100644
--- a/engines/twine/text.cpp
+++ b/engines/twine/text.cpp
@@ -21,7 +21,7 @@
#include "twine/text.h"
#include "common/algorithm.h"
-#include "common/endian.h"
+#include "common/config-manager.h"
#include "common/memstream.h"
#include "common/scummsys.h"
#include "common/str.h"
diff --git a/engines/twine/twine.h b/engines/twine/twine.h
index 75d2efacff6..491cbac634e 100644
--- a/engines/twine/twine.h
+++ b/engines/twine/twine.h
@@ -22,7 +22,6 @@
#ifndef TWINE_TWINE_H
#define TWINE_TWINE_H
-#include "backends/keymapper/keymap.h"
#include "common/platform.h"
#include "common/random.h"
#include "common/rect.h"
@@ -32,7 +31,6 @@
#include "engines/metaengine.h"
#include "graphics/managed_surface.h"
#include "graphics/screen.h"
-#include "graphics/pixelformat.h"
#include "graphics/surface.h"
#include "twine/detection.h"
#include "twine/input.h"
Commit: 4f49b2c8127444e6d50885cc672fb29311bd03c0
https://github.com/scummvm/scummvm/commit/4f49b2c8127444e6d50885cc672fb29311bd03c0
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-11T17:29:25+02:00
Commit Message:
TWINE: renamed variables to match the original sources
Changed paths:
engines/twine/text.cpp
engines/twine/twine.cpp
engines/twine/twine.h
diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp
index 7ae5c8c2408..2f160e0534a 100644
--- a/engines/twine/text.cpp
+++ b/engines/twine/text.cpp
@@ -61,7 +61,7 @@ Text::~Text() {
}
void Text::initVoxBank(TextBankId bankIdx) {
- static const char *LanguageSuffixTypes[] = {
+ static const char *ListFileText[] = {
"sys",
"cre",
"gam", // global game voices (e.g. inventory descriptions)
@@ -78,19 +78,19 @@ void Text::initVoxBank(TextBankId bankIdx) {
"010", // Polar Island voices
"011" //
};
- if ((int)bankIdx < 0 || (int)bankIdx >= ARRAYSIZE(LanguageSuffixTypes)) {
+ if ((int)bankIdx < 0 || (int)bankIdx >= ARRAYSIZE(ListFileText)) {
error("bankIdx is out of bounds: %i", (int)bankIdx);
}
// get the correct vox hqr file - english is the default
- _currentVoxBankFile = Common::String::format("%s%s" VOX_EXT, LanguageTypes[0].id, LanguageSuffixTypes[(int)bankIdx]);
- _currentOggBaseFile = Common::String::format("%s%s_", LanguageTypes[0].id, LanguageSuffixTypes[(int)bankIdx]);
+ _currentVoxBankFile = Common::String::format("%s%s" VOX_EXT, ListLanguage[0].id, ListFileText[(int)bankIdx]);
+ _currentOggBaseFile = Common::String::format("%s%s_", ListLanguage[0].id, ListFileText[(int)bankIdx]);
const int voice = ConfMan.getInt("audio_language");
- const int32 length = ARRAYSIZE(LanguageTypes);
+ const int32 length = ARRAYSIZE(ListLanguage);
for (int32 i = 0; i < length; i++) {
- if (LanguageTypes[i].voice == voice) {
- _currentVoxBankFile = Common::String::format("%s%s" VOX_EXT, LanguageTypes[i].id, LanguageSuffixTypes[(int)bankIdx]);
- _currentOggBaseFile = Common::String::format("%s%s_", LanguageTypes[i].id, LanguageSuffixTypes[(int)bankIdx]);
+ if (ListLanguage[i].voice == voice) {
+ _currentVoxBankFile = Common::String::format("%s%s" VOX_EXT, ListLanguage[i].id, ListFileText[(int)bankIdx]);
+ _currentOggBaseFile = Common::String::format("%s%s_", ListLanguage[i].id, ListFileText[(int)bankIdx]);
return;
}
}
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index b5053588f4b..3d83eb8ebbd 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -490,9 +490,9 @@ static int getLanguageTypeIndex(const char *languageName) {
*ptr = '\0';
}
- const int32 length = ARRAYSIZE(LanguageTypes);
+ const int32 length = ARRAYSIZE(ListLanguage);
for (int32 i = 0; i < length; i++) {
- if (!strcmp(LanguageTypes[i].name, buffer)) {
+ if (!strcmp(ListLanguage[i].name, buffer)) {
return i;
}
}
@@ -512,7 +512,7 @@ void TwinEEngine::initConfigurations() {
const char *lng = Common::getLanguageDescription(_gameLang);
_cfgfile._languageId = getLanguageTypeIndex(lng);
- ConfMan.registerDefault("audio_language", LanguageTypes[_cfgfile._languageId].voice);
+ ConfMan.registerDefault("audio_language", ListLanguage[_cfgfile._languageId].voice);
_cfgfile.FlagDisplayText = ConfGetBoolOrDefault("displaytext", true); // TODO: use subtitles
const Common::String midiType = ConfGetOrDefault("miditype", "auto");
diff --git a/engines/twine/twine.h b/engines/twine/twine.h
index 491cbac634e..073b28267e7 100644
--- a/engines/twine/twine.h
+++ b/engines/twine/twine.h
@@ -59,7 +59,7 @@ static const struct TwinELanguage {
const char *name;
const char *id;
const int voice;
-} LanguageTypes[] = {
+} ListLanguage[] = { // TabLanguage
{"English", "EN_", 1},
{"French", "FR_", 2},
{"German", "DE_", 3},
More information about the Scummvm-git-logs
mailing list