aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/draw.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/gob/draw.cpp')
-rw-r--r--engines/gob/draw.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/gob/draw.cpp b/engines/gob/draw.cpp
index 8619e08e8b..b3e5e7418c 100644
--- a/engines/gob/draw.cpp
+++ b/engines/gob/draw.cpp
@@ -30,6 +30,7 @@
#include "gob/global.h"
#include "gob/util.h"
#include "gob/game.h"
+#include "gob/script.h"
#include "gob/inter.h"
#include "gob/video.h"
#include "gob/palanim.h"
@@ -389,11 +390,10 @@ void Draw::printTextCentered(int16 id, int16 left, int16 top, int16 right,
adjustCoords(1, &left, &top);
adjustCoords(1, &right, &bottom);
- if (READ_LE_UINT16(_vm->_game->_totFileData + 0x7E) != 0) {
- byte *storedIP = _vm->_global->_inter_execPtr;
+ uint16 centerOffset = _vm->_game->_script->getFunctionOffset(TOTFile::kFunctionCenter);
+ if (centerOffset != 0) {
+ _vm->_game->_script->call(centerOffset);
- _vm->_global->_inter_execPtr = _vm->_game->_totFileData +
- READ_LE_UINT16(_vm->_game->_totFileData + 0x7E);
WRITE_VAR(17, (uint32) id);
WRITE_VAR(18, (uint32) left);
WRITE_VAR(19, (uint32) top);
@@ -401,7 +401,7 @@ void Draw::printTextCentered(int16 id, int16 left, int16 top, int16 right,
WRITE_VAR(21, (uint32) (bottom - top + 1));
_vm->_inter->funcBlock(0);
- _vm->_global->_inter_execPtr = storedIP;
+ _vm->_game->_script->pop();
}
if (str[0] == '\0')