diff options
author | Max Horn | 2004-06-27 21:52:25 +0000 |
---|---|---|
committer | Max Horn | 2004-06-27 21:52:25 +0000 |
commit | df984b3824c596c7f7e6a12e33bbbe0b2b470586 (patch) | |
tree | d477d1a4d47ace1604a477a9bfb308632ffecdda | |
parent | a1b82d8e13ca41834c494839c2a05ae7638a38c3 (diff) | |
download | scummvm-rg350-df984b3824c596c7f7e6a12e33bbbe0b2b470586.tar.gz scummvm-rg350-df984b3824c596c7f7e6a12e33bbbe0b2b470586.tar.bz2 scummvm-rg350-df984b3824c596c7f7e6a12e33bbbe0b2b470586.zip |
Thanks to File::setDefaultDirectory(), in most cases it is *not* necessary to pass getGameDataPath() on to File::open()
svn-id: r14087
-rw-r--r-- | queen/talk.cpp | 2 | ||||
-rw-r--r-- | scumm/charset.cpp | 2 | ||||
-rw-r--r-- | scumm/insane/insane.cpp | 14 | ||||
-rw-r--r-- | scumm/nut_renderer.cpp | 12 | ||||
-rw-r--r-- | scumm/nut_renderer.h | 2 | ||||
-rw-r--r-- | scumm/resource.cpp | 2 | ||||
-rw-r--r-- | scumm/resource_v3.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v6.cpp | 4 | ||||
-rw-r--r-- | scumm/script_v8.cpp | 2 | ||||
-rw-r--r-- | scumm/scumm.cpp | 4 | ||||
-rw-r--r-- | scumm/smush/chunk.cpp | 8 | ||||
-rw-r--r-- | scumm/smush/chunk.h | 2 | ||||
-rw-r--r-- | scumm/smush/smush_player.cpp | 42 | ||||
-rw-r--r-- | scumm/smush/smush_player.h | 8 |
14 files changed, 53 insertions, 53 deletions
diff --git a/queen/talk.cpp b/queen/talk.cpp index 17421e4e2d..4fd8779664 100644 --- a/queen/talk.cpp +++ b/queen/talk.cpp @@ -384,7 +384,7 @@ byte *Talk::loadDialogFile(const char *filename) { if (!scumm_stricmp(filename, dogFiles[i].filename) && _vm->resource()->getLanguage() == dogFiles[i].lang) { File fdog; - fdog.open(filename, _vm->getGameDataPath()); + fdog.open(filename); if (fdog.isOpen()) { debug(6, "Loading dog file '%s' from game data path", filename); uint32 size = fdog.size() - DOG_HEADER_SIZE; diff --git a/scumm/charset.cpp b/scumm/charset.cpp index dec2790b72..43b9b6cdd4 100644 --- a/scumm/charset.cpp +++ b/scumm/charset.cpp @@ -1229,7 +1229,7 @@ CharsetRendererNut::CharsetRendererNut(ScummEngine *vm) break; sprintf(fontname, "font%d.nut", i); _fr[i] = new NutRenderer(_vm); - if (!(_fr[i]->loadFont(fontname, _vm->getGameDataPath()))) { + if (!(_fr[i]->loadFont(fontname))) { delete _fr[i]; _fr[i] = NULL; } diff --git a/scumm/insane/insane.cpp b/scumm/insane/insane.cpp index 7135f846d8..f98cb83f3a 100644 --- a/scumm/insane/insane.cpp +++ b/scumm/insane/insane.cpp @@ -71,15 +71,15 @@ Insane::Insane(ScummEngine_v6 *scumm) { readFileToMem("minedriv.flu", &_smush_minedrivFlu); readFileToMem("minefite.flu", &_smush_minefiteFlu); _smush_bensgoggNut = new NutRenderer(_vm); - _smush_bensgoggNut->loadFont("bensgogg.nut", _vm->getGameDataPath()); + _smush_bensgoggNut->loadFont("bensgogg.nut"); _smush_bencutNut = new NutRenderer(_vm); - _smush_bencutNut->loadFont("bencut.nut", _vm->getGameDataPath()); + _smush_bencutNut->loadFont("bencut.nut"); } _smush_iconsNut = new NutRenderer(_vm); - _smush_iconsNut->loadFont("icons.nut", _vm->getGameDataPath()); + _smush_iconsNut->loadFont("icons.nut"); _smush_icons2Nut = new NutRenderer(_vm); - _smush_icons2Nut->loadFont("icons2.nut", _vm->getGameDataPath()); + _smush_icons2Nut->loadFont("icons2.nut"); } Insane::~Insane(void) { @@ -591,7 +591,7 @@ void Insane::readFileToMem(const char *name, byte **buf) { uint32 len; in = new File(); - in->open(name, _vm->getGameDataPath()); + in->open(name); len = in->size(); *buf = (byte *)malloc(len); in->read(*buf, len); @@ -615,7 +615,7 @@ void Insane::startVideo(const char *filename, int num, int argC, int frameRate, smush_setupSanFromStart(filename, 0, -1, -1, 0); } - _player->play(filename, _vm->getGameDataPath(), offset, startFrame); + _player->play(filename, offset, startFrame); } void Insane::smush_warpMouse(int x, int y, int buttons) { @@ -1447,7 +1447,7 @@ void Insane::smush_setFrameSteps(int32 step1, int32 step2) { void Insane::smush_setupSanFile(const char *filename, int32 offset, int32 contFrame) { debugC(DEBUG_INSANE, "Insane::smush_setupSanFile(%s, %x, %d)", filename, offset, contFrame); - _player->seekSan(filename, _vm->getGameDataPath(), offset, contFrame); + _player->seekSan(filename, offset, contFrame); _vm->_imuseDigital->pause(false); } diff --git a/scumm/nut_renderer.cpp b/scumm/nut_renderer.cpp index d99d61f1a0..5bf36d1e12 100644 --- a/scumm/nut_renderer.cpp +++ b/scumm/nut_renderer.cpp @@ -113,16 +113,16 @@ static int32 codec1(byte *dst, byte *src, int height) { return decoded_length; } -bool NutRenderer::loadFont(const char *filename, const char *directory) { - debug(8, "NutRenderer::loadFont(\"%s\", \"%s\") called", filename, directory); +bool NutRenderer::loadFont(const char *filename) { + debug(8, "NutRenderer::loadFont(\"%s\") called", filename); if (_loaded) { warning("NutRenderer::loadFont() Font already loaded, ok, loading..."); } File file; - file.open(filename, directory); + file.open(filename); if (file.isOpen() == false) { - warning("NutRenderer::loadFont() Can't open font file: %s/%s", directory, filename); + warning("NutRenderer::loadFont() Can't open font file: %s", filename); return false; } @@ -183,11 +183,11 @@ bool NutRenderer::loadFont(const char *filename, const char *directory) { _chars[l].width--; } } else { - warning("NutRenderer::loadFont(%s, %s) there is no FOBJ chunk in FRME chunk %d (offset %x)", filename, directory, l, offset); + warning("NutRenderer::loadFont(%s) there is no FOBJ chunk in FRME chunk %d (offset %x)", filename, l, offset); break; } } else { - warning("NutRenderer::loadFont(%s, %s) there is no FRME chunk %d (offset %x)", filename, directory, l, offset); + warning("NutRenderer::loadFont(%s) there is no FRME chunk %d (offset %x)", filename, l, offset); break; } } diff --git a/scumm/nut_renderer.h b/scumm/nut_renderer.h index 6e06f6cec0..c9bbec2269 100644 --- a/scumm/nut_renderer.h +++ b/scumm/nut_renderer.h @@ -51,7 +51,7 @@ public: virtual ~NutRenderer(); int getNbChars() { return _nbChars; } - bool loadFont(const char *filename, const char *dir); + bool loadFont(const char *filename); void drawFrame(byte *dst, int c, int x, int y); void drawShadowChar(int c, int x, int y, byte color, bool useMask, bool showShadow); diff --git a/scumm/resource.cpp b/scumm/resource.cpp index c3e2e7882c..ba13e8dbc8 100644 --- a/scumm/resource.cpp +++ b/scumm/resource.cpp @@ -845,7 +845,7 @@ int ScummEngine::readSoundResource(int type, int idx) { *(strstr(buffer, " ")) = '\0'; debugC(DEBUG_SOUND, "FMUS file %s", buffer); - if (dmuFile.open(buffer, getGameDataPath()) == false) { + if (dmuFile.open(buffer) == false) { warning("Can't open music file %s*", buffer); res.roomoffs[type][idx] = 0xFFFFFFFF; return 0; diff --git a/scumm/resource_v3.cpp b/scumm/resource_v3.cpp index 7acff39842..234b0bbd30 100644 --- a/scumm/resource_v3.cpp +++ b/scumm/resource_v3.cpp @@ -179,7 +179,7 @@ void ScummEngine_v3::loadCharset(int no) { sprintf(buf, "%02d.LFL", 99 - no); - file.open(buf, getGameDataPath()); + file.open(buf); if (file.isOpen() == false) { error("loadCharset(%d): Missing file charset: %s", no, buf); diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index b15d726512..afc21cd86d 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -2510,9 +2510,9 @@ void ScummEngine_v6::o6_kernelSetFunctions() { // Correct incorrect smush filename in Macintosh FT demo if ((_gameId == GID_FT) && (_features & GF_DEMO) && (_features & GF_MACINTOSH) && (strcmp((char *)getStringAddressVar(VAR_VIDEONAME), "jumpgorge.san") == 0)) - sp->play("jumpgorg.san", getGameDataPath()); + sp->play("jumpgorg.san"); else - sp->play((char *)getStringAddressVar(VAR_VIDEONAME), getGameDataPath()); + sp->play((char *)getStringAddressVar(VAR_VIDEONAME)); delete sp; } else if (_gameId == GID_FT) { const int insaneVarNum = ((_features & GF_DEMO) && (_features & GF_PC)) diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index df452ba62d..daf5975739 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -1244,7 +1244,7 @@ void ScummEngine_v8::o8_startVideo() { debug(4, "o8_startVideo(%s/%s)", getGameDataPath(), (const char*)_scriptPointer); SmushPlayer *sp = new SmushPlayer(this, 1000000 / 12); - sp->play((const char*)_scriptPointer, getGameDataPath()); + sp->play((const char*)_scriptPointer); delete sp; _scriptPointer += len + 1; diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index ef575d38ef..6f683e06b0 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -791,7 +791,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS default: break; } - if (fontFile && fp.open(fontFile, getGameDataPath())) { + if (fontFile && fp.open(fontFile)) { debug(2, "Loading CJK Font"); _CJKMode = true; fp.seek(2, SEEK_CUR); @@ -822,7 +822,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS _2byteWidth = 16; _2byteHeight = 16; //use FM Towns font rom, since game files don't have kanji font resources - if (fp.open("fmt_fnt.rom", getGameDataPath()) || fp.open("fmt_fnt.rom", "./")) { + if (fp.open("fmt_fnt.rom")) { _CJKMode = true; debug(2, "Loading FM Towns Kanji rom"); _2byteFontPtr = new byte[((_2byteWidth + 7) / 8) * _2byteHeight * numChar]; diff --git a/scumm/smush/chunk.cpp b/scumm/smush/chunk.cpp index 6df6a7fb74..04a57557f2 100644 --- a/scumm/smush/chunk.cpp +++ b/scumm/smush/chunk.cpp @@ -32,11 +32,11 @@ class FilePtr : public File { Common::String _filename; int32 _refcount; public: - FilePtr(const char *fname, const char *directory) : + FilePtr(const char *fname) : _filename(fname), _refcount(1) { debug(9, "FilePtr created for %s", fname); - open(fname, directory); + open(fname); if (isOpen() == false) error("FilePtr unable to read file %s", fname); } @@ -115,8 +115,8 @@ FileChunk::FileChunk() : _data(0) { } -FileChunk::FileChunk(const char *fname, const char *directory) { - _data = new FilePtr(fname, directory); +FileChunk::FileChunk(const char *fname) { + _data = new FilePtr(fname); _type = _data->readUint32BE(); _size = _data->readUint32BE(); _offset = sizeof(Chunk::type) + sizeof(uint32); diff --git a/scumm/smush/chunk.h b/scumm/smush/chunk.h index 3e5bc59c9a..b37eb806c2 100644 --- a/scumm/smush/chunk.h +++ b/scumm/smush/chunk.h @@ -74,7 +74,7 @@ protected: FileChunk(); public: - FileChunk(const char *fname, const char *directory); + FileChunk(const char *fname); virtual ~FileChunk(); Chunk *subBlock(); bool read(void *buffer, uint32 size); diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp index a0dddb6aa0..2950c150c0 100644 --- a/scumm/smush/smush_player.cpp +++ b/scumm/smush/smush_player.cpp @@ -171,11 +171,11 @@ public: } }; -static StringResource *getStrings(const char *file, const char *directory, bool is_encoded) { +static StringResource *getStrings(const char *file, bool is_encoded) { debug(7, "trying to read text ressources from %s", file); File theFile; - theFile.open(file, directory); + theFile.open(file); if (!theFile.isOpen()) { return 0; } @@ -192,7 +192,7 @@ static StringResource *getStrings(const char *file, const char *directory, bool if (type != TYPE_ETRS) { delete [] filebuffer; - return getStrings(file, directory, false); + return getStrings(file, false); } char *old = filebuffer; @@ -601,7 +601,7 @@ const char *SmushPlayer::getString(int id) { return _strings->get(id); } -bool SmushPlayer::readString(const char *file, const char *directory) { +bool SmushPlayer::readString(const char *file) { const char *i = strrchr(file, '.'); if (i == NULL) { error("invalid filename : %s", file); @@ -609,11 +609,11 @@ bool SmushPlayer::readString(const char *file, const char *directory) { char fname[260]; memcpy(fname, file, i - file); strcpy(fname + (i - file), ".trs"); - if ((_strings = getStrings(fname, directory, false)) != 0) { + if ((_strings = getStrings(fname, false)) != 0) { return true; } - if ((_strings = getStrings("digtxt.trs", directory, true)) != 0) { + if ((_strings = getStrings("digtxt.trs", true)) != 0) { return true; } return false; @@ -913,21 +913,21 @@ void SmushPlayer::handleAnimHeader(Chunk &b) { } } -void SmushPlayer::setupAnim(const char *file, const char *directory) { +void SmushPlayer::setupAnim(const char *file) { Chunk *sub; int i; char file_font[11]; - _base = new FileChunk(file, directory); + _base = new FileChunk(file); sub = _base->subBlock(); checkBlock(*sub, TYPE_AHDR); handleAnimHeader(*sub); if (_insanity) { if (!((_vm->_features & GF_DEMO) && (_vm->_features & GF_PC))) - readString("mineroad.trs", directory); + readString("mineroad.trs"); } else - readString(file, directory); + readString(file); if (_vm->_gameId == GID_FT) { if (!((_vm->_features & GF_DEMO) && (_vm->_features & GF_PC))) { @@ -935,17 +935,17 @@ void SmushPlayer::setupAnim(const char *file, const char *directory) { _sf[1] = new SmushFont(true, false); _sf[2] = new SmushFont(true, false); _sf[3] = new SmushFont(true, false); - _sf[0]->loadFont("scummfnt.nut", directory); - _sf[1]->loadFont("techfnt.nut", directory); - _sf[2]->loadFont("titlfnt.nut", directory); - _sf[3]->loadFont("specfnt.nut", directory); + _sf[0]->loadFont("scummfnt.nut"); + _sf[1]->loadFont("techfnt.nut"); + _sf[2]->loadFont("titlfnt.nut"); + _sf[3]->loadFont("specfnt.nut"); } } else if (_vm->_gameId == GID_DIG) { if (!(_vm->_features & GF_DEMO)) { for (i = 0; i < 4; i++) { sprintf(file_font, "font%d.nut", i); _sf[i] = new SmushFont(i != 0, false); - _sf[i]->loadFont(file_font, directory); + _sf[i]->loadFont(file_font); } } } else if (_vm->_gameId == GID_CMI) { @@ -954,7 +954,7 @@ void SmushPlayer::setupAnim(const char *file, const char *directory) { break; sprintf(file_font, "font%d.nut", i); _sf[i] = new SmushFont(false, true); - _sf[i]->loadFont(file_font, directory); + _sf[i]->loadFont(file_font); } } else { error("SmushPlayer::setupAnim() Unknown font setup for game"); @@ -1077,7 +1077,7 @@ void SmushPlayer::insanity(bool flag) { _insanity = flag; } -void SmushPlayer::seekSan(const char *file, const char *directory, int32 pos, int32 contFrame) { +void SmushPlayer::seekSan(const char *file, int32 pos, int32 contFrame) { if(_smixer) _smixer->stop(); @@ -1087,7 +1087,7 @@ void SmushPlayer::seekSan(const char *file, const char *directory, int32 pos, in delete _base; } - _base = new FileChunk(file, directory); + _base = new FileChunk(file); // In this case we need to get palette and number of frames if (pos > 8) { Chunk *sub = _base->subBlock(); @@ -1113,11 +1113,11 @@ void SmushPlayer::seekSan(const char *file, const char *directory, int32 pos, in _frame = contFrame; } -void SmushPlayer::play(const char *filename, const char *directory, int32 offset, int32 startFrame) { +void SmushPlayer::play(const char *filename, int32 offset, int32 startFrame) { // Verify the specified file exists File f; - f.open(filename, directory); + f.open(filename); if (!f.isOpen()) { warning("SmushPlayer::play() File not found %s", filename); return; @@ -1130,7 +1130,7 @@ void SmushPlayer::play(const char *filename, const char *directory, int32 offset bool oldMouseState = _vm->_system->showMouse(false); // Load the video - setupAnim(filename, directory); + setupAnim(filename); init(); if (offset) { diff --git a/scumm/smush/smush_player.h b/scumm/smush/smush_player.h index 37e1299e10..8b433ffc37 100644 --- a/scumm/smush/smush_player.h +++ b/scumm/smush/smush_player.h @@ -75,7 +75,7 @@ public: SmushPlayer(ScummEngine_v6 *scumm, int speed); ~SmushPlayer(); - void play(const char *filename, const char *directory, int32 offset = 0, int32 startFrame = 0); + void play(const char *filename, int32 offset = 0, int32 startFrame = 0); protected: SmushFont *_sf[5]; @@ -84,7 +84,7 @@ protected: void insanity(bool); void setPalette(const byte *palette); void setPaletteValue(int n, byte r, byte g, byte b); - void seekSan(const char *file, const char *directory, int32 pos, int32 contFrame); + void seekSan(const char *file, int32 pos, int32 contFrame); const char *getString(int id); private: @@ -92,10 +92,10 @@ private: void parseNextFrame(); void init(); void release(); - void setupAnim(const char *file, const char *directory); + void setupAnim(const char *file); void updateScreen(); - bool readString(const char *file, const char *directory); + bool readString(const char *file); void checkBlock(const Chunk &, Chunk::type, uint32 = 0); void handleAnimHeader(Chunk &); void handleFrame(Chunk &); |