Add support for unpacked data files, in the PC version of PN.

svn-id: r40192
This commit is contained in:
Travis Howell 2009-04-29 05:41:44 +00:00
parent 9a78f6ef41
commit 6b962cda4e
3 changed files with 45 additions and 23 deletions

View File

@ -92,13 +92,14 @@ static const AGOSGameDescription gameDescriptions[] = {
GF_OLD_BUNDLE | GF_CRUNCHED | GF_PLANAR
},
// Personal Nightmare 1.1c - EGA English DOS Floppy
// Personal Nightmare 1.1c - EGA English DOS Floppy (Packed)
{
{
"pn",
"Floppy",
{
{ "01.out", GAME_ICONFILE, "3a2a4c3e07dfbc4b309deade0af37baf", -1},
{ "icon.out", GAME_ICONFILE, "40d8347c3154bfa8b642d6860a4b9481", -1},
{ "night.dbm", GAME_BASEFILE, "177311ae059243f6a2740e950585d786", -1},
{ "night.txt", GAME_TEXTFILE, "861fc1fa0864eef585f5865dee52e325", -1},
@ -114,6 +115,29 @@ static const AGOSGameDescription gameDescriptions[] = {
GF_OLD_BUNDLE | GF_CRUNCHED | GF_EGA | GF_PLANAR
},
// Personal Nightmare 1.1c - EGA English DOS Floppy (Unpacked)
{
{
"pn",
"Floppy",
{
{ "01.out", GAME_ICONFILE, "7f3e2a7a3aad016ad1bf540fcbe031ca", -1},
{ "icon.out", GAME_ICONFILE, "40d8347c3154bfa8b642d6860a4b9481", -1},
{ "night.dbm", GAME_BASEFILE, "177311ae059243f6a2740e950585d786", -1},
{ "night.txt", GAME_TEXTFILE, "861fc1fa0864eef585f5865dee52e325", -1},
{ NULL, 0, NULL, 0}
},
Common::EN_ANY,
Common::kPlatformPC,
ADGF_NO_FLAGS
},
GType_PN,
GID_PN,
GF_OLD_BUNDLE | GF_EGA | GF_PLANAR
},
// Elvira 1 - English Amiga Floppy Demo
{
{

View File

@ -892,29 +892,27 @@ void AGOSEngine::loadVGAVideoFile(uint16 id, uint8 type, bool useError) {
dst = allocBlock(dstSize + extraBuffer);
if (in.read(dst, dstSize) != dstSize)
error("loadVGAVideoFile: Read failed");
} else if (getGameType() == GType_PN && (getFeatures() & GF_CRUNCHED)) {
Common::Stack<uint32> data;
byte *dataOut = 0;
int dataOutSize = 0;
for (uint i = 0; i < srcSize / 4; ++i)
data.push(in.readUint32BE());
decompressPN(data, dataOut, dataOutSize);
dst = allocBlock (dataOutSize + extraBuffer);
memcpy(dst, dataOut, dataOutSize);
delete[] dataOut;
} else if (getFeatures() & GF_CRUNCHED) {
if (getGameType() == GType_PN) {
Common::Stack<uint32> data;
byte *dataOut = 0;
int dataOutSize = 0;
byte *srcBuffer = (byte *)malloc(srcSize);
if (in.read(srcBuffer, srcSize) != srcSize)
error("loadVGAVideoFile: Read failed");
for (uint i = 0; i < srcSize / 4; ++i)
data.push(in.readUint32BE());
decompressPN(data, dataOut, dataOutSize);
dst = allocBlock (dataOutSize + extraBuffer);
memcpy(dst, dataOut, dataOutSize);
delete[] dataOut;
} else {
byte *srcBuffer = (byte *)malloc(srcSize);
if (in.read(srcBuffer, srcSize) != srcSize)
error("loadVGAVideoFile: Read failed");
dstSize = READ_BE_UINT32(srcBuffer + srcSize - 4);
dst = allocBlock (dstSize + extraBuffer);
decrunchFile(srcBuffer, dst, srcSize);
free(srcBuffer);
}
dstSize = READ_BE_UINT32(srcBuffer + srcSize - 4);
dst = allocBlock (dstSize + extraBuffer);
decrunchFile(srcBuffer, dst, srcSize);
free(srcBuffer);
} else {
dst = allocBlock(dstSize + extraBuffer);
if (in.read(dst, dstSize) != dstSize)

View File

@ -390,7 +390,7 @@ bool AGOSEngine::loadVGASoundFile(uint16 id, uint8 type) {
}
dstSize = srcSize = in.size();
if (getGameType() == GType_PN) {
if (getGameType() == GType_PN && (getFeatures() & GF_CRUNCHED)) {
Common::Stack<uint32> data;
byte *dataOut = 0;
int dataOutSize = 0;