mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-30 23:43:10 +00:00
Cleanup
svn-id: r24099
This commit is contained in:
parent
1dc5670022
commit
ab573e0c62
@ -1362,30 +1362,29 @@ TextLocation *AGOSEngine::getTextLocation(uint a) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void AGOSEngine::loadZone(uint vga_res) {
|
||||
void AGOSEngine::loadZone(uint zoneNum) {
|
||||
VgaPointersEntry *vpe;
|
||||
uint32 size;
|
||||
|
||||
CHECK_BOUNDS(vga_res, _vgaBufferPointers);
|
||||
CHECK_BOUNDS(zoneNum, _vgaBufferPointers);
|
||||
|
||||
vpe = _vgaBufferPointers + vga_res;
|
||||
vpe = _vgaBufferPointers + zoneNum;
|
||||
if (vpe->vgaFile1 != NULL)
|
||||
return;
|
||||
|
||||
// Loading order is important
|
||||
// due to resource managment
|
||||
|
||||
loadVGAFile(vga_res * 2, 2, size);
|
||||
loadVGAFile(zoneNum, 2);
|
||||
vpe->vgaFile2 = _block;
|
||||
vpe->vgaFile2End = _blockEnd;
|
||||
|
||||
loadVGAFile(vga_res * 2, 1, size);
|
||||
loadVGAFile(zoneNum, 1);
|
||||
vpe->vgaFile1 = _block;
|
||||
vpe->vgaFile1End = _blockEnd;
|
||||
|
||||
vpe->sfxFile = NULL;
|
||||
if (!(getFeatures() & GF_ZLIBCOMP)) {
|
||||
loadVGAFile(vga_res * 2, 3, size);
|
||||
loadVGAFile(zoneNum, 3);
|
||||
vpe->sfxFile = _block;
|
||||
vpe->sfxFileEnd = _blockEnd;
|
||||
}
|
||||
|
@ -728,7 +728,7 @@ protected:
|
||||
|
||||
void set_video_mode_internal(uint16 mode, uint16 vga_res_id);
|
||||
|
||||
void loadZone(uint vga_res);
|
||||
void loadZone(uint zoneNum);
|
||||
|
||||
void loadSprite(uint windowNum, uint vga_res, uint vga_sprite_id, uint x, uint y, uint palette);
|
||||
void playSpeech(uint speech_id, uint vga_sprite_id);
|
||||
@ -1136,8 +1136,8 @@ protected:
|
||||
byte *getBackGround();
|
||||
byte *getScaleBuf();
|
||||
|
||||
byte *loadVGAFile(uint id, uint type, uint32 &dstSize);
|
||||
void loadSimonVGAFile(uint vga_id);
|
||||
void loadVGAFile(uint id, uint type);
|
||||
void loadSimonVGAFile(uint id);
|
||||
|
||||
int init();
|
||||
int go();
|
||||
|
@ -554,24 +554,24 @@ static bool decrunchFile(byte *src, byte *dst, uint32 size) {
|
||||
#undef SD_TYPE_LITERAL
|
||||
#undef SD_TYPE_MATCH
|
||||
|
||||
void AGOSEngine::loadSimonVGAFile(uint vga_id) {
|
||||
void AGOSEngine::loadSimonVGAFile(uint id) {
|
||||
uint32 offs, size;
|
||||
|
||||
if (getFeatures() & GF_OLD_BUNDLE) {
|
||||
File in;
|
||||
char filename[15];
|
||||
if (vga_id == 23)
|
||||
vga_id = 112;
|
||||
if (vga_id == 328)
|
||||
vga_id = 119;
|
||||
if (id == 23)
|
||||
id = 112;
|
||||
else if (id == 328)
|
||||
id = 119;
|
||||
|
||||
if (getPlatform() == Common::kPlatformAmiga) {
|
||||
if (getFeatures() & GF_TALKIE)
|
||||
sprintf(filename, "0%d.out", vga_id);
|
||||
sprintf(filename, "0%d.out", id);
|
||||
else
|
||||
sprintf(filename, "0%d.pkd", vga_id);
|
||||
sprintf(filename, "0%d.pkd", id);
|
||||
} else {
|
||||
sprintf(filename, "0%d.VGA", vga_id);
|
||||
sprintf(filename, "0%d.VGA", id);
|
||||
}
|
||||
|
||||
in.open(filename);
|
||||
@ -591,18 +591,18 @@ void AGOSEngine::loadSimonVGAFile(uint vga_id) {
|
||||
}
|
||||
in.close();
|
||||
} else {
|
||||
offs = _gameOffsetsPtr[vga_id];
|
||||
offs = _gameOffsetsPtr[id];
|
||||
|
||||
size = _gameOffsetsPtr[vga_id + 1] - offs;
|
||||
size = _gameOffsetsPtr[id + 1] - offs;
|
||||
readGameFile(_vgaBufferPointers[11].vgaFile2, offs, size);
|
||||
}
|
||||
}
|
||||
|
||||
byte *AGOSEngine::loadVGAFile(uint id, uint type, uint32 &dstSize) {
|
||||
void AGOSEngine::loadVGAFile(uint id, uint type) {
|
||||
File in;
|
||||
char filename[15];
|
||||
byte *dst = NULL;
|
||||
uint32 file, offs, srcSize;
|
||||
uint32 file, offs, srcSize, dstSize;
|
||||
uint extraBuffer = 0;
|
||||
|
||||
if (getGameType() == GType_PP) {
|
||||
@ -618,11 +618,7 @@ byte *AGOSEngine::loadVGAFile(uint id, uint type, uint32 &dstSize) {
|
||||
}
|
||||
|
||||
if (getFeatures() & GF_ZLIBCOMP) {
|
||||
if (getPlatform() == Common::kPlatformAmiga) {
|
||||
loadOffsets((const char*)"gfxindex.dat", id / 2 * 3 + type, file, offs, srcSize, dstSize);
|
||||
} else {
|
||||
loadOffsets((const char*)"graphics.vga", id / 2 * 3 + type, file, offs, srcSize, dstSize);
|
||||
}
|
||||
loadOffsets(getFileName(GAME_GFXIDXFILE), id * 3 + type, file, offs, srcSize, dstSize);
|
||||
|
||||
if (getPlatform() == Common::kPlatformAmiga)
|
||||
sprintf(filename, "GFX%d.VGA", file);
|
||||
@ -634,52 +630,46 @@ byte *AGOSEngine::loadVGAFile(uint id, uint type, uint32 &dstSize) {
|
||||
} else if (getFeatures() & GF_OLD_BUNDLE) {
|
||||
if (getPlatform() == Common::kPlatformAmiga) {
|
||||
if (getFeatures() & GF_TALKIE)
|
||||
sprintf(filename, "%.3d%d.out", id / 2, type);
|
||||
sprintf(filename, "%.3d%d.out", id, type);
|
||||
else
|
||||
sprintf(filename, "%.3d%d.pkd", id / 2, type);
|
||||
sprintf(filename, "%.3d%d.pkd", id, type);
|
||||
} else {
|
||||
if (getGameType() == GType_ELVIRA || getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
|
||||
sprintf(filename, "%.2d%d.VGA", id / 2, type);
|
||||
sprintf(filename, "%.2d%d.VGA", id, type);
|
||||
} else {
|
||||
sprintf(filename, "%.3d%d.VGA", id / 2, type);
|
||||
sprintf(filename, "%.3d%d.VGA", id, type);
|
||||
}
|
||||
}
|
||||
|
||||
in.open(filename);
|
||||
if (in.isOpen() == false) {
|
||||
if (type == 3)
|
||||
return NULL;
|
||||
else
|
||||
error("loadVGAFile: Can't load %s", filename);
|
||||
}
|
||||
if (in.isOpen() == true) {
|
||||
dstSize = srcSize = in.size();
|
||||
if (getFeatures() & GF_CRUNCHED) {
|
||||
byte *srcBuffer = (byte *)malloc(srcSize);
|
||||
if (in.read(srcBuffer, srcSize) != srcSize)
|
||||
error("loadVGAFile: Read failed");
|
||||
|
||||
dstSize = srcSize = in.size();
|
||||
if (getFeatures() & GF_CRUNCHED) {
|
||||
byte *srcBuffer = (byte *)malloc(srcSize);
|
||||
if (in.read(srcBuffer, srcSize) != srcSize)
|
||||
error("loadVGAFile: Read failed");
|
||||
|
||||
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)
|
||||
error("loadVGAFile: Read failed");
|
||||
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)
|
||||
error("loadVGAFile: Read failed");
|
||||
}
|
||||
in.close();
|
||||
} else if (type != 3) {
|
||||
error("loadVGAFile: Can't load %s", filename);
|
||||
}
|
||||
in.close();
|
||||
} else {
|
||||
id += (type - 1);
|
||||
id = id * 2 + (type - 1);
|
||||
offs = _gameOffsetsPtr[id];
|
||||
|
||||
dstSize = _gameOffsetsPtr[id + 1] - offs;
|
||||
dst = allocBlock(dstSize + extraBuffer);
|
||||
readGameFile(dst, offs, dstSize);
|
||||
}
|
||||
|
||||
dstSize += extraBuffer;
|
||||
return dst;
|
||||
}
|
||||
|
||||
static const char *dimpSoundList[32] = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user