aboutsummaryrefslogtreecommitdiff
path: root/saga/sdebug.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2004-08-12 23:57:45 +0000
committerEugene Sandulenko2004-08-12 23:57:45 +0000
commit3fe739efb24e72a97fd9212657cd692df8d97c90 (patch)
treea063d8ab02f7cf19e179e4ae8c8f7e7504f30ac7 /saga/sdebug.cpp
parentcdb88416a850cea68baab90685c14aa1d7624111 (diff)
downloadscummvm-rg350-3fe739efb24e72a97fd9212657cd692df8d97c90.tar.gz
scummvm-rg350-3fe739efb24e72a97fd9212657cd692df8d97c90.tar.bz2
scummvm-rg350-3fe739efb24e72a97fd9212657cd692df8d97c90.zip
Merge SDEBUG_*, SF_* and STHREAD_* into Script class.
svn-id: r14568
Diffstat (limited to 'saga/sdebug.cpp')
-rw-r--r--saga/sdebug.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/saga/sdebug.cpp b/saga/sdebug.cpp
index e68f8cdd82..107dcc1198 100644
--- a/saga/sdebug.cpp
+++ b/saga/sdebug.cpp
@@ -29,16 +29,14 @@
#include "saga/scene.h"
#include "saga/font.h"
-#include "saga/script_mod.h"
#include "saga/script.h"
-#include "saga/sthread.h"
namespace Saga {
#define SD_DISPLAY_LEN 128
#define SD_ADDTXT( x ) strncat( disp_buf, x, SD_DISPLAY_LEN );
-int SDEBUG_PrintInstr(R_SCRIPT_THREAD *thread) {
+int Script::SDebugPrintInstr(R_SCRIPT_THREAD *thread) {
R_TEXTLIST_ENTRY tl_e;
char tmp_buf[80] = { 0 };
static char disp_buf[SD_DISPLAY_LEN] = { 0 };
@@ -52,9 +50,9 @@ int SDEBUG_PrintInstr(R_SCRIPT_THREAD *thread) {
disp_buf[0] = 0;
- if (_vm->_script->_dbg_txtentry != NULL) {
- _vm->textDeleteEntry(si.text_list, _vm->_script->_dbg_txtentry);
- _vm->_script->_dbg_txtentry = NULL;
+ if (_dbg_txtentry != NULL) {
+ _vm->textDeleteEntry(si.text_list, _dbg_txtentry);
+ _dbg_txtentry = NULL;
}
tl_e.color = 1;
@@ -66,9 +64,9 @@ int SDEBUG_PrintInstr(R_SCRIPT_THREAD *thread) {
tl_e.string = disp_buf;
tl_e.display = 1;
- MemoryReadStream readS(_vm->_script->currentScript()->bytecode->bytecode_p
+ MemoryReadStream readS(currentScript()->bytecode->bytecode_p
+ thread->i_offset,
- _vm->_script->currentScript()->bytecode->bytecode_len
+ currentScript()->bytecode->bytecode_len
- thread->i_offset);
in_char = readS.readByte();
sprintf(tmp_buf, "%04lX | %02X | ", thread->i_offset, in_char);
@@ -514,8 +512,8 @@ int SDEBUG_PrintInstr(R_SCRIPT_THREAD *thread) {
break;
}
- _vm->_script->_dbg_txtentry = _vm->textAddEntry(si.text_list, &tl_e);
- _vm->textSetDisplay(_vm->_script->_dbg_txtentry, 1);
+ _dbg_txtentry = _vm->textAddEntry(si.text_list, &tl_e);
+ _vm->textSetDisplay(_dbg_txtentry, 1);
return R_SUCCESS;
}