AGS: Add debug flag to enable script dump

This commit is contained in:
Thierry Crozat 2021-04-14 23:46:28 +01:00
parent b1683699bd
commit ba15b9c84b
2 changed files with 7 additions and 1 deletions

View File

@ -59,6 +59,7 @@
#include "ags/engine/ac/route_finder.h"
#include "ags/shared/core/assetmanager.h"
#include "ags/shared/util/directory.h"
#include "ags/shared/script/cc_options.h"
#ifdef ENABLE_AGS_TESTS
#include "ags/tests/test_all.h"
@ -77,6 +78,7 @@ AGSEngine::AGSEngine(OSystem *syst, const AGSGameDescription *gameDesc) : Engine
DebugMan.addDebugChannel(kDebugPath, "Path", "Pathfinding debug level");
DebugMan.addDebugChannel(kDebugFilePath, "FilePath", "File path debug level");
DebugMan.addDebugChannel(kDebugScan, "Scan", "Scan for unrecognised games");
DebugMan.addDebugChannel(kDebugScript, "Script", "Enable debug script dump");
_events = new EventsManager();
_music = new Music();
@ -123,6 +125,9 @@ Common::Error AGSEngine::run() {
return Common::kNoError;
}
if (debugChannelSet(-1, kDebugScript))
AGS3::ccSetOption(SCOPT_DEBUGRUN, 1);
#ifdef ENABLE_AGS_TESTS
AGS3::Test_DoAllTests();
return Common::kNoError;

View File

@ -50,7 +50,8 @@ enum AGSDebugChannels {
kDebugGraphics = 1 << 0,
kDebugPath = 1 << 1,
kDebugScan = 1 << 2,
kDebugFilePath = 1 << 3
kDebugFilePath = 1 << 3,
kDebugScript = 1 << 4
};
struct AGSGameDescription;