Implemented a call stack
svn-id: r41754
This commit is contained in:
parent
962fc19b57
commit
7fbad08fd1
8 changed files with 86 additions and 68 deletions
|
@ -358,4 +358,33 @@ void Script::cuckoo(byte *totData, uint32 totSize) {
|
|||
_totSize = totSize;
|
||||
}
|
||||
|
||||
void Script::push() {
|
||||
CallEntry currentCall;
|
||||
|
||||
currentCall.totData = _totData;
|
||||
currentCall.totPtr = _totPtr;
|
||||
currentCall.totSize = _totSize;
|
||||
currentCall.finished = _finished;
|
||||
|
||||
_callStack.push(currentCall);
|
||||
}
|
||||
|
||||
void Script::pop(bool ret) {
|
||||
assert(!_callStack.empty());
|
||||
|
||||
CallEntry lastCall = _callStack.pop();
|
||||
|
||||
if (ret) {
|
||||
_totData = lastCall.totData;
|
||||
_totPtr = lastCall.totPtr;
|
||||
_totSize = lastCall.totSize;
|
||||
_finished = lastCall.finished;
|
||||
}
|
||||
}
|
||||
|
||||
void Script::call(uint32 offset) {
|
||||
push();
|
||||
seek(offset);
|
||||
}
|
||||
|
||||
} // End of namespace Gob
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue