aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-06-02 23:54:52 +0000
committerMax Horn2003-06-02 23:54:52 +0000
commit3baff34226e276546e645faf85fe02d1bd067d92 (patch)
tree226e4cfed545e20298ae3ecb07ea908f4d7889cb
parentcb9c64aae2fc19ce21b6d47670c8fe80abda9f29 (diff)
downloadscummvm-rg350-3baff34226e276546e645faf85fe02d1bd067d92.tar.gz
scummvm-rg350-3baff34226e276546e645faf85fe02d1bd067d92.tar.bz2
scummvm-rg350-3baff34226e276546e645faf85fe02d1bd067d92.zip
use enqueueText for FT, too
svn-id: r8284
-rw-r--r--scumm/script_v6.cpp32
-rw-r--r--scumm/script_v8.cpp2
-rw-r--r--scumm/scumm.h1
-rw-r--r--scumm/string.cpp51
4 files changed, 8 insertions, 78 deletions
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index 2a87fff543..c63d8a0249 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -2479,13 +2479,15 @@ void Scumm_v6::o6_kernelSetFunctions() {
break;
case 16:
case 17:{
- const byte *message = getStringAddressVar(VAR_STRING2DRAW);
+ const byte *message;
+ byte buf_input[300];
+ _messagePtr = getStringAddressVar(VAR_STRING2DRAW);
+ message = _msgPtrToAdd = buf_input;
+ addMessageToStack(_messagePtr);
if (_gameId == GID_DIG) {
- byte buf_input[300], buf_output[300], buf_trans[300], *ptr = buf_input;
+ byte buf_output[300], buf_trans[300], *ptr = buf_input;
char *t_ptr = (char *)ptr;
- _msgPtrToAdd = buf_input;
buf_output[0] = 0;
- addMessageToStack(message);
while (t_ptr != NULL) {
if (*t_ptr == '/') {
translateText((byte *)t_ptr, buf_trans);
@@ -2502,28 +2504,8 @@ void Scumm_v6::o6_kernelSetFunctions() {
t_ptr = strchr((char *)t_ptr + 1, '/');
}
message = buf_output;
-#if 0
- setStringVars(0);
- _string[0].charset = (byte)args[1];
- _string[0].color = (byte)args[2];
- _string[0].xpos = args[3];
- _string[0].ypos = args[4];
- drawDescString(message);
-#else
- enqueueText(message, args[3], args[4] + camera._cur.y - (_screenHeight / 2), args[2], args[1], true);
-#endif
- } else {
-#if 1
- setStringVars(0);
- _string[0].charset = (byte)args[1];
- _string[0].color = (byte)args[2];
- _string[0].xpos = args[3];
- _string[0].ypos = args[4];
- drawDescString(message);
-#else
- enqueueText(message + camera._cur.y - (_screenHeight / 2), args[3], args[4], args[2], args[1], true);
-#endif
}
+ enqueueText(message, args[3], args[4] + camera._cur.y - (_screenHeight / 2), args[2], args[1], true);
break;}
case 20:
// Occurs in The Dig, at the alien pyramid. See bug #742979.
diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp
index 171b56e64b..9d3a2b15b5 100644
--- a/scumm/script_v8.cpp
+++ b/scumm/script_v8.cpp
@@ -539,7 +539,7 @@ void Scumm_v8::decodeParseString(int m, int n) {
case 5:{
byte buffer[256];
_msgPtrToAdd = buffer;
- _messagePtr = addMessageToStack(_messagePtr);
+ addMessageToStack(_messagePtr);
enqueueText(buffer, _string[m].xpos, _string[m].ypos, _string[m].color, _string[m].charset, _string[m].center);
}
break;
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 2ac5feac38..1a9421f5dc 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -1038,7 +1038,6 @@ public:
protected:
void CHARSET_1();
void drawString(int a);
- void drawDescString(const byte *msg);
const byte *addMessageToStack(const byte *msg);
void addIntToStack(int var);
void addVerbToStack(int var);
diff --git a/scumm/string.cpp b/scumm/string.cpp
index 5d89378cc3..c141501e1f 100644
--- a/scumm/string.cpp
+++ b/scumm/string.cpp
@@ -336,57 +336,6 @@ void Scumm::CHARSET_1() {
gdi._mask.extend(_charset->_str);
}
-void Scumm::drawDescString(const byte *msg) {
- byte c, *buf, buffer[256];
-
- buf = _msgPtrToAdd = buffer;
- addMessageToStack(msg);
-
- _charsetBufPos = 0;
- _string[0].ypos += camera._cur.y - (_screenHeight / 2);
- _charset->_top = _string[0].ypos;
- _charset->_startLeft = _charset->_left = _string[0].xpos;
- _charset->_right = _screenWidth - 1;
- _charset->_center = _string[0].center;
- _charset->setColor(_string[0].color);
- _charset->_disableOffsX = _charset->_firstChar = true;
- _charset->setCurID(_string[0].charset);
- _charset->_nextLeft = _string[0].xpos;
- _charset->_nextTop = _string[0].ypos;
-
- // Center text
- _string[0].xpos -= _charset->getStringWidth(0, buffer) >> 1;
- if (_string[0].xpos < 0) {
- _string[0].xpos = 0;
- }
-
- _talkDelay = 1;
-
- if (_string[0].ypos + _charset->getFontHeight() > 0)
- restoreBG(ScummVM::Rect(0, _string[0].ypos, _screenWidth - 1, _string[0].ypos + _charset->getFontHeight()));
-
- _charset->_nextLeft = _string[0].xpos;
- _charset->_nextTop = _string[0].ypos;
-
- do {
- c = *buf++;
- if (c != 0 && c != 0xFF) {
- _charset->_left = _charset->_nextLeft;
- _charset->_top = _charset->_nextTop;
- _charset->printChar(c);
- _charset->_nextLeft = _charset->_left;
- _charset->_nextTop = _charset->_top;
- }
- } while (c);
- _haveMsg = 1;
-
- // hack: more 8 pixels at width and height while redraw
- // for proper description redraw while scrolling room
- ScummVM::Rect r(_charset->_str);
- r.grow(8);
- gdi._mask.extend(r);
-}
-
void Scumm::drawString(int a) {
byte buf[256];
byte *space;