aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/res.cpp
diff options
context:
space:
mode:
authorTravis Howell2006-10-21 01:51:59 +0000
committerTravis Howell2006-10-21 01:51:59 +0000
commit399f8381a970133a6a6247d49eaf57b7a811d902 (patch)
tree8617f9222657de3cbb0fa90aa05e46ae3ef7ba34 /engines/agos/res.cpp
parent4e859bb26ea6b75f954f3b5b155eea74104dbfa1 (diff)
downloadscummvm-rg350-399f8381a970133a6a6247d49eaf57b7a811d902.tar.gz
scummvm-rg350-399f8381a970133a6a6247d49eaf57b7a811d902.tar.bz2
scummvm-rg350-399f8381a970133a6a6247d49eaf57b7a811d902.zip
Cleanup
svn-id: r24397
Diffstat (limited to 'engines/agos/res.cpp')
-rw-r--r--engines/agos/res.cpp197
1 files changed, 0 insertions, 197 deletions
diff --git a/engines/agos/res.cpp b/engines/agos/res.cpp
index 2b68d3d0ec..68b7ab5fe9 100644
--- a/engines/agos/res.cpp
+++ b/engines/agos/res.cpp
@@ -756,201 +756,4 @@ void AGOSEngine::loadVGAVideoFile(uint id, uint type) {
}
}
-static const byte elvira1_soundTable[100] = {
- 0, 2, 0, 1, 0, 0, 0, 0, 0, 3,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 6, 4, 0, 0, 9, 0,
- 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 8, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 0, 0, 5, 0, 6, 6, 0, 0,
- 0, 5, 0, 0, 6, 0, 0, 0, 0, 8,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-bool AGOSEngine::loadVGASoundFile(uint id, uint type) {
- File in;
- char filename[15];
- byte *dst;
- uint32 srcSize, dstSize;
-
- if (getPlatform() == Common::kPlatformAmiga || getPlatform() == Common::kPlatformAtariST) {
- if (getGameType() == GType_ELVIRA1 && getFeatures() & GF_DEMO) {
- if (id == 20)
- sprintf(filename, "D%d.out", type);
- else if (id == 26)
- sprintf(filename, "J%d.out", type);
- else if (id == 27)
- sprintf(filename, "K%d.out", type);
- else if (id == 33)
- sprintf(filename, "Q%d.out", type);
- else if (id == 34)
- sprintf(filename, "R%d.out", type);
- else
- sprintf(filename, "%.1d%d.out", id, type);
- } else if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2) {
- sprintf(filename, "%.2d%d.out", id, type);
- } else {
- sprintf(filename, "%.3d%d.out", id, type);
- }
- } else {
- if (getGameType() == GType_ELVIRA1) {
- if (elvira1_soundTable[id] == 0)
- return false;
-
- sprintf(filename, "%.2d.SND", elvira1_soundTable[id]);
- } else if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
- sprintf(filename, "%.2d%d.VGA", id, type);
- } else {
- sprintf(filename, "%.3d%d.VGA", id, type);
- }
- }
-
- in.open(filename);
- if (in.isOpen() == false || in.size() == 0) {
- return false;
- }
-
- dstSize = srcSize = in.size();
- if (getGameType() == GType_ELVIRA1 && getFeatures() & GF_DEMO) {
- byte *srcBuffer = (byte *)malloc(srcSize);
- if (in.read(srcBuffer, srcSize) != srcSize)
- error("loadVGASoundFile: Read failed");
-
- dstSize = READ_BE_UINT32(srcBuffer + srcSize - 4);
- dst = allocBlock (dstSize);
- decrunchFile(srcBuffer, dst, srcSize);
- free(srcBuffer);
- } else {
- dst = allocBlock(dstSize);
- if (in.read(dst, dstSize) != dstSize)
- error("loadVGASoundFile: Read failed");
- }
- in.close();
-
- return true;
-}
-
-static const char *dimpSoundList[32] = {
- "Beep",
- "Birth",
- "Boiling",
- "Burp",
- "Cough",
- "Die1",
- "Die2",
- "Fart",
- "Inject",
- "Killchik",
- "Puke",
- "Lights",
- "Shock",
- "Snore",
- "Snotty",
- "Whip",
- "Whistle",
- "Work1",
- "Work2",
- "Yawn",
- "And0w",
- "And0x",
- "And0y",
- "And0z",
- "And10",
- "And11",
- "And12",
- "And13",
- "And14",
- "And15",
- "And16",
- "And17",
-};
-
-
-void AGOSEngine::loadSound(uint sound, int pan, int vol, uint type) {
- byte *dst;
-
- if (getGameId() == GID_DIMP) {
- File in;
- char filename[15];
-
- assert(sound >= 1 && sound <= 32);
- sprintf(filename, "%s.wav", dimpSoundList[sound - 1]);
-
- in.open(filename);
- if (in.isOpen() == false)
- error("loadSound: Can't load %s", filename);
-
- uint32 dstSize = in.size();
- dst = (byte *)malloc(dstSize);
- if (in.read(dst, dstSize) != dstSize)
- error("loadSound: Read failed");
- in.close();
- } else if (getFeatures() & GF_ZLIBCOMP) {
- char filename[15];
-
- uint32 file, offset, srcSize, dstSize;
- if (getPlatform() == Common::kPlatformAmiga) {
- loadOffsets((const char*)"sfxindex.dat", _zoneNumber * 22 + sound, file, offset, srcSize, dstSize);
- } else {
- loadOffsets((const char*)"effects.wav", _zoneNumber * 22 + sound, file, offset, srcSize, dstSize);
- }
-
- if (getPlatform() == Common::kPlatformAmiga)
- sprintf(filename, "sfx%d.wav", file);
- else
- sprintf(filename, "effects.wav");
-
- dst = (byte *)malloc(dstSize);
- decompressData(filename, dst, offset, srcSize, dstSize);
- } else {
- if (!_curSfxFile)
- error("loadSound: Can't load sound data file '%d3.VGA'", _zoneNumber);
-
- dst = _curSfxFile + READ_LE_UINT32(_curSfxFile + sound * 4);
- }
-
- if (type == 3)
- _sound->playSfx5Data(dst, sound, pan, vol);
- else if (type == 2)
- _sound->playAmbientData(dst, sound, pan, vol);
- else
- _sound->playSfxData(dst, sound, pan, vol);
-}
-
-void AGOSEngine::loadVoice(uint speechId) {
- if (getGameType() == GType_PP && speechId == 99) {
- _sound->stopVoice();
- return;
- }
-
- if (getFeatures() & GF_ZLIBCOMP) {
- char filename[15];
-
- uint32 file, offset, srcSize, dstSize;
- if (getPlatform() == Common::kPlatformAmiga) {
- loadOffsets((const char*)"spindex.dat", speechId, file, offset, srcSize, dstSize);
- } else {
- loadOffsets((const char*)"speech.wav", speechId, file, offset, srcSize, dstSize);
- }
-
- // Voice segment doesn't exist
- if (offset == 0xFFFFFFFF && srcSize == 0xFFFFFFFF && dstSize == 0xFFFFFFFF) {
- debug(0, "loadVoice: speechId %d removed", speechId);
- return;
- }
-
- if (getPlatform() == Common::kPlatformAmiga)
- sprintf(filename, "sp%d.wav", file);
- else
- sprintf(filename, "speech.wav");
-
- byte *dst = (byte *)malloc(dstSize);
- decompressData(filename, dst, offset, srcSize, dstSize);
- _sound->playVoiceData(dst, speechId);
- } else {
- _sound->playVoice(speechId);
- }
-}
-
} // End of namespace AGOS