aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage/ringworld2
diff options
context:
space:
mode:
authorStrangerke2013-12-07 18:42:24 +0100
committerStrangerke2013-12-07 18:42:24 +0100
commit6800035822e7171e7b79a11a498540652fc20cf4 (patch)
treef17805fe6076d74c9e54a85db10d43bf79d0870b /engines/tsage/ringworld2
parent61c36d133abcd2732fd602991bf4fb39c6783595 (diff)
downloadscummvm-rg350-6800035822e7171e7b79a11a498540652fc20cf4.tar.gz
scummvm-rg350-6800035822e7171e7b79a11a498540652fc20cf4.tar.bz2
scummvm-rg350-6800035822e7171e7b79a11a498540652fc20cf4.zip
TSAGE: R2R - Fix a giant memory leak in scene 1337, add some comments
Diffstat (limited to 'engines/tsage/ringworld2')
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
index 1e79cf4e51..c491a5c292 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -3380,6 +3380,9 @@ void Scene1337::Action3::signal() {
}
}
+/**
+ * Action used to handle the other players' turn
+ */
void Scene1337::Action4::signal() {
Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene;
@@ -3549,7 +3552,9 @@ void Scene1337::Action4::signal() {
}
}
-// Animations for discarding a card
+/**
+ * Animations for discarding a card
+ */
void Scene1337::Action5::signal() {
Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene;
@@ -6878,6 +6883,9 @@ void Scene1337::setCursorData(int resNum, int rlbNum, int frameNum) {
// FIXME: Use another cursor when possible
R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS);
} else {
+ // TODO: The original was using some ressource caching, which was useless and complex
+ // and which has been removed. This cursor behavior clearly made intensive use of this caching...
+ // We now have to find a way to cache these cursor pointers and avoid loading them multiple times per seconds
uint size;
byte *cursor = g_resourceManager->getSubResource(resNum, rlbNum, frameNum, &size);
// Decode the cursor
@@ -6887,6 +6895,8 @@ void Scene1337::setCursorData(int resNum, int rlbNum, int frameNum) {
const byte *cursorData = (const byte *)surface.getPixels();
CursorMan.replaceCursor(cursorData, surface.w, surface.h, s._centroid.x, s._centroid.y, s._transColor);
s.unlockSurface();
+
+ DEALLOCATE(cursor);
}
}