From 9fbe8481d8590ee61cc07a28e9bded3b440c3a3e Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Mon, 9 Oct 2006 01:56:51 +0000 Subject: Add conversion for planar graphics in Amiga version of Elvira 1/2 and Waxworks svn-id: r24242 --- engines/agos/agos.h | 2 ++ engines/agos/items.cpp | 6 ++++++ engines/agos/module.mk | 1 + engines/agos/res.cpp | 21 ++++++++++++++++----- 4 files changed, 25 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/agos/agos.h b/engines/agos/agos.h index bb81a85139..3519146224 100644 --- a/engines/agos/agos.h +++ b/engines/agos/agos.h @@ -1072,6 +1072,7 @@ public: void oe1_clearUserItem(); void oe1_findMaster(); void oe1_nextMaster(); + void oe1_menu(); void oe1_setTime(); void oe1_ifTime(); void oe1_bitClear(); @@ -1240,6 +1241,7 @@ protected: byte *getBackGround(); byte *getScaleBuf(); + void convertAmiga(byte *srcBuf, int32 flength); void loadVGAFile(uint id, uint type); void loadSimonVGAFile(uint id); diff --git a/engines/agos/items.cpp b/engines/agos/items.cpp index 4db5e802c3..8113633780 100644 --- a/engines/agos/items.cpp +++ b/engines/agos/items.cpp @@ -290,6 +290,7 @@ void AGOSEngine::setupElvira1Opcodes(OpcodeProc *op) { op[230] = &AGOSEngine::o_window; op[231] = &AGOSEngine::o_cls; op[232] = &AGOSEngine::o_closeWindow; + op[233] = &AGOSEngine::oe1_menu; op[235] = &AGOSEngine::o_addBox; op[236] = &AGOSEngine::o_delBox; @@ -2027,6 +2028,11 @@ void AGOSEngine::oe1_nextMaster() { _objectItem = nextMaster(levelOf(me()), item, ad, no); } +void AGOSEngine::oe1_menu() { + // 233: agos menu + // Used by Amiga demo +} + void AGOSEngine::oe1_bitClear() { // 251: set bit off int var = getVarOrWord(); diff --git a/engines/agos/module.mk b/engines/agos/module.mk index 8be332758a..e9f749ab6b 100644 --- a/engines/agos/module.mk +++ b/engines/agos/module.mk @@ -17,6 +17,7 @@ MODULE_OBJS := \ midiparser_s1d.o \ oracle.o \ res.o \ + res_ami.o \ rooms.o \ saveload.o \ sound.o \ diff --git a/engines/agos/res.cpp b/engines/agos/res.cpp index 4f4b699998..2c7f9b6a31 100644 --- a/engines/agos/res.cpp +++ b/engines/agos/res.cpp @@ -669,10 +669,14 @@ void AGOSEngine::loadVGAFile(uint id, uint type) { if (getFeatures() & GF_TALKIE) { sprintf(filename, "%.3d%d.out", id, type); } else if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2) { - if (getGameId() == GID_ELVIRA1DEMO) - sprintf(filename, "%.1d%d.out", id, type); - else + if (getGameId() == GID_ELVIRA1DEMO) { + if (id == 27) + sprintf(filename, "K%d.out", type); + else + sprintf(filename, "%.1d%d.out", id, type); + } else { sprintf(filename, "%.2d%d.pkd", id, type); + } } else { sprintf(filename, "%.3d%d.pkd", id, type); } @@ -693,8 +697,15 @@ void AGOSEngine::loadVGAFile(uint id, uint type) { error("loadVGAFile: Read failed"); dstSize = READ_BE_UINT32(srcBuffer + srcSize - 4); - dst = allocBlock (dstSize + extraBuffer); - decrunchFile(srcBuffer, dst, srcSize); + if (type == 2 && dstSize != 64800) { + dst = (byte *)malloc(dstSize); + decrunchFile(srcBuffer, dst, srcSize); + convertAmiga(dst, dstSize); + free(dst); + } else { + dst = allocBlock (dstSize + extraBuffer); + decrunchFile(srcBuffer, dst, srcSize); + } free(srcBuffer); } else { dst = allocBlock(dstSize + extraBuffer); -- cgit v1.2.3