diff options
author | Max Horn | 2005-05-10 22:56:25 +0000 |
---|---|---|
committer | Max Horn | 2005-05-10 22:56:25 +0000 |
commit | b75c969e666b9f262a05e0d1e54d56f7d3e45441 (patch) | |
tree | e4868d14ac249a63e01f905472ec9be69f04a028 /simon | |
parent | 55c37c18ceed916eb3744666d3d10783b0cf8783 (diff) | |
download | scummvm-rg350-b75c969e666b9f262a05e0d1e54d56f7d3e45441.tar.gz scummvm-rg350-b75c969e666b9f262a05e0d1e54d56f7d3e45441.tar.bz2 scummvm-rg350-b75c969e666b9f262a05e0d1e54d56f7d3e45441.zip |
Moved class File and the MD5 stuff to namespace Common
svn-id: r18037
Diffstat (limited to 'simon')
-rw-r--r-- | simon/icons.cpp | 2 | ||||
-rw-r--r-- | simon/midi.cpp | 8 | ||||
-rw-r--r-- | simon/midi.h | 12 | ||||
-rw-r--r-- | simon/res.cpp | 12 | ||||
-rw-r--r-- | simon/simon.cpp | 6 | ||||
-rw-r--r-- | simon/simon.h | 28 | ||||
-rw-r--r-- | simon/sound.cpp | 2 | ||||
-rw-r--r-- | simon/sound.h | 2 |
8 files changed, 39 insertions, 33 deletions
diff --git a/simon/icons.cpp b/simon/icons.cpp index 9f7bcc7eac..7a6fd6f105 100644 --- a/simon/icons.cpp +++ b/simon/icons.cpp @@ -29,7 +29,7 @@ namespace Simon { void SimonEngine::loadIconFile() { - File in; + Common::File in; if (_game & GF_ACORN) in.open("ICONDATA"); else if (_game & GF_AMIGA) diff --git a/simon/midi.cpp b/simon/midi.cpp index ed0d23f23e..98dc5bc0d6 100644 --- a/simon/midi.cpp +++ b/simon/midi.cpp @@ -335,7 +335,7 @@ static int simon1_gmf_size[] = { 17256, 5103, 8794, 4884, 16 }; -void MidiPlayer::loadSMF (File *in, int song, bool sfx) { +void MidiPlayer::loadSMF (Common::File *in, int song, bool sfx) { Common::StackLock lock(_mutex); MusicInfo *p = sfx ? &_sfx : &_music; @@ -409,7 +409,7 @@ void MidiPlayer::loadSMF (File *in, int song, bool sfx) { p->parser = parser; // That plugs the power cord into the wall } -void MidiPlayer::loadMultipleSMF (File *in, bool sfx) { +void MidiPlayer::loadMultipleSMF (Common::File *in, bool sfx) { // This is a special case for Simon 2 Windows. // Instead of having multiple sequences as // separate tracks in a Type 2 file, simon2win @@ -465,7 +465,7 @@ void MidiPlayer::loadMultipleSMF (File *in, bool sfx) { } } -void MidiPlayer::loadXMIDI(File *in, bool sfx) { +void MidiPlayer::loadXMIDI(Common::File *in, bool sfx) { Common::StackLock lock(_mutex); MusicInfo *p = sfx ? &_sfx : &_music; clearConstructs(*p); @@ -512,7 +512,7 @@ void MidiPlayer::loadXMIDI(File *in, bool sfx) { p->parser = parser; // That plugs the power cord into the wall } -void MidiPlayer::loadS1D (File *in, bool sfx) { +void MidiPlayer::loadS1D (Common::File *in, bool sfx) { Common::StackLock lock(_mutex); MusicInfo *p = sfx ? &_sfx : &_music; clearConstructs(*p); diff --git a/simon/midi.h b/simon/midi.h index 828782690e..913e93fb04 100644 --- a/simon/midi.h +++ b/simon/midi.h @@ -26,7 +26,9 @@ #include "sound/midiparser.h" #include "common/mutex.h" -class File; +namespace Common { + class File; +} namespace Simon { @@ -83,10 +85,10 @@ public: MidiPlayer (OSystem *system); virtual ~MidiPlayer(); - void loadSMF (File *in, int song, bool sfx = false); - void loadMultipleSMF (File *in, bool sfx = false); - void loadXMIDI (File *in, bool sfx = false); - void loadS1D (File *in, bool sfx = false); + void loadSMF (Common::File *in, int song, bool sfx = false); + void loadMultipleSMF (Common::File *in, bool sfx = false); + void loadXMIDI (Common::File *in, bool sfx = false); + void loadS1D (Common::File *in, bool sfx = false); void mapMT32toGM (bool map); void setLoop (bool loop); diff --git a/simon/res.cpp b/simon/res.cpp index 0174a8ba17..c7a6a76127 100644 --- a/simon/res.cpp +++ b/simon/res.cpp @@ -97,7 +97,7 @@ static const char *const opcode_arg_table_simon2dos[256] = { }; void SimonEngine::loadGamePcFile(const char *filename) { - File in; + Common::File in; int num_inited_objects; int i, file_size; @@ -164,7 +164,7 @@ void SimonEngine::loadGamePcFile(const char *filename) { in.close(); } -void SimonEngine::readGamePcText(File *in) { +void SimonEngine::readGamePcText(Common::File *in) { uint text_size; byte *text_mem; @@ -178,7 +178,7 @@ void SimonEngine::readGamePcText(File *in) { setupStringTable(text_mem, _stringTabNum); } -void SimonEngine::readItemFromGamePc(File *in, Item *item) { +void SimonEngine::readItemFromGamePc(Common::File *in, Item *item) { uint32 type; item->unk2 = in->readUint16BE(); @@ -199,7 +199,7 @@ void SimonEngine::readItemFromGamePc(File *in, Item *item) { } } -void SimonEngine::readItemChildren(File *in, Item *item, uint type) { +void SimonEngine::readItemChildren(Common::File *in, Item *item, uint type) { if (type == 1) { uint fr1 = in->readUint16BE(); uint fr2 = in->readUint16BE(); @@ -246,14 +246,14 @@ void SimonEngine::readItemChildren(File *in, Item *item, uint type) { } } -uint fileReadItemID(File *in) { +uint fileReadItemID(Common::File *in) { uint32 val = in->readUint32BE(); if (val == 0xFFFFFFFF) return 0; return val + 2; } -byte *SimonEngine::readSingleOpcode(File *in, byte *ptr) { +byte *SimonEngine::readSingleOpcode(Common::File *in, byte *ptr) { int i, l; const char *string_ptr; uint val; diff --git a/simon/simon.cpp b/simon/simon.cpp index 1621cd1253..31ddcf820d 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -46,6 +46,8 @@ #include "globals.h" #endif +using Common::File; + struct SimonGameSettings { const char *name; const char *description; @@ -128,7 +130,7 @@ DetectedGameList Engine_SIMON_detectGames(const FSList &fslist) { for (StringSet::const_iterator iter = fileSet.begin(); iter != fileSet.end(); ++iter) { uint8 md5sum[16]; const char *name = iter->_key.c_str(); - if (md5_file(name, md5sum)) { + if (Common::md5_file(name, md5sum)) { char md5str[32+1]; for (int j = 0; j < 16; j++) { sprintf(md5str + j*2, "%02x", (int)md5sum[j]); @@ -317,7 +319,7 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst) if (f.isOpen() == false) strcat(buf, "."); - if (md5_file(buf, md5sum)) { + if (Common::md5_file(buf, md5sum)) { char md5str[32+1]; for (int j = 0; j < 16; j++) { sprintf(md5str + j*2, "%02x", (int)md5sum[j]); diff --git a/simon/simon.h b/simon/simon.h index 7fc9273db0..537554e513 100644 --- a/simon/simon.h +++ b/simon/simon.h @@ -36,7 +36,7 @@ namespace Simon { //#define DUMP_FILE_NR 8 //#define DUMP_BITMAPS_FILE_NR 8 -uint fileReadItemID(File *in); +uint fileReadItemID(Common::File *in); #define CHECK_BOUNDS(x, y) assert((uint)(x) < ARRAYSIZE(y)) #define NUM_PALETTE_FADEOUT 32 @@ -138,7 +138,7 @@ protected: FORMAT_VOC } SoundFormat; - File *_gameFile; + Common::File *_gameFile; byte *_strippedTxtMem; uint _textSize; @@ -376,15 +376,15 @@ public: virtual ~SimonEngine(); protected: - int allocGamePcVars(File *in); + int allocGamePcVars(Common::File *in); void loginPlayerHelper(Item *item, int a, int b); void loginPlayer(); void allocateStringTable(int num); void setupStringTable(byte *mem, int num); void setupLocalStringTable(byte *mem, int num); - void readGamePcText(File *in); - void readItemChildren(File *in, Item *item, uint tmp); - void readItemFromGamePc(File *in, Item *item); + void readGamePcText(Common::File *in); + void readItemChildren(Common::File *in, Item *item, uint tmp); + void readItemFromGamePc(Common::File *in, Item *item); void loadGamePcFile(const char *filename); byte *allocateItem(uint size); @@ -398,11 +398,11 @@ protected: void allocTablesHeap(); Subroutine *createSubroutine(uint a); - void readSubroutine(File *in, Subroutine *sub); + void readSubroutine(Common::File *in, Subroutine *sub); SubroutineLine *createSubroutineLine(Subroutine *sub, int a); - void readSubroutineLine(File *in, SubroutineLine *new_table, Subroutine *sub); - byte *readSingleOpcode(File *in, byte *ptr); - void readSubroutineBlock(File *in); + void readSubroutineLine(Common::File *in, SubroutineLine *new_table, Subroutine *sub); + byte *readSingleOpcode(Common::File *in, byte *ptr); + void readSubroutineBlock(Common::File *in); Subroutine *getSubroutineByID(uint subroutine_id); @@ -524,14 +524,14 @@ protected: uint loadTextFile(const char *filename, byte *dst); - File *openTablesFile(const char *filename); - void closeTablesFile(File *in); + Common::File *openTablesFile(const char *filename); + void closeTablesFile(Common::File *in); uint loadTextFile_simon1(const char *filename, byte *dst); - File *openTablesFile_simon1(const char *filename); + Common::File *openTablesFile_simon1(const char *filename); uint loadTextFile_gme(const char *filename, byte *dst); - File *openTablesFile_gme(const char *filename); + Common::File *openTablesFile_gme(const char *filename); void invokeTimeEvent(TimeEvent *te); bool kickoffTimeEvents(); diff --git a/simon/sound.cpp b/simon/sound.cpp index a712d828d1..ca95d19f2f 100644 --- a/simon/sound.cpp +++ b/simon/sound.cpp @@ -30,6 +30,8 @@ #include "sound/vorbis.h" #include "sound/wave.h" +using Common::File; + namespace Simon { #define SOUND_BIG_ENDIAN true diff --git a/simon/sound.h b/simon/sound.h index ad0b535f5f..c95dd1d321 100644 --- a/simon/sound.h +++ b/simon/sound.h @@ -57,7 +57,7 @@ public: ~Sound(); void readSfxFile(const char *filename); - void loadSfxTable(File *gameFile, uint32 base); + void loadSfxTable(Common::File *gameFile, uint32 base); void readVoiceFile(const char *filename); void playVoice(uint sound); |