diff options
author | Torbjörn Andersson | 2006-04-16 17:53:37 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2006-04-16 17:53:37 +0000 |
commit | d2efa9fc65ff509fc4d829a5a818f9b8e7e6f1c6 (patch) | |
tree | 5979d3a91060668030a907abe93e05d91d33a2f2 | |
parent | 75e851777b71b04576b255864e65159faaa79ebd (diff) | |
download | scummvm-rg350-d2efa9fc65ff509fc4d829a5a818f9b8e7e6f1c6.tar.gz scummvm-rg350-d2efa9fc65ff509fc4d829a5a818f9b8e7e6f1c6.tar.bz2 scummvm-rg350-d2efa9fc65ff509fc4d829a5a818f9b8e7e6f1c6.zip |
The backend is responsible for making its own copy of the mouse cursor, so FF
can use the original data, instead of leaking memory every time the
drawMousePointer() function is called (several times per second).
svn-id: r21948
-rw-r--r-- | engines/simon/cursor.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/engines/simon/cursor.cpp b/engines/simon/cursor.cpp index b77dd487e9..f0dd0945f0 100644 --- a/engines/simon/cursor.cpp +++ b/engines/simon/cursor.cpp @@ -227,7 +227,7 @@ void SimonEngine::drawMousePointer() { //debug(0, "Mouse %d Anim %d Max %d", _mouseCursor, _mouseAnim, _mouseAnimMax); if (getGameType() == GType_FF) { - byte *src, *dst; + byte *src; VgaPointersEntry *vpe = &_vgaBufferPointers[7]; uint cursor, image, width, height; @@ -241,7 +241,7 @@ void SimonEngine::drawMousePointer() { if (_animatePointer == 0 && getBitFlag(99)) { cursor = 6; _mouseAnim = 1; - } else if (getBitFlag(72)) { + } else if (getBitFlag(72)) { cursor += 7; } @@ -252,9 +252,7 @@ void SimonEngine::drawMousePointer() { height = READ_LE_UINT16(src + 4) & 0x7FFF; src = vpe->vgaFile2 + readUint32Wrapper(src); - dst = (byte *)malloc(width * height); - memcpy(dst, src, width * height); - _system->setMouseCursor(dst, width, height, width / 2, height / 2, 0); + _system->setMouseCursor(src, width, height, width / 2, height / 2, 0); } else if (getGameType() == GType_SIMON2) { _system->setMouseCursor(_simon2_cursors[_mouseCursor], 16, 16, 7, 7); } else { |