aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2005-05-26 14:14:32 +0000
committerMax Horn2005-05-26 14:14:32 +0000
commit852fe1b1c7d601df534ac059713375817f7b86a3 (patch)
tree86bd93de892667884e5c83399e592eb73e2e56f2 /scumm
parent4b82800cc51b2bc3285bfc1eab3c4e16618105c6 (diff)
downloadscummvm-rg350-852fe1b1c7d601df534ac059713375817f7b86a3.tar.gz
scummvm-rg350-852fe1b1c7d601df534ac059713375817f7b86a3.tar.bz2
scummvm-rg350-852fe1b1c7d601df534ac059713375817f7b86a3.zip
Changed name of addMessageToStack to convertMessageToString (still not really happy with that name but at least it is a little bit more descriptive than the old)
svn-id: r18262
Diffstat (limited to 'scumm')
-rw-r--r--scumm/actor.cpp2
-rw-r--r--scumm/script.cpp2
-rw-r--r--scumm/script_v6he.cpp10
-rw-r--r--scumm/script_v7he.cpp8
-rw-r--r--scumm/scumm.h10
-rw-r--r--scumm/string.cpp34
6 files changed, 33 insertions, 33 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index efe355c739..e1137fa000 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -1296,7 +1296,7 @@ void ScummEngine_v7::actorTalk(const byte *msg) {
void ScummEngine::actorTalk(const byte *msg) {
Actor *a;
- addMessageToStack(msg, _charsetBuffer, sizeof(_charsetBuffer));
+ convertMessageToString(msg, _charsetBuffer, sizeof(_charsetBuffer));
// FIXME: Workaround for bugs #770039 and #770049
if (_gameId == GID_LOOM || _gameId == GID_LOOM256) {
diff --git a/scumm/script.cpp b/scumm/script.cpp
index 3ad32ea13a..6e1537db55 100644
--- a/scumm/script.cpp
+++ b/scumm/script.cpp
@@ -1086,7 +1086,7 @@ int ScummEngine::resStrLen(const byte *src) const {
num++;
// WORKAROUND for bug #985948, a script bug in Indy3. See also
- // the corresponding code in ScummEngine::addMessageToStack().
+ // the corresponding code in ScummEngine::convertMessageToString().
if (_gameId == GID_INDY3 && chr == 0x2E) {
continue;
}
diff --git a/scumm/script_v6he.cpp b/scumm/script_v6he.cpp
index f8489bab2f..414fa4e402 100644
--- a/scumm/script_v6he.cpp
+++ b/scumm/script_v6he.cpp
@@ -729,7 +729,7 @@ void ScummEngine_v60he::o60_actorOps() {
int slot = pop();
int len = resStrLen(string) + 1;
- addMessageToStack(string, a->_heTalkQueue[slot].sentence, len);
+ convertMessageToString(string, a->_heTalkQueue[slot].sentence, len);
a->_heTalkQueue[slot].posX = a->_talkPosX;
a->_heTalkQueue[slot].posY = a->_talkPosY;
@@ -985,7 +985,7 @@ void ScummEngine_v60he::o60_openFile() {
int mode, len, slot, l, r;
byte filename[100];
- addMessageToStack(_scriptPointer, filename, sizeof(filename));
+ convertMessageToString(_scriptPointer, filename, sizeof(filename));
len = resStrLen(_scriptPointer);
_scriptPointer += len + 1;
@@ -1035,7 +1035,7 @@ void ScummEngine_v60he::o60_deleteFile() {
int len, r;
byte filename[100];
- addMessageToStack(_scriptPointer, filename, sizeof(filename));
+ convertMessageToString(_scriptPointer, filename, sizeof(filename));
len = resStrLen(_scriptPointer);
_scriptPointer += len + 1;
@@ -1052,7 +1052,7 @@ void ScummEngine_v60he::o60_rename() {
int len, r1, r2;
byte filename[100],filename2[100];
- addMessageToStack(_scriptPointer, filename, sizeof(filename));
+ convertMessageToString(_scriptPointer, filename, sizeof(filename));
len = resStrLen(_scriptPointer);
_scriptPointer += len + 1;
@@ -1062,7 +1062,7 @@ void ScummEngine_v60he::o60_rename() {
break;
}
- addMessageToStack(_scriptPointer, filename2, sizeof(filename2));
+ convertMessageToString(_scriptPointer, filename2, sizeof(filename2));
len = resStrLen(_scriptPointer);
_scriptPointer += len + 1;
diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp
index 165dfef855..ca883aa06e 100644
--- a/scumm/script_v7he.cpp
+++ b/scumm/script_v7he.cpp
@@ -906,7 +906,7 @@ void ScummEngine_v70he::o70_readINI() {
const char *entry;
int len, type;
- addMessageToStack(_scriptPointer, option, sizeof(option));
+ convertMessageToString(_scriptPointer, option, sizeof(option));
len = resStrLen(_scriptPointer);
_scriptPointer += len + 1;
@@ -941,7 +941,7 @@ void ScummEngine_v70he::o70_writeINI() {
type = pop();
value = pop();
- addMessageToStack(_scriptPointer, option, sizeof(option));
+ convertMessageToString(_scriptPointer, option, sizeof(option));
len = resStrLen(_scriptPointer);
_scriptPointer += len + 1;
@@ -950,7 +950,7 @@ void ScummEngine_v70he::o70_writeINI() {
ConfMan.set((char *)option, value);
break;
case 2: // string
- addMessageToStack(_scriptPointer, string, sizeof(string));
+ convertMessageToString(_scriptPointer, string, sizeof(string));
len = resStrLen(_scriptPointer);
_scriptPointer += len + 1;
ConfMan.set((char *)option, (char *)string);
@@ -1030,7 +1030,7 @@ void ScummEngine_v70he::o70_setFilePath() {
int len;
byte filename[100];
- addMessageToStack(_scriptPointer, filename, sizeof(filename));
+ convertMessageToString(_scriptPointer, filename, sizeof(filename));
len = resStrLen(_scriptPointer);
_scriptPointer += len + 1;
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 84eaddbabc..9500062f6c 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -1158,11 +1158,11 @@ protected:
void unkMessage1(const byte *msg);
void showMessageDialog(const byte *msg);
- int addMessageToStack(const byte *msg, byte *dst, int dstSize);
- int addIntToStack(byte *dst, int dstSize, int var);
- int addVerbToStack(byte *dst, int dstSize, int var);
- int addNameToStack(byte *dst, int dstSize, int var);
- int addStringToStack(byte *dst, int dstSize, int var);
+ int convertMessageToString(const byte *msg, byte *dst, int dstSize);
+ int convertIntMessage(byte *dst, int dstSize, int var);
+ int convertVerbMessage(byte *dst, int dstSize, int var);
+ int convertNameMessage(byte *dst, int dstSize, int var);
+ int convertStringMessage(byte *dst, int dstSize, int var);
virtual void loadLanguageBundle() {}
diff --git a/scumm/string.cpp b/scumm/string.cpp
index bb2a07ac79..3f69e64e7e 100644
--- a/scumm/string.cpp
+++ b/scumm/string.cpp
@@ -56,7 +56,7 @@ void ScummEngine::printString(int m, const byte *msg) {
void ScummEngine::unkMessage1(const byte *msg) {
byte buffer[500];
- addMessageToStack(msg, buffer, sizeof(buffer));
+ convertMessageToString(msg, buffer, sizeof(buffer));
// if ((_gameId == GID_CMI) && _debugMode) { // In CMI, unkMessage1 is used for printDebug output
if ((buffer[0] != 0xFF) && _debugMode) {
@@ -86,7 +86,7 @@ void ScummEngine::showMessageDialog(const byte *msg) {
// Seemed to use blastText for the messages
byte buf[500];
- addMessageToStack(msg, buf, sizeof(buf));
+ convertMessageToString(msg, buf, sizeof(buf));
if (_string[3].color == 0)
_string[3].color = 4;
@@ -444,7 +444,7 @@ void ScummEngine::drawString(int a, const byte *msg) {
bool cmi_pos_hack = false;
- addMessageToStack(msg, buf, sizeof(buf));
+ convertMessageToString(msg, buf, sizeof(buf));
_charset->_top = _string[a].ypos + _screenTop;
_charset->_startLeft = _charset->_left = _string[a].xpos;
@@ -580,7 +580,7 @@ void ScummEngine::drawString(int a, const byte *msg) {
_string[a].xpos = _charset->_str.right + 8; // Indy3: Fixes Grail Diary text positioning
}
-int ScummEngine::addMessageToStack(const byte *msg, byte *dst, int dstSize) {
+int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize) {
uint num = 0;
uint32 val;
byte chr;
@@ -592,7 +592,7 @@ int ScummEngine::addMessageToStack(const byte *msg, byte *dst, int dstSize) {
end = dst + dstSize;
if (msg == NULL) {
- warning("Bad message in addMessageToStack, ignoring");
+ warning("Bad message in convertMessageToString, ignoring");
return 0;
}
@@ -637,16 +637,16 @@ int ScummEngine::addMessageToStack(const byte *msg, byte *dst, int dstSize) {
val = (_version == 8) ? READ_LE_UINT32(src + num) : READ_LE_UINT16(src + num);
switch (chr) {
case 4:
- dst += addIntToStack(dst, end - dst, val);
+ dst += convertIntMessage(dst, end - dst, val);
break;
case 5:
- dst += addVerbToStack(dst, end - dst, val);
+ dst += convertVerbMessage(dst, end - dst, val);
break;
case 6:
dst += addNameToStack(dst, end - dst, val);
break;
case 7:
- dst += addStringToStack(dst, end - dst, val);
+ dst += convertStringMessage(dst, end - dst, val);
break;
case 9:
case 10:
@@ -664,7 +664,7 @@ int ScummEngine::addMessageToStack(const byte *msg, byte *dst, int dstSize) {
}
break;
default:
- warning("addMessageToStack(): string escape sequence %d unknown", chr);
+ warning("convertMessageToString(): string escape sequence %d unknown", chr);
break;
}
num += (_version == 8) ? 4 : 2;
@@ -677,21 +677,21 @@ int ScummEngine::addMessageToStack(const byte *msg, byte *dst, int dstSize) {
// Check for a buffer overflow
if (dst >= end)
- error("addMessageToStack: buffer overflow!");
+ error("convertMessageToString: buffer overflow!");
}
*dst = 0;
return dstSize - (end - dst);
}
-int ScummEngine::addIntToStack(byte *dst, int dstSize, int var) {
+int ScummEngine::convertIntMessage(byte *dst, int dstSize, int var) {
int num;
num = readVar(var);
return snprintf((char *)dst, dstSize, "%d", num);
}
-int ScummEngine::addVerbToStack(byte *dst, int dstSize, int var) {
+int ScummEngine::convertVerbMessage(byte *dst, int dstSize, int var) {
int num, k;
num = readVar(var);
@@ -699,7 +699,7 @@ int ScummEngine::addVerbToStack(byte *dst, int dstSize, int var) {
for (k = 1; k < _numVerbs; k++) {
if (num == _verbs[k].verbid && !_verbs[k].type && !_verbs[k].saveid) {
const byte *ptr = getResourceAddress(rtVerb, k);
- return addMessageToStack(ptr, dst, dstSize);
+ return convertMessageToString(ptr, dst, dstSize);
}
}
}
@@ -713,13 +713,13 @@ int ScummEngine::addNameToStack(byte *dst, int dstSize, int var) {
if (num) {
const byte *ptr = getObjOrActorName(num);
if (ptr) {
- return addMessageToStack(ptr, dst, dstSize);
+ return convertMessageToString(ptr, dst, dstSize);
}
}
return 0;
}
-int ScummEngine::addStringToStack(byte *dst, int dstSize, int var) {
+int ScummEngine::convertStringMessage(byte *dst, int dstSize, int var) {
const byte *ptr;
if (_version <= 2) {
@@ -741,7 +741,7 @@ int ScummEngine::addStringToStack(byte *dst, int dstSize, int var) {
if (var) {
ptr = getStringAddress(var);
if (ptr) {
- return addMessageToStack(ptr, dst, dstSize);
+ return convertMessageToString(ptr, dst, dstSize);
}
}
return 0;
@@ -777,7 +777,7 @@ void ScummEngine_v6::enqueueText(const byte *text, int x, int y, byte color, byt
BlastText &bt = _blastTextQueue[_blastTextQueuePos++];
assert(_blastTextQueuePos <= ARRAYSIZE(_blastTextQueue));
- addMessageToStack(text, bt.text, sizeof(bt.text));
+ convertMessageToString(text, bt.text, sizeof(bt.text));
bt.xpos = x;
bt.ypos = y;
bt.color = color;