aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Boutonné2010-11-01 20:20:21 +0000
committerArnaud Boutonné2010-11-01 20:20:21 +0000
commite0fec608741636a79ba229425936a44519880343 (patch)
tree6f1a682e896b2cb3c0ae0f9e9f48b46e6b7aa653
parent130365ef0d36372349f566104faaa1acc105940d (diff)
downloadscummvm-rg350-e0fec608741636a79ba229425936a44519880343.tar.gz
scummvm-rg350-e0fec608741636a79ba229425936a44519880343.tar.bz2
scummvm-rg350-e0fec608741636a79ba229425936a44519880343.zip
HUGO: Convert class member comments to Doxygen format
svn-id: r54018
-rw-r--r--engines/hugo/display.cpp99
-rw-r--r--engines/hugo/display_v1d.cpp8
-rw-r--r--engines/hugo/display_v1w.cpp4
-rw-r--r--engines/hugo/file.cpp79
-rw-r--r--engines/hugo/file_v1d.cpp8
-rw-r--r--engines/hugo/file_v1w.cpp4
-rw-r--r--engines/hugo/file_v2d.cpp18
-rw-r--r--engines/hugo/file_v3d.cpp14
-rw-r--r--engines/hugo/game.h132
-rw-r--r--engines/hugo/hugo.cpp85
-rw-r--r--engines/hugo/intro_v1w.cpp4
-rw-r--r--engines/hugo/intro_v3d.cpp6
-rw-r--r--engines/hugo/intro_v3w.cpp10
-rw-r--r--engines/hugo/inventory.cpp42
-rw-r--r--engines/hugo/mouse.cpp31
-rw-r--r--engines/hugo/object.cpp58
-rw-r--r--engines/hugo/object_v1d.cpp24
-rw-r--r--engines/hugo/object_v1w.cpp24
-rw-r--r--engines/hugo/object_v2d.cpp16
-rw-r--r--engines/hugo/object_v3d.cpp14
-rw-r--r--engines/hugo/parser.cpp33
-rw-r--r--engines/hugo/parser_v1d.cpp60
-rw-r--r--engines/hugo/parser_v1w.cpp50
-rw-r--r--engines/hugo/parser_v2d.cpp4
-rw-r--r--engines/hugo/parser_v3d.cpp4
-rw-r--r--engines/hugo/route.cpp68
-rw-r--r--engines/hugo/schedule.cpp81
-rw-r--r--engines/hugo/schedule_v1d.cpp47
-rw-r--r--engines/hugo/schedule_v1w.cpp34
-rw-r--r--engines/hugo/schedule_v2d.cpp30
-rw-r--r--engines/hugo/schedule_v3d.cpp8
-rw-r--r--engines/hugo/util.cpp29
32 files changed, 755 insertions, 373 deletions
diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp
index 2380ab9f30..0ac12076dc 100644
--- a/engines/hugo/display.cpp
+++ b/engines/hugo/display.cpp
@@ -61,13 +61,17 @@ void Screen::createPal() {
g_system->setPalette(_vm->_palette, 0, NUM_COLORS);
}
+/**
+* Create logical palette
+*/
void Screen::initDisplay() {
debugC(1, kDebugDisplay, "initDisplay");
- // Create logical palette
createPal();
}
-// Move an image from source to destination
+/**
+* Move an image from source to destination
+*/
void Screen::moveImage(image_pt srcImage, uint16 x1, uint16 y1, uint16 dx, uint16 dy, uint16 width1, image_pt dstImage, uint16 x2, uint16 y2, uint16 width2) {
debugC(3, kDebugDisplay, "moveImage(srcImage, %d, %d, %d, %d, %d, dstImage, %d, %d, %d)", x1, y1, dx, dy, width1, x2, y2, width2);
@@ -91,15 +95,19 @@ void Screen::displayBackground() {
g_system->copyRectToScreen(_frontBuffer, 320, 0, 0, 320, 200);
}
-// Blit the supplied rectangle from _frontBuffer to the screen
+/**
+* Blit the supplied rectangle from _frontBuffer to the screen
+*/
void Screen::displayRect(int16 x, int16 y, int16 dx, int16 dy) {
debugC(3, kDebugDisplay, "displayRect(%d, %d, %d, %d)", x, y, dx, dy);
g_system->copyRectToScreen(&_frontBuffer[x + y * 320], 320, x, y, dx, dy);
}
+/**
+* Change a color by remapping supplied palette index with new index
+*/
void Screen::remapPal(uint16 oldIndex, uint16 newIndex) {
-// Change a color by remapping supplied palette index with new index
debugC(1, kDebugDisplay, "Remap_pal(%d, %d)", oldIndex, newIndex);
warning("STUB: Remap_pal()");
@@ -121,16 +129,20 @@ void Screen::restorePal(Common::SeekableReadStream *f) {
}
-// Set the new background color
+/**
+* Set the new background color
+*/
void Screen::setBackgroundColor(long color) {
debugC(1, kDebugDisplay, "setBackgroundColor(%ld)", color);
// How??? Translate existing pixels in dib before objects rendered?
}
-// Return the overlay state (Foreground/Background) of the currently
-// processed object by looking down the current column for an overlay
-// base bit set (in which case the object is foreground).
+/**
+* Return the overlay state (Foreground/Background) of the currently
+* processed object by looking down the current column for an overlay
+* base bit set (in which case the object is foreground).
+*/
overlayState_t Screen::findOvl(seq_t *seq_p, image_pt dst_p, uint16 y) {
debugC(4, kDebugDisplay, "findOvl");
@@ -144,8 +156,10 @@ overlayState_t Screen::findOvl(seq_t *seq_p, image_pt dst_p, uint16 y) {
return BG; // No bits set, must be background
}
-// Merge an object frame into _frontBuffer at sx, sy and update rectangle list.
-// If fore TRUE, force object above any overlay
+/**
+* Merge an object frame into _frontBuffer at sx, sy and update rectangle list.
+* If fore TRUE, force object above any overlay
+*/
void Screen::displayFrame(int sx, int sy, seq_t *seq, bool foreFl) {
debugC(3, kDebugDisplay, "displayFrame(%d, %d, seq, %d)", sx, sy, (foreFl) ? 1 : 0);
@@ -180,7 +194,9 @@ void Screen::displayFrame(int sx, int sy, seq_t *seq, bool foreFl) {
displayList(D_ADD, sx, sy, seq->x2 + 1, seq->lines);
}
-// Merge rectangles A,B leaving result in B
+/**
+* Merge rectangles A,B leaving result in B
+*/
void Screen::merge(rect_t *rectA, rect_t *rectB) {
debugC(6, kDebugDisplay, "merge");
@@ -195,10 +211,12 @@ void Screen::merge(rect_t *rectA, rect_t *rectB) {
rectB->dy = MAX(ya, yb) - rectB->y;
}
-// Coalesce the rectangles in the restore/add list into one unified
-// blist. len is the sizes of alist or rlist. blen is current length
-// of blist. bmax is the max size of the blist. Note that blist can
-// have holes, in which case dx = 0. Returns used length of blist.
+/**
+* Coalesce the rectangles in the restore/add list into one unified
+* blist. len is the sizes of alist or rlist. blen is current length
+* of blist. bmax is the max size of the blist. Note that blist can
+* have holes, in which case dx = 0. Returns used length of blist.
+*/
int16 Screen::mergeLists(rect_t *list, rect_t *blist, int16 len, int16 blen, int16 bmax) {
debugC(4, kDebugDisplay, "mergeLists");
@@ -233,8 +251,10 @@ int16 Screen::mergeLists(rect_t *list, rect_t *blist, int16 len, int16 blen, int
return blen;
}
-// Process the display list
-// Trailing args are int16 x,y,dx,dy for the D_ADD operation
+/**
+* Process the display list
+* Trailing args are int16 x,y,dx,dy for the D_ADD operation
+*/
void Screen::displayList(dupdate_t update, ...) {
debugC(6, kDebugDisplay, "displayList");
@@ -295,13 +315,14 @@ void Screen::displayList(dupdate_t update, ...) {
}
}
+/**
+* Write supplied character (font data) at sx,sy in supplied color
+* Font data as follows:
+* *(fontdata+1) = Font Height (pixels)
+* *(fontdata+1) = Font Width (pixels)
+* *(fontdata+x) = Font Bitmap (monochrome)
+*/
void Screen::writeChr(int sx, int sy, byte color, char *local_fontdata) {
-// Write supplied character (font data) at sx,sy in supplied color
-// Font data as follows:
-//
-// *(fontdata+1) = Font Height (pixels)
-// *(fontdata+1) = Font Width (pixels)
-// *(fontdata+x) = Font Bitmap (monochrome)
debugC(2, kDebugDisplay, "writeChr(%d, %d, %d, %d)", sx, sy, color, local_fontdata[0]);
byte height = local_fontdata[0];
@@ -320,7 +341,9 @@ void Screen::writeChr(int sx, int sy, byte color, char *local_fontdata) {
}
}
-// Returns height of characters in current font
+/**
+* Returns height of characters in current font
+*/
int16 Screen::fontHeight() {
debugC(2, kDebugDisplay, "fontHeight");
@@ -328,8 +351,9 @@ int16 Screen::fontHeight() {
return height[_fnt - FIRST_FONT];
}
-
-// Returns length of supplied string in pixels
+/**
+* Returns length of supplied string in pixels
+*/
int16 Screen::stringLength(const char *s) {
debugC(2, kDebugDisplay, "stringLength(%s)", s);
@@ -341,15 +365,19 @@ int16 Screen::stringLength(const char *s) {
return sum;
}
-// Return x which would center supplied string
+/**
+* Return x which would center supplied string
+*/
int16 Screen::center(const char *s) {
debugC(1, kDebugDisplay, "center(%s)", s);
return (int16)((XPIX - stringLength(s)) >> 1);
}
-// Write string at sx,sy in supplied color in current font
-// If sx == CENTER, center it
+/**
+* Write string at sx,sy in supplied color in current font
+* If sx == CENTER, center it
+*/
void Screen::writeStr(int16 sx, int16 sy, const char *s, byte color) {
debugC(2, kDebugDisplay, "writeStr(%d, %d, %s, %d)", sx, sy, s, color);
@@ -363,7 +391,9 @@ void Screen::writeStr(int16 sx, int16 sy, const char *s, byte color) {
}
}
-// Shadowed version of writestr
+/**
+* Shadowed version of writestr
+*/
void Screen::shadowStr(int16 sx, int16 sy, const char *s, byte color) {
debugC(1, kDebugDisplay, "shadowStr(%d, %d, %s, %d)", sx, sy, s, color);
@@ -374,9 +404,10 @@ void Screen::shadowStr(int16 sx, int16 sy, const char *s, byte color) {
writeStr(sx, sy, s, color);
}
+/** Introduce user to the game
+* DOS versions Only
+*/
void Screen::userHelp() {
-// Introduce user to the game
-// DOS versions Only
Utils::Box(BOX_ANY , "%s",
"F1 - Press F1 again\n"
" for instructions\n"
@@ -440,7 +471,9 @@ void Screen::drawRectangle(bool filledFl, uint16 x1, uint16 y1, uint16 x2, uint1
}
}
-// Initialize screen components and display results
+/**
+* Initialize screen components and display results
+*/
void Screen::initNewScreenDisplay() {
displayList(D_INIT);
setBackgroundColor(_TBLACK);
diff --git a/engines/hugo/display_v1d.cpp b/engines/hugo/display_v1d.cpp
index a46f5a8bec..df5ea636c6 100644
--- a/engines/hugo/display_v1d.cpp
+++ b/engines/hugo/display_v1d.cpp
@@ -46,9 +46,11 @@ Screen_v1d::Screen_v1d(HugoEngine *vm) : Screen(vm) {
Screen_v1d::~Screen_v1d() {
}
-// Load font file, construct font ptrs and reverse data bytes
-// TODO: This uses hardcoded fonts in hugo.dat, it should be replaced
-// by a proper implementation of .FON files
+/**
+* Load font file, construct font ptrs and reverse data bytes
+* TODO: This uses hardcoded fonts in hugo.dat, it should be replaced
+* by a proper implementation of .FON files
+*/
void Screen_v1d::loadFont(int16 fontId) {
debugC(2, kDebugDisplay, "loadFont(%d)", fontId);
diff --git a/engines/hugo/display_v1w.cpp b/engines/hugo/display_v1w.cpp
index 3dd8328c43..773d592731 100644
--- a/engines/hugo/display_v1w.cpp
+++ b/engines/hugo/display_v1w.cpp
@@ -47,7 +47,9 @@ Screen_v1w::Screen_v1w(HugoEngine *vm) : Screen(vm) {
Screen_v1w::~Screen_v1w() {
}
-// Load font file, construct font ptrs and reverse data bytes
+/**
+* Load font file, construct font ptrs and reverse data bytes
+*/
void Screen_v1w::loadFont(int16 fontId) {
debugC(2, kDebugDisplay, "loadFont(%d)", fontId);
diff --git a/engines/hugo/file.cpp b/engines/hugo/file.cpp
index c8f9586c74..5374e09304 100644
--- a/engines/hugo/file.cpp
+++ b/engines/hugo/file.cpp
@@ -48,9 +48,11 @@ FileManager::FileManager(HugoEngine *vm) : _vm(vm) {
FileManager::~FileManager() {
}
+/**
+* Convert 4 planes (RGBI) data to 8-bit DIB format
+* Return original plane data ptr
+*/
byte *FileManager::convertPCC(byte *p, uint16 y, uint16 bpl, image_pt dataPtr) {
-// Convert 4 planes (RGBI) data to 8-bit DIB format
-// Return original plane data ptr
debugC(2, kDebugFile, "convertPCC(byte *p, %d, %d, image_pt data_p)", y, bpl);
dataPtr += y * bpl * 8; // Point to correct DIB line
@@ -65,10 +67,12 @@ byte *FileManager::convertPCC(byte *p, uint16 y, uint16 bpl, image_pt dataPtr) {
return p;
}
+/**
+* Read a pcx file of length len. Use supplied seq_p and image_p or
+* 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, bool firstFl, const char *name) {
-// Read a pcx file of length len. Use supplied seq_p and image_p or
-// 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).
debugC(1, kDebugFile, "readPCX(..., %s)", name);
// Read in the PCC header and check consistency
@@ -137,8 +141,10 @@ seq_t *FileManager::readPCX(Common::File &f, seq_t *seqPtr, byte *imagePtr, bool
return seqPtr;
}
+/**
+* Read object file of PCC images into object supplied
+*/
void FileManager::readImage(int objNum, object_t *objPtr) {
-// Read object file of PCC images into object supplied
debugC(1, kDebugFile, "readImage(%d, object_t *objPtr)", objNum);
if (!objPtr->seqNumb) // This object has no images
@@ -227,9 +233,11 @@ void FileManager::readImage(int objNum, object_t *objPtr) {
_objectsArchive.close();
}
+/**
+* Read sound (or music) file data. Call with SILENCE to free-up
+* any allocated memory. Also returns size of data
+*/
sound_pt FileManager::getSound(int16 sound, uint16 *size) {
-// Read sound (or music) file data. Call with SILENCE to free-up
-// any allocated memory. Also returns size of data
debugC(1, kDebugFile, "getSound(%d, %d)", sound, *size);
// No more to do if SILENCE (called for cleanup purposes)
@@ -274,8 +282,10 @@ sound_pt FileManager::getSound(int16 sound, uint16 *size) {
return soundPtr;
}
+/**
+* Return whether file exists or not
+*/
bool FileManager::fileExists(char *filename) {
-// Return whether file exists or not
Common::File f;
if (f.open(filename)) {
f.close();
@@ -284,8 +294,10 @@ bool FileManager::fileExists(char *filename) {
return false;
}
+/**
+* Save game to supplied slot (-1 is INITFILE)
+*/
void FileManager::saveGame(int16 slot, const char *descrip) {
-// Save game to supplied slot (-1 is INITFILE)
debugC(1, kDebugFile, "saveGame(%d, %s)", slot, descrip);
// Get full path of saved game file - note test for INITFILE
@@ -353,8 +365,10 @@ void FileManager::saveGame(int16 slot, const char *descrip) {
delete out;
}
+/**
+* Restore game from supplied slot number (-1 is INITFILE)
+*/
void FileManager::restoreGame(int16 slot) {
-// Restore game from supplied slot number (-1 is INITFILE)
debugC(1, kDebugFile, "restoreGame(%d)", slot);
// Initialize new-game status
@@ -437,13 +451,15 @@ void FileManager::restoreGame(int16 slot) {
delete in;
}
+/**
+* Initialize the size of a saved game (from the fixed initial game).
+* If status.initsave is TRUE, or the initial saved game is not found,
+* force a save to create one. Normally the game will be shipped with
+* the initial game file but useful to force a write during development
+* when the size is changeable.
+* The net result is a valid INITFILE, with status.savesize initialized.
+*/
void FileManager::initSavedGame() {
-// Initialize the size of a saved game (from the fixed initial game).
-// If status.initsave is TRUE, or the initial saved game is not found,
-// force a save to create one. Normally the game will be shipped with
-// the initial game file but useful to force a write during development
-// when the size is changeable.
-// The net result is a valid INITFILE, with status.savesize initialized.
debugC(1, kDebugFile, "initSavedGame");
// Force save of initial game
@@ -470,8 +486,10 @@ void FileManager::initSavedGame() {
Utils::Error(WRITE_ERR, "%s", _vm->_initFilename.c_str());
}
+/**
+* Read the encrypted text from the boot file and print it
+*/
void FileManager::printBootText() {
-// Read the encrypted text from the boot file and print it
debugC(1, kDebugFile, "printBootText");
Common::File ofp;
@@ -508,9 +526,11 @@ void FileManager::printBootText() {
ofp.close();
}
+/**
+* Reads boot file for program environment. Fatal error if not there or
+* file checksum is bad. De-crypts structure while checking checksum
+*/
void FileManager::readBootFile() {
-// Reads boot file for program environment. Fatal error if not there or
-// file checksum is bad. De-crypts structure while checking checksum
debugC(1, kDebugFile, "readBootFile");
Common::File ofp;
@@ -546,8 +566,10 @@ void FileManager::readBootFile() {
Utils::Error(GEN_ERR, "%s", "Program startup file invalid");
}
+/**
+* Returns address of uif_hdr[id], reading it in if first call
+*/
uif_hdr_t *FileManager::getUIFHeader(uif_t id) {
-// Returns address of uif_hdr[id], reading it in if first call
debugC(1, kDebugFile, "getUIFHeader(%d)", id);
static bool firstFl = true;
@@ -574,8 +596,10 @@ uif_hdr_t *FileManager::getUIFHeader(uif_t id) {
return &UIFHeader[id];
}
+/**
+* Read uif item into supplied buffer.
+*/
void FileManager::readUIFItem(int16 id, byte *buf) {
-// Read uif item into supplied buffer.
debugC(1, kDebugFile, "readUIFItem(%d, ...)", id);
// Open uif file to read data
@@ -602,10 +626,11 @@ void FileManager::readUIFItem(int16 id, byte *buf) {
ip.close();
}
+/**
+* Simple instructions given when F1 pressed twice in a row
+* Only in DOS versions
+*/
void FileManager::instructions() {
-// Simple instructions given when F1 pressed twice in a row
-// Only in DOS versions
-
Common::File f;
if (!f.open(HELPFILE)) {
warning("help.dat not found");
@@ -629,7 +654,9 @@ void FileManager::instructions() {
f.close();
}
-// Read the uif image file (inventory icons)
+/**
+* Read the uif image file (inventory icons)
+*/
void FileManager::readUIFImages() {
debugC(1, kDebugFile, "readUIFImages");
diff --git a/engines/hugo/file_v1d.cpp b/engines/hugo/file_v1d.cpp
index 115a691ffc..059f1a25b7 100644
--- a/engines/hugo/file_v1d.cpp
+++ b/engines/hugo/file_v1d.cpp
@@ -52,8 +52,10 @@ void FileManager_v1d::closeDatabaseFiles() {
debugC(1, kDebugFile, "closeDatabaseFiles");
}
+/**
+* Open and read in an overlay file, close file
+*/
void FileManager_v1d::readOverlay(int screenNum, image_pt image, ovl_t overlayType) {
-// Open and read in an overlay file, close file
debugC(1, kDebugFile, "readOverlay(%d, ...)", screenNum);
const char *ovl_ext[] = {".b", ".o", ".ob"};
@@ -76,8 +78,10 @@ void FileManager_v1d::readOverlay(int screenNum, image_pt image, ovl_t overlayTy
_sceneryArchive1.close();
}
+/**
+* Read a PCX image into dib_a
+*/
void FileManager_v1d::readBackground(int screenIndex) {
-// Read a PCX image into dib_a
debugC(1, kDebugFile, "readBackground(%d)", screenIndex);
char *buf = (char *) malloc(2048 + 1); // Buffer for file access
diff --git a/engines/hugo/file_v1w.cpp b/engines/hugo/file_v1w.cpp
index 5218876caf..9e9d380200 100644
--- a/engines/hugo/file_v1w.cpp
+++ b/engines/hugo/file_v1w.cpp
@@ -43,8 +43,10 @@ FileManager_v1w::FileManager_v1w(HugoEngine *vm) : FileManager_v2d(vm) {
FileManager_v1w::~FileManager_v1w() {
}
+/**
+* Open and read in an overlay file, close file
+*/
void FileManager_v1w::readOverlay(int screenNum, image_pt image, ovl_t overlayType) {
-// Open and read in an overlay file, close file
debugC(1, kDebugFile, "readOverlay(%d, ...)", screenNum);
image_pt tmpImage = image; // temp ptr to overlay file
diff --git a/engines/hugo/file_v2d.cpp b/engines/hugo/file_v2d.cpp
index c4b17b3e65..a6f2ec6bb0 100644
--- a/engines/hugo/file_v2d.cpp
+++ b/engines/hugo/file_v2d.cpp
@@ -46,6 +46,9 @@ FileManager_v2d::FileManager_v2d(HugoEngine *vm) : FileManager(vm) {
FileManager_v2d::~FileManager_v2d() {
}
+/**
+* Open "database" file (packed files)
+*/
void FileManager_v2d::openDatabaseFiles() {
debugC(1, kDebugFile, "openDatabaseFiles");
@@ -57,6 +60,9 @@ void FileManager_v2d::openDatabaseFiles() {
Utils::Error(FILE_ERR, "%s", OBJECTS_FILE);
}
+/**
+* Close "Database" files
+*/
void FileManager_v2d::closeDatabaseFiles() {
debugC(1, kDebugFile, "closeDatabaseFiles");
@@ -65,8 +71,10 @@ void FileManager_v2d::closeDatabaseFiles() {
_objectsArchive.close();
}
+/**
+* Read a PCX image into dib_a
+*/
void FileManager_v2d::readBackground(int screenIndex) {
-// Read a PCX image into dib_a
debugC(1, kDebugFile, "readBackground(%d)", screenIndex);
_sceneryArchive1.seek((uint32) screenIndex * sizeof(sceneBlock_t), SEEK_SET);
@@ -88,8 +96,10 @@ void FileManager_v2d::readBackground(int screenIndex) {
readPCX(_sceneryArchive1, &dummySeq, _vm->_screen->getFrontBuffer(), true, _vm->_screenNames[screenIndex]);
}
+/**
+* Open and read in an overlay file, close file
+*/
void FileManager_v2d::readOverlay(int screenNum, image_pt image, ovl_t overlayType) {
-// Open and read in an overlay file, close file
debugC(1, kDebugFile, "readOverlay(%d, ...)", screenNum);
image_pt tmpImage = image; // temp ptr to overlay file
@@ -147,8 +157,10 @@ void FileManager_v2d::readOverlay(int screenNum, image_pt image, ovl_t overlayTy
} while (k < OVL_SIZE);
}
+/**
+* Fetch string from file, decode and return ptr to string in memory
+*/
char *FileManager_v2d::fetchString(int index) {
-// Fetch string from file, decode and return ptr to string in memory
debugC(1, kDebugFile, "fetchString(%d)", index);
// Get offset to string[index] (and next for length calculation)
diff --git a/engines/hugo/file_v3d.cpp b/engines/hugo/file_v3d.cpp
index f1e4bf0a15..e7af41b93f 100644
--- a/engines/hugo/file_v3d.cpp
+++ b/engines/hugo/file_v3d.cpp
@@ -45,8 +45,10 @@ FileManager_v3d::FileManager_v3d(HugoEngine *vm) : FileManager_v2d(vm) {
FileManager_v3d::~FileManager_v3d() {
}
+/**
+* Read a PCX image into dib_a
+*/
void FileManager_v3d::readBackground(int screenIndex) {
-// Read a PCX image into dib_a
debugC(1, kDebugFile, "readBackground(%d)", screenIndex);
_sceneryArchive1.seek((uint32) screenIndex * sizeof(sceneBlock_t), SEEK_SET);
@@ -73,6 +75,9 @@ void FileManager_v3d::readBackground(int screenIndex) {
}
}
+/**
+* Open "database" file (packed files)
+*/
void FileManager_v3d::openDatabaseFiles() {
debugC(1, kDebugFile, "openDatabaseFiles");
@@ -86,6 +91,9 @@ void FileManager_v3d::openDatabaseFiles() {
Utils::Error(FILE_ERR, "%s", OBJECTS_FILE);
}
+/**
+* Close "Database" files
+*/
void FileManager_v3d::closeDatabaseFiles() {
debugC(1, kDebugFile, "closeDatabaseFiles");
@@ -95,8 +103,10 @@ void FileManager_v3d::closeDatabaseFiles() {
_objectsArchive.close();
}
+/**
+* Open and read in an overlay file, close file
+*/
void FileManager_v3d::readOverlay(int screenNum, image_pt image, ovl_t overlayType) {
-// Open and read in an overlay file, close file
debugC(1, kDebugFile, "readOverlay(%d, ...)", screenNum);
image_pt tmpImage = image; // temp ptr to overlay file
diff --git a/engines/hugo/game.h b/engines/hugo/game.h
index 869aa1baa4..05d752e0fa 100644
--- a/engines/hugo/game.h
+++ b/engines/hugo/game.h
@@ -123,28 +123,42 @@ enum TEXTCOLORS {
enum uif_t {U_FONT5, U_FONT6, U_FONT8, UIF_IMAGES, NUM_UIF_ITEMS};
-// Enumerate overlay file types
+/**
+* Enumerate overlay file types
+*/
enum ovl_t {BOUNDARY, OVERLAY, OVLBASE};
-// Enumerate error types
+/**
+* Enumerate error types
+*/
enum {
GEN_ERR, FILE_ERR, WRITE_ERR, PCCH_ERR, HEAP_ERR, EVNT_ERR, SOUND_ERR
//MOUSE_ERR, VID_ERR, FONT_ERR, ARG_ERR, CHK_ERR, TIMER_ERR, VBX_ERR
};
-// Enumerate ways of cycling a sequence of frames
+/**
+* Enumerate ways of cycling a sequence of frames
+*/
enum cycle_t {INVISIBLE, ALMOST_INVISIBLE, NOT_CYCLING, CYCLE_FORWARD, CYCLE_BACKWARD};
-// Enumerate sequence index matching direction of travel
+/**
+* Enumerate sequence index matching direction of travel
+*/
enum {RIGHT, LEFT, DOWN, _UP};
-// Channel requirement during sound effect
+/**
+* Channel requirement during sound effect
+*/
enum stereo_t {BOTH_CHANNELS, RIGHT_CHANNEL, LEFT_CHANNEL};
-// Priority for sound effect
+/**
+* Priority for sound effect
+*/
enum priority_t {LOW_PRI, MED_PRI, HIGH_PRI};
-// Enumerate the different path types for an object
+/**
+* Enumerate the different path types for an object
+*/
enum path_t {
USER, // User has control of object via cursor keys
AUTO, // Computer has control, controlled by action lists
@@ -155,42 +169,62 @@ enum path_t {
WANDER2 // Same as WANDER, except keeps cycling when stationary
};
-// Enumerate whether object is foreground, background or 'floating'
-// If floating, HERO can collide with it and fore/back ground is determined
-// by relative y-coord of object base. This is the general case.
-// If fore or background, no collisions can take place and object is either
-// behind or in front of all others, although can still be hidden by the
-// the overlay plane. OVEROVL means the object is FLOATING (to other
-// objects) but is never hidden by the overlay plane
+/**
+* Enumerate whether object is foreground, background or 'floating'
+* If floating, HERO can collide with it and fore/back ground is determined
+* by relative y-coord of object base. This is the general case.
+* If fore or background, no collisions can take place and object is either
+* behind or in front of all others, although can still be hidden by the
+* the overlay plane. OVEROVL means the object is FLOATING (to other
+* objects) but is never hidden by the overlay plane
+*/
enum {FOREGROUND, BACKGROUND, FLOATING, OVEROVL};
-// Game view state machine
+/**
+* Game view state machine
+*/
enum vstate_t {V_IDLE, V_INTROINIT, V_INTRO, V_PLAY, V_INVENT, V_EXIT};
enum font_t {LARGE_ROMAN, MED_ROMAN, NUM_GDI_FONTS, INIT_FONTS, DEL_FONTS};
-// Ways to dismiss a text/prompt box
+/**
+* Ways to dismiss a text/prompt box
+*/
enum box_t {BOX_ANY, BOX_OK, BOX_PROMPT, BOX_YESNO};
-// Standard viewport sizes
+/**
+* Standard viewport sizes
+*/
enum wsize_t {SIZE_DEF, SIZE_1, SIZE_2, SIZE_3};
-// Display list functions
+/**
+* Display list functions
+*/
enum dupdate_t {D_INIT, D_ADD, D_DISPLAY, D_RESTORE};
-// General device installation commands
+/**
+* General device installation commands
+*/
enum inst_t {INSTALL, RESTORE, RESET};
-// Inventory icon bar states
+/**
+* Inventory icon bar states
+*/
enum istate_t {I_OFF, I_UP, I_DOWN, I_ACTIVE};
-// Actions for Process_inventory()
+/**
+* Actions for Process_inventory()
+*/
enum invact_t {INV_INIT, INV_LEFT, INV_RIGHT, INV_GET};
-// Purpose of an automatic route
+/**
+* Purpose of an automatic route
+*/
enum go_t {GO_SPACE, GO_EXIT, GO_LOOK, GO_GET};
-// Following defines the action types and action list
+/**
+* Following defines the action types and action list
+*/
enum action_t { // Parameters:
ANULL = 0xff, // Special NOP used to 'delete' events in DEL_EVENTS
ASCHEDULE = 0, // 0 - Ptr to action list to be rescheduled
@@ -259,17 +293,23 @@ struct uif_hdr_t { // UIF font/image look up
uint32 offset; // Offset of item in file
};
-// Game specific type definitions
+/**
+* Game specific type definitions
+*/
typedef byte *image_pt; // ptr to an object image (sprite)
typedef byte *sound_pt; // ptr to sound (or music) data
-// Following are points for achieving certain actions.
+/**
+* Following are points for achieving certain actions.
+*/
struct point_t {
byte score; // The value of the point
bool scoredFl; // Whether scored yet
};
-// Structure for initializing maze processing
+/**
+* Structure for initializing maze processing
+*/
struct maze_t {
bool enabledFl; // TRUE when maze processing enabled
byte size; // Size of (square) maze matrix
@@ -684,7 +724,9 @@ union act {
act49 a49;
};
-// The following determines how a verb is acted on, for an object
+/**
+* The following determines how a verb is acted on, for an object
+*/
struct cmd {
uint16 verbIndex; // the verb
uint16 reqIndex; // ptr to list of required objects
@@ -696,8 +738,10 @@ struct cmd {
uint16 actIndex; // Ptr to action list if verb done
};
-// The following is a linked list of images in an animation sequence
-// The image data is in 8-bit DIB format, i.e. 1 byte = 1 pixel
+/**
+* The following is a linked list of images in an animation sequence
+* The image data is in 8-bit DIB format, i.e. 1 byte = 1 pixel
+*/
struct seq_t { // Linked list of images
byte *imagePtr; // ptr to image
uint16 bytesPerLine8; // bytes per line (8bits)
@@ -706,13 +750,17 @@ struct seq_t { // Linked list of images
seq_t *nextSeqPtr; // ptr to next record
};
-// The following is an array of structures of above sequences
+/**
+* The following is an array of structures of above sequences
+*/
struct seqList_t {
uint16 imageNbr; // Number of images in sequence
seq_t *seqPtr; // Ptr to sequence structure
};
-// Following is definition of object attributes
+/**
+* Following is definition of object attributes
+*/
struct object_t {
uint16 nounIndex; // String identifying object
uint16 dataIndex; // String describing the object
@@ -747,10 +795,12 @@ struct object_t {
int8 oldvy; // Previous vy
};
-// Following is structure of verbs and nouns for 'background' objects
-// These are objects that appear in the various screens, but nothing
-// interesting ever happens with them. Rather than just be dumb and say
-// "don't understand" we produce an interesting msg to keep user sane.
+/**
+* Following is structure of verbs and nouns for 'background' objects
+* These are objects that appear in the various screens, but nothing
+* interesting ever happens with them. Rather than just be dumb and say
+* "don't understand" we produce an interesting msg to keep user sane.
+*/
struct background_t {
uint16 verbIndex;
uint16 nounIndex;
@@ -769,7 +819,9 @@ typedef byte icondib_t[XPIX *INV_DY]; // Icon bar dib
typedef char command_t[MAX_CHARS + 8]; // Command line (+spare for prompt,cursor)
typedef char fpath_t[MAX_FPATH]; // File path
-// Structure to define an EXIT or other collision-activated hotspot
+/**
+* Structure to define an EXIT or other collision-activated hotspot
+*/
struct hotspot_t {
int screenIndex; // Screen in which hotspot appears
int x1, y1, x2, y2; // Bounding box of hotspot
@@ -842,7 +894,9 @@ extern hugo_boot_t _boot; // Boot info structure
extern char _textBoxBuffer[]; // Useful box text buffer
extern command_t _line; // Line of user text input
-// Structure of scenery file lookup entry
+/**
+* Structure of scenery file lookup entry
+*/
struct sceneBlock_t {
uint32 scene_off;
uint32 scene_len;
@@ -854,7 +908,9 @@ struct sceneBlock_t {
uint32 ob_len;
};
-// Structure of object file lookup entry
+/**
+* Structure of object file lookup entry
+*/
struct objBlock_t {
uint32 objOffset;
uint32 objLength;
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp
index 4aca02c748..daa4df66bc 100644
--- a/engines/hugo/hugo.cpp
+++ b/engines/hugo/hugo.cpp
@@ -299,8 +299,10 @@ void HugoEngine::initMachine() {
_file->readUIFImages(); // Read all uif images (only in Win versions)
}
+/**
+* Hugo game state machine - called during onIdle
+*/
void HugoEngine::runMachine() {
-// Hugo game state machine - called during onIdle
static uint32 lastTime;
status_t &gameStatus = getGameStatus();
@@ -353,6 +355,9 @@ void HugoEngine::runMachine() {
}
}
+/**
+* Loads Hugo.dat file, which contains all the hardcoded data in the original executables
+*/
bool HugoEngine::loadHugoDat() {
Common::File in;
in.open("hugo.dat");
@@ -670,7 +675,7 @@ bool HugoEngine::loadHugoDat() {
_heroImage = HERO; // Current in use hero image
_scheduler->loadActListArr(in);
-
+
for (int varnt = 0; varnt < _numVariant; varnt++) {
if (varnt == _gameVariant) {
_tunesNbr = in.readSByte();
@@ -895,7 +900,9 @@ void HugoEngine::freeTexts(char **ptr) {
free(ptr);
}
-// Sets the playlist to be the default tune selection
+/**
+* Sets the playlist to be the default tune selection
+*/
void HugoEngine::initPlaylist(bool playlist[MAX_TUNES]) {
debugC(1, kDebugEngine, "initPlaylist");
@@ -905,7 +912,9 @@ void HugoEngine::initPlaylist(bool playlist[MAX_TUNES]) {
playlist[_defltTunes[i]] = true;
}
-// Initialize the dynamic game status
+/**
+* Initialize the dynamic game status
+*/
void HugoEngine::initStatus() {
debugC(1, kDebugEngine, "initStatus");
_status.initSaveFl = true; // Force initial save
@@ -942,8 +951,10 @@ void HugoEngine::initStatus() {
_status.go_id = -1; // Hero not walking to anything
}
-// Initialize default config values. Must be done before Initialize().
-// Reset needed to save config.cx,cy which get splatted during OnFileNew()
+/**
+* Initialize default config values. Must be done before Initialize().
+* Reset needed to save config.cx,cy which get splatted during OnFileNew()
+*/
void HugoEngine::initConfig(inst_t action) {
debugC(1, kDebugEngine, "initConfig(%d)", action);
@@ -1011,7 +1022,9 @@ void HugoEngine::initialize() {
}
}
-// Restore all resources before termination
+/**
+* Restore all resources before termination
+*/
void HugoEngine::shutdown() {
debugC(1, kDebugEngine, "shutdown");
@@ -1026,7 +1039,9 @@ void HugoEngine::readObjectImages() {
_file->readImage(i, &_object->_objects[i]);
}
-// Read scenery, overlay files for given screen number
+/**
+* Read scenery, overlay files for given screen number
+*/
void HugoEngine::readScreenFiles(int screenNum) {
debugC(1, kDebugEngine, "readScreenFiles(%d)", screenNum);
@@ -1037,8 +1052,10 @@ void HugoEngine::readScreenFiles(int screenNum) {
_file->readOverlay(screenNum, _ovlBase, OVLBASE); // Overlay base file
}
-// Return maximum allowed movement (from zero to vx) such that object does
-// not cross a boundary (either background or another object)
+/**
+* Return maximum allowed movement (from zero to vx) such that object does
+* not cross a boundary (either background or another object)
+*/
int HugoEngine::deltaX(int x1, int x2, int vx, int y) {
// Explanation of algorithm: The boundaries are drawn as contiguous
// lines 1 pixel wide. Since DX,DY are not necessarily 1, we must
@@ -1087,9 +1104,11 @@ int HugoEngine::deltaX(int x1, int x2, int vx, int y) {
return vx;
}
-// Similar to Delta_x, but for movement in y direction. Special case of
-// bytes at end of line segment; must only count boundary bits falling on
-// line segment.
+/**
+* Similar to Delta_x, but for movement in y direction. Special case of
+* bytes at end of line segment; must only count boundary bits falling on
+* line segment.
+*/
int HugoEngine::deltaY(int x1, int x2, int vy, int y) {
debugC(3, kDebugEngine, "deltaY(%d, %d, %d, %d)", x1, x2, vy, y);
@@ -1114,7 +1133,9 @@ int HugoEngine::deltaY(int x1, int x2, int vy, int y) {
return vy;
}
-// Store a horizontal line segment in the object boundary file
+/**
+* Store a horizontal line segment in the object boundary file
+*/
void HugoEngine::storeBoundary(int x1, int x2, int y) {
debugC(5, kDebugEngine, "storeBoundary(%d, %d, %d)", x1, x2, y);
@@ -1129,7 +1150,9 @@ void HugoEngine::storeBoundary(int x1, int x2, int y) {
}
}
-// Clear a horizontal line segment in the object boundary file
+/**
+* Clear a horizontal line segment in the object boundary file
+*/
void HugoEngine::clearBoundary(int x1, int x2, int y) {
debugC(5, kDebugEngine, "clearBoundary(%d, %d, %d)", x1, x2, y);
@@ -1144,8 +1167,10 @@ void HugoEngine::clearBoundary(int x1, int x2, int y) {
}
}
-// Search background command list for this screen for supplied object.
-// Return first associated verb (not "look") or 0 if none found.
+/**
+* Search background command list for this screen for supplied object.
+* Return first associated verb (not "look") or 0 if none found.
+*/
char *HugoEngine::useBG(char *name) {
debugC(1, kDebugEngine, "useBG(%s)", name);
@@ -1160,7 +1185,9 @@ char *HugoEngine::useBG(char *name) {
return 0;
}
-// Add action lists for this screen to event queue
+/**
+* Add action lists for this screen to event queue
+*/
void HugoEngine::screenActions(int screenNum) {
debugC(1, kDebugEngine, "screenActions(%d)", screenNum);
@@ -1171,18 +1198,22 @@ void HugoEngine::screenActions(int screenNum) {
}
}
-// Set the new screen number into the hero object and any carried objects
+/**
+* Set the new screen number into the hero object and any carried objects
+*/
void HugoEngine::setNewScreen(int screenNum) {
debugC(1, kDebugEngine, "setNewScreen(%d)", screenNum);
- *_screen_p = screenNum; // HERO object
- for (int i = HERO + 1; i < _numObj; i++) { // Any others
- if (_object->isCarried(i)) // being carried
+ *_screen_p = screenNum; // HERO object
+ for (int i = HERO + 1; i < _numObj; i++) { // Any others
+ if (_object->isCarried(i)) // being carried
_object->_objects[i].screenIndex = screenNum;
}
}
-// An object has collided with a boundary. See if any actions are required
+/**
+* An object has collided with a boundary. See if any actions are required
+*/
void HugoEngine::boundaryCollision(object_t *obj) {
debugC(1, kDebugEngine, "boundaryCollision");
@@ -1216,7 +1247,9 @@ void HugoEngine::boundaryCollision(object_t *obj) {
}
}
-// Add up all the object values and all the bonus points
+/**
+* Add up all the object values and all the bonus points
+*/
void HugoEngine::calcMaxScore() {
debugC(1, kDebugEngine, "calcMaxScore");
@@ -1227,7 +1260,9 @@ void HugoEngine::calcMaxScore() {
_maxscore += _points[i].score;
}
-// Exit game, advertise trilogy, show copyright
+/**
+* Exit game, advertise trilogy, show copyright
+*/
void HugoEngine::endGame() {
debugC(1, kDebugEngine, "endGame");
diff --git a/engines/hugo/intro_v1w.cpp b/engines/hugo/intro_v1w.cpp
index 74efc4ff8c..bdea2837b1 100644
--- a/engines/hugo/intro_v1w.cpp
+++ b/engines/hugo/intro_v1w.cpp
@@ -45,8 +45,10 @@ intro_v1w::intro_v1w(HugoEngine *vm) : IntroHandler(vm) {
intro_v1w::~intro_v1w() {
}
+/**
+* Auto-start a new game
+*/
void intro_v1w::preNewGame() {
- // Auto-start a new game
_vm->_file->restoreGame(-1);
_vm->getGameStatus().viewState = V_INTROINIT;
}
diff --git a/engines/hugo/intro_v3d.cpp b/engines/hugo/intro_v3d.cpp
index 8e0c0cc22c..87dca946f5 100644
--- a/engines/hugo/intro_v3d.cpp
+++ b/engines/hugo/intro_v3d.cpp
@@ -75,11 +75,13 @@ void intro_v3d::introInit() {
introTicks = 0;
}
+/**
+* Hugo 3 - Preamble screen before going into game. Draws path of Hugo's plane.
+* Called every tick. Returns TRUE when complete
+*/
bool intro_v3d::introPlay() {
byte introSize = _vm->getIntroSize();
-// Hugo 3 - Preamble screen before going into game. Draws path of Hugo's plane.
-// Called every tick. Returns TRUE when complete
//TODO : Add proper check of story mode
//#if STORY
if (introTicks < introSize) {
diff --git a/engines/hugo/intro_v3w.cpp b/engines/hugo/intro_v3w.cpp
index a0bc624760..06fe1814fe 100644
--- a/engines/hugo/intro_v3w.cpp
+++ b/engines/hugo/intro_v3w.cpp
@@ -49,8 +49,10 @@ intro_v3w::~intro_v3w() {
void intro_v3w::preNewGame() {
}
+/**
+* Hugo 3 - show map and set up for introPlay()
+*/
void intro_v3w::introInit() {
-// Hugo 3 - show map and set up for introPlay()
//#if STORY
_vm->_file->readBackground(22); // display screen MAP_3w
_vm->_screen->displayBackground();
@@ -59,11 +61,13 @@ void intro_v3w::introInit() {
//#endif
}
+/**
+* Hugo 3 - Preamble screen before going into game. Draws path of Hugo's plane.
+* Called every tick. Returns TRUE when complete
+*/
bool intro_v3w::introPlay() {
byte introSize = _vm->getIntroSize();
-// Hugo 3 - Preamble screen before going into game. Draws path of Hugo's plane.
-// Called every tick. Returns TRUE when complete
//TODO : Add proper check of story mode
//#if STORY
if (introTicks < introSize) {
diff --git a/engines/hugo/inventory.cpp b/engines/hugo/inventory.cpp
index ad0d5cbce9..74ab32c34f 100644
--- a/engines/hugo/inventory.cpp
+++ b/engines/hugo/inventory.cpp
@@ -49,11 +49,13 @@ namespace Hugo {
InventoryHandler::InventoryHandler(HugoEngine *vm) : _vm(vm) {
}
-// Construct the inventory scrollbar in dib_i
-// imageTotNumb is total number of inventory icons
-// displayNumb is number requested for display
-// scrollFl is TRUE if scroll arrows required
-// firstObjId is index of first (scrolled) inventory object to display
+/**
+* Construct the inventory scrollbar in dib_i
+* imageTotNumb is total number of inventory icons
+* displayNumb is number requested for display
+* scrollFl is TRUE if scroll arrows required
+* firstObjId is index of first (scrolled) inventory object to display
+*/
void InventoryHandler::constructInventory(int16 imageTotNumb, int displayNumb, bool scrollFl, int16 firstObjId) {
debugC(1, kDebugInventory, "constructInventory(%d, %d, %d, %d)", imageTotNumb, displayNumb, (scrollFl) ? 0 : 1, firstObjId);
@@ -81,7 +83,7 @@ void InventoryHandler::constructInventory(int16 imageTotNumb, int displayNumb, b
// Compute dest coordinates in dib_i
int16 ix = ((scrollFl) ? displayed + 1 : displayed) * INV_DX;
- displayed++; // Count number displayed
+ displayed++; // Count number displayed
// Copy the icon
_vm->_screen->moveImage(_vm->_screen->getGUIBuffer(), ux, uy, INV_DX, INV_DY, XPIX, _vm->_screen->getIconBuffer(), ix, 0, XPIX);
@@ -91,8 +93,10 @@ void InventoryHandler::constructInventory(int16 imageTotNumb, int displayNumb, b
}
}
-// Process required action for inventory
-// Returns objId under cursor (or -1) for INV_GET
+/**
+* Process required action for inventory
+* Returns objId under cursor (or -1) for INV_GET
+*/
int16 InventoryHandler::processInventory(invact_t action, ...) {
debugC(1, kDebugInventory, "processInventory(invact_t action, ...)");
@@ -110,7 +114,7 @@ int16 InventoryHandler::processInventory(invact_t action, ...) {
bool scrollFl = displayNumb > MAX_DISP;
va_list marker; // Args used for D_ADD operation
int16 cursorx, cursory; // Current cursor position
- int16 objId = -1; // Return objid under cursor
+ int16 objId = -1; // Return objid under cursor
switch (action) {
case INV_INIT: // Initialize inventory display
@@ -159,15 +163,17 @@ int16 InventoryHandler::processInventory(invact_t action, ...) {
}
break;
}
- return objId; // For the INV_GET action
+ return objId; // For the INV_GET action
}
+/**
+* Process inventory state machine
+*/
void InventoryHandler::runInventory() {
status_t &gameStatus = _vm->getGameStatus();
debugC(1, kDebugInventory, "runInventory");
-// Process inventory state machine
switch (gameStatus.inventoryState) {
case I_OFF: // Icon bar off screen
break;
@@ -195,9 +201,9 @@ void InventoryHandler::runInventory() {
// and get any icon/text out of _frontBuffer
if (gameStatus.inventoryHeight == 0) {
processInventory(INV_INIT); // Initialize dib_i
- _vm->_screen->displayList(D_RESTORE); // Restore _frontBuffer
- _vm->_object->updateImages(); // Rebuild _frontBuffer without icons/text
- _vm->_screen->displayList(D_DISPLAY); // Blit display list to screen
+ _vm->_screen->displayList(D_RESTORE); // Restore _frontBuffer
+ _vm->_object->updateImages(); // Rebuild _frontBuffer without icons/text
+ _vm->_screen->displayList(D_DISPLAY); // Blit display list to screen
}
gameStatus.inventoryHeight += STEP_DY; // Move the icon bar down
@@ -221,10 +227,10 @@ void InventoryHandler::runInventory() {
}
break;
case I_ACTIVE: // Inventory active
- _vm->_parser->charHandler(); // Still allow commands
- _vm->_screen->displayList(D_RESTORE); // Restore previous background
- _vm->_mouse->mouseHandler(); // Mouse activity - adds to display list
- _vm->_screen->displayList(D_DISPLAY); // Blit the display list to screen
+ _vm->_parser->charHandler(); // Still allow commands
+ _vm->_screen->displayList(D_RESTORE); // Restore previous background
+ _vm->_mouse->mouseHandler(); // Mouse activity - adds to display list
+ _vm->_screen->displayList(D_DISPLAY); // Blit the display list to screen
break;
}
}
diff --git a/engines/hugo/mouse.cpp b/engines/hugo/mouse.cpp
index 9fc8a33373..385dce2703 100644
--- a/engines/hugo/mouse.cpp
+++ b/engines/hugo/mouse.cpp
@@ -63,7 +63,9 @@ enum seqTextMouse {
MouseHandler::MouseHandler(HugoEngine *vm) : _vm(vm) {
}
-// Shadow-blit supplied string into dib_a at cx,cy and add to display list
+/**
+* Shadow-blit supplied string into dib_a at cx,cy and add to display list
+*/
void MouseHandler::cursorText(char *buffer, int16 cx, int16 cy, uif_t fontId, int16 color) {
debugC(1, kDebugMouse, "cursorText(%s, %d, %d, %d, %d)", buffer, cx, cy, fontId, color);
@@ -80,8 +82,10 @@ void MouseHandler::cursorText(char *buffer, int16 cx, int16 cy, uif_t fontId, in
_vm->_screen->displayList(D_ADD, sx, sy, sdx, sdy);
}
-// Find the exit hotspot containing cx, cy.
-// Return hotspot index or -1 if not found.
+/**
+* Find the exit hotspot containing cx, cy.
+* Return hotspot index or -1 if not found.
+*/
int16 MouseHandler::findExit(int16 cx, int16 cy) {
debugC(2, kDebugMouse, "findExit(%d, %d)", cx, cy);
@@ -95,7 +99,9 @@ int16 MouseHandler::findExit(int16 cx, int16 cy) {
return -1;
}
-// Process a mouse right click at coord cx, cy over object objid
+/**
+* Process a mouse right click at coord cx, cy over object objid
+*/
void MouseHandler::processRightClick(int16 objId, int16 cx, int16 cy) {
debugC(1, kDebugMouse, "Process_rclick(%d, %d, %d)", objId, cx, cy);
@@ -138,12 +144,13 @@ void MouseHandler::processRightClick(int16 objId, int16 cx, int16 cy) {
}
}
-// Process a left mouse click over:
-// 1. An icon - show description
-// 2. An object - walk to and show description
-// 3. An icon scroll arrow - scroll the iconbar
-// 4. Nothing - attempt to walk there
-// 5. Exit - walk to exit hotspot
+/** Process a left mouse click over:
+* 1. An icon - show description
+* 2. An object - walk to and show description
+* 3. An icon scroll arrow - scroll the iconbar
+* 4. Nothing - attempt to walk there
+* 5. Exit - walk to exit hotspot
+*/
void MouseHandler::processLeftClick(int16 objId, int16 cx, int16 cy) {
debugC(1, kDebugMouse, "Process_lclick(%d, %d, %d)", objId, cx, cy);
@@ -223,7 +230,9 @@ void MouseHandler::processLeftClick(int16 objId, int16 cx, int16 cy) {
}
}
-// Process mouse activity
+/**
+* Process mouse activity
+*/
void MouseHandler::mouseHandler() {
debugC(2, kDebugMouse, "mouseHandler");
diff --git a/engines/hugo/object.cpp b/engines/hugo/object.cpp
index 5ecfb354fe..e54bf2f342 100644
--- a/engines/hugo/object.cpp
+++ b/engines/hugo/object.cpp
@@ -52,8 +52,10 @@ ObjectHandler::ObjectHandler(HugoEngine *vm) : _vm(vm) {
ObjectHandler::~ObjectHandler() {
}
+/**
+* Save sequence number and image number in given object
+*/
void ObjectHandler::saveSeq(object_t *obj) {
-// Save sequence number and image number in given object
debugC(1, kDebugObject, "saveSeq");
bool found = false;
@@ -71,8 +73,10 @@ void ObjectHandler::saveSeq(object_t *obj) {
}
}
+/**
+* Set up cur_seq_p from stored sequence and image number in object
+*/
void ObjectHandler::restoreSeq(object_t *obj) {
-// Set up cur_seq_p from stored sequence and image number in object
debugC(1, kDebugObject, "restoreSeq");
seq_t *q = obj->seqList[obj->curSeqNum].seqPtr;
@@ -81,8 +85,10 @@ void ObjectHandler::restoreSeq(object_t *obj) {
obj->currImagePtr = q;
}
-// If status.objid = -1, pick up objid, else use status.objid on objid,
-// if objid can't be picked up, use it directly
+/**
+* If status.objid = -1, pick up objid, else use status.objid on objid,
+* if objid can't be picked up, use it directly
+*/
void ObjectHandler::useObject(int16 objId) {
debugC(1, kDebugObject, "useObject(%d)", objId);
@@ -140,8 +146,10 @@ void ObjectHandler::useObject(int16 objId) {
_vm->_parser->lineHandler(); // and process command
}
-// Return object index of the topmost object under the cursor, or -1 if none
-// Objects are filtered if not "useful"
+/**
+* Return object index of the topmost object under the cursor, or -1 if none
+* Objects are filtered if not "useful"
+*/
int16 ObjectHandler::findObject(uint16 x, uint16 y) {
debugC(3, kDebugObject, "findObject(%d, %d)", x, y);
@@ -181,8 +189,10 @@ int16 ObjectHandler::findObject(uint16 x, uint16 y) {
return objIndex;
}
-// Issue "Look at <object>" command
-// Note special case of swapped hero image
+/**
+* Issue "Look at <object>" command
+* Note special case of swapped hero image
+*/
void ObjectHandler::lookObject(object_t *obj) {
debugC(1, kDebugObject, "lookObject");
@@ -193,7 +203,9 @@ void ObjectHandler::lookObject(object_t *obj) {
_vm->_parser->command("%s %s", _vm->_arrayVerbs[_vm->_look][0], _vm->_arrayNouns[obj->nounIndex][0]);
}
-// Free all object images
+/**
+* Free all object images
+*/
void ObjectHandler::freeObjects() {
debugC(1, kDebugObject, "freeObjects");
@@ -217,14 +229,14 @@ void ObjectHandler::freeObjects() {
}
}
-// Compare function for the quicksort. The sort is to order the objects in
-// increasing vertical position, using y+y2 as the baseline
-// Returns -1 if ay2 < by2 else 1 if ay2 > by2 else 0
+/**
+* Compare function for the quicksort. The sort is to order the objects in
+* increasing vertical position, using y+y2 as the baseline
+* Returns -1 if ay2 < by2 else 1 if ay2 > by2 else 0
+*/
int ObjectHandler::y2comp(const void *a, const void *b) {
debugC(6, kDebugObject, "y2comp");
-// const object_t *p1 = &s_Engine->_objects[*(const byte *)a];
-// const object_t *p2 = &s_Engine->_objects[*(const byte *)b];
const object_t *p1 = &HugoEngine::get()._object->_objects[*(const byte *)a];
const object_t *p2 = &HugoEngine::get()._object->_objects[*(const byte *)b];
@@ -250,7 +262,9 @@ int ObjectHandler::y2comp(const void *a, const void *b) {
return ay2 - by2;
}
-// Return TRUE if object being carried by hero
+/**
+* Return TRUE if object being carried by hero
+*/
bool ObjectHandler::isCarrying(uint16 wordIndex) {
debugC(1, kDebugObject, "isCarrying(%d)", wordIndex);
@@ -261,7 +275,9 @@ bool ObjectHandler::isCarrying(uint16 wordIndex) {
return false;
}
-// Describe any takeable objects visible in this screen
+/**
+* Describe any takeable objects visible in this screen
+*/
void ObjectHandler::showTakeables() {
debugC(1, kDebugObject, "showTakeables");
@@ -275,7 +291,9 @@ void ObjectHandler::showTakeables() {
}
}
-// Find a clear space around supplied object that hero can walk to
+/**
+* Find a clear space around supplied object that hero can walk to
+*/
bool ObjectHandler::findObjectSpace(object_t *obj, int16 *destx, int16 *desty) {
debugC(1, kDebugObject, "findObjectSpace(obj, %d, %d)", *destx, *desty);
@@ -318,10 +336,16 @@ bool ObjectHandler::findObjectSpace(object_t *obj, int16 *destx, int16 *desty) {
return foundFl;
}
+/**
+* Free ObjectArr (before exiting)
+*/
void ObjectHandler::freeObjectArr() {
free(_objects);
}
+/**
+* Load ObjectArr from Hugo.dat
+*/
void ObjectHandler::loadObjectArr(Common::File &in) {
debugC(6, kDebugObject, "loadObject(&in)");
diff --git a/engines/hugo/object_v1d.cpp b/engines/hugo/object_v1d.cpp
index 8c1a65ebd5..6c929f75fd 100644
--- a/engines/hugo/object_v1d.cpp
+++ b/engines/hugo/object_v1d.cpp
@@ -52,10 +52,12 @@ ObjectHandler_v1d::ObjectHandler_v1d(HugoEngine *vm) : ObjectHandler(vm) {
ObjectHandler_v1d::~ObjectHandler_v1d() {
}
-// Draw all objects on screen as follows:
-// 1. Sort 'FLOATING' objects in order of y2 (base of object)
-// 2. Display new object frames/positions in dib
-// Finally, cycle any animating objects to next frame
+/**
+* Draw all objects on screen as follows:
+* 1. Sort 'FLOATING' objects in order of y2 (base of object)
+* 2. Display new object frames/positions in dib
+* Finally, cycle any animating objects to next frame
+*/
void ObjectHandler_v1d::updateImages() {
debugC(5, kDebugObject, "updateImages");
@@ -169,8 +171,10 @@ void ObjectHandler_v1d::updateImages() {
}
}
-// Update all object positions. Process object 'local' events
-// including boundary events and collisions
+/**
+* Update all object positions. Process object 'local' events
+* including boundary events and collisions
+*/
void ObjectHandler_v1d::moveObjects() {
debugC(4, kDebugObject, "moveObjects");
@@ -346,10 +350,12 @@ void ObjectHandler_v1d::moveObjects() {
}
}
+/**
+* Swap all the images of one object with another. Set hero_image (we make
+* the assumption for now that the first obj is always the HERO) to the object
+* number of the swapped image
+*/
void ObjectHandler_v1d::swapImages(int objNumb1, int objNumb2) {
-// Swap all the images of one object with another. Set hero_image (we make
-// the assumption for now that the first obj is always the HERO) to the object
-// number of the swapped image
debugC(1, kDebugObject, "swapImages(%d, %d)", objNumb1, objNumb2);
seqList_t tmpSeqList[MAX_SEQUENCES];
diff --git a/engines/hugo/object_v1w.cpp b/engines/hugo/object_v1w.cpp
index 0b376889fc..48d921f2be 100644
--- a/engines/hugo/object_v1w.cpp
+++ b/engines/hugo/object_v1w.cpp
@@ -52,10 +52,12 @@ ObjectHandler_v1w::ObjectHandler_v1w(HugoEngine *vm) : ObjectHandler(vm) {
ObjectHandler_v1w::~ObjectHandler_v1w() {
}
-// Draw all objects on screen as follows:
-// 1. Sort 'FLOATING' objects in order of y2 (base of object)
-// 2. Display new object frames/positions in dib
-// Finally, cycle any animating objects to next frame
+/**
+* Draw all objects on screen as follows:
+* 1. Sort 'FLOATING' objects in order of y2 (base of object)
+* 2. Display new object frames/positions in dib
+* Finally, cycle any animating objects to next frame
+*/
void ObjectHandler_v1w::updateImages() {
debugC(5, kDebugObject, "updateImages");
@@ -167,8 +169,10 @@ void ObjectHandler_v1w::updateImages() {
}
}
-// Update all object positions. Process object 'local' events
-// including boundary events and collisions
+/**
+* Update all object positions. Process object 'local' events
+* including boundary events and collisions
+*/
void ObjectHandler_v1w::moveObjects() {
debugC(4, kDebugObject, "moveObjects");
@@ -354,10 +358,12 @@ void ObjectHandler_v1w::moveObjects() {
}
}
+/**
+* Swap all the images of one object with another. Set hero_image (we make
+* the assumption for now that the first obj is always the HERO) to the object
+* number of the swapped image
+*/
void ObjectHandler_v1w::swapImages(int objNumb1, int objNumb2) {
-// Swap all the images of one object with another. Set hero_image (we make
-// the assumption for now that the first obj is always the HERO) to the object
-// number of the swapped image
debugC(1, kDebugObject, "swapImages(%d, %d)", objNumb1, objNumb2);
saveSeq(&_objects[objNumb1]);
diff --git a/engines/hugo/object_v2d.cpp b/engines/hugo/object_v2d.cpp
index 2915eb6bf0..9d35edd882 100644
--- a/engines/hugo/object_v2d.cpp
+++ b/engines/hugo/object_v2d.cpp
@@ -52,10 +52,12 @@ ObjectHandler_v2d::ObjectHandler_v2d(HugoEngine *vm) : ObjectHandler_v1d(vm) {
ObjectHandler_v2d::~ObjectHandler_v2d() {
}
-// Draw all objects on screen as follows:
-// 1. Sort 'FLOATING' objects in order of y2 (base of object)
-// 2. Display new object frames/positions in dib
-// Finally, cycle any animating objects to next frame
+/**
+* Draw all objects on screen as follows:
+* 1. Sort 'FLOATING' objects in order of y2 (base of object)
+* 2. Display new object frames/positions in dib
+* Finally, cycle any animating objects to next frame
+*/
void ObjectHandler_v2d::updateImages() {
debugC(5, kDebugObject, "updateImages");
@@ -169,8 +171,10 @@ void ObjectHandler_v2d::updateImages() {
}
}
-// Update all object positions. Process object 'local' events
-// including boundary events and collisions
+/**
+* Update all object positions. Process object 'local' events
+* including boundary events and collisions
+*/
void ObjectHandler_v2d::moveObjects() {
debugC(4, kDebugObject, "moveObjects");
diff --git a/engines/hugo/object_v3d.cpp b/engines/hugo/object_v3d.cpp
index 399a6414ef..485522bb12 100644
--- a/engines/hugo/object_v3d.cpp
+++ b/engines/hugo/object_v3d.cpp
@@ -52,8 +52,10 @@ ObjectHandler_v3d::ObjectHandler_v3d(HugoEngine *vm) : ObjectHandler_v2d(vm) {
ObjectHandler_v3d::~ObjectHandler_v3d() {
}
-// Update all object positions. Process object 'local' events
-// including boundary events and collisions
+/**
+* Update all object positions. Process object 'local' events
+* including boundary events and collisions
+*/
void ObjectHandler_v3d::moveObjects() {
debugC(4, kDebugObject, "moveObjects");
@@ -240,10 +242,12 @@ void ObjectHandler_v3d::moveObjects() {
}
}
+/**
+* Swap all the images of one object with another. Set hero_image (we make
+* the assumption for now that the first obj is always the HERO) to the object
+* number of the swapped image
+*/
void ObjectHandler_v3d::swapImages(int objNumb1, int objNumb2) {
-// Swap all the images of one object with another. Set hero_image (we make
-// the assumption for now that the first obj is always the HERO) to the object
-// number of the swapped image
debugC(1, kDebugObject, "swapImages(%d, %d)", objNumb1, objNumb2);
saveSeq(&_objects[objNumb1]);
diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp
index a1f493706e..22f1102b08 100644
--- a/engines/hugo/parser.cpp
+++ b/engines/hugo/parser.cpp
@@ -106,7 +106,6 @@ void Parser::keyHandler(uint16 nChar, uint16 nFlags) {
default: // Any other key
if (!gameStatus.storyModeFl) { // Keyboard disabled
// Add printable keys to ring buffer
-
uint16 bnext = _putIndex + 1;
if (bnext >= sizeof(_ringBuffer))
bnext = 0;
@@ -121,8 +120,10 @@ void Parser::keyHandler(uint16 nChar, uint16 nFlags) {
_checkDoubleF1Fl = false;
}
-// Add any new chars to line buffer and display them.
-// If CR pressed, pass line to LineHandler()
+/**
+* Add any new chars to line buffer and display them.
+* If CR pressed, pass line to LineHandler()
+*/
void Parser::charHandler() {
debugC(4, kDebugParser, "charHandler");
@@ -187,8 +188,10 @@ void Parser::charHandler() {
}
}
-// Perform an immediate command. Takes parameters a la sprintf
-// Assumes final string will not overrun line[] length
+/**
+* Perform an immediate command. Takes parameters a la sprintf
+* Assumes final string will not overrun line[] length
+*/
void Parser::command(const char *format, ...) {
debugC(1, kDebugParser, "Command(%s, ...)", format);
@@ -200,7 +203,9 @@ void Parser::command(const char *format, ...) {
lineHandler();
}
-// Locate any member of object name list appearing in command line
+/**
+* Locate any member of object name list appearing in command line
+*/
bool Parser::isWordPresent(char **wordArr) {
debugC(1, kDebugParser, "isWordPresent(%s)", wordArr[0]);
@@ -213,7 +218,9 @@ bool Parser::isWordPresent(char **wordArr) {
return false;
}
-// 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() {
debugC(1, kDebugParser, "findNoun()");
@@ -226,7 +233,9 @@ char *Parser::findNoun() {
return 0;
}
-// 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() {
debugC(1, kDebugParser, "findVerb()");
@@ -239,13 +248,15 @@ char *Parser::findVerb() {
return 0;
}
-// Show user all objects being carried in a variable width 2 column format
+/**
+* Show user all objects being carried in a variable width 2 column format
+*/
void Parser::showDosInventory() {
debugC(1, kDebugParser, "showDosInventory()");
static const char *blanks = " ";
uint16 index = 0, len1 = 0, len2 = 0;
- for (int i = 0; i < _vm->_numObj; i++) { // Find widths of 2 columns
+ for (int i = 0; i < _vm->_numObj; i++) { // Find widths of 2 columns
if (_vm->_object->isCarried(i)) {
uint16 len = strlen(_vm->_arrayNouns[_vm->_object->_objects[i].nounIndex][1]);
if (index++ & 1) // Right hand column
@@ -263,7 +274,7 @@ void Parser::showDosInventory() {
strncat(buffer, blanks, (len1 + len2 - strlen(_vm->_textParser[kTBIntro])) / 2);
strcat(strcat(buffer, _vm->_textParser[kTBIntro]), "\n");
index = 0;
- for (int i = 0; i < _vm->_numObj; i++) { // Assign strings
+ for (int i = 0; i < _vm->_numObj; i++) { // Assign strings
if (_vm->_object->isCarried(i)) {
if (index++ & 1)
strcat(strcat(buffer, _vm->_arrayNouns[_vm->_object->_objects[i].nounIndex][1]), "\n");
diff --git a/engines/hugo/parser_v1d.cpp b/engines/hugo/parser_v1d.cpp
index dcdc2c74ac..216ab8386c 100644
--- a/engines/hugo/parser_v1d.cpp
+++ b/engines/hugo/parser_v1d.cpp
@@ -49,8 +49,10 @@ Parser_v1d::Parser_v1d(HugoEngine *vm) : Parser(vm) {
Parser_v1d::~Parser_v1d() {
}
-// 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
+/**
+* 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
+*/
char *Parser_v1d::findNextNoun(char *noun) {
debugC(1, kDebugParser, "findNextNoun(%s)", noun);
@@ -70,10 +72,12 @@ char *Parser_v1d::findNextNoun(char *noun) {
return 0;
}
-// Test whether hero is close to object. Return TRUE or FALSE
-// If no noun specified, check context flag in object before other tests.
-// If object not near, return suitable string; may be similar object closer
-// If radius is -1, treat radius as infinity
+/**
+* Test whether hero is close to object. Return TRUE or FALSE
+* If no noun specified, check context flag in object before other tests.
+* If object not near, return suitable string; may be similar object closer
+* If radius is -1, treat radius as infinity
+*/
bool Parser_v1d::isNear(char *verb, char *noun, object_t *obj, char *comment) {
debugC(1, kDebugParser, "isNear(%s, %s, obj, %s)", verb, noun, comment);
@@ -131,9 +135,11 @@ bool Parser_v1d::isNear(char *verb, char *noun, object_t *obj, char *comment) {
return true;
}
-// Test whether supplied verb is one of the common variety for this object
-// 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
+/**
+* Test whether supplied verb is one of the common variety for this object
+* 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
+*/
bool Parser_v1d::isGenericVerb(char *word, object_t *obj) {
debugC(1, kDebugParser, "isGenericVerb(%s, object_t *obj)", word);
@@ -169,10 +175,12 @@ bool Parser_v1d::isGenericVerb(char *word, object_t *obj) {
return true;
}
-// Test whether supplied verb is included in the list of allowed verbs for
-// this object. If it is, then perform the tests on it from the cmd list
-// and if it passes, perform the actions in the action list. If the verb
-// is catered for, return TRUE
+/**
+* Test whether supplied verb is included in the list of allowed verbs for
+* this object. If it is, then perform the tests on it from the cmd list
+* and if it passes, perform the actions in the action list. If the verb
+* is catered for, return TRUE
+*/
bool Parser_v1d::isObjectVerb(char *word, object_t *obj) {
debugC(1, kDebugParser, "isObjectVerb(%s, object_t *obj)", word);
@@ -219,8 +227,10 @@ bool Parser_v1d::isObjectVerb(char *word, object_t *obj) {
return true;
}
-// 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
+/**
+* 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
+*/
bool Parser_v1d::isBackgroundWord(char *noun, char *verb, objectList_t obj) {
debugC(1, kDebugParser, "isBackgroundWord(%s, %s, object_list_t obj)", noun, verb);
@@ -236,7 +246,9 @@ bool Parser_v1d::isBackgroundWord(char *noun, char *verb, objectList_t obj) {
return false;
}
-// Do all things necessary to carry an object
+/**
+* Do all things necessary to carry an object
+*/
void Parser_v1d::takeObject(object_t *obj) {
debugC(1, kDebugParser, "takeObject(object_t *obj)");
@@ -249,7 +261,9 @@ void Parser_v1d::takeObject(object_t *obj) {
Utils::Box(BOX_ANY, TAKE_TEXT, _vm->_arrayNouns[obj->nounIndex][TAKE_NAME]);
}
-// Do all necessary things to drop an object
+/**
+* Do all necessary things to drop an object
+*/
void Parser_v1d::dropObject(object_t *obj) {
debugC(1, kDebugParser, "dropObject(object_t *obj)");
@@ -263,8 +277,10 @@ void Parser_v1d::dropObject(object_t *obj) {
Utils::Box(BOX_ANY, "%s", _vm->_textParser[kTBOk]);
}
-// Print text for possible background object. Return TRUE if match found
-// If test_noun TRUE, must have a noun given
+/**
+* Print text for possible background object. Return TRUE if match found
+* If test_noun TRUE, must have a noun given
+*/
bool Parser_v1d::isCatchallVerb(bool testNounFl, char *noun, char *verb, objectList_t obj) {
debugC(1, kDebugParser, "isCatchallVerb(%d, %s, %s, object_list_t obj)", (testNounFl) ? 1 : 0, noun, verb);
@@ -280,7 +296,9 @@ bool Parser_v1d::isCatchallVerb(bool testNounFl, char *noun, char *verb, objectL
return false;
}
-// Parse the user's line of text input. Generate events as necessary
+/**
+* Parse the user's line of text input. Generate events as necessary
+*/
void Parser_v1d::lineHandler() {
debugC(1, kDebugParser, "lineHandler()");
@@ -349,7 +367,7 @@ void Parser_v1d::lineHandler() {
Utils::Box(BOX_ANY, "%s", farComment);
else if (!isCatchallVerb(true, noun, verb, _vm->_catchallList) &&
!isCatchallVerb(false, noun, verb, _vm->_backgroundObjects[*_vm->_screen_p]) &&
- !isCatchallVerb(false, noun, verb, _vm->_catchallList))
+ !isCatchallVerb(false, noun, verb, _vm->_catchallList))
Utils::Box(BOX_ANY, "%s", _vm->_textParser[kTBEh_1d]);
}
diff --git a/engines/hugo/parser_v1w.cpp b/engines/hugo/parser_v1w.cpp
index 5021db4c6e..96442e4fcd 100644
--- a/engines/hugo/parser_v1w.cpp
+++ b/engines/hugo/parser_v1w.cpp
@@ -49,9 +49,11 @@ Parser_v1w::Parser_v1w(HugoEngine *vm) : Parser(vm) {
Parser_v1w::~Parser_v1w() {
}
-// Test whether command line contains a verb allowed by this object.
-// If it does, and the object is near and passes the tests in the command
-// list then carry out the actions in the action list and return TRUE
+/**
+* Test whether command line contains a verb allowed by this object.
+* If it does, and the object is near and passes the tests in the command
+* list then carry out the actions in the action list and return TRUE
+*/
bool Parser_v1w::isObjectVerb(object_t *obj, char *comment) {
debugC(1, kDebugParser, "isObjectVerb(object_t *obj, %s)", comment);
@@ -104,7 +106,9 @@ bool Parser_v1w::isObjectVerb(object_t *obj, char *comment) {
return true;
}
-// Test whether command line contains one of the generic actions
+/**
+* Test whether command line contains one of the generic actions
+*/
bool Parser_v1w::isGenericVerb(object_t *obj, char *comment) {
debugC(1, kDebugParser, "isGenericVerb(object_t *obj, %s)", comment);
@@ -154,10 +158,12 @@ bool Parser_v1w::isGenericVerb(object_t *obj, char *comment) {
return true;
}
-// Test whether hero is close to object. Return TRUE or FALSE
-// If object not near, return suitable comment; may be another object close
-// If radius is -1, treat radius as infinity
-// Verb is included to determine correct comment if not near
+/**
+* Test whether hero is close to object. Return TRUE or FALSE
+* If object not near, return suitable comment; may be another object close
+* If radius is -1, treat radius as infinity
+* Verb is included to determine correct comment if not near
+*/
bool Parser_v1w::isNear(object_t *obj, char *verb, char *comment) {
debugC(1, kDebugParser, "isNear(object_t *obj, %s, %s)", verb, comment);
@@ -210,7 +216,9 @@ bool Parser_v1w::isNear(object_t *obj, char *verb, char *comment) {
return true;
}
-// Do all things necessary to carry an object
+/**
+* Do all things necessary to carry an object
+*/
void Parser_v1w::takeObject(object_t *obj) {
debugC(1, kDebugParser, "takeObject(object_t *obj)");
@@ -225,7 +233,9 @@ void Parser_v1w::takeObject(object_t *obj) {
Utils::Box(BOX_ANY, TAKE_TEXT, _vm->_arrayNouns[obj->nounIndex][TAKE_NAME]);
}
-// Do all necessary things to drop an object
+/**
+* Do all necessary things to drop an object
+*/
void Parser_v1w::dropObject(object_t *obj) {
debugC(1, kDebugParser, "dropObject(object_t *obj)");
@@ -242,10 +252,12 @@ void Parser_v1w::dropObject(object_t *obj) {
Utils::Box(BOX_ANY, "%s", _vm->_textParser[kTBOk]);
}
-// Search for matching verbs in background command list.
-// Noun is not required. Return TRUE if match found
-// Note that if the background command list has match set TRUE then do not
-// print text if there are any recognizable nouns in the command line
+/**
+* Search for matching verbs in background command list.
+* Noun is not required. Return TRUE if match found
+* Note that if the background command list has match set TRUE then do not
+* print text if there are any recognizable nouns in the command line
+*/
bool Parser_v1w::isCatchallVerb(objectList_t obj) {
debugC(1, kDebugParser, "isCatchallVerb(object_list_t obj)");
@@ -267,8 +279,10 @@ bool Parser_v1w::isCatchallVerb(objectList_t obj) {
return false;
}
-// Search for matching verb/noun pairs in background command list
-// Print text for possible background object. Return TRUE if match found
+/**
+* Search for matching verb/noun pairs in background command list
+* Print text for possible background object. Return TRUE if match found
+*/
bool Parser_v1w::isBackgroundWord(objectList_t obj) {
debugC(1, kDebugParser, "isBackgroundWord(object_list_t obj)");
@@ -285,7 +299,9 @@ bool Parser_v1w::isBackgroundWord(objectList_t obj) {
return false;
}
-// Parse the user's line of text input. Generate events as necessary
+/**
+* Parse the user's line of text input. Generate events as necessary
+*/
void Parser_v1w::lineHandler() {
debugC(1, kDebugParser, "lineHandler()");
diff --git a/engines/hugo/parser_v2d.cpp b/engines/hugo/parser_v2d.cpp
index 99fcf63a4e..fc82412962 100644
--- a/engines/hugo/parser_v2d.cpp
+++ b/engines/hugo/parser_v2d.cpp
@@ -47,7 +47,9 @@ Parser_v2d::Parser_v2d(HugoEngine *vm) : Parser_v1d(vm) {
Parser_v2d::~Parser_v2d() {
}
-// Parse the user's line of text input. Generate events as necessary
+/**
+* Parse the user's line of text input. Generate events as necessary
+*/
void Parser_v2d::lineHandler() {
debugC(1, kDebugParser, "lineHandler()");
diff --git a/engines/hugo/parser_v3d.cpp b/engines/hugo/parser_v3d.cpp
index 49c9ec2c08..7c0b9adedf 100644
--- a/engines/hugo/parser_v3d.cpp
+++ b/engines/hugo/parser_v3d.cpp
@@ -49,7 +49,9 @@ Parser_v3d::Parser_v3d(HugoEngine *vm) : Parser_v1w(vm) {
Parser_v3d::~Parser_v3d() {
}
-// Parse the user's line of text input. Generate events as necessary
+/**
+* Parse the user's line of text input. Generate events as necessary
+*/
void Parser_v3d::lineHandler() {
debugC(1, kDebugParser, "lineHandler()");
diff --git a/engines/hugo/route.cpp b/engines/hugo/route.cpp
index 9e068171a2..962adab45d 100644
--- a/engines/hugo/route.cpp
+++ b/engines/hugo/route.cpp
@@ -44,11 +44,13 @@ namespace Hugo {
Route::Route(HugoEngine *vm) : _vm(vm) {
}
-// Face hero in new direction, based on cursor key input by user.
+/**
+* Face hero in new direction, based on cursor key input by user.
+*/
void Route::setDirection(uint16 keyCode) {
debugC(1, kDebugRoute, "setDirection(%d)", keyCode);
- object_t *obj = _vm->_hero; // Pointer to hero object
+ object_t *obj = _vm->_hero; // Pointer to hero object
// Set first image in sequence
switch (keyCode) {
@@ -79,15 +81,17 @@ void Route::setDirection(uint16 keyCode) {
}
}
-// Set hero walking, based on cursor key input by user.
-// Hitting same key twice will stop hero.
+/**
+* Set hero walking, based on cursor key input by user.
+* Hitting same key twice will stop hero.
+*/
void Route::setWalk(uint16 direction) {
debugC(1, kDebugRoute, "setWalk(%d)", direction);
static uint16 oldDirection = 0; // Last direction char
- object_t *obj = _vm->_hero; // Pointer to hero object
+ object_t *obj = _vm->_hero; // Pointer to hero object
- if (_vm->getGameStatus().storyModeFl || obj->pathType != USER) // Make sure user has control
+ if (_vm->getGameStatus().storyModeFl || obj->pathType != USER) // Make sure user has control
return;
if (!obj->vx && !obj->vy)
@@ -142,20 +146,22 @@ void Route::setWalk(uint16 direction) {
}
}
-// Recursive algorithm! Searches from hero to dest_x, dest_y
-// Find horizontal line segment about supplied point and recursively
-// find line segments for each point above and below that segment.
-// When destination point found in segment, start surfacing and leave
-// a trail in segment[] from destination back to hero.
-//
-// Note: there is a bug which allows a route through a 1-pixel high
-// narrow gap if between 2 segments wide enough for hero. To work
-// around this, make sure any narrow gaps are 2 or more pixels high.
-// An example of this was the blocking guard in Hugo1/Dead-End.
+/**
+* Recursive algorithm! Searches from hero to dest_x, dest_y
+* Find horizontal line segment about supplied point and recursively
+* find line segments for each point above and below that segment.
+* When destination point found in segment, start surfacing and leave
+* a trail in segment[] from destination back to hero.
+*
+* Note: there is a bug which allows a route through a 1-pixel high
+* narrow gap if between 2 segments wide enough for hero. To work
+* around this, make sure any narrow gaps are 2 or more pixels high.
+* An example of this was the blocking guard in Hugo1/Dead-End.
+*/
void Route::segment(int16 x, int16 y) {
debugC(1, kDebugRoute, "segment(%d, %d)", x, y);
-// Note use of static - can't waste stack
+ // Note: use of static - can't waste stack
static image_pt p; // Ptr to _boundaryMap[y]
static segment_t *seg_p; // Ptr to segment
@@ -262,8 +268,10 @@ void Route::segment(int16 x, int16 y) {
}
}
-// Create and return ptr to new node. Initialize with previous node.
-// Returns 0 if MAX_NODES exceeded
+/**
+* Create and return ptr to new node. Initialize with previous node.
+* Returns 0 if MAX_NODES exceeded
+*/
Point *Route::newNode() {
debugC(1, kDebugRoute, "newNode");
@@ -274,10 +282,12 @@ Point *Route::newNode() {
return &_route[_routeListIndex];
}
-// Construct route to cx, cy. Return TRUE if successful.
-// 1. Copy boundary bitmap to local byte map (include object bases)
-// 2. Construct list of segments segment[] from hero to destination
-// 3. Compress to shortest route in route[]
+/**
+* Construct route to cx, cy. Return TRUE if successful.
+* 1. Copy boundary bitmap to local byte map (include object bases)
+* 2. Construct list of segments segment[] from hero to destination
+* 3. Compress to shortest route in route[]
+*/
bool Route::findRoute(int16 cx, int16 cy) {
debugC(1, kDebugRoute, "findRoute(%d, %d)", cx, cy);
@@ -383,7 +393,9 @@ bool Route::findRoute(int16 cx, int16 cy) {
return true;
}
-// Process hero in route mode - called from Move_objects()
+/**
+* Process hero in route mode - called from Move_objects()
+*/
void Route::processRoute() {
debugC(1, kDebugRoute, "processRoute");
@@ -454,9 +466,11 @@ void Route::processRoute() {
}
}
-// Start a new route from hero to cx, cy
-// go_for is the purpose, id indexes the exit or object to walk to
-// Returns FALSE if route not found
+/**
+* Start a new route from hero to cx, cy
+* go_for is the purpose, id indexes the exit or object to walk to
+* Returns FALSE if route not found
+*/
bool Route::startRoute(go_t go_for, int16 id, int16 cx, int16 cy) {
debugC(1, kDebugRoute, "startRoute(%d, %d, %d, %d)", go_for, id, cx, cy);
diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp
index 8a1f74eeae..57e072372b 100644
--- a/engines/hugo/schedule.cpp
+++ b/engines/hugo/schedule.cpp
@@ -48,7 +48,9 @@ Scheduler::Scheduler(HugoEngine *vm) : _vm(vm) {
Scheduler::~Scheduler() {
}
-// Initialise the timer event queue
+/**
+* Initialise the timer event queue
+*/
void Scheduler::initEventQueue() {
debugC(1, kDebugSchedule, "initEventQueue");
@@ -66,7 +68,9 @@ void Scheduler::initEventQueue() {
_freeEvent = _events; // Free list is full
}
-// Return a ptr to an event structure from the free list
+/**
+* Return a ptr to an event structure from the free list
+*/
event_t *Scheduler::getQueue() {
debugC(4, kDebugSchedule, "getQueue");
@@ -78,7 +82,9 @@ event_t *Scheduler::getQueue() {
return resEvent;
}
-// Call Insert_action for each action in the list supplied
+/**
+* Call Insert_action for each action in the list supplied
+*/
void Scheduler::insertActionList(uint16 actIndex) {
debugC(1, kDebugSchedule, "insertActionList(%d)", actIndex);
@@ -88,7 +94,9 @@ void Scheduler::insertActionList(uint16 actIndex) {
}
}
-// Decode a string
+/**
+* Decode a string
+*/
void Scheduler::decodeString(char *line) {
debugC(1, kDebugSchedule, "decodeString(%s)", line);
@@ -99,17 +107,21 @@ void Scheduler::decodeString(char *line) {
debugC(1, kDebugSchedule, "result : %s", line);
}
-// Return system time in ticks. A tick is 1/TICKS_PER_SEC mS
+/**
+* Return system time in ticks. A tick is 1/TICKS_PER_SEC mS
+*/
uint32 Scheduler::getWinTicks() {
debugC(3, kDebugSchedule, "getTicks");
return _vm->getGameStatus().tick;
}
-// Return system time in ticks. A tick is 1/TICKS_PER_SEC mS
-// If update FALSE, simply return last known time
-// Note that this is real time unless a processing cycle takes longer than
-// a real tick, in which case the system tick is simply incremented
+/**
+* Return system time in ticks. A tick is 1/TICKS_PER_SEC mS
+* If update FALSE, simply return last known time
+* Note that this is real time unless a processing cycle takes longer than
+* a real tick, in which case the system tick is simply incremented
+*/
uint32 Scheduler::getDosTicks(bool updateFl) {
debugC(5, kDebugSchedule, "getTicks");
@@ -133,7 +145,9 @@ uint32 Scheduler::getDosTicks(bool updateFl) {
return(tick);
}
-// Add indecated bonus to score if not added already
+/**
+* Add indecated bonus to score if not added already
+*/
void Scheduler::processBonus(int bonusIndex) {
debugC(1, kDebugSchedule, "processBonus(%d)", bonusIndex);
@@ -143,12 +157,14 @@ void Scheduler::processBonus(int bonusIndex) {
}
}
-// Transition to a new screen as follows:
-// 1. Clear out all non-global events from event list.
-// 2. Set the new screen (in the hero object and any carried objects)
-// 3. Read in the screen files for the new screen
-// 4. Schedule action list for new screen
-// 5. Initialise prompt line and status line
+/**
+* Transition to a new screen as follows:
+* 1. Clear out all non-global events from event list.
+* 2. Set the new screen (in the hero object and any carried objects)
+* 3. Read in the screen files for the new screen
+* 4. Schedule action list for new screen
+* 5. Initialise prompt line and status line
+*/
void Scheduler::newScreen(int screenIndex) {
debugC(1, kDebugSchedule, "newScreen(%d)", screenIndex);
@@ -185,10 +201,12 @@ void Scheduler::newScreen(int screenIndex) {
_vm->_screen->initNewScreenDisplay();
}
-// Transition to a new screen as follows:
-// 1. Set the new screen (in the hero object and any carried objects)
-// 2. Read in the screen files for the new screen
-// 3. Initialise prompt line and status line
+/**
+* Transition to a new screen as follows:
+* 1. Set the new screen (in the hero object and any carried objects)
+* 2. Read in the screen files for the new screen
+* 3. Initialise prompt line and status line
+*/
void Scheduler::restoreScreen(int screenIndex) {
debugC(1, kDebugSchedule, "restoreScreen(%d)", screenIndex);
@@ -202,10 +220,12 @@ void Scheduler::restoreScreen(int screenIndex) {
_vm->_screen->initNewScreenDisplay();
}
-// Wait (if necessary) for next synchronizing tick
-// Slow machines won't make it by the end of tick, so will just plod on
-// at their own speed, not waiting here, but free running.
-// Note: DOS Versions only
+/**
+* Wait (if necessary) for next synchronizing tick
+* Slow machines won't make it by the end of tick, so will just plod on
+* at their own speed, not waiting here, but free running.
+* Note: DOS Versions only
+*/
void Scheduler::waitForRefresh(void) {
debugC(1, kDebugSchedule, "waitForRefresh()");
@@ -220,7 +240,9 @@ void Scheduler::waitForRefresh(void) {
timeout = ++t;
}
- //Read kALnewscr used by maze (Hugo 2)
+/**
+* Read kALnewscr used by maze (Hugo 2)
+*/
void Scheduler::loadAlNewscrIndex(Common::File &in) {
debugC(6, kDebugSchedule, "loadAlNewscrIndex(&in)");
@@ -232,6 +254,9 @@ void Scheduler::loadAlNewscrIndex(Common::File &in) {
}
}
+/**
+* Load actListArr from Hugo.dat
+*/
void Scheduler::loadActListArr(Common::File &in) {
debugC(6, kDebugSchedule, "loadActListArr(&in)");
@@ -809,8 +834,10 @@ void Scheduler::freeActListArr() {
free(_actListArr);
}
-// Maze mode is enabled. Check to see whether hero has crossed the maze
-// bounding box, if so, go to the next room */
+/**
+* Maze mode is enabled. Check to see whether hero has crossed the maze
+* bounding box, if so, go to the next room */
+*/
void Scheduler::processMaze(int x1, int x2, int y1, int y2) {
debugC(1, kDebugSchedule, "processMaze");
diff --git a/engines/hugo/schedule_v1d.cpp b/engines/hugo/schedule_v1d.cpp
index 09bfc2294b..4efd371394 100644
--- a/engines/hugo/schedule_v1d.cpp
+++ b/engines/hugo/schedule_v1d.cpp
@@ -56,10 +56,12 @@ const char *Scheduler_v1d::getCypher() {
return "Copyright 1991, Gray Design Associates";
}
-// Delete an event structure (i.e. return it to the free list)
-// Note that event is assumed at head of queue (i.e. earliest). To delete
-// an event from the middle of the queue, merely overwrite its action type
-// to be ANULL
+/**
+* Delete an event structure (i.e. return it to the free list)
+* Note that event is assumed at head of queue (i.e. earliest). To delete
+* an event from the middle of the queue, merely overwrite its action type
+* to be ANULL
+*/
void Scheduler_v1d::delQueue(event_t *curEvent) {
debugC(4, kDebugSchedule, "delQueue()");
@@ -77,8 +79,10 @@ void Scheduler_v1d::delQueue(event_t *curEvent) {
_freeEvent = curEvent;
}
-// Insert the action pointed to by p into the timer event queue
-// The queue goes from head (earliest) to tail (latest) timewise
+/**
+* Insert the action pointed to by p into the timer event queue
+* The queue goes from head (earliest) to tail (latest) timewise
+*/
void Scheduler_v1d::insertAction(act *action) {
debugC(1, kDebugSchedule, "insertAction() - Action type A%d", action->a0.actType);
@@ -121,10 +125,12 @@ void Scheduler_v1d::insertAction(act *action) {
}
}
+/**
+* This function performs the action in the event structure pointed to by p
+* It dequeues the event and returns it to the free list. It returns a ptr
+* to the next action in the list, except special case of NEW_SCREEN
+*/
event_t *Scheduler_v1d::doAction(event_t *curEvent) {
-// This function performs the action in the event structure pointed to by p
-// It dequeues the event and returns it to the free list. It returns a ptr
-// to the next action in the list, except special case of NEW_SCREEN
debugC(1, kDebugSchedule, "doAction - Event action type : %d", curEvent->action->a0.actType);
status_t &gameStatus = _vm->getGameStatus();
@@ -134,7 +140,6 @@ event_t *Scheduler_v1d::doAction(event_t *curEvent) {
object_t *obj2;
int dx, dy;
event_t *wrkEvent; // Save ev_p->next_p for return
-// event_t *saveEvent; // Used in DEL_EVENTS
switch (action->a0.actType) {
case ANULL: // Big NOP from DEL_EVENTS
@@ -321,10 +326,12 @@ event_t *Scheduler_v1d::doAction(event_t *curEvent) {
}
}
-// Write the event queue to the file with handle f
-// Note that we convert all the event structure ptrs to indexes
-// using -1 for NULL. We can't convert the action ptrs to indexes
-// so we save address of first dummy action ptr to compare on restore.
+/**
+* Write the event queue to the file with handle f
+* Note that we convert all the event structure ptrs to indexes
+* using -1 for NULL. We can't convert the action ptrs to indexes
+* so we save address of first dummy action ptr to compare on restore.
+*/
void Scheduler_v1d::saveEvents(Common::WriteStream *f) {
debugC(1, kDebugSchedule, "saveEvents()");
@@ -350,7 +357,9 @@ void Scheduler_v1d::saveEvents(Common::WriteStream *f) {
f->write(saveEventArr, sizeof(saveEventArr));
}
-// Restore the event list from file with handle f
+/**
+* Restore the event list from file with handle f
+*/
void Scheduler_v1d::restoreEvents(Common::SeekableReadStream *f) {
debugC(1, kDebugSchedule, "restoreEvents");
@@ -387,9 +396,11 @@ void Scheduler_v1d::restoreEvents(Common::SeekableReadStream *f) {
}
}
-// This is the scheduler which runs every tick. It examines the event queue
-// for any events whose time has come. It dequeues these events and performs
-// the action associated with the event, returning it to the free queue
+/**
+* This is the scheduler which runs every tick. It examines the event queue
+* for any events whose time has come. It dequeues these events and performs
+* the action associated with the event, returning it to the free queue
+*/
void Scheduler_v1d::runScheduler() {
debugC(6, kDebugSchedule, "runScheduler");
diff --git a/engines/hugo/schedule_v1w.cpp b/engines/hugo/schedule_v1w.cpp
index 34eff0447f..128d0687a7 100644
--- a/engines/hugo/schedule_v1w.cpp
+++ b/engines/hugo/schedule_v1w.cpp
@@ -53,10 +53,12 @@ Scheduler_v1w::Scheduler_v1w(HugoEngine *vm) : Scheduler_v3d(vm) {
Scheduler_v1w::~Scheduler_v1w() {
}
+/**
+* This function performs the action in the event structure pointed to by p
+* It dequeues the event and returns it to the free list. It returns a ptr
+* to the next action in the list, except special case of NEW_SCREEN
+*/
event_t *Scheduler_v1w::doAction(event_t *curEvent) {
-// This function performs the action in the event structure pointed to by p
-// It dequeues the event and returns it to the free list. It returns a ptr
-// to the next action in the list, except special case of NEW_SCREEN
debugC(1, kDebugSchedule, "doAction - Event action type : %d", curEvent->action->a0.actType);
status_t &gameStatus = _vm->getGameStatus();
@@ -351,10 +353,12 @@ event_t *Scheduler_v1w::doAction(event_t *curEvent) {
}
}
-// Write the event queue to the file with handle f
-// Note that we convert all the event structure ptrs to indexes
-// using -1 for NULL. We can't convert the action ptrs to indexes
-// so we save address of first dummy action ptr to compare on restore.
+/**
+* Write the event queue to the file with handle f
+* Note that we convert all the event structure ptrs to indexes
+* using -1 for NULL. We can't convert the action ptrs to indexes
+* so we save address of first dummy action ptr to compare on restore.
+*/
void Scheduler_v1w::saveEvents(Common::WriteStream *f) {
debugC(1, kDebugSchedule, "saveEvents()");
@@ -380,7 +384,9 @@ void Scheduler_v1w::saveEvents(Common::WriteStream *f) {
f->write(saveEventArr, sizeof(saveEventArr));
}
-// Restore the event list from file with handle f
+/**
+* Restore the event list from file with handle f
+*/
void Scheduler_v1w::restoreEvents(Common::SeekableReadStream *f) {
debugC(1, kDebugSchedule, "restoreEvents");
@@ -417,6 +423,10 @@ void Scheduler_v1w::restoreEvents(Common::SeekableReadStream *f) {
}
}
+/**
+* Insert the action pointed to by p into the timer event queue
+* The queue goes from head (earliest) to tail (latest) timewise
+*/
void Scheduler_v1w::insertAction(act *action) {
debugC(1, kDebugSchedule, "insertAction() - Action type A%d", action->a0.actType);
@@ -465,9 +475,11 @@ void Scheduler_v1w::insertAction(act *action) {
}
}
-// This is the scheduler which runs every tick. It examines the event queue
-// for any events whose time has come. It dequeues these events and performs
-// the action associated with the event, returning it to the free queue
+/**
+* This is the scheduler which runs every tick. It examines the event queue
+* for any events whose time has come. It dequeues these events and performs
+* the action associated with the event, returning it to the free queue
+*/
void Scheduler_v1w::runScheduler() {
debugC(6, kDebugSchedule, "runScheduler");
diff --git a/engines/hugo/schedule_v2d.cpp b/engines/hugo/schedule_v2d.cpp
index 2735bc4cf4..6f46213d79 100644
--- a/engines/hugo/schedule_v2d.cpp
+++ b/engines/hugo/schedule_v2d.cpp
@@ -53,13 +53,15 @@ Scheduler_v2d::Scheduler_v2d(HugoEngine *vm) : Scheduler_v1d(vm) {
Scheduler_v2d::~Scheduler_v2d() {
}
-// Delete an event structure (i.e. return it to the free list)
-// Historical note: Originally event p was assumed to be at head of queue
-// (i.e. earliest) since all events were deleted in order when proceeding to
-// a new screen. To delete an event from the middle of the queue, the action
-// was overwritten to be ANULL. With the advent of GLOBAL events, delQueue
-// was modified to allow deletes anywhere in the list, and the DEL_EVENT
-// action was modified to perform the actual delete.
+/**
+* Delete an event structure (i.e. return it to the free list)
+* Historical note: Originally event p was assumed to be at head of queue
+* (i.e. earliest) since all events were deleted in order when proceeding to
+* a new screen. To delete an event from the middle of the queue, the action
+* was overwritten to be ANULL. With the advent of GLOBAL events, delQueue
+* was modified to allow deletes anywhere in the list, and the DEL_EVENT
+* action was modified to perform the actual delete.
+*/
void Scheduler_v2d::delQueue(event_t *curEvent) {
debugC(4, kDebugSchedule, "delQueue()");
@@ -84,8 +86,10 @@ void Scheduler_v2d::delQueue(event_t *curEvent) {
_freeEvent = curEvent;
}
-// Insert the action pointed to by p into the timer event queue
-// The queue goes from head (earliest) to tail (latest) timewise
+/**
+* Insert the action pointed to by p into the timer event queue
+* The queue goes from head (earliest) to tail (latest) timewise
+*/
void Scheduler_v2d::insertAction(act *action) {
debugC(1, kDebugSchedule, "insertAction() - Action type A%d", action->a0.actType);
@@ -134,9 +138,11 @@ void Scheduler_v2d::insertAction(act *action) {
}
}
-// This function performs the action in the event structure pointed to by p
-// It dequeues the event and returns it to the free list. It returns a ptr
-// to the next action in the list, except special case of NEW_SCREEN
+/**
+* This function performs the action in the event structure pointed to by p
+* It dequeues the event and returns it to the free list. It returns a ptr
+* to the next action in the list, except special case of NEW_SCREEN
+*/
event_t *Scheduler_v2d::doAction(event_t *curEvent) {
debugC(1, kDebugSchedule, "doAction - Event action type : %d", curEvent->action->a0.actType);
diff --git a/engines/hugo/schedule_v3d.cpp b/engines/hugo/schedule_v3d.cpp
index cc449ba8c4..fc37bd8b83 100644
--- a/engines/hugo/schedule_v3d.cpp
+++ b/engines/hugo/schedule_v3d.cpp
@@ -57,9 +57,11 @@ const char *Scheduler_v3d::getCypher() {
return "Copyright 1992, Gray Design Associates";
}
-// This function performs the action in the event structure pointed to by p
-// It dequeues the event and returns it to the free list. It returns a ptr
-// to the next action in the list, except special case of NEW_SCREEN
+/**
+* This function performs the action in the event structure pointed to by p
+* It dequeues the event and returns it to the free list. It returns a ptr
+* to the next action in the list, except special case of NEW_SCREEN
+*/
event_t *Scheduler_v3d::doAction(event_t *curEvent) {
debugC(1, kDebugSchedule, "doAction - Event action type : %d", curEvent->action->a0.actType);
diff --git a/engines/hugo/util.cpp b/engines/hugo/util.cpp
index 2def4a4dba..73efb4cd38 100644
--- a/engines/hugo/util.cpp
+++ b/engines/hugo/util.cpp
@@ -40,8 +40,10 @@
namespace Hugo {
+/**
+* Returns index (0 to 7) of first 1 in supplied byte, or 8 if not found
+*/
int Utils::firstBit(byte data) {
-// Returns index (0 to 7) of first 1 in supplied byte, or 8 if not found
if (!data)
return 8;
@@ -54,8 +56,10 @@ int Utils::firstBit(byte data) {
return i;
}
+/**
+* Returns index (0 to 7) of last 1 in supplied byte, or 8 if not found
+*/
int Utils::lastBit(byte data) {
-// Returns index (0 to 7) of last 1 in supplied byte, or 8 if not found
if (!data)
return 8;
@@ -68,8 +72,10 @@ int Utils::lastBit(byte data) {
return i;
}
+/**
+* Reverse the bit order in supplied byte
+*/
void Utils::reverseByte(byte *data) {
-// Reverse the bit order in supplied byte
byte maskIn = 0x80;
byte maskOut = 0x01;
byte result = 0;
@@ -129,9 +135,11 @@ char *Utils::Box(box_t dismiss, const char *s, ...) {
return buffer;
}
+/**
+* Warning handler. Print supplied message and continue
+* Arguments are same as printf
+*/
void Utils::Warn(const char *format, ...) {
-// Warning handler. Print supplied message and continue
-// Arguments are same as printf
char buffer[WARNLEN];
va_list marker;
va_start(marker, format);
@@ -140,9 +148,11 @@ void Utils::Warn(const char *format, ...) {
warning("Hugo warning: %s", buffer);
}
+/**
+* Fatal error handler. Reset environment, print error and exit
+* Arguments are same as printf
+*/
void Utils::Error(int error_type, const char *format, ...) {
-// Fatal error handler. Reset environment, print error and exit
-// Arguments are same as printf
char buffer[ERRLEN + 1];
bool fatal = true; // Fatal error, else continue
@@ -183,8 +193,10 @@ void Utils::Error(int error_type, const char *format, ...) {
exit(1);
}
+/**
+* Print options for user when dead
+*/
void Utils::gameOverMsg(void) {
- // Print options for user when dead
//MessageBox(hwnd, gameoverstring, "Be more careful next time!", MB_OK | MB_ICONINFORMATION);
warning("STUB: Gameover_msg(): %s", HugoEngine::get()._textUtil[kGameOver]);
}
@@ -201,5 +213,4 @@ char *Utils::strlwr(char *buffer) {
return result;
}
-
} // End of namespace Hugo