diff options
author | Johannes Schickel | 2009-08-17 12:22:15 +0000 |
---|---|---|
committer | Johannes Schickel | 2009-08-17 12:22:15 +0000 |
commit | b7b637046355522ce75c3b18dfbc8f3e8cc0aa76 (patch) | |
tree | bf4d6c259e946af2fe93374bb7f5fe21ab5b5447 | |
parent | 58ec3e67eff75f6f8c6a7d9802dc42544a0f6b03 (diff) | |
download | scummvm-rg350-b7b637046355522ce75c3b18dfbc8f3e8cc0aa76.tar.gz scummvm-rg350-b7b637046355522ce75c3b18dfbc8f3e8cc0aa76.tar.bz2 scummvm-rg350-b7b637046355522ce75c3b18dfbc8f3e8cc0aa76.zip |
Cleanup: don't copy the Kyrandia 1 Amiga credits data in a temporary buffer, and thus keeping it twice in memory.
svn-id: r43473
-rw-r--r-- | engines/kyra/sequences_lok.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/engines/kyra/sequences_lok.cpp b/engines/kyra/sequences_lok.cpp index 35f434698b..202e314e07 100644 --- a/engines/kyra/sequences_lok.cpp +++ b/engines/kyra/sequences_lok.cpp @@ -1354,15 +1354,12 @@ void KyraEngine_LoK::seq_playCreditsAmiga() { } int size = 0; - const uint8 *bufferTmp = _staticres->loadRawData(k1CreditsStrings, size); - char *buffer = new char[size]; - assert(buffer); - memcpy(buffer, bufferTmp, size); + const char *creditsData = (const char *)_staticres->loadRawData(k1CreditsStrings, size); char stringBuffer[81]; memset(stringBuffer, 0, sizeof(stringBuffer)); - char *cur = buffer; + const char *cur = creditsData; char *specialString = stringBuffer; bool fillRectFlag = false, subWidth = false, centerFlag = false; x = 0; @@ -1424,9 +1421,7 @@ void KyraEngine_LoK::seq_playCreditsAmiga() { removeInputTop(); break; } - } while (++cur != buffer + size && !shouldQuit()); - - delete[] buffer; + } while (++cur != (creditsData + size) && !shouldQuit()); } bool KyraEngine_LoK::seq_skipSequence() const { |