aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Turner2012-02-24 09:59:27 -0800
committerDavid Turner2012-02-24 09:59:27 -0800
commit62b01525f00186dd8088452ba2ed3f82948f070e (patch)
tree33f25803ebfb1ab9cbdd33f5487a15c6a5317dab
parent30fa5e166379b9e0764b437c6925c22d908d7122 (diff)
parent966210b56dbe9a37ffde1fb0b46cc794ffed0562 (diff)
downloadscummvm-rg350-62b01525f00186dd8088452ba2ed3f82948f070e.tar.gz
scummvm-rg350-62b01525f00186dd8088452ba2ed3f82948f070e.tar.bz2
scummvm-rg350-62b01525f00186dd8088452ba2ed3f82948f070e.zip
Merge pull request #200 from digitall/dreamwebDatafilePrefix
DREAMWEB: Addition of Shared Datafile Prefix String to Engine
-rw-r--r--engines/dreamweb/dreamweb.cpp2
-rw-r--r--engines/dreamweb/dreamweb.h13
-rw-r--r--engines/dreamweb/keypad.cpp24
-rw-r--r--engines/dreamweb/monitor.cpp26
-rw-r--r--engines/dreamweb/newplace.cpp8
-rw-r--r--engines/dreamweb/people.cpp2
-rw-r--r--engines/dreamweb/saveload.cpp2
-rw-r--r--engines/dreamweb/sound.cpp7
-rw-r--r--engines/dreamweb/stubs.cpp33
-rw-r--r--engines/dreamweb/titles.cpp20
-rw-r--r--engines/dreamweb/vgagrafx.cpp5
11 files changed, 75 insertions, 67 deletions
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index 2ee20210ba..4ed6ef7c15 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -62,6 +62,8 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam
_channel0 = 0;
_channel1 = 0;
+ _datafilePrefix = Common::String("DREAMWEB.");
+
_openChangeSize = kInventx+(4*kItempicsize);
_quitRequested = false;
diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h
index 6d7253da65..e80b5538ad 100644
--- a/engines/dreamweb/dreamweb.h
+++ b/engines/dreamweb/dreamweb.h
@@ -142,7 +142,7 @@ public:
void quit();
- void loadSounds(uint bank, const Common::String &file);
+ void loadSounds(uint bank, const Common::String &suffix);
bool loadSpeech(const Common::String &filename);
void enableSavingOrLoading(bool enable = true) { _enableSavingOrLoading = enable; }
@@ -152,6 +152,8 @@ public:
void stopSound(uint8 channel);
+ const Common::String& getDatafilePrefix() { return _datafilePrefix; };
+
private:
void keyPressed(uint16 ascii);
void setSpeed(uint speed);
@@ -160,6 +162,7 @@ private:
const DreamWebGameDescription *_gameDescription;
Common::RandomSource _rnd;
+ Common::String _datafilePrefix;
uint _speed;
bool _turbo;
@@ -805,12 +808,12 @@ public:
const uint8 *getTextInFile1(uint16 index);
uint8 findNextColon(const uint8 **string);
void allocateBuffers();
- void loadTextFile(TextFile &file, const char *fileName);
- void loadGraphicsFile(GraphicsFile &file, const char *fileName);
+ void loadTextFile(TextFile &file, const char *suffix);
+ void loadGraphicsFile(GraphicsFile &file, const char *suffix);
void loadGraphicsSegment(GraphicsFile &file, Common::File &inFile, unsigned int len);
void loadTextSegment(TextFile &file, Common::File &inFile, unsigned int len);
void loadTravelText();
- void loadTempText(const char *fileName);
+ void loadTempText(const char *suffix);
void sortOutMap();
void loadRoomData(const Room &room, bool skipDat);
void useTempCharset(GraphicsFile *charset);
@@ -1133,7 +1136,7 @@ public:
void doShake();
void vSync();
void setMode();
- void showPCX(const Common::String &name);
+ void showPCX(const Common::String &suffix);
void showFrameInternal(const uint8 *pSrc, uint16 x, uint16 y, uint8 effectsFlag, uint8 width, uint8 height);
void showFrame(const GraphicsFile &frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height);
void showFrame(const GraphicsFile &frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag);
diff --git a/engines/dreamweb/keypad.cpp b/engines/dreamweb/keypad.cpp
index 172e85104f..2ab5835997 100644
--- a/engines/dreamweb/keypad.cpp
+++ b/engines/dreamweb/keypad.cpp
@@ -108,7 +108,7 @@ bool DreamWebEngine::isItRight(uint8 digit0, uint8 digit1, uint8 digit2, uint8 d
}
void DreamWebEngine::loadKeypad() {
- loadGraphicsFile(_keypadGraphics, "DREAMWEB.G02");
+ loadGraphicsFile(_keypadGraphics, "G02");
}
void DreamWebEngine::quitKey() {
@@ -293,8 +293,8 @@ void DreamWebEngine::showMenu() {
}
void DreamWebEngine::loadMenu() {
- loadGraphicsFile(_menuGraphics, "DREAMWEB.S02"); // sprite name 3
- loadGraphicsFile(_menuGraphics2, "DREAMWEB.G07"); // mon. graphics 2
+ loadGraphicsFile(_menuGraphics, "S02"); // sprite name 3
+ loadGraphicsFile(_menuGraphics2, "G07"); // mon. graphics 2
}
void DreamWebEngine::viewFolder() {
@@ -394,11 +394,11 @@ void DreamWebEngine::checkFolderCoords() {
}
void DreamWebEngine::loadFolder() {
- loadGraphicsFile(_folderGraphics, "DREAMWEB.G09"); // folder graphics 1
- loadGraphicsFile(_folderGraphics2, "DREAMWEB.G10"); // folder graphics 2
- loadGraphicsFile(_folderGraphics3, "DREAMWEB.G11"); // folder graphics 3
- loadGraphicsFile(_folderCharset, "DREAMWEB.C02"); // character set 3
- loadTempText("DREAMWEB.T50"); // folder text
+ loadGraphicsFile(_folderGraphics, "G09"); // folder graphics 1
+ loadGraphicsFile(_folderGraphics2, "G10"); // folder graphics 2
+ loadGraphicsFile(_folderGraphics3, "G11"); // folder graphics 3
+ loadGraphicsFile(_folderCharset, "C02"); // character set 3
+ loadTempText("T50"); // folder text
}
void DreamWebEngine::showFolder() {
@@ -491,7 +491,7 @@ void DreamWebEngine::showRightPage() {
void DreamWebEngine::enterSymbol() {
_manIsOffScreen = 1;
getRidOfReels();
- loadGraphicsFile(_symbolGraphics, "DREAMWEB.G12"); // symbol graphics
+ loadGraphicsFile(_symbolGraphics, "G12"); // symbol graphics
_symbolTopX = 24;
_symbolTopDir = 0;
_symbolBotX = 24;
@@ -716,9 +716,9 @@ void DreamWebEngine::updateSymbolBot() {
void DreamWebEngine::useDiary() {
getRidOfReels();
- loadGraphicsFile(_diaryGraphics, "DREAMWEB.G14");
- loadTempText("DREAMWEB.T51");
- loadGraphicsFile(_diaryCharset, "DREAMWEB.C02");
+ loadGraphicsFile(_diaryGraphics, "G14");
+ loadTempText("T51");
+ loadGraphicsFile(_diaryCharset, "C02");
createPanel();
showIcon();
showDiary();
diff --git a/engines/dreamweb/monitor.cpp b/engines/dreamweb/monitor.cpp
index f5f064f855..cdef60e94d 100644
--- a/engines/dreamweb/monitor.cpp
+++ b/engines/dreamweb/monitor.cpp
@@ -54,11 +54,11 @@ void DreamWebEngine::useMon() {
showIcon();
drawFloor();
getRidOfAll();
- loadGraphicsFile(_monitorGraphics, "DREAMWEB.G03"); // mon. graphic name
+ loadGraphicsFile(_monitorGraphics, "G03"); // mon. graphic name
loadPersonal();
loadNews();
loadCart();
- loadGraphicsFile(_monitorCharset, "DREAMWEB.C01"); // character set 2
+ loadGraphicsFile(_monitorCharset, "C01"); // character set 2
printOuterMon();
initialMonCols();
printLogo();
@@ -383,21 +383,21 @@ void DreamWebEngine::printOuterMon() {
void DreamWebEngine::loadPersonal() {
if (_vars._location == 0 || _vars._location == 42)
- loadTextFile(_textFile1, "DREAMWEB.T01"); // monitor file 1
+ loadTextFile(_textFile1, "T01"); // monitor file 1
else
- loadTextFile(_textFile1, "DREAMWEB.T02"); // monitor file 2
+ loadTextFile(_textFile1, "T02"); // monitor file 2
}
void DreamWebEngine::loadNews() {
// textfile2 holds information accessible by anyone
if (_vars._newsItem == 0)
- loadTextFile(_textFile2, "DREAMWEB.T10"); // monitor file 10
+ loadTextFile(_textFile2, "T10"); // monitor file 10
else if (_vars._newsItem == 1)
- loadTextFile(_textFile2, "DREAMWEB.T11"); // monitor file 11
+ loadTextFile(_textFile2, "T11"); // monitor file 11
else if (_vars._newsItem == 2)
- loadTextFile(_textFile2, "DREAMWEB.T12"); // monitor file 12
+ loadTextFile(_textFile2, "T12"); // monitor file 12
else
- loadTextFile(_textFile2, "DREAMWEB.T13"); // monitor file 13
+ loadTextFile(_textFile2, "T13"); // monitor file 13
}
void DreamWebEngine::loadCart() {
@@ -408,15 +408,15 @@ void DreamWebEngine::loadCart() {
cartridgeId = getExAd(cartridgeIndex)->objId[3] + 1;
if (cartridgeId == 0)
- loadTextFile(_textFile3, "DREAMWEB.T20"); // monitor file 20
+ loadTextFile(_textFile3, "T20"); // monitor file 20
else if (cartridgeId == 1)
- loadTextFile(_textFile3, "DREAMWEB.T21"); // monitor file 21
+ loadTextFile(_textFile3, "T21"); // monitor file 21
else if (cartridgeId == 2)
- loadTextFile(_textFile3, "DREAMWEB.T22"); // monitor file 22
+ loadTextFile(_textFile3, "T22"); // monitor file 22
else if (cartridgeId == 3)
- loadTextFile(_textFile3, "DREAMWEB.T23"); // monitor file 23
+ loadTextFile(_textFile3, "T23"); // monitor file 23
else
- loadTextFile(_textFile3, "DREAMWEB.T24"); // monitor file 24
+ loadTextFile(_textFile3, "T24"); // monitor file 24
}
void DreamWebEngine::showKeys() {
diff --git a/engines/dreamweb/newplace.cpp b/engines/dreamweb/newplace.cpp
index c484855da4..529c45bd4a 100644
--- a/engines/dreamweb/newplace.cpp
+++ b/engines/dreamweb/newplace.cpp
@@ -259,13 +259,13 @@ void DreamWebEngine::resetLocation(uint8 index) {
}
void DreamWebEngine::readDestIcon() {
- loadGraphicsFile(_newplaceGraphics, "DREAMWEB.G05");
- loadGraphicsFile(_newplaceGraphics2, "DREAMWEB.G06");
- loadGraphicsFile(_newplaceGraphics3, "DREAMWEB.G08");
+ loadGraphicsFile(_newplaceGraphics, "G05");
+ loadGraphicsFile(_newplaceGraphics2, "G06");
+ loadGraphicsFile(_newplaceGraphics3, "G08");
}
void DreamWebEngine::readCityPic() {
- loadGraphicsFile(_cityGraphics, "DREAMWEB.G04");
+ loadGraphicsFile(_cityGraphics, "G04");
}
} // End of namespace DreamWeb
diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp
index 1b8ee1b4de..316a1689c9 100644
--- a/engines/dreamweb/people.cpp
+++ b/engines/dreamweb/people.cpp
@@ -178,7 +178,7 @@ void DreamWebEngine::madman(ReelRoutine &routine) {
return;
}
if (newReelPointer == 10) {
- loadTempText("DREAMWEB.T82");
+ loadTempText("T82");
_vars._combatCount = (uint8)-1;
_speechCount = 0;
}
diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp
index acc76572ef..a526c8a3bc 100644
--- a/engines/dreamweb/saveload.cpp
+++ b/engines/dreamweb/saveload.cpp
@@ -708,7 +708,7 @@ void DreamWebEngine::showDecisions() {
}
void DreamWebEngine::loadSaveBox() {
- loadGraphicsFile(_saveGraphics, "DREAMWEB.G08");
+ loadGraphicsFile(_saveGraphics, "G08");
}
// show savegame names (original interface), and set kCursorpos
diff --git a/engines/dreamweb/sound.cpp b/engines/dreamweb/sound.cpp
index b79be28cea..b51527a8cd 100644
--- a/engines/dreamweb/sound.cpp
+++ b/engines/dreamweb/sound.cpp
@@ -89,7 +89,7 @@ void DreamWebEngine::loadRoomsSample() {
return; // loaded already
assert(sample < 100);
- Common::String sampleName = Common::String::format("DREAMWEB.V%02d", sample);
+ Common::String sampleSuffix = Common::String::format("V%02d", sample);
_currentSample = sample;
uint8 ch0 = _channel0Playing;
@@ -98,7 +98,7 @@ void DreamWebEngine::loadRoomsSample() {
uint8 ch1 = _channel1Playing;
if (ch1 >= 12)
cancelCh1();
- loadSounds(1, sampleName.c_str());
+ loadSounds(1, sampleSuffix.c_str());
}
} // End of namespace DreamWeb
@@ -240,7 +240,8 @@ void DreamWebEngine::soundHandler() {
}
-void DreamWebEngine::loadSounds(uint bank, const Common::String &filename) {
+void DreamWebEngine::loadSounds(uint bank, const Common::String &suffix) {
+ Common::String filename = getDatafilePrefix() + suffix;
debug(1, "loadSounds(%u, %s)", bank, filename.c_str());
Common::File file;
if (!file.open(filename)) {
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 763bcb88fe..8e63774317 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -579,7 +579,7 @@ void DreamWebEngine::dreamweb() {
readSetData();
_wonGame = false;
- loadSounds(0, "DREAMWEB.V99"); // basic sample
+ loadSounds(0, "V99"); // basic sample
bool firstLoop = true;
@@ -728,8 +728,8 @@ void DreamWebEngine::dreamweb() {
}
}
-void DreamWebEngine::loadTextFile(TextFile &file, const char *fileName)
-{
+void DreamWebEngine::loadTextFile(TextFile &file, const char *suffix) {
+ Common::String fileName = getDatafilePrefix() + suffix;
FileHeader header;
Common::File f;
@@ -834,7 +834,8 @@ void DreamWebEngine::switchRyanOff() {
_vars._ryanOn = 1;
}
-void DreamWebEngine::loadGraphicsFile(GraphicsFile &file, const char *fileName) {
+void DreamWebEngine::loadGraphicsFile(GraphicsFile &file, const char *suffix) {
+ Common::String fileName = getDatafilePrefix() + suffix;
FileHeader header;
Common::File f;
@@ -1991,16 +1992,16 @@ void DreamWebEngine::loadRoom() {
}
void DreamWebEngine::readSetData() {
- loadGraphicsFile(_charset1, "DREAMWEB.C00");
- loadGraphicsFile(_icons1, "DREAMWEB.G00");
- loadGraphicsFile(_icons2, "DREAMWEB.G01");
- loadGraphicsFile(_mainSprites, "DREAMWEB.S00");
- loadTextFile(_puzzleText, "DREAMWEB.T80");
- loadTextFile(_commandText, "DREAMWEB.T84");
+ loadGraphicsFile(_charset1, "C00");
+ loadGraphicsFile(_icons1, "G00");
+ loadGraphicsFile(_icons2, "G01");
+ loadGraphicsFile(_mainSprites, "S00");
+ loadTextFile(_puzzleText, "T80");
+ loadTextFile(_commandText, "T84");
useCharset1();
// FIXME: Why is this commented out?
- //openFile("DREAMWEB.VOL");
+ //openFile(getDatafilePrefix() + "VOL");
//uint8 *volumeTab = getSegment(data.word(kSoundbuffer)).ptr(16384, 0);
//readFromFile(volumeTab, 2048-256);
//closeFile();
@@ -2235,11 +2236,11 @@ const uint8 *DreamWebEngine::getTextInFile1(uint16 index) {
}
void DreamWebEngine::loadTravelText() {
- loadTextFile(_travelText, "DREAMWEB.T81"); // location descs
+ loadTextFile(_travelText, "T81"); // location descs
}
-void DreamWebEngine::loadTempText(const char *fileName) {
- loadTextFile(_textFile1, fileName);
+void DreamWebEngine::loadTempText(const char *suffix) {
+ loadTextFile(_textFile1, suffix);
}
void DreamWebEngine::drawFloor() {
@@ -2780,7 +2781,7 @@ void DreamWebEngine::showGun() {
loadRoomsSample();
_volume = 0;
GraphicsFile graphics;
- loadGraphicsFile(graphics, "DREAMWEB.G13");
+ loadGraphicsFile(graphics, "G13");
createPanel2();
showFrame(graphics, 100, 4, 0, 0);
showFrame(graphics, 158, 106, 1, 0);
@@ -2789,7 +2790,7 @@ void DreamWebEngine::showGun() {
fadeScreenUp();
hangOn(160);
playChannel0(12, 0);
- loadTempText("DREAMWEB.T83");
+ loadTempText("T83");
rollEndCreditsGameLost();
getRidOfTempText();
}
diff --git a/engines/dreamweb/titles.cpp b/engines/dreamweb/titles.cpp
index f4112f71f6..f7486ce687 100644
--- a/engines/dreamweb/titles.cpp
+++ b/engines/dreamweb/titles.cpp
@@ -26,7 +26,7 @@
namespace DreamWeb {
void DreamWebEngine::endGame() {
- loadTempText("DREAMWEB.T83");
+ loadTempText("T83");
monkSpeaking();
if (_quitRequested)
return;
@@ -41,7 +41,7 @@ void DreamWebEngine::monkSpeaking() {
_roomsSample = 35;
loadRoomsSample();
GraphicsFile graphics;
- loadGraphicsFile(graphics, "DREAMWEB.G15");
+ loadGraphicsFile(graphics, "G15");
clearWork();
showFrame(graphics, 160, 72, 0, 128); // show monk
workToScreen();
@@ -104,7 +104,7 @@ void DreamWebEngine::gettingShot() {
void DreamWebEngine::bibleQuote() {
initGraphics(640, 480, true);
- showPCX("DREAMWEB.I00");
+ showPCX("I00");
fadeScreenUps();
hangOne(80);
@@ -141,7 +141,7 @@ void DreamWebEngine::hangOne(uint16 delay) {
}
void DreamWebEngine::intro() {
- loadTempText("DREAMWEB.T82");
+ loadTempText("T82");
loadPalFromIFF();
setMode();
_newLocation = 50;
@@ -292,7 +292,7 @@ void DreamWebEngine::realCredits() {
initGraphics(640, 480, true);
hangOn(35);
- showPCX("DREAMWEB.I01");
+ showPCX("I01");
playChannel0(12, 0);
hangOne(2);
@@ -318,7 +318,7 @@ void DreamWebEngine::realCredits() {
return; // "realcreditsearly"
}
- showPCX("DREAMWEB.I02");
+ showPCX("I02");
playChannel0(12, 0);
hangOne(2);
@@ -343,7 +343,7 @@ void DreamWebEngine::realCredits() {
return; // "realcreditsearly"
}
- showPCX("DREAMWEB.I03");
+ showPCX("I03");
playChannel0(12, 0);
hangOne(2);
@@ -368,7 +368,7 @@ void DreamWebEngine::realCredits() {
return; // "realcreditsearly"
}
- showPCX("DREAMWEB.I04");
+ showPCX("I04");
playChannel0(12, 0);
hangOne(2);
@@ -393,7 +393,7 @@ void DreamWebEngine::realCredits() {
return; // "realcreditsearly"
}
- showPCX("DREAMWEB.I05");
+ showPCX("I05");
playChannel0(12, 0);
hangOne(2);
@@ -418,7 +418,7 @@ void DreamWebEngine::realCredits() {
return; // "realcreditsearly"
}
- showPCX("DREAMWEB.I06");
+ showPCX("I06");
fadeScreenUps();
hangOne(60);
diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp
index 26b5e60b9d..be7d210999 100644
--- a/engines/dreamweb/vgagrafx.cpp
+++ b/engines/dreamweb/vgagrafx.cpp
@@ -153,7 +153,8 @@ void DreamWebEngine::setMode() {
initGraphics(320, 200, false);
}
-void DreamWebEngine::showPCX(const Common::String &name) {
+void DreamWebEngine::showPCX(const Common::String &suffix) {
+ Common::String name = getDatafilePrefix() + suffix;
Common::File pcxFile;
if (!pcxFile.open(name)) {
@@ -408,7 +409,7 @@ bool DreamWebEngine::pixelCheckSet(const ObjPos *pos, uint8 x, uint8 y) {
void DreamWebEngine::loadPalFromIFF() {
Common::File palFile;
uint8* buf = new uint8[2000];
- palFile.open("DREAMWEB.PAL");
+ palFile.open(getDatafilePrefix() + "PAL");
palFile.read(buf, 2000);
palFile.close();