aboutsummaryrefslogtreecommitdiff
path: root/sword2/logic.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-10-26 15:42:49 +0000
committerTorbjörn Andersson2003-10-26 15:42:49 +0000
commit7c4cc25cec714073d947e6451b4bf76cd53624ef (patch)
tree79a4c235fb9b62e0f49e069d87645f99022b2859 /sword2/logic.cpp
parent2a139049d621479da4898fcb22c742c52d17eac3 (diff)
downloadscummvm-rg350-7c4cc25cec714073d947e6451b4bf76cd53624ef.tar.gz
scummvm-rg350-7c4cc25cec714073d947e6451b4bf76cd53624ef.tar.bz2
scummvm-rg350-7c4cc25cec714073d947e6451b4bf76cd53624ef.zip
Enable the debug console. Actually, what I've done is to adapt the debug
console from the SCUMM engine. I decided that would be easier than to clean up the original console code. Unfortunately there's a bunch of code that I just copied - a pretty lousy form of code-reusal. It'd be nice if the console could be made part of the Engine class, or something like that. Most of the debug commands seem to be working. Some aren't relevant for ScummVM, and some are a bit obscure so I'm not quite sure what they're supposed to be doing. svn-id: r10978
Diffstat (limited to 'sword2/logic.cpp')
-rw-r--r--sword2/logic.cpp48
1 files changed, 10 insertions, 38 deletions
diff --git a/sword2/logic.cpp b/sword2/logic.cpp
index 166fd53b73..90161a2249 100644
--- a/sword2/logic.cpp
+++ b/sword2/logic.cpp
@@ -63,7 +63,7 @@ int Logic::processSession(void) {
head = (_standardHeader*) res_man.open(run_list);
if (head->fileType != RUN_LIST)
- Con_fatal_error("Logic_engine %d not a run_list", run_list);
+ error("Logic_engine %d not a run_list", run_list);
game_object_list = (uint32 *) (head + 1);
@@ -87,7 +87,7 @@ int Logic::processSession(void) {
head = (_standardHeader*) res_man.open(ID);
if (head->fileType != GAME_OBJECT)
- Con_fatal_error("Logic_engine %d not an object", ID);
+ error("Logic_engine %d not an object", ID);
_curObjectHub = (_object_hub *) (head + 1);
@@ -133,7 +133,7 @@ int Logic::processSession(void) {
far_head = (_standardHeader*) res_man.open(script / SIZE);
if (far_head->fileType != GAME_OBJECT && far_head->fileType != SCREEN_MANAGER)
- Con_fatal_error("Logic_engine %d not a far object (its a %d)", script / SIZE, far_head->fileType);
+ error("Logic_engine %d not a far object (its a %d)", script / SIZE, far_head->fileType);
// raw_script_ad = (char*) (head + 1) + sizeof(_standardHeader);
@@ -171,7 +171,7 @@ int Logic::processSession(void) {
ret = 0;
}
} else if (ret > 2) {
- Con_fatal_error("processSession: illegal script return type %d", ret);
+ error("processSession: illegal script return type %d", ret);
}
// if ret == 2 then we simply go around again - a new
@@ -300,7 +300,7 @@ void Logic::logicUp(uint32 new_script) {
// can be 0, 1, 2
if (LEVEL == 3)
- Con_fatal_error("logicUp id %d has run off script tree! :-O", ID);
+ error("logicUp id %d has run off script tree! :-O", ID);
// setup new script on next level (not the current level)
@@ -333,53 +333,25 @@ void Logic::logicReplace(uint32 new_script) {
_curObjectHub->script_pc[LEVEL] = new_script & 0xffff;
}
-uint32 Logic::examineRunList(void) {
+void Logic::examineRunList(void) {
uint32 *game_object_list;
_standardHeader *file_header;
- int scrolls = 0;
- _keyboardEvent ke;
if (_currentRunList) {
// open and lock in place
game_object_list = (uint32 *) (res_man.open(_currentRunList) + sizeof(_standardHeader));
- Print_to_console("runlist number %d", _currentRunList);
+ Debug_Printf("Runlist number %d\n", _currentRunList);
for (int i = 0; game_object_list[i]; i++) {
file_header = (_standardHeader *) res_man.open(game_object_list[i]);
- Print_to_console(" %d %s", game_object_list[i], file_header->name);
+ Debug_Printf("%d %s\n", game_object_list[i], file_header->name);
res_man.close(game_object_list[i]);
-
- scrolls++;
- Build_display();
-
- if (scrolls == 18) {
- Temp_print_to_console("- Press ESC to stop or any other key to continue");
- Build_display();
-
- do {
- g_display->updateDisplay();
- } while (!KeyWaiting());
-
- // kill the key we just pressed
- ReadKey(&ke);
- if (ke.keycode == 27)
- break;
-
- // clear the Press Esc message ready for the
- // new line
-
- Clear_console_line();
- scrolls = 0;
- }
}
res_man.close(_currentRunList);
} else
- Print_to_console("no run list set");
-
- Scroll_console();
- return 1;
+ Debug_Printf("No run list set\n");
}
/**
@@ -435,7 +407,7 @@ int32 Logic::fnAddToKillList(int32 *params) {
#ifdef _SWORD2_DEBUG
// no room at the inn
if (_kills == OBJECT_KILL_LIST_SIZE)
- Con_fatal_error("List full in fnAddToKillList(%u)", ID);
+ error("List full in fnAddToKillList(%u)", ID);
#endif
// add this 'ID' to the kill list