From 145d5fd7359d0b146d4fecefa5592ef346e73e77 Mon Sep 17 00:00:00 2001 From: fracturehill Date: Tue, 2 Mar 2021 01:48:02 +0200 Subject: [PATCH] NANCY: Add ActionRecord and Scene debug channels Added debug channels for action records and scenes, and added proper output to their respective loading functions. --- engines/nancy/action/actionmanager.cpp | 74 +++++++++++++++ engines/nancy/action/actionrecord.h | 3 + engines/nancy/action/arfactory_v1.cpp | 4 +- engines/nancy/action/leverpuzzle.h | 2 + engines/nancy/action/orderingpuzzle.h | 2 + engines/nancy/action/passwordpuzzle.h | 2 + engines/nancy/action/primaryvideo.h | 2 + engines/nancy/action/recordtypes.h | 107 ++++++++++++++++++++++ engines/nancy/action/rotatinglockpuzzle.h | 2 + engines/nancy/action/secondaryvideo.h | 8 +- engines/nancy/action/sliderpuzzle.h | 2 + engines/nancy/action/staticbitmapanim.h | 2 + engines/nancy/action/telephone.h | 2 + engines/nancy/nancy.cpp | 11 +-- engines/nancy/nancy.h | 13 +-- engines/nancy/state/scene.cpp | 7 ++ engines/nancy/state/scene.h | 2 +- 17 files changed, 222 insertions(+), 23 deletions(-) diff --git a/engines/nancy/action/actionmanager.cpp b/engines/nancy/action/actionmanager.cpp index 86399ac7882..c2cf0f939fc 100644 --- a/engines/nancy/action/actionmanager.cpp +++ b/engines/nancy/action/actionmanager.cpp @@ -147,6 +147,80 @@ bool ActionManager::addNewActionRecord(Common::SeekableReadStream &inputData) { } _records.push_back(newRecord); + + debugC(1, kDebugActionRecord, "Loaded action record %i, type %s, typeID %i, description \"%s\", execType == %s", + _records.size() - 1, + newRecord->getRecordTypeName().c_str(), + newRecord->type, + newRecord->description.c_str(), + newRecord->execType == ActionRecord::kRepeating ? "kRepeating" : "kOneShot"); + for (uint i = 0; i < newRecord->dependencies.size(); ++i) { + debugCN(1, kDebugActionRecord, "\tDependency %i: type ", i); + switch (newRecord->dependencies[i].type) { + case kNone :debugCN(1, kDebugActionRecord, "kNone"); break; + case kInventory : + debugCN(1, kDebugActionRecord, "kInventory, item ID %i %s", + newRecord->dependencies[i].label, + newRecord->dependencies[i].condition == kTrue ? "is in possession" : "is not in possession"); + break; + case kEventFlag : + debugCN(1, kDebugActionRecord, "kEventFlag, flag ID %i == %s", + newRecord->dependencies[i].label, + newRecord->dependencies[i].condition == kTrue ? "true" : "false"); + break; + case kLogicCondition : + debugCN(1, kDebugActionRecord, "kLogicCondition, logic condition ID %i == %s", + newRecord->dependencies[i].label, + newRecord->dependencies[i].condition == kTrue ? "true" : "false"); + break; + case kTotalTime : + debugCN(1, kDebugActionRecord, "kTotalTime, %i hours, %i minutes, %i seconds, %i milliseconds", + newRecord->dependencies[i].hours, + newRecord->dependencies[i].minutes, + newRecord->dependencies[i].seconds, + newRecord->dependencies[i].milliseconds); + break; + case kSceneTime : + debugCN(1, kDebugActionRecord, "kSceneTime, %i hours, %i minutes, %i seconds, %i milliseconds", + newRecord->dependencies[i].hours, + newRecord->dependencies[i].minutes, + newRecord->dependencies[i].seconds, + newRecord->dependencies[i].milliseconds); + break; + case kPlayerTime : + debugCN(1, kDebugActionRecord, "kPlayerTime, %i days, %i hours, %i minutes, %i seconds", + newRecord->dependencies[i].hours, + newRecord->dependencies[i].minutes, + newRecord->dependencies[i].seconds, + newRecord->dependencies[i].milliseconds); + break; + case kSceneCount : + debugCN(1, kDebugActionRecord, "kSceneCount, scene ID %i, hit count %s %i", + newRecord->dependencies[i].hours, + newRecord->dependencies[i].milliseconds == 1 ? ">" : newRecord->dependencies[i].milliseconds == 2 ? "<" : "==", + newRecord->dependencies[i].seconds); + break; + case kResetOnNewDay : debugCN(1, kDebugActionRecord, "kResetOnNewDay"); break; + case kUseItem : + debugCN(1, kDebugActionRecord, "kUseItem, item ID %i %s", + newRecord->dependencies[i].label, + newRecord->dependencies[i].condition == kTrue ? "is held" : "is not held"); + break; + case kTimeOfDay : + debugCN(1, kDebugActionRecord, "kTimeOfDay, %s", + newRecord->dependencies[i].label == 0 ? "day" : newRecord->dependencies[i].label == 1 ? "night" : "dusk/dawn"); + break; + case kTimerNotDone : debugCN(1, kDebugActionRecord, "kTimerNotDone"); break; + case kTimerDone : debugCN(1, kDebugActionRecord, "kTimerDone"); break; + case kDifficultyLevel : + debugCN(1, kDebugActionRecord, "kDifficultyLevel, level %i", newRecord->dependencies[i].condition); + break; + default: debugCN(1, kDebugActionRecord, "unknown"); break; + } + debugC(1, kDebugActionRecord, ", orFlag == %s", newRecord->dependencies[i].orFlag == true ? "true" : "false"); + } + + return true; } diff --git a/engines/nancy/action/actionrecord.h b/engines/nancy/action/actionrecord.h index 868d1492447..cd57af9ea8e 100644 --- a/engines/nancy/action/actionrecord.h +++ b/engines/nancy/action/actionrecord.h @@ -128,6 +128,9 @@ protected: } } + // Used for debugging + virtual Common::String getRecordTypeName() const =0; + public: Common::String description; // 0x00 byte type; // 0x30 diff --git a/engines/nancy/action/arfactory_v1.cpp b/engines/nancy/action/arfactory_v1.cpp index 32b594bc911..711f6fd0892 100644 --- a/engines/nancy/action/arfactory_v1.cpp +++ b/engines/nancy/action/arfactory_v1.cpp @@ -63,9 +63,9 @@ ActionRecord *ActionManager::createActionRecord(uint16 type) { case 0x28: return new PlayPrimaryVideoChan0(_engine->scene->getViewport()); case 0x29: - return new PlaySecondaryVideo(_engine->scene->getViewport()); + return new PlaySecondaryVideo('0', _engine->scene->getViewport()); case 0x2A: - return new PlaySecondaryVideo(_engine->scene->getViewport()); + return new PlaySecondaryVideo('1', _engine->scene->getViewport()); case 0x2B: return new PlaySecondaryMovie(_engine->scene->getViewport()); case 0x2C: diff --git a/engines/nancy/action/leverpuzzle.h b/engines/nancy/action/leverpuzzle.h index d1f44f8b30f..ca6798dcd19 100644 --- a/engines/nancy/action/leverpuzzle.h +++ b/engines/nancy/action/leverpuzzle.h @@ -69,6 +69,8 @@ public: SolveState solveState = kNotSolved; protected: + virtual Common::String getRecordTypeName() const override { return "LeverPuzzle"; } + virtual uint16 getZOrder() const override { return 7; } virtual BlitType getBlitType() const override { return kTrans; } virtual bool isViewportRelative() const override { return true; } diff --git a/engines/nancy/action/orderingpuzzle.h b/engines/nancy/action/orderingpuzzle.h index f78adca3663..4c819632a81 100644 --- a/engines/nancy/action/orderingpuzzle.h +++ b/engines/nancy/action/orderingpuzzle.h @@ -70,6 +70,8 @@ public: Time solveSoundPlayTime; protected: + virtual Common::String getRecordTypeName() const override { return "OrderingPuzzle"; } + virtual uint16 getZOrder() const override { return 7; } virtual BlitType getBlitType() const override { return kTrans; } virtual bool isViewportRelative() const override { return true; } diff --git a/engines/nancy/action/passwordpuzzle.h b/engines/nancy/action/passwordpuzzle.h index 4f516b2cfb5..4901e58a44c 100644 --- a/engines/nancy/action/passwordpuzzle.h +++ b/engines/nancy/action/passwordpuzzle.h @@ -76,6 +76,8 @@ public: SolveState solveState; protected: + virtual Common::String getRecordTypeName() const override { return "PasswordPuzzle"; } + virtual uint16 getZOrder() const override { return 7; } virtual BlitType getBlitType() const override { return kTrans; } virtual bool isViewportRelative() const override { return true; } diff --git a/engines/nancy/action/primaryvideo.h b/engines/nancy/action/primaryvideo.h index 2d57bab72d8..aa75611ab33 100644 --- a/engines/nancy/action/primaryvideo.h +++ b/engines/nancy/action/primaryvideo.h @@ -114,6 +114,8 @@ public: static PlayPrimaryVideoChan0 *activePrimaryVideo; protected: + virtual Common::String getRecordTypeName() const override { return "PlayPrimaryVideoChan0"; } + virtual uint16 getZOrder() const override { return 8; } virtual BlitType getBlitType() const override { return kNoTrans; } virtual bool isViewportRelative() const override { return true; } diff --git a/engines/nancy/action/recordtypes.h b/engines/nancy/action/recordtypes.h index eb2621de62a..fbb38119f85 100644 --- a/engines/nancy/action/recordtypes.h +++ b/engines/nancy/action/recordtypes.h @@ -45,6 +45,9 @@ public: virtual void execute(Nancy::NancyEngine *engine) override; SceneChangeDescription sceneChange; + +protected: + virtual Common::String getRecordTypeName() const override { return "SceneChange"; } }; class HotMultiframeSceneChange : public SceneChange { @@ -53,6 +56,9 @@ public: virtual void execute(Nancy::NancyEngine *engine) override; Common::Array hotspots; + +protected: + virtual Common::String getRecordTypeName() const override { return "HotMultiframeSceneChange"; } }; class Hot1FrSceneChange : public SceneChange { @@ -61,20 +67,32 @@ public: virtual void execute(Nancy::NancyEngine *engine) override; HotspotDescription hotspotDesc; + +protected: + virtual Common::String getRecordTypeName() const override { return "Hot1FrSceneChange"; } }; class Hot1FrExitSceneChange : public Hot1FrSceneChange { virtual CursorManager::CursorType getHoverCursor() const override { return CursorManager::kExitArrow; } + +protected: + virtual Common::String getRecordTypeName() const override { return "Hot1FrExitSceneChange"; } }; class HotMultiframeMultisceneChange : public ActionRecord { public: virtual uint16 readData(Common::SeekableReadStream &stream) override; + +protected: + virtual Common::String getRecordTypeName() const override { return "HotMultiframeMultisceneChange"; } }; class StartFrameNextScene : public ActionRecord { public: virtual uint16 readData(Common::SeekableReadStream &stream) override; + +protected: + virtual Common::String getRecordTypeName() const override { return "StartFrameNextScene"; } }; class StartStopPlayerScrolling : public ActionRecord { @@ -83,6 +101,9 @@ public: // TODO add a Start and Stop subclass byte type = 0; + +protected: + virtual Common::String getRecordTypeName() const override { return "StartStopPlayerScrolling"; } }; class MapCall : public ActionRecord { @@ -91,6 +112,9 @@ public: virtual void execute(Nancy::NancyEngine *engine) override; virtual CursorManager::CursorType getHoverCursor() const override { return CursorManager::kExitArrow; } + +protected: + virtual Common::String getRecordTypeName() const override { return "MapCall"; } }; class MapCallHot1Fr : public MapCall { @@ -99,6 +123,9 @@ public: virtual void execute(Nancy::NancyEngine *engine) override; HotspotDescription hotspotDesc; + +protected: + virtual Common::String getRecordTypeName() const override { return "MapCallHot1Fr"; } }; class MapCallHotMultiframe : public MapCall { @@ -107,21 +134,33 @@ public: virtual void execute(Nancy::NancyEngine *engine) override; Common::Array hotspots; + +protected: + virtual Common::String getRecordTypeName() const override { return "MapCallHotMultiframe"; } }; class MapLocationAccess : public ActionRecord { public: virtual uint16 readData(Common::SeekableReadStream &stream) override; + +protected: + virtual Common::String getRecordTypeName() const override { return "MapLocationAccess"; } }; class MapSound : public ActionRecord { public: virtual uint16 readData(Common::SeekableReadStream &stream) override; + +protected: + virtual Common::String getRecordTypeName() const override { return "MapSound"; } }; class MapAviOverride : public ActionRecord { public: virtual uint16 readData(Common::SeekableReadStream &stream) override; + +protected: + virtual Common::String getRecordTypeName() const override { return "MapAviOverride"; } }; class MapAviOverrideOff : public ActionRecord { @@ -129,11 +168,17 @@ public: virtual uint16 readData(Common::SeekableReadStream &stream) override; byte overrideOffData = 0; + +protected: + virtual Common::String getRecordTypeName() const override { return "MapAviOverrideOff"; } }; class TextBoxWrite : public ActionRecord { public: virtual uint16 readData(Common::SeekableReadStream &stream) override; + +protected: + virtual Common::String getRecordTypeName() const override { return "TextBoxWrite"; } }; class TextBoxClear : public ActionRecord { @@ -141,11 +186,17 @@ public: virtual uint16 readData(Common::SeekableReadStream &stream) override; byte clearData = 0; + +protected: + virtual Common::String getRecordTypeName() const override { return "TextBoxClear"; } }; class BumpPlayerClock : public ActionRecord { public: virtual uint16 readData(Common::SeekableReadStream &stream) override; + +protected: + virtual Common::String getRecordTypeName() const override { return "BumpPlayerClock"; } }; class SaveContinueGame : public ActionRecord { @@ -153,6 +204,9 @@ public: virtual uint16 readData(Common::SeekableReadStream &stream) override; byte saveContinueData = 0; + +protected: + virtual Common::String getRecordTypeName() const override { return "SaveContinueGame"; } }; class TurnOffMainRendering : public ActionRecord { @@ -160,6 +214,9 @@ public: virtual uint16 readData(Common::SeekableReadStream &stream) override; byte turnOffData = 0; + +protected: + virtual Common::String getRecordTypeName() const override { return "TurnOffMainRendering"; } }; class TurnOnMainRendering : public ActionRecord { @@ -167,18 +224,27 @@ public: virtual uint16 readData(Common::SeekableReadStream &stream) override; byte turnOnData = 0; + +protected: + virtual Common::String getRecordTypeName() const override { return "TurnOnMainRendering"; } }; class ResetAndStartTimer : public ActionRecord { public: virtual uint16 readData(Common::SeekableReadStream &stream) override; virtual void execute(Nancy::NancyEngine *engine) override; + +protected: + virtual Common::String getRecordTypeName() const override { return "ResetAndStartTimer"; } }; class StopTimer : public ActionRecord { public: virtual uint16 readData(Common::SeekableReadStream &stream) override; virtual void execute(Nancy::NancyEngine *engine) override; + +protected: + virtual Common::String getRecordTypeName() const override { return "StopTimer"; } }; class EventFlags : public ActionRecord { @@ -187,6 +253,9 @@ public: virtual void execute(Nancy::NancyEngine *engine) override; MultiEventFlagDescription flags; + +protected: + virtual Common::String getRecordTypeName() const override { return "EventFlags"; } }; class EventFlagsMultiHS : public EventFlags { @@ -195,6 +264,9 @@ public: virtual void execute(Nancy::NancyEngine *engine) override; Common::Array hotspots; + +protected: + virtual Common::String getRecordTypeName() const override { return "EventFlagsMultiHS"; } }; class LoseGame : public ActionRecord { @@ -202,6 +274,9 @@ public: virtual uint16 readData(Common::SeekableReadStream &stream) override; byte loseData = 0; + +protected: + virtual Common::String getRecordTypeName() const override { return "LoseGame"; } }; class PushScene : public ActionRecord { @@ -209,6 +284,9 @@ public: virtual uint16 readData(Common::SeekableReadStream &stream) override; byte pushData = 0; + +protected: + virtual Common::String getRecordTypeName() const override { return "PushScene"; } }; class PopScene : public ActionRecord { @@ -216,6 +294,9 @@ public: virtual uint16 readData(Common::SeekableReadStream &stream) override; byte popData = 0; + +protected: + virtual Common::String getRecordTypeName() const override { return "PopScene"; } }; class WinGame : public ActionRecord { @@ -223,16 +304,25 @@ public: virtual uint16 readData(Common::SeekableReadStream &stream) override; byte winData = 0; + +protected: + virtual Common::String getRecordTypeName() const override { return "WinGame"; } }; class AddInventoryNoHS : public ActionRecord { public: virtual uint16 readData(Common::SeekableReadStream &stream) override; + +protected: + virtual Common::String getRecordTypeName() const override { return "AddInventoryNoHS"; } }; class RemoveInventoryNoHS : public ActionRecord { public: virtual uint16 readData(Common::SeekableReadStream &stream) override; + +protected: + virtual Common::String getRecordTypeName() const override { return "RemoveInventoryNoHS"; } }; class DifficultyLevel : public ActionRecord { @@ -242,6 +332,9 @@ public: uint16 difficulty = 0; EventFlagDescription flag; + +protected: + virtual Common::String getRecordTypeName() const override { return "DifficultyLevel"; } }; class ShowInventoryItem : public ActionRecord, public RenderObject { @@ -262,6 +355,8 @@ public: Graphics::ManagedSurface _fullSurface; protected: + virtual Common::String getRecordTypeName() const override { return "ShowInventoryItem"; } + virtual uint16 getZOrder() const override { return 9; } virtual BlitType getBlitType() const override { return kNoTrans; } virtual bool isViewportRelative() const override { return true; } @@ -276,11 +371,17 @@ public: SoundDescription sound; SceneChangeDescription sceneChange; EventFlagDescription flagOnTrigger; + +protected: + virtual Common::String getRecordTypeName() const override { return "PlayDigiSoundAndDie"; } }; class PlaySoundPanFrameAnchorAndDie : public ActionRecord { public: virtual uint16 readData(Common::SeekableReadStream &stream) override; + +protected: + virtual Common::String getRecordTypeName() const override { return "PlaySoundPanFrameAnchorAndDie"; } }; class PlaySoundMultiHS : public ActionRecord { @@ -292,6 +393,9 @@ public: SceneChangeDescription sceneChange; // 0x22 EventFlagDescription flag; // 0x2A Common::Array hotspots; // 0x31 + +protected: + virtual Common::String getRecordTypeName() const override { return "PlaySoundMultiHS"; } }; class HintSystem : public ActionRecord { @@ -309,6 +413,9 @@ public: void selectHint(Nancy::NancyEngine *engine); void getHint(uint hint, uint difficulty); + +protected: + virtual Common::String getRecordTypeName() const override { return "HintSystem"; } }; } // End of namespace Action diff --git a/engines/nancy/action/rotatinglockpuzzle.h b/engines/nancy/action/rotatinglockpuzzle.h index 352ed0a1f71..4ca0ec5bbb8 100644 --- a/engines/nancy/action/rotatinglockpuzzle.h +++ b/engines/nancy/action/rotatinglockpuzzle.h @@ -71,6 +71,8 @@ public: protected: + virtual Common::String getRecordTypeName() const override { return "RotatingLockPuzzle"; } + virtual uint16 getZOrder() const override { return 7; } virtual BlitType getBlitType() const override { return kTrans; } virtual bool isViewportRelative() const override { return true; } diff --git a/engines/nancy/action/secondaryvideo.h b/engines/nancy/action/secondaryvideo.h index 903879ba8fe..b8c2f070ace 100644 --- a/engines/nancy/action/secondaryvideo.h +++ b/engines/nancy/action/secondaryvideo.h @@ -50,7 +50,7 @@ class PlaySecondaryVideo : public ActionRecord, public RenderObject { public: enum HoverState { kNoHover, kHover, kEndHover }; - PlaySecondaryVideo(RenderObject &redrawFrom) : RenderObject(redrawFrom) {} + PlaySecondaryVideo(char chan, RenderObject &redrawFrom) : RenderObject(redrawFrom), channel(chan) {} virtual ~PlaySecondaryVideo() { _decoder.close(); } virtual void init() override; @@ -74,6 +74,8 @@ public: Common::Array videoDescs; // 0x35 protected: + virtual Common::String getRecordTypeName() const override { return Common::String("PlaySecondaryVideoChan" + channel); } + virtual uint16 getZOrder() const override { return 8; } virtual BlitType getBlitType() const override { return kTrans; } virtual bool isViewportRelative() const override { return true; } @@ -83,6 +85,8 @@ protected: int _currentViewportFrame = -1; bool _isPlaying = false; bool _isHovered = false; + + char channel; }; class PlaySecondaryMovie : public ActionRecord, public RenderObject { @@ -113,6 +117,8 @@ public: Common::Array videoDescs; // 0xD4 protected: + virtual Common::String getRecordTypeName() const override { return "PlaySecondaryMovie"; } + virtual uint16 getZOrder() const override { return 8; } virtual BlitType getBlitType() const override { return kNoTrans; } virtual bool isViewportRelative() const override { return true; } diff --git a/engines/nancy/action/sliderpuzzle.h b/engines/nancy/action/sliderpuzzle.h index 2ee2fe5c222..f7144a6a0ca 100644 --- a/engines/nancy/action/sliderpuzzle.h +++ b/engines/nancy/action/sliderpuzzle.h @@ -70,6 +70,8 @@ public: static bool playerHasTriedPuzzle; protected: + virtual Common::String getRecordTypeName() const override { return "SliderPuzzle"; } + virtual uint16 getZOrder() const override { return 7; } virtual BlitType getBlitType() const override { return kTrans; } virtual bool isViewportRelative() const override { return true; } diff --git a/engines/nancy/action/staticbitmapanim.h b/engines/nancy/action/staticbitmapanim.h index 32389ab3eec..ee8e60557e2 100644 --- a/engines/nancy/action/staticbitmapanim.h +++ b/engines/nancy/action/staticbitmapanim.h @@ -77,6 +77,8 @@ public: bool isInterruptible; protected: + virtual Common::String getRecordTypeName() const override { return isInterruptible ? "PlayIntStaticBitmapAnimation" : "PlayStaticBitmapAnimation"; } + virtual uint16 getZOrder() const override { return zOrder; } virtual BlitType getBlitType() const override { return isTransparent == kTrue ? kTrans : kNoTrans; } virtual bool isViewportRelative() const override { return true; } diff --git a/engines/nancy/action/telephone.h b/engines/nancy/action/telephone.h index c05aca63483..b8265e2c3ed 100644 --- a/engines/nancy/action/telephone.h +++ b/engines/nancy/action/telephone.h @@ -88,6 +88,8 @@ public: uint selected; protected: + virtual Common::String getRecordTypeName() const override { return "Telephone"; } + virtual uint16 getZOrder() const override { return 7; } virtual BlitType getBlitType() const override { return kTrans; } virtual bool isViewportRelative() const override { return true; } diff --git a/engines/nancy/nancy.cpp b/engines/nancy/nancy.cpp index cefce166f2a..a7abe09dfae 100644 --- a/engines/nancy/nancy.cpp +++ b/engines/nancy/nancy.cpp @@ -61,16 +61,9 @@ NancyEngine::NancyEngine(OSystem *syst, const NancyGameDescription *gd) : { _system = syst; - DebugMan.addDebugChannel(kDebugSchedule, "Schedule", "Script Schedule debug level"); DebugMan.addDebugChannel(kDebugEngine, "Engine", "Engine debug level"); - DebugMan.addDebugChannel(kDebugDisplay, "Display", "Display debug level"); - DebugMan.addDebugChannel(kDebugMouse, "Mouse", "Mouse debug level"); - DebugMan.addDebugChannel(kDebugParser, "Parser", "Parser debug level"); - DebugMan.addDebugChannel(kDebugFile, "File", "File IO debug level"); - DebugMan.addDebugChannel(kDebugRoute, "Route", "Route debug level"); - DebugMan.addDebugChannel(kDebugInventory, "Inventory", "Inventory debug level"); - DebugMan.addDebugChannel(kDebugObject, "Object", "Object debug level"); - DebugMan.addDebugChannel(kDebugMusic, "Music", "Music debug level"); + DebugMan.addDebugChannel(kDebugActionRecord, "ActionRecord", "Action Record debug level"); + DebugMan.addDebugChannel(kDebugScene, "Scene", "Scene debug level"); _console = new NancyConsole(this); _rnd = new Common::RandomSource("Nancy"); diff --git a/engines/nancy/nancy.h b/engines/nancy/nancy.h index b10ea8201bb..2d067e2b46e 100644 --- a/engines/nancy/nancy.h +++ b/engines/nancy/nancy.h @@ -49,16 +49,9 @@ namespace Nancy { static const int kSavegameVersion = 1; enum NancyDebugChannels { - kDebugSchedule = 1 << 0, - kDebugEngine = 1 << 1, - kDebugDisplay = 1 << 2, - kDebugMouse = 1 << 3, - kDebugParser = 1 << 4, - kDebugFile = 1 << 5, - kDebugRoute = 1 << 6, - kDebugInventory = 1 << 7, - kDebugObject = 1 << 8, - kDebugMusic = 1 << 9 + kDebugEngine = 1 << 0, + kDebugActionRecord = 1 << 1, + kDebugScene = 1 << 2 }; struct NancyGameDescription; diff --git a/engines/nancy/state/scene.cpp b/engines/nancy/state/scene.cpp index b2af32df96a..80df69949d5 100644 --- a/engines/nancy/state/scene.cpp +++ b/engines/nancy/state/scene.cpp @@ -194,6 +194,13 @@ void Scene::load() { readSceneSummary(*sceneSummaryChunk); + debugC(0, kDebugScene, "Loading new scene %i: description \"%s\", frame %i, vertical scroll %i, doNotStartSound == %s", + _sceneState.nextScene.sceneID, + _sceneState.summary.description.c_str(), + _sceneState.nextScene.frameID, + _sceneState.nextScene.verticalOffset, + _sceneState._doNotStartSound == true ? "true" : "false"); + // Search for Action Records, maximum for a scene is 30 Common::SeekableReadStream *actionRecordChunk = nullptr; diff --git a/engines/nancy/state/scene.h b/engines/nancy/state/scene.h index ddfc4e86f39..fb24ea963f2 100644 --- a/engines/nancy/state/scene.h +++ b/engines/nancy/state/scene.h @@ -189,7 +189,7 @@ protected: }; struct Timers { - enum TimeOfDay { kDay, kNight, kDuskDawn }; + enum TimeOfDay { kDay = 0, kNight = 1, kDuskDawn = 2 }; Time tickCount; Time pushedPlayTime;