use enqueueText for FT, too

svn-id: r8284
This commit is contained in:
Max Horn 2003-06-02 23:54:52 +00:00
parent cb9c64aae2
commit 3baff34226
4 changed files with 8 additions and 78 deletions

View file

@ -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.

View file

@ -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;

View file

@ -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);

View file

@ -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;