diff options
author | Strangerke | 2011-07-09 09:39:02 +0200 |
---|---|---|
committer | Strangerke | 2011-07-09 09:39:02 +0200 |
commit | cf1a45f8a8ecfe758dfb6a420b004821528a19cc (patch) | |
tree | 4dbd2cb0725edb9eddc14443626e0782e10cddae /engines | |
parent | 6ed9dd0d04b8513ad44e3541afc6db758100310c (diff) | |
download | scummvm-rg350-cf1a45f8a8ecfe758dfb6a420b004821528a19cc.tar.gz scummvm-rg350-cf1a45f8a8ecfe758dfb6a420b004821528a19cc.tar.bz2 scummvm-rg350-cf1a45f8a8ecfe758dfb6a420b004821528a19cc.zip |
CGE: replace the 2 memcpy previously used by a memmove
(thanks eriktorbjorn for pointing that out)
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cge/talk.cpp | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/engines/cge/talk.cpp b/engines/cge/talk.cpp index 61de47e48a..f41e31dce6 100644 --- a/engines/cge/talk.cpp +++ b/engines/cge/talk.cpp @@ -248,22 +248,13 @@ void Talk::putLine(int line, const char *text) { // clear whole rectangle p = v; // assume blanked line above text - - byte *tmpBuf = new byte[rsiz]; - - memcpy(tmpBuf, p - lsiz, rsiz); - memcpy(p, tmpBuf, rsiz); + memmove(p, p - lsiz, rsiz); p += psiz; // tricky replicate lines for plane 0 - memcpy(tmpBuf, p - lsiz, rsiz); - memcpy(p, tmpBuf, rsiz); + memmove(p, p - lsiz, rsiz); p += psiz; // same for plane 1 - memcpy(tmpBuf, p - lsiz, rsiz); - memcpy(p, tmpBuf, rsiz); + memmove(p, p - lsiz, rsiz); p += psiz; // same for plane 2 - memcpy(tmpBuf, p - lsiz, rsiz); - memcpy(p, tmpBuf, rsiz); - - delete[] tmpBuf; + memmove(p, p - lsiz, rsiz); // paint text line if (text) { @@ -311,18 +302,10 @@ void InfoLine::update(const char *tx) { uint16 size = 4 * psiz; // whole map size // clear whole rectangle - byte *tmpBuf = new byte[size]; memset(v + 2, TEXT_BG, dsiz); // data bytes - - memcpy(tmpBuf, v, psiz - lsiz); - memcpy(v + lsiz, tmpBuf, psiz - lsiz); - + memmove(v + lsiz, v, psiz - lsiz); *(uint16 *)(v + psiz - 2) = EOI; // plane trailer uint16 - - memcpy(tmpBuf, v, 3 * psiz); - memcpy(v + psiz, tmpBuf, 3 * psiz); - - delete[] tmpBuf; + memmove(v + psiz, v, 3 * psiz); // paint text line if (tx) { |