[Scummvm-cvs-logs] SF.net SVN: scummvm:[55897] scummvm/trunk/engines/hugo
strangerke at users.sourceforge.net
strangerke at users.sourceforge.net
Sat Feb 12 17:20:57 CET 2011
Revision: 55897
http://scummvm.svn.sourceforge.net/scummvm/?rev=55897&view=rev
Author: strangerke
Date: 2011-02-12 16:20:57 +0000 (Sat, 12 Feb 2011)
Log Message:
-----------
HUGO: Replace Common::File by Common::ReadStream in several functions
Modified Paths:
--------------
scummvm/trunk/engines/hugo/display.cpp
scummvm/trunk/engines/hugo/display.h
scummvm/trunk/engines/hugo/file.cpp
scummvm/trunk/engines/hugo/file.h
scummvm/trunk/engines/hugo/hugo.cpp
scummvm/trunk/engines/hugo/hugo.h
scummvm/trunk/engines/hugo/menu.cpp
scummvm/trunk/engines/hugo/menu.h
scummvm/trunk/engines/hugo/object.cpp
scummvm/trunk/engines/hugo/object.h
scummvm/trunk/engines/hugo/schedule.cpp
scummvm/trunk/engines/hugo/schedule.h
scummvm/trunk/engines/hugo/sound.cpp
scummvm/trunk/engines/hugo/sound.h
scummvm/trunk/engines/hugo/text.cpp
scummvm/trunk/engines/hugo/text.h
Modified: scummvm/trunk/engines/hugo/display.cpp
===================================================================
--- scummvm/trunk/engines/hugo/display.cpp 2011-02-12 15:35:33 UTC (rev 55896)
+++ scummvm/trunk/engines/hugo/display.cpp 2011-02-12 16:20:57 UTC (rev 55897)
@@ -574,7 +574,7 @@
/**
* Load palette from Hugo.dat
*/
-void Screen::loadPalette(Common::File &in) {
+void Screen::loadPalette(Common::ReadStream &in) {
// Read palette
_paletteSize = in.readUint16BE();
_mainPalette = (byte *)malloc(sizeof(byte) * _paletteSize);
@@ -733,7 +733,7 @@
* These fonts are a workaround to avoid handling TTF fonts used by DOS versions
* TODO: Get rid of this function when the win1 fonts are supported
*/
-void Screen_v1d::loadFontArr(Common::File &in) {
+void Screen_v1d::loadFontArr(Common::ReadStream &in) {
for (int i = 0; i < kNumFonts; i++) {
_arrayFontSize[i] = in.readUint16BE();
_arrayFont[i] = (byte *)malloc(sizeof(byte) * _arrayFontSize[i]);
@@ -785,7 +785,7 @@
/**
* Skips the fonts used by the DOS versions
*/
-void Screen_v1w::loadFontArr(Common::File &in) {
+void Screen_v1w::loadFontArr(Common::ReadStream &in) {
for (int i = 0; i < kNumFonts; i++) {
uint16 numElem = in.readUint16BE();
for (int j = 0; j < numElem; j++)
Modified: scummvm/trunk/engines/hugo/display.h
===================================================================
--- scummvm/trunk/engines/hugo/display.h 2011-02-12 15:35:33 UTC (rev 55896)
+++ scummvm/trunk/engines/hugo/display.h 2011-02-12 16:20:57 UTC (rev 55897)
@@ -52,7 +52,7 @@
virtual ~Screen();
virtual void loadFont(int16 fontId) = 0;
- virtual void loadFontArr(Common::File &in) = 0;
+ virtual void loadFontArr(Common::ReadStream &in) = 0;
int16 fontHeight() const;
int16 stringLength(const char *s) const;
@@ -70,7 +70,7 @@
void hideCursor();
void initDisplay();
void initNewScreenDisplay();
- void loadPalette(Common::File &in);
+ void loadPalette(Common::ReadStream &in);
void moveImage(image_pt srcImage, const int16 x1, const int16 y1, const int16 dx, int16 dy, const int16 width1, image_pt dstImage, const int16 x2, const int16 y2, const int16 width2);
void remapPal(uint16 oldIndex, uint16 newIndex);
void resetInventoryObjId();
@@ -165,7 +165,7 @@
~Screen_v1d();
void loadFont(int16 fontId);
- void loadFontArr(Common::File &in);
+ void loadFontArr(Common::ReadStream &in);
};
class Screen_v1w : public Screen {
@@ -174,7 +174,7 @@
~Screen_v1w();
void loadFont(int16 fontId);
- void loadFontArr(Common::File &in);
+ void loadFontArr(Common::ReadStream &in);
};
} // End of namespace Hugo
Modified: scummvm/trunk/engines/hugo/file.cpp
===================================================================
--- scummvm/trunk/engines/hugo/file.cpp 2011-02-12 15:35:33 UTC (rev 55896)
+++ scummvm/trunk/engines/hugo/file.cpp 2011-02-12 16:20:57 UTC (rev 55897)
@@ -78,7 +78,7 @@
* allocate space if NULL. Name used for errors. Returns address of seq_p
* Set first TRUE to initialize b_index (i.e. not reading a sequential image in file).
*/
-seq_t *FileManager::readPCX(Common::File &f, seq_t *seqPtr, byte *imagePtr, const bool firstFl, const char *name) {
+seq_t *FileManager::readPCX(Common::ReadStream &f, seq_t *seqPtr, byte *imagePtr, const bool firstFl, const char *name) {
debugC(1, kDebugFile, "readPCX(..., %s)", name);
// Read in the PCC header and check consistency
Modified: scummvm/trunk/engines/hugo/file.h
===================================================================
--- scummvm/trunk/engines/hugo/file.h 2011-02-12 15:35:33 UTC (rev 55896)
+++ scummvm/trunk/engines/hugo/file.h 2011-02-12 16:20:57 UTC (rev 55897)
@@ -112,7 +112,7 @@
PCC_header_t PCC_header;
- seq_t *readPCX(Common::File &f, seq_t *seqPtr, byte *imagePtr, const bool firstFl, const char *name);
+ seq_t *readPCX(Common::ReadStream &f, seq_t *seqPtr, byte *imagePtr, const bool firstFl, const char *name);
const char *getBootCypher() const;
// If this is the first call, read the lookup table
Modified: scummvm/trunk/engines/hugo/hugo.cpp
===================================================================
--- scummvm/trunk/engines/hugo/hugo.cpp 2011-02-12 15:35:33 UTC (rev 55896)
+++ scummvm/trunk/engines/hugo/hugo.cpp 2011-02-12 16:20:57 UTC (rev 55897)
@@ -689,7 +689,7 @@
return true;
}
-uint16 **HugoEngine::loadLongArray(Common::File &in) {
+uint16 **HugoEngine::loadLongArray(Common::ReadStream &in) {
uint16 **resArray = 0;
for (int varnt = 0; varnt < _numVariant; varnt++) {
Modified: scummvm/trunk/engines/hugo/hugo.h
===================================================================
--- scummvm/trunk/engines/hugo/hugo.h 2011-02-12 15:35:33 UTC (rev 55896)
+++ scummvm/trunk/engines/hugo/hugo.h 2011-02-12 16:20:57 UTC (rev 55897)
@@ -385,7 +385,7 @@
int _score; // Holds current score
int _maxscore; // Holds maximum score
- uint16 **loadLongArray(Common::File &in);
+ uint16 **loadLongArray(Common::ReadStream &in);
void initPlaylist(bool playlist[kMaxTunes]);
void initConfig();
Modified: scummvm/trunk/engines/hugo/menu.cpp
===================================================================
--- scummvm/trunk/engines/hugo/menu.cpp 2011-02-12 15:35:33 UTC (rev 55896)
+++ scummvm/trunk/engines/hugo/menu.cpp 2011-02-12 16:20:57 UTC (rev 55897)
@@ -121,7 +121,7 @@
_inventButton->setGfx(arrayBmp[4 * kMenuInventory + scale - 1]);
}
-void TopMenu::loadBmpArr(Common::File &in) {
+void TopMenu::loadBmpArr(Common::SeekableReadStream &in) {
arraySize = in.readUint16BE();
delete arrayBmp;
Modified: scummvm/trunk/engines/hugo/menu.h
===================================================================
--- scummvm/trunk/engines/hugo/menu.h 2011-02-12 15:35:33 UTC (rev 55896)
+++ scummvm/trunk/engines/hugo/menu.h 2011-02-12 16:20:57 UTC (rev 55897)
@@ -74,7 +74,7 @@
void handleCommand(GUI::CommandSender *sender, uint32 command, uint32 data);
void handleMouseUp(int x, int y, int button, int clickCount);
- void loadBmpArr(Common::File &in);
+ void loadBmpArr(Common::SeekableReadStream &in);
protected:
void init();
Modified: scummvm/trunk/engines/hugo/object.cpp
===================================================================
--- scummvm/trunk/engines/hugo/object.cpp 2011-02-12 15:35:33 UTC (rev 55896)
+++ scummvm/trunk/engines/hugo/object.cpp 2011-02-12 16:20:57 UTC (rev 55897)
@@ -369,7 +369,7 @@
/**
* Load ObjectArr from Hugo.dat
*/
-void ObjectHandler::loadObjectArr(Common::File &in) {
+void ObjectHandler::loadObjectArr(Common::ReadStream &in) {
debugC(6, kDebugObject, "loadObject(&in)");
for (int varnt = 0; varnt < _vm->_numVariant; varnt++) {
@@ -487,7 +487,7 @@
/**
* Load _numObj from Hugo.dat
*/
-void ObjectHandler::loadNumObj(Common::File &in) {
+void ObjectHandler::loadNumObj(Common::ReadStream &in) {
int numElem;
for (int varnt = 0; varnt < _vm->_numVariant; varnt++) {
Modified: scummvm/trunk/engines/hugo/object.h
===================================================================
--- scummvm/trunk/engines/hugo/object.h 2011-02-12 15:35:33 UTC (rev 55896)
+++ scummvm/trunk/engines/hugo/object.h 2011-02-12 16:20:57 UTC (rev 55897)
@@ -73,9 +73,9 @@
int calcMaxScore();
int16 findObject(uint16 x, uint16 y);
void freeObjects();
- void loadObjectArr(Common::File &in);
+ void loadObjectArr(Common::ReadStream &in);
void freeObjectArr();
- void loadNumObj(Common::File &in);
+ void loadNumObj(Common::ReadStream &in);
void lookObject(object_t *obj);
void readObjectImages();
void restoreAllSeq();
Modified: scummvm/trunk/engines/hugo/schedule.cpp
===================================================================
--- scummvm/trunk/engines/hugo/schedule.cpp 2011-02-12 15:35:33 UTC (rev 55896)
+++ scummvm/trunk/engines/hugo/schedule.cpp 2011-02-12 16:20:57 UTC (rev 55897)
@@ -233,7 +233,7 @@
/**
* Read kALnewscr used by maze (Hugo 2)
*/
-void Scheduler::loadAlNewscrIndex(Common::File &in) {
+void Scheduler::loadAlNewscrIndex(Common::ReadStream &in) {
debugC(6, kDebugSchedule, "loadAlNewscrIndex(&in)");
int numElem;
@@ -247,7 +247,7 @@
/**
* Load actListArr from Hugo.dat
*/
-void Scheduler::loadActListArr(Common::File &in) {
+void Scheduler::loadActListArr(Common::ReadStream &in) {
debugC(6, kDebugSchedule, "loadActListArr(&in)");
int numElem, numSubElem, numSubAct;
@@ -910,7 +910,7 @@
* Restore the action data from file with handle f
*/
-void Scheduler::restoreActions(Common::SeekableReadStream *f) {
+void Scheduler::restoreActions(Common::ReadStream *f) {
for (int i = 0; i < _actListArrSize; i++) {
@@ -982,7 +982,7 @@
/**
* Restore the event list from file with handle f
*/
-void Scheduler::restoreEvents(Common::SeekableReadStream *f) {
+void Scheduler::restoreEvents(Common::ReadStream *f) {
debugC(1, kDebugSchedule, "restoreEvents");
event_t savedEvents[kMaxEvents]; // Convert event ptrs to indexes
Modified: scummvm/trunk/engines/hugo/schedule.h
===================================================================
--- scummvm/trunk/engines/hugo/schedule.h 2011-02-12 15:35:33 UTC (rev 55896)
+++ scummvm/trunk/engines/hugo/schedule.h 2011-02-12 16:20:57 UTC (rev 55897)
@@ -461,19 +461,19 @@
void freeActListArr();
void initEventQueue();
void insertActionList(const uint16 actIndex);
- void loadActListArr(Common::File &in);
- void loadAlNewscrIndex(Common::File &in);
+ void loadActListArr(Common::ReadStream &in);
+ void loadAlNewscrIndex(Common::ReadStream &in);
void newScreen(const int screenIndex);
void processBonus(const int bonusIndex);
void processMaze(const int x1, const int x2, const int y1, const int y2);
void restoreScreen(const int screenIndex);
- void restoreEvents(Common::SeekableReadStream *f);
+ void restoreEvents(Common::ReadStream *f);
void saveEvents(Common::WriteStream *f);
void waitForRefresh();
void findAction(act* action, int16* index, int16* subElem);
void saveActions(Common::WriteStream* f) const;
- void restoreActions(Common::SeekableReadStream *f);
+ void restoreActions(Common::ReadStream *f);
protected:
HugoEngine *_vm;
Modified: scummvm/trunk/engines/hugo/sound.cpp
===================================================================
--- scummvm/trunk/engines/hugo/sound.cpp 2011-02-12 15:35:33 UTC (rev 55896)
+++ scummvm/trunk/engines/hugo/sound.cpp 2011-02-12 16:20:57 UTC (rev 55897)
@@ -479,7 +479,7 @@
}
}
-void SoundHandler::loadIntroSong(Common::File &in) {
+void SoundHandler::loadIntroSong(Common::ReadStream &in) {
for (int varnt = 0; varnt < _vm->_numVariant; varnt++) {
uint16 numBuf = in.readUint16BE();
if (varnt == _vm->_gameVariant)
Modified: scummvm/trunk/engines/hugo/sound.h
===================================================================
--- scummvm/trunk/engines/hugo/sound.h 2011-02-12 15:35:33 UTC (rev 55896)
+++ scummvm/trunk/engines/hugo/sound.h 2011-02-12 16:20:57 UTC (rev 55897)
@@ -113,7 +113,7 @@
void initSound();
void syncVolume();
void checkMusic();
- void loadIntroSong(Common::File &in);
+ void loadIntroSong(Common::ReadStream &in);
void initPcspkrPlayer();
protected:
byte curPriority; // Priority of currently playing sound
Modified: scummvm/trunk/engines/hugo/text.cpp
===================================================================
--- scummvm/trunk/engines/hugo/text.cpp 2011-02-12 15:35:33 UTC (rev 55896)
+++ scummvm/trunk/engines/hugo/text.cpp 2011-02-12 16:20:57 UTC (rev 55897)
@@ -37,7 +37,7 @@
TextHandler::~TextHandler() {
}
-char **TextHandler::loadTextsVariante(Common::File &in, uint16 *arraySize) {
+char **TextHandler::loadTextsVariante(Common::ReadStream &in, uint16 *arraySize) {
int numTexts;
int entryLen;
int len;
@@ -80,7 +80,7 @@
return res;
}
-char ***TextHandler::loadTextsArray(Common::File &in) {
+char ***TextHandler::loadTextsArray(Common::ReadStream &in) {
char ***resArray = 0;
uint16 arraySize;
@@ -127,7 +127,7 @@
return resArray;
}
-char **TextHandler::loadTexts(Common::File &in) {
+char **TextHandler::loadTexts(Common::ReadStream &in) {
int numTexts = in.readUint16BE();
char **res = (char **)malloc(sizeof(char *) * numTexts);
int entryLen = in.readUint16BE();
@@ -148,7 +148,7 @@
return res;
}
-void TextHandler::loadAllTexts(Common::File &in) {
+void TextHandler::loadAllTexts(Common::ReadStream &in) {
// Read textData
_textData = loadTextsVariante(in, 0);
Modified: scummvm/trunk/engines/hugo/text.h
===================================================================
--- scummvm/trunk/engines/hugo/text.h 2011-02-12 15:35:33 UTC (rev 55896)
+++ scummvm/trunk/engines/hugo/text.h 2011-02-12 16:20:57 UTC (rev 55897)
@@ -45,7 +45,7 @@
char **getNounArray(int idx1) { return _arrayNouns[idx1]; }
char **getVerbArray(int idx1) { return _arrayVerbs[idx1]; }
- void loadAllTexts(Common::File &in);
+ void loadAllTexts(Common::ReadStream &in);
void freeAllTexts();
private:
@@ -63,9 +63,9 @@
char **_textParser;
char **_textUtil;
- char ***loadTextsArray(Common::File &in);
- char **loadTextsVariante(Common::File &in, uint16 *arraySize);
- char **loadTexts(Common::File &in);
+ char ***loadTextsArray(Common::ReadStream &in);
+ char **loadTextsVariante(Common::ReadStream &in, uint16 *arraySize);
+ char **loadTexts(Common::ReadStream &in);
void freeTexts(char **ptr);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list