HUGO: Cleanup based on Fingolfin comments

svn-id: r55887
This commit is contained in:
Arnaud Boutonné 2011-02-12 08:13:35 +00:00
parent 191d216785
commit 69d907151b
20 changed files with 73 additions and 85 deletions

View file

@ -317,9 +317,6 @@ void HugoEngine::initGame(const HugoGameDescription *gd) {
_platform = gd->desc.platform; _platform = gd->desc.platform;
_packedFl = (getFeatures() & GF_PACKED); _packedFl = (getFeatures() & GF_PACKED);
_gameVariant = _gameType - 1 + ((_platform == Common::kPlatformWindows) ? 0 : 3); _gameVariant = _gameType - 1 + ((_platform == Common::kPlatformWindows) ? 0 : 3);
// Generate filename
_saveFilename = _targetName + "-%02d.SAV";
} }
} // End of namespace Hugo } // End of namespace Hugo

View file

@ -287,18 +287,10 @@ sound_pt FileManager::getSound(const int16 sound, uint16 *size) {
return soundPtr; return soundPtr;
} }
/**
* Return whether file exists or not
*/
bool FileManager::fileExists(const Common::String filename) const {
Common::File f;
return(f.exists(filename));
}
/** /**
* Save game to supplied slot * Save game to supplied slot
*/ */
bool FileManager::saveGame(const int16 slot, const Common::String descrip) { bool FileManager::saveGame(const int16 slot, const Common::String &descrip) {
debugC(1, kDebugFile, "saveGame(%d, %s)", slot, descrip.c_str()); debugC(1, kDebugFile, "saveGame(%d, %s)", slot, descrip.c_str());
const EnginePlugin *plugin = NULL; const EnginePlugin *plugin = NULL;
@ -324,7 +316,7 @@ bool FileManager::saveGame(const int16 slot, const Common::String descrip) {
if (savegameId < 0) // dialog aborted if (savegameId < 0) // dialog aborted
return false; return false;
Common::String savegameFile = Common::String::format(_vm->_saveFilename.c_str(), savegameId); Common::String savegameFile = _vm->getSavegameFilename(savegameId);
Common::SaveFileManager *saveMan = g_system->getSavefileManager(); Common::SaveFileManager *saveMan = g_system->getSavefileManager();
Common::OutSaveFile *out = saveMan->openForSaving(savegameFile); Common::OutSaveFile *out = saveMan->openForSaving(savegameFile);
@ -432,7 +424,7 @@ bool FileManager::restoreGame(const int16 slot) {
if (savegameId < 0) // dialog aborted if (savegameId < 0) // dialog aborted
return false; return false;
Common::String savegameFile = Common::String::format(_vm->_saveFilename.c_str(), savegameId); Common::String savegameFile = _vm->getSavegameFilename(savegameId);
Common::SaveFileManager *saveMan = g_system->getSavefileManager(); Common::SaveFileManager *saveMan = g_system->getSavefileManager();
Common::InSaveFile *in = saveMan->openForLoading(savegameFile); Common::InSaveFile *in = saveMan->openForLoading(savegameFile);

View file

@ -44,7 +44,6 @@ public:
FileManager(HugoEngine *vm); FileManager(HugoEngine *vm);
virtual ~FileManager(); virtual ~FileManager();
bool fileExists(const Common::String filename) const;
sound_pt getSound(const int16 sound, uint16 *size); sound_pt getSound(const int16 sound, uint16 *size);
void readBootFile(); void readBootFile();
@ -52,15 +51,15 @@ public:
void readUIFImages(); void readUIFImages();
void readUIFItem(const int16 id, byte *buf); void readUIFItem(const int16 id, byte *buf);
bool restoreGame(const int16 slot); bool restoreGame(const int16 slot);
bool saveGame(const int16 slot, const Common::String descrip); bool saveGame(const int16 slot, const Common::String &descrip);
// Name scenery and objects picture databases // Name scenery and objects picture databases
const char *getBootFilename() const { return "HUGO.BSF"; } const char *getBootFilename() const { return "HUGO.BSF"; }
const char *getObjectFilename() const { return "objects.dat"; } const char *getObjectFilename() const { return "objects.dat"; }
const char *getSceneryFilename() const { return "scenery.dat"; } const char *getSceneryFilename() const { return "scenery.dat"; }
const char *getSoundFilename() const { return "sounds.dat"; } const char *getSoundFilename() const { return "sounds.dat"; }
const char *getStringFilename() const { return "strings.dat"; } const char *getStringFilename() const { return "strings.dat"; }
const char *getUifFilename() const { return "uif.dat"; } const char *getUifFilename() const { return "uif.dat"; }
virtual void openDatabaseFiles() = 0; virtual void openDatabaseFiles() = 0;
virtual void closeDatabaseFiles() = 0; virtual void closeDatabaseFiles() = 0;
@ -69,7 +68,7 @@ public:
virtual void readBackground(const int screenIndex) = 0; virtual void readBackground(const int screenIndex) = 0;
virtual void readOverlay(const int screenNum, image_pt image, ovl_t overlayType) = 0; virtual void readOverlay(const int screenNum, image_pt image, ovl_t overlayType) = 0;
virtual char *fetchString(const int index) = 0; virtual const char *fetchString(const int index) = 0;
protected: protected:
HugoEngine *_vm; HugoEngine *_vm;
@ -138,7 +137,7 @@ public:
virtual void openDatabaseFiles(); virtual void openDatabaseFiles();
virtual void readBackground(const int screenIndex); virtual void readBackground(const int screenIndex);
virtual void readOverlay(const int screenNum, image_pt image, ovl_t overlayType); virtual void readOverlay(const int screenNum, image_pt image, ovl_t overlayType);
virtual char *fetchString(const int index); virtual const char *fetchString(const int index);
}; };
class FileManager_v2d : public FileManager_v1d { class FileManager_v2d : public FileManager_v1d {
@ -150,7 +149,7 @@ public:
virtual void openDatabaseFiles(); virtual void openDatabaseFiles();
virtual void readBackground(const int screenIndex); virtual void readBackground(const int screenIndex);
virtual void readOverlay(const int screenNum, image_pt image, ovl_t overlayType); virtual void readOverlay(const int screenNum, image_pt image, ovl_t overlayType);
char *fetchString(const int index); const char *fetchString(const int index);
private: private:
char *_fetchStringBuf; char *_fetchStringBuf;
}; };

View file

@ -62,7 +62,7 @@ void FileManager_v1d::readOverlay(const int screenNum, image_pt image, const ovl
const char *ovl_ext[] = {".b", ".o", ".ob"}; const char *ovl_ext[] = {".b", ".o", ".ob"};
Common::String buf = Common::String(_vm->_text->getScreenNames(screenNum)) + Common::String(ovl_ext[overlayType]); Common::String buf = Common::String(_vm->_text->getScreenNames(screenNum)) + Common::String(ovl_ext[overlayType]);
if (!fileExists(buf)) { if (!Common::File::exists(buf)) {
for (int i = 0; i < kOvlSize; i++) for (int i = 0; i < kOvlSize; i++)
image[i] = 0; image[i] = 0;
warning("File not found: %s", buf.c_str()); warning("File not found: %s", buf.c_str());
@ -95,7 +95,7 @@ void FileManager_v1d::readBackground(const int screenIndex) {
_sceneryArchive1.close(); _sceneryArchive1.close();
} }
char *FileManager_v1d::fetchString(const int index) { const char *FileManager_v1d::fetchString(const int index) {
debugC(1, kDebugFile, "fetchString(%d)", index); debugC(1, kDebugFile, "fetchString(%d)", index);
return _vm->_text->getStringtData(index); return _vm->_text->getStringtData(index);

View file

@ -163,7 +163,7 @@ void FileManager_v2d::readOverlay(const int screenNum, image_pt image, ovl_t ove
/** /**
* Fetch string from file, decode and return ptr to string in memory * Fetch string from file, decode and return ptr to string in memory
*/ */
char *FileManager_v2d::fetchString(const int index) { const char *FileManager_v2d::fetchString(const int index) {
debugC(1, kDebugFile, "fetchString(%d)", index); debugC(1, kDebugFile, "fetchString(%d)", index);
// Get offset to string[index] (and next for length calculation) // Get offset to string[index] (and next for length calculation)

View file

@ -150,7 +150,7 @@ struct hugo_boot_t { // Common HUGO boot file
char pbswitch[8]; // Playback switch string char pbswitch[8]; // Playback switch string
char distrib[32]; // Distributor branding string char distrib[32]; // Distributor branding string
uint16 exit_len; // Length of exit text (next in file) uint16 exit_len; // Length of exit text (next in file)
}; } PACKED_STRUCT;
struct uif_hdr_t { // UIF font/image look up struct uif_hdr_t { // UIF font/image look up
uint16 size; // Size of uif item uint16 size; // Size of uif item

View file

@ -864,7 +864,7 @@ void HugoEngine::readScreenFiles(const int screenNum) {
* Search background command list for this screen for supplied object. * Search background command list for this screen for supplied object.
* Return first associated verb (not "look") or 0 if none found. * Return first associated verb (not "look") or 0 if none found.
*/ */
char *HugoEngine::useBG(const char *name) { const char *HugoEngine::useBG(const char *name) {
debugC(1, kDebugEngine, "useBG(%s)", name); debugC(1, kDebugEngine, "useBG(%s)", name);
objectList_t p = _backgroundObjects[*_screen_p]; objectList_t p = _backgroundObjects[*_screen_p];
@ -943,5 +943,10 @@ void HugoEngine::syncSoundSettings() {
_sound->syncVolume(); _sound->syncVolume();
} }
Common::String HugoEngine::getSavegameFilename(int slot) {
return _targetName + Common::String::format("-%02d.SAV", slot);
}
} // End of namespace Hugo } // End of namespace Hugo

View file

@ -275,8 +275,6 @@ public:
const char *_episode; const char *_episode;
Common::String _picDir; Common::String _picDir;
Common::String _saveFilename;
command_t _statusLine; command_t _statusLine;
command_t _scoreLine; command_t _scoreLine;
@ -298,7 +296,7 @@ public:
virtual bool canSaveGameStateCurrently(); virtual bool canSaveGameStateCurrently();
bool loadHugoDat(); bool loadHugoDat();
char *useBG(const char *name); const char *useBG(const char *name);
int8 getTPS() const; int8 getTPS() const;
@ -347,6 +345,7 @@ public:
const char *getCopyrightString() const { return "Copyright 1989-1997 David P Gray, All Rights Reserved."; } const char *getCopyrightString() const { return "Copyright 1989-1997 David P Gray, All Rights Reserved."; }
Common::String getSavegameFilename(int slot);
FileManager *_file; FileManager *_file;
Scheduler *_scheduler; Scheduler *_scheduler;
@ -379,10 +378,6 @@ private:
HugoConsole *_console; HugoConsole *_console;
// The following are bit plane display overlays which mark travel boundaries,
// foreground stationary objects and baselines for those objects (used to
// determine foreground/background wrt moving objects)
GameType _gameType; GameType _gameType;
Common::Platform _platform; Common::Platform _platform;
bool _packedFl; bool _packedFl;

View file

@ -267,7 +267,7 @@ void MouseHandler::mouseHandler() {
if (objId >= 0) { // Got a match if (objId >= 0) { // Got a match
// Display object name next to cursor (unless CURSOR_NOCHAR) // Display object name next to cursor (unless CURSOR_NOCHAR)
// Note test for swapped hero name // Note test for swapped hero name
char *name = _vm->_text->getNoun(_vm->_object->_objects[(objId == kHeroIndex) ? _vm->_heroImage : objId].nounIndex, kCursorNameIndex); const char *name = _vm->_text->getNoun(_vm->_object->_objects[(objId == kHeroIndex) ? _vm->_heroImage : objId].nounIndex, kCursorNameIndex);
if (name[0] != kCursorNochar) if (name[0] != kCursorNochar)
cursorText(name, cx, cy, U_FONT8, _TBRIGHTWHITE); cursorText(name, cx, cy, U_FONT8, _TBRIGHTWHITE);

View file

@ -99,7 +99,7 @@ void ObjectHandler::restoreSeq(object_t *obj) {
void ObjectHandler::useObject(int16 objId) { void ObjectHandler::useObject(int16 objId) {
debugC(1, kDebugObject, "useObject(%d)", objId); debugC(1, kDebugObject, "useObject(%d)", objId);
char *verb; // Background verb to use directly const char *verb; // Background verb to use directly
int16 inventObjId = _vm->_inventory->getInventoryObjId(); int16 inventObjId = _vm->_inventory->getInventoryObjId();
object_t *obj = &_objects[objId]; // Ptr to object object_t *obj = &_objects[objId]; // Ptr to object
if (inventObjId == -1) { if (inventObjId == -1) {

View file

@ -283,7 +283,7 @@ bool Parser::isWordPresent(char **wordArr) const {
/** /**
* Locate word in list of nouns and return ptr to first string in noun list * Locate word in list of nouns and return ptr to first string in noun list
*/ */
char *Parser::findNoun() const { const char *Parser::findNoun() const {
debugC(1, kDebugParser, "findNoun()"); debugC(1, kDebugParser, "findNoun()");
for (int i = 0; _vm->_text->getNounArray(i); i++) { for (int i = 0; _vm->_text->getNounArray(i); i++) {
@ -298,7 +298,7 @@ char *Parser::findNoun() const {
/** /**
* Locate word in list of verbs and return ptr to first string in verb list * Locate word in list of verbs and return ptr to first string in verb list
*/ */
char *Parser::findVerb() const { const char *Parser::findVerb() const {
debugC(1, kDebugParser, "findVerb()"); debugC(1, kDebugParser, "findVerb()");
for (int i = 0; _vm->_text->getVerbArray(i); i++) { for (int i = 0; _vm->_text->getVerbArray(i); i++) {

View file

@ -65,8 +65,8 @@ protected:
char _cmdLineCursor; char _cmdLineCursor;
command_t _cmdLine; // Build command line command_t _cmdLine; // Build command line
char *findNoun() const; const char *findNoun() const;
char *findVerb() const; const char *findVerb() const;
void showDosInventory() const; void showDosInventory() const;
bool _checkDoubleF1Fl; // Flag used to display user help or instructions bool _checkDoubleF1Fl; // Flag used to display user help or instructions
@ -90,12 +90,12 @@ protected:
virtual void dropObject(object_t *obj); virtual void dropObject(object_t *obj);
virtual void takeObject(object_t *obj); virtual void takeObject(object_t *obj);
char *findNextNoun(char *noun) const; const char *findNextNoun(const char *noun) const;
bool isBackgroundWord_v1(char *noun, char *verb, objectList_t obj) const; bool isBackgroundWord_v1(const char *noun, const char *verb, objectList_t obj) const;
bool isCatchallVerb_v1(bool testNounFl, char *noun, char *verb, objectList_t obj) const; bool isCatchallVerb_v1(bool testNounFl, const char *noun, const char *verb, objectList_t obj) const;
bool isGenericVerb_v1(char *word, object_t *obj); bool isGenericVerb_v1(const char *word, object_t *obj);
bool isNear_v1(char *verb, char *noun, object_t *obj, char *comment) const; bool isNear_v1(const char *verb, const char *noun, object_t *obj, char *comment) const;
bool isObjectVerb_v1(char *word, object_t *obj); bool isObjectVerb_v1(const char *word, object_t *obj);
}; };
class Parser_v2d : public Parser_v1d { class Parser_v2d : public Parser_v1d {
@ -117,7 +117,7 @@ protected:
bool isBackgroundWord_v3(objectList_t obj) const; bool isBackgroundWord_v3(objectList_t obj) const;
bool isCatchallVerb_v3(objectList_t obj) const; bool isCatchallVerb_v3(objectList_t obj) const;
bool isGenericVerb_v3(object_t *obj, char *comment); bool isGenericVerb_v3(object_t *obj, char *comment);
bool isNear_v3(object_t *obj, char *verb, char *comment) const; bool isNear_v3(object_t *obj, const char *verb, char *comment) const;
bool isObjectVerb_v3(object_t *obj, char *comment); bool isObjectVerb_v3(object_t *obj, char *comment);
void takeObject(object_t *obj); void takeObject(object_t *obj);
}; };

View file

@ -55,7 +55,7 @@ Parser_v1d::~Parser_v1d() {
* Locate word in list of nouns and return ptr to string in noun list * Locate word in list of nouns and return ptr to string in noun list
* If n is NULL, start at beginning of list, else with n * If n is NULL, start at beginning of list, else with n
*/ */
char *Parser_v1d::findNextNoun(char *noun) const { const char *Parser_v1d::findNextNoun(const char *noun) const {
debugC(1, kDebugParser, "findNextNoun(%s)", noun); debugC(1, kDebugParser, "findNextNoun(%s)", noun);
int currNounIndex = -1; int currNounIndex = -1;
@ -80,7 +80,7 @@ char *Parser_v1d::findNextNoun(char *noun) const {
* If object not near, return suitable string; may be similar object closer * If object not near, return suitable string; may be similar object closer
* If radius is -1, treat radius as infinity * If radius is -1, treat radius as infinity
*/ */
bool Parser_v1d::isNear_v1(char *verb, char *noun, object_t *obj, char *comment) const { bool Parser_v1d::isNear_v1(const char *verb, const char *noun, object_t *obj, char *comment) const {
debugC(1, kDebugParser, "isNear(%s, %s, obj, %s)", verb, noun, comment); debugC(1, kDebugParser, "isNear(%s, %s, obj, %s)", verb, noun, comment);
if (!noun && !obj->verbOnlyFl) { // No noun specified & object not context senesitive if (!noun && !obj->verbOnlyFl) { // No noun specified & object not context senesitive
@ -142,7 +142,7 @@ bool Parser_v1d::isNear_v1(char *verb, char *noun, object_t *obj, char *comment)
* say_ok needed for special case of take/drop which may be handled not only * say_ok needed for special case of take/drop which may be handled not only
* here but also in a cmd_list with a donestr string simultaneously * here but also in a cmd_list with a donestr string simultaneously
*/ */
bool Parser_v1d::isGenericVerb_v1(char *word, object_t *obj) { bool Parser_v1d::isGenericVerb_v1(const char *word, object_t *obj) {
debugC(1, kDebugParser, "isGenericVerb(%s, object_t *obj)", word); debugC(1, kDebugParser, "isGenericVerb(%s, object_t *obj)", word);
if (!obj->genericCmd) if (!obj->genericCmd)
@ -183,7 +183,7 @@ bool Parser_v1d::isGenericVerb_v1(char *word, object_t *obj) {
* and if it passes, perform the actions in the action list. If the verb * and if it passes, perform the actions in the action list. If the verb
* is catered for, return TRUE * is catered for, return TRUE
*/ */
bool Parser_v1d::isObjectVerb_v1(char *word, object_t *obj) { bool Parser_v1d::isObjectVerb_v1(const char *word, object_t *obj) {
debugC(1, kDebugParser, "isObjectVerb(%s, object_t *obj)", word); debugC(1, kDebugParser, "isObjectVerb(%s, object_t *obj)", word);
// First, find matching verb in cmd list // First, find matching verb in cmd list
@ -233,7 +233,7 @@ bool Parser_v1d::isObjectVerb_v1(char *word, object_t *obj) {
* Print text for possible background object. Return TRUE if match found * Print text for possible background object. Return TRUE if match found
* Only match if both verb and noun found. Test_ca will match verb-only * Only match if both verb and noun found. Test_ca will match verb-only
*/ */
bool Parser_v1d::isBackgroundWord_v1(char *noun, char *verb, objectList_t obj) const { bool Parser_v1d::isBackgroundWord_v1(const char *noun, const char *verb, objectList_t obj) const {
debugC(1, kDebugParser, "isBackgroundWord(%s, %s, object_list_t obj)", noun, verb); debugC(1, kDebugParser, "isBackgroundWord(%s, %s, object_list_t obj)", noun, verb);
if (!noun) if (!noun)
@ -283,7 +283,7 @@ void Parser_v1d::dropObject(object_t *obj) {
* Print text for possible background object. Return TRUE if match found * Print text for possible background object. Return TRUE if match found
* If test_noun TRUE, must have a noun given * If test_noun TRUE, must have a noun given
*/ */
bool Parser_v1d::isCatchallVerb_v1(bool testNounFl, char *noun, char *verb, objectList_t obj) const { bool Parser_v1d::isCatchallVerb_v1(bool testNounFl, const char *noun, const char *verb, objectList_t obj) const {
debugC(1, kDebugParser, "isCatchallVerb(%d, %s, %s, object_list_t obj)", (testNounFl) ? 1 : 0, noun, verb); debugC(1, kDebugParser, "isCatchallVerb(%d, %s, %s, object_list_t obj)", (testNounFl) ? 1 : 0, noun, verb);
if (_maze.enabledFl) if (_maze.enabledFl)
@ -397,8 +397,8 @@ void Parser_v1d::lineHandler() {
} }
// Find the first verb in the line // Find the first verb in the line
char *verb = findVerb(); const char *verb = findVerb();
char *noun = 0; // Noun not found yet const char *noun = 0; // Noun not found yet
char farComment[kCompLineSize * 5] = ""; // hold 5 line comment if object not nearby char farComment[kCompLineSize * 5] = ""; // hold 5 line comment if object not nearby
if (verb) { // OK, verb found. Try to match with object if (verb) { // OK, verb found. Try to match with object

View file

@ -189,8 +189,8 @@ void Parser_v1w::lineHandler() {
} }
// Nothing matches. Report recognition success to user. // Nothing matches. Report recognition success to user.
char *verb = findVerb(); const char *verb = findVerb();
char *noun = findNoun(); const char *noun = findNoun();
if (verb == _vm->_text->getVerb(_vm->_look, 0) && _maze.enabledFl) { if (verb == _vm->_text->getVerb(_vm->_look, 0) && _maze.enabledFl) {
Utils::Box(kBoxAny, "%s", _vm->_text->getTextParser(kTBMaze)); Utils::Box(kBoxAny, "%s", _vm->_text->getTextParser(kTBMaze));
_vm->_object->showTakeables(); _vm->_object->showTakeables();

View file

@ -149,8 +149,8 @@ void Parser_v2d::lineHandler() {
} }
// Find the first verb in the line // Find the first verb in the line
char *verb = findVerb(); const char *verb = findVerb();
char *noun = 0; // Noun not found yet const char *noun = 0; // Noun not found yet
char farComment[kCompLineSize * 5] = ""; // hold 5 line comment if object not nearby char farComment[kCompLineSize * 5] = ""; // hold 5 line comment if object not nearby
if (verb) { // OK, verb found. Try to match with object if (verb) { // OK, verb found. Try to match with object

View file

@ -191,8 +191,8 @@ void Parser_v3d::lineHandler() {
} }
// Nothing matches. Report recognition success to user. // Nothing matches. Report recognition success to user.
char *verb = findVerb(); const char *verb = findVerb();
char *noun = findNoun(); const char *noun = findNoun();
if (verb && noun) { // A combination I didn't think of if (verb && noun) { // A combination I didn't think of
Utils::Box(kBoxAny, "%s", _vm->_text->getTextParser(kTBNoPoint)); Utils::Box(kBoxAny, "%s", _vm->_text->getTextParser(kTBNoPoint));
@ -319,7 +319,7 @@ bool Parser_v3d::isGenericVerb_v3(object_t *obj, char *comment) {
* If radius is -1, treat radius as infinity * If radius is -1, treat radius as infinity
* Verb is included to determine correct comment if not near * Verb is included to determine correct comment if not near
*/ */
bool Parser_v3d::isNear_v3(object_t *obj, char *verb, char *comment) const { bool Parser_v3d::isNear_v3(object_t *obj, const char *verb, char *comment) const {
debugC(1, kDebugParser, "isNear(object_t *obj, %s, %s)", verb, comment); debugC(1, kDebugParser, "isNear(object_t *obj, %s, %s)", verb, comment);
if (obj->carriedFl) // Object is being carried if (obj->carriedFl) // Object is being carried

View file

@ -162,8 +162,8 @@ void Scheduler::newScreen(const int screenIndex) {
// Make sure the background file exists! // Make sure the background file exists!
if (!_vm->isPacked()) { if (!_vm->isPacked()) {
Common::String filename = Common::String(_vm->_text->getScreenNames(screenIndex)); Common::String filename = Common::String(_vm->_text->getScreenNames(screenIndex));
if (!_vm->_file->fileExists(_vm->_picDir + filename + ".PCX") && if (!Common::File::exists(_vm->_picDir + filename + ".PCX") &&
!_vm->_file->fileExists(filename + ".ART")) { !Common::File::exists(filename + ".ART")) {
error("Unable to find background file for %s", filename.c_str()); error("Unable to find background file for %s", filename.c_str());
return; return;
} }

View file

@ -100,8 +100,8 @@ public:
int8 pcspkrOctave; // Current octave 1..7 int8 pcspkrOctave; // Current octave 1..7
int8 pcspkrNoteDuration; // Current length of note (ticks) int8 pcspkrNoteDuration; // Current length of note (ticks)
char *DOSSongPtr; const char *DOSSongPtr;
char *DOSIntroSong; const char *DOSIntroSong;
void toggleMusic(); void toggleMusic();
void toggleSound(); void toggleSound();

View file

@ -32,17 +32,17 @@ public:
TextHandler(HugoEngine *vm); TextHandler(HugoEngine *vm);
~TextHandler(); ~TextHandler();
char *getScreenNames(int screenIndex) { return _screenNames[screenIndex]; } const char *getNoun(int idx1, int idx2) const { return _arrayNouns[idx1][idx2]; }
char *getTextData(int textIndex) { return _textData[textIndex]; } const char *getScreenNames(int screenIndex) const { return _screenNames[screenIndex]; }
char *getStringtData(int stringIndex) { return _stringtData[stringIndex]; } const char *getStringtData(int stringIndex) const { return _stringtData[stringIndex]; }
char *getTextEngine(int engineIndex) { return _textEngine[engineIndex]; } const char *getTextData(int textIndex) const { return _textData[textIndex]; }
char *getTextIntro(int introIndex) { return _textIntro[introIndex]; } const char *getTextEngine(int engineIndex) const { return _textEngine[engineIndex]; }
char *getTextMouse(int mouseIndex) { return _textMouse[mouseIndex]; } const char *getTextIntro(int introIndex) const { return _textIntro[introIndex]; }
char *getTextParser(int parserIndex) { return _textParser[parserIndex]; } const char *getTextMouse(int mouseIndex) const { return _textMouse[mouseIndex]; }
char *getTextUtil(int utilIndex) { return _textUtil[utilIndex]; } const char *getTextParser(int parserIndex) const { return _textParser[parserIndex]; }
char *getNoun(int idx1, int idx2) { return _arrayNouns[idx1][idx2]; } const char *getTextUtil(int utilIndex) const { return _textUtil[utilIndex]; }
const char *getVerb(int idx1, int idx2) const { return _arrayVerbs[idx1][idx2]; }
char **getNounArray(int idx1) { return _arrayNouns[idx1]; } char **getNounArray(int idx1) { return _arrayNouns[idx1]; }
char *getVerb(int idx1, int idx2) { return _arrayVerbs[idx1][idx2]; }
char **getVerbArray(int idx1) { return _arrayVerbs[idx1]; } char **getVerbArray(int idx1) { return _arrayVerbs[idx1]; }
void loadAllTexts(Common::File &in); void loadAllTexts(Common::File &in);

View file

@ -39,17 +39,17 @@ enum seqTextUtil {
kGameOver = 0 kGameOver = 0
}; };
namespace Utils {
static const int kMaxStrLength = 1024; static const int kMaxStrLength = 1024;
namespace Utils { int firstBit(byte data);
int firstBit(byte data); int lastBit(byte data);
int lastBit(byte data);
void gameOverMsg(); void gameOverMsg();
void reverseByte(byte *data); void reverseByte(byte *data);
char *Box(box_t, const char *, ...) GCC_PRINTF(2, 3); char *Box(box_t, const char *, ...) GCC_PRINTF(2, 3);
char *strlwr(char *buffer); char *strlwr(char *buffer);
} }
} // End of namespace Hugo } // End of namespace Hugo