From 91eaea3e583b4df9a75384e5b8627bfab7de9118 Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Sun, 1 Apr 2007 14:35:33 +0000 Subject: Added code for resource loading and fixed the bug having Amiga demo crashing. It is now limitedly playable, although graphics is still heavily messed up. svn-id: r26349 --- engines/parallaction/disk.cpp | 26 ++++++++++++++++++++++---- engines/parallaction/graphics.cpp | 4 +++- 2 files changed, 25 insertions(+), 5 deletions(-) (limited to 'engines/parallaction') diff --git a/engines/parallaction/disk.cpp b/engines/parallaction/disk.cpp index eaedcf5017..27d3cc137e 100644 --- a/engines/parallaction/disk.cpp +++ b/engines/parallaction/disk.cpp @@ -882,11 +882,29 @@ Cnv* AmigaDisk::loadFont(const char* name) { StaticCnv* AmigaDisk::loadStatic(const char* name) { debugC(1, kDebugDisk, "AmigaDisk::loadStatic '%s'", name); - if (!_archive.openArchivedFile(name)) - error("can't open static '%s' from archive", name); + Common::SeekableReadStream *s; + bool dispose = false; - DecrunchStream stream(_archive); - return makeStaticCnv(stream); + char path[PATH_LEN]; + sprintf(path, "%s.pp", name); + if (!_archive.openArchivedFile(path)) { + if (!_archive.openArchivedFile(name)) + error("can't open static '%s' from archive", name); + + s = &_archive; + } else { + DecrunchStream *stream = new DecrunchStream(_archive); + s = stream; + + dispose = true; + } + + StaticCnv *cnv = makeStaticCnv(*s); + + if (dispose) + delete s; + + return cnv; } Cnv* AmigaDisk::loadFrames(const char* name) { diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index 2565be1b06..7016c6039f 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -147,7 +147,7 @@ void Gfx::setBlackPalette() { // FIXME: the effect is different from the original // void Gfx::animatePalette() { -// printf("Gfx::animatePalette()\n"); +// printf("Gfx::animatePalette()\n"); byte tmp[3]; @@ -903,6 +903,8 @@ Gfx::Gfx(Parallaction* vm) : setBlackPalette(); + memset(_palettefx, 0, sizeof(_palettefx)); + initMouse( 0 ); _font = NULL; -- cgit v1.2.3