diff options
author | Willem Jan Palenstijn | 2011-11-15 13:44:48 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2011-11-15 13:45:34 +0100 |
commit | 46ec2c4d732797d300608cc04bf14dd0a699ebe8 (patch) | |
tree | 414c92d5ad39c82f6c46d83a8c54beff619d039a /engines/dreamweb/object.cpp | |
parent | 5adf8b4864e80b10070ad31819271a0af7588f64 (diff) | |
download | scummvm-rg350-46ec2c4d732797d300608cc04bf14dd0a699ebe8.tar.gz scummvm-rg350-46ec2c4d732797d300608cc04bf14dd0a699ebe8.tar.bz2 scummvm-rg350-46ec2c4d732797d300608cc04bf14dd0a699ebe8.zip |
DREAMWEB: Use strcpy/strlen instead of manual loops
Diffstat (limited to 'engines/dreamweb/object.cpp')
-rw-r--r-- | engines/dreamweb/object.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp index 9bb5a7d0b3..5e822cafba 100644 --- a/engines/dreamweb/object.cpp +++ b/engines/dreamweb/object.cpp @@ -249,14 +249,12 @@ void DreamGenContext::transfertext() { segRef(data.word(kExtras)).word(kExtextdat + data.byte(kExpos) * 2) = data.word(kExtextpos); uint16 freeTextOffset = data.byte(kItemtotran) * 2; uint16 srcOffset = segRef(data.word(kFreedesc)).word(kFreetextdat + freeTextOffset); - const uint8 *src = segRef(data.word(kFreedesc)).ptr(kFreetext + srcOffset, 0); - uint8 *dst = segRef(data.word(kExtras)).ptr(kExtext + data.word(kExtextpos), 0); - uint8 c; - do { - c = *src++; - *dst++ = c; - ++data.word(kExtextpos); - } while (c); + const char *src = (const char *)segRef(data.word(kFreedesc)).ptr(kFreetext + srcOffset, 0); + char *dst = (char *)segRef(data.word(kExtras)).ptr(kExtext + data.word(kExtextpos), 0); + + strcpy(dst, src); + + data.word(kExtextpos) += strlen(src) + 1; } |