Some instrumentation for script debugging.

svn-id: r33359
This commit is contained in:
Nicola Mettifogo 2008-07-28 08:25:06 +00:00
parent 533dbfd756
commit 8d59006bd7
3 changed files with 8 additions and 8 deletions

View File

@ -143,10 +143,6 @@ public:
~CommandExec_br();
};
class ProgramExec {
protected:
struct ParallactionStruct2 {
@ -157,6 +153,8 @@ protected:
bool suspend;
} _ctxt;
const char **_instructionNames;
OpcodeSet _opcodes;
uint16 _modCounter;

View File

@ -61,8 +61,6 @@ namespace Parallaction {
#define INST_STOP 30
#define INST_ENDSCRIPT 31
#define SetOpcodeTable(x) table = &x;
typedef Common::Functor0Mem<void, CommandExec_br> OpcodeV1;
@ -73,6 +71,8 @@ typedef Common::Functor0Mem<void, ProgramExec_br> OpcodeV2;
#define INSTRUCTION_OPCODE(op) table->push_back(new OpcodeV2(this, &ProgramExec_br::instOp_##op))
#define DECLARE_INSTRUCTION_OPCODE(op) void ProgramExec_br::instOp_##op()
extern const char *_instructionNamesRes_br[];
void Parallaction_br::setupSubtitles(char *s, char *s2, int y) {
debugC(5, kDebugExec, "setupSubtitles(%s, %s, %i)", s, s2, y);
@ -602,6 +602,7 @@ void ProgramExec_br::init() {
}
ProgramExec_br::ProgramExec_br(Parallaction_br *vm) : ProgramExec_ns(vm), _vm(vm) {
_instructionNames = _instructionNamesRes_br;
}
ProgramExec_br::~ProgramExec_br() {

View File

@ -61,7 +61,7 @@ typedef Common::Functor0Mem<void, ProgramExec_ns> OpcodeV2;
#define INSTRUCTION_OPCODE(op) table->push_back(new OpcodeV2(this, &ProgramExec_ns::instOp_##op))
#define DECLARE_INSTRUCTION_OPCODE(op) void ProgramExec_ns::instOp_##op()
extern const char *_instructionNamesRes_ns[];
DECLARE_INSTRUCTION_OPCODE(on) {
@ -394,7 +394,7 @@ void ProgramExec::runScripts(ProgramList::iterator first, ProgramList::iterator
(*it)->_status = kProgramRunning;
debugC(9, kDebugExec, "Animation: %s, instruction: %i", a->_name, (*inst)->_index); //_instructionNamesRes[(*inst)->_index - 1]);
debugC(9, kDebugExec, "anim: %s, inst[%02i]: %s", a->_name, (*inst)->_index, _instructionNames[(*inst)->_index - 1]);
_ctxt.inst = inst;
_ctxt.anim = AnimationPtr(a);
@ -755,6 +755,7 @@ void ProgramExec_ns::init() {
}
ProgramExec_ns::ProgramExec_ns(Parallaction_ns *vm) : _vm(vm) {
_instructionNames = _instructionNamesRes_ns;
}
ProgramExec_ns::~ProgramExec_ns() {