From a338d5fdb2715a7b29ae789c632a0cfa05803079 Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Mon, 2 Jun 2008 21:08:49 +0000 Subject: PARA: Got rid of calls to system->quit() so that the Parallaction engine can return to the launcher. Also fixed a couple of memory leaks. svn-id: r32504 --- graphics/iff.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'graphics') diff --git a/graphics/iff.cpp b/graphics/iff.cpp index ac51531eee..514fba9cc0 100644 --- a/graphics/iff.cpp +++ b/graphics/iff.cpp @@ -139,6 +139,7 @@ void ILBMDecoder::readBODY(Common::IFFChunk& chunk) { out += _bitmapHeader.width; } + free(scan); break; } -- cgit v1.2.3 From 4fddafa3e6ef1c250804ea6ce9baaf2a911027e8 Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Mon, 9 Jun 2008 23:15:17 +0000 Subject: Implemented popAllCursors() in CursorManager to ensure that all unnecessary cursors are removed from the cursor stack when returning to the launcher svn-id: r32642 --- graphics/cursorman.cpp | 18 ++++++++++++++++++ graphics/cursorman.h | 8 ++++++++ 2 files changed, 26 insertions(+) (limited to 'graphics') diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp index ba7c6dee9b..fe5f653b94 100644 --- a/graphics/cursorman.cpp +++ b/graphics/cursorman.cpp @@ -83,6 +83,24 @@ void CursorManager::popCursor() { g_system->showMouse(isVisible()); } + +void CursorManager::popAllCursors() { + while (!_cursorStack.empty()) { + Cursor *cur = _cursorStack.pop(); + delete cur; + } + + if (g_system->hasFeature(OSystem::kFeatureCursorHasPalette)) { + while (!_cursorPaletteStack.empty()) { + Palette *pal = _cursorPaletteStack.pop(); + delete pal; + } + } + + g_system->showMouse(isVisible()); +} + + void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetScale) { if (_cursorStack.empty()) { pushCursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale); diff --git a/graphics/cursorman.h b/graphics/cursorman.h index 151038e118..bf05ab762b 100644 --- a/graphics/cursorman.h +++ b/graphics/cursorman.h @@ -79,6 +79,14 @@ public: */ void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1); + /** + * Pop all of the cursors and cursor palettes from their respective stacks. + * The purpose is to ensure that all unecessary cursors are removed from the + * stack when returning to the launcher from an engine. + * + */ + void popAllCursors(); + /** * Enable/Disable the current cursor palette. * -- cgit v1.2.3 From 0be985ce833d03e4458bb4512d5bed377c13d9c7 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 29 Jul 2008 16:09:10 +0000 Subject: Changed class File (and derived classes) to only support read-only access; added a new class DumpFile for writing svn-id: r33412 --- graphics/font.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'graphics') diff --git a/graphics/font.cpp b/graphics/font.cpp index b5817e613a..0b0405b4b4 100644 --- a/graphics/font.cpp +++ b/graphics/font.cpp @@ -585,8 +585,8 @@ NewFont *NewFont::loadFont(Common::SeekableReadStream &stream) { } bool NewFont::cacheFontData(const NewFont &font, const Common::String &filename) { - Common::File cacheFile; - if (!cacheFile.open(filename, Common::File::kFileWriteMode)) { + Common::DumpFile cacheFile; + if (!cacheFile.open(filename)) { warning("Couldn't open file '%s' for writing", filename.c_str()); return false; } -- cgit v1.2.3