aboutsummaryrefslogtreecommitdiff
path: root/scumm/script_v72he.cpp
diff options
context:
space:
mode:
authorTravis Howell2005-04-27 14:26:52 +0000
committerTravis Howell2005-04-27 14:26:52 +0000
commitf5189c323b1ce0ae8f713d4799a7fc6b77cc1efc (patch)
tree498123765feac2f7d6b889c9841d2dc23d8cc7cc /scumm/script_v72he.cpp
parentf6971f847ce37b7c8afbbd29262a1ffed7335610 (diff)
downloadscummvm-rg350-f5189c323b1ce0ae8f713d4799a7fc6b77cc1efc.tar.gz
scummvm-rg350-f5189c323b1ce0ae8f713d4799a7fc6b77cc1efc.tar.bz2
scummvm-rg350-f5189c323b1ce0ae8f713d4799a7fc6b77cc1efc.zip
Minor clean up, HE games should always copy strings directly.
svn-id: r17838
Diffstat (limited to 'scumm/script_v72he.cpp')
-rw-r--r--scumm/script_v72he.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp
index 4a25f7dcfe..cd07a50965 100644
--- a/scumm/script_v72he.cpp
+++ b/scumm/script_v72he.cpp
@@ -49,7 +49,7 @@ void ScummEngine_v72he::setupOpcodes() {
OPCODE(o72_pushDWord),
OPCODE(o6_pushWordVar),
/* 04 */
- OPCODE(o72_addMessageToStack),
+ OPCODE(o72_getScriptString),
OPCODE(o6_invalid),
OPCODE(o6_invalid),
OPCODE(o6_wordArrayRead),
@@ -610,9 +610,9 @@ void ScummEngine_v72he::decodeScriptString(byte *dst, bool scriptString) {
// Get string
if (scriptString) {
- addMessageToStack(_scriptPointer, string, sizeof(string));
- len = resStrLen(_scriptPointer);
- _scriptPointer += len + 1;
+ len = resStrLen(_scriptPointer) + 1;
+ memcpy(string, _scriptPointer, len);
+ _scriptPointer += len;
} else {
copyScriptString(string, sizeof(string));
len = resStrLen(string) + 1;
@@ -776,7 +776,7 @@ void ScummEngine_v72he::o72_pushDWord() {
push(a);
}
-void ScummEngine_v72he::o72_addMessageToStack() {
+void ScummEngine_v72he::o72_getScriptString() {
byte chr;
while ((chr = fetchScriptByte()) != 0) {
@@ -1305,7 +1305,7 @@ void ScummEngine_v72he::o72_actorOps() {
int slot = pop();
int len = resStrLen(string) + 1;
- addMessageToStack(string, a->_heTalkQueue[slot].sentence, len);
+ memcpy(a->_heTalkQueue[slot].sentence, string, len);
a->_heTalkQueue[slot].posX = a->_talkPosX;
a->_heTalkQueue[slot].posY = a->_talkPosY;