aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/hugo/display.cpp48
-rw-r--r--engines/hugo/display.h52
-rw-r--r--engines/hugo/file.cpp36
-rw-r--r--engines/hugo/file.h32
-rw-r--r--engines/hugo/file_v1d.cpp10
-rw-r--r--engines/hugo/file_v1w.cpp8
-rw-r--r--engines/hugo/file_v2d.cpp14
-rw-r--r--engines/hugo/file_v3d.cpp14
-rw-r--r--engines/hugo/game.h38
-rw-r--r--engines/hugo/hugo.cpp12
-rw-r--r--engines/hugo/hugo.h68
-rw-r--r--engines/hugo/inventory.cpp10
-rw-r--r--engines/hugo/inventory.h10
-rw-r--r--engines/hugo/mouse.cpp24
-rw-r--r--engines/hugo/mouse.h6
-rw-r--r--engines/hugo/object.cpp74
-rw-r--r--engines/hugo/object.h38
-rw-r--r--engines/hugo/object_v1d.cpp42
-rw-r--r--engines/hugo/object_v1w.cpp38
-rw-r--r--engines/hugo/object_v2d.cpp38
-rw-r--r--engines/hugo/object_v3d.cpp18
-rw-r--r--engines/hugo/parser.cpp20
-rw-r--r--engines/hugo/parser.h42
-rw-r--r--engines/hugo/parser_v1d.cpp28
-rw-r--r--engines/hugo/parser_v1w.cpp10
-rw-r--r--engines/hugo/parser_v2d.cpp4
-rw-r--r--engines/hugo/parser_v3d.cpp30
-rw-r--r--engines/hugo/route.cpp30
-rw-r--r--engines/hugo/route.h18
-rw-r--r--engines/hugo/schedule.cpp72
-rw-r--r--engines/hugo/schedule.h166
-rw-r--r--engines/hugo/sound.cpp4
32 files changed, 527 insertions, 527 deletions
diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp
index 12a9edfbb7..34b0303eee 100644
--- a/engines/hugo/display.cpp
+++ b/engines/hugo/display.cpp
@@ -105,23 +105,23 @@ Screen::Screen(HugoEngine *vm) : _vm(vm) {
Screen::~Screen() {
}
-icondib_t &Screen::getIconBuffer() {
+Icondib &Screen::getIconBuffer() {
return _iconBuffer;
}
-viewdib_t &Screen::getBackBuffer() {
+Viewdib &Screen::getBackBuffer() {
return _backBuffer;
}
-viewdib_t &Screen::getBackBufferBackup() {
+Viewdib &Screen::getBackBufferBackup() {
return _backBufferBackup;
}
-viewdib_t &Screen::getFrontBuffer() {
+Viewdib &Screen::getFrontBuffer() {
return _frontBuffer;
}
-viewdib_t &Screen::getGUIBuffer() {
+Viewdib &Screen::getGUIBuffer() {
return _GUIBuffer;
}
@@ -149,7 +149,7 @@ void Screen::initDisplay() {
/**
* Move an image from source to destination
*/
-void Screen::moveImage(image_pt srcImage, const int16 x1, const int16 y1, const int16 dx, int16 dy, const int16 width1, image_pt dstImage, const int16 x2, const int16 y2, const int16 width2) {
+void Screen::moveImage(ImagePtr srcImage, const int16 x1, const int16 y1, const int16 dx, int16 dy, const int16 width1, ImagePtr dstImage, const int16 x2, const int16 y2, const int16 width2) {
debugC(3, kDebugDisplay, "moveImage(srcImage, %d, %d, %d, %d, %d, dstImage, %d, %d, %d)", x1, y1, dx, dy, width1, x2, y2, width2);
int16 wrap_src = width1 - dx; // Wrap to next src row
@@ -236,14 +236,14 @@ void Screen::setBackgroundColor(const uint16 color) {
* Merge an object frame into _frontBuffer at sx, sy and update rectangle list.
* If fore TRUE, force object above any overlay
*/
-void Screen::displayFrame(const int sx, const int sy, seq_t *seq, const bool foreFl) {
+void Screen::displayFrame(const int sx, const int sy, Seq *seq, const bool foreFl) {
debugC(3, kDebugDisplay, "displayFrame(%d, %d, seq, %d)", sx, sy, (foreFl) ? 1 : 0);
- image_pt image = seq->_imagePtr; // Ptr to object image data
- image_pt subFrontBuffer = &_frontBuffer[sy * kXPix + sx]; // Ptr to offset in _frontBuffer
+ ImagePtr image = seq->_imagePtr; // Ptr to object image data
+ ImagePtr subFrontBuffer = &_frontBuffer[sy * kXPix + sx]; // Ptr to offset in _frontBuffer
int16 frontBufferwrap = kXPix - seq->_x2 - 1; // Wraps dest_p after each line
int16 imageWrap = seq->_bytesPerLine8 - seq->_x2 - 1;
- overlayState_t overlayState = (foreFl) ? kOvlForeground : kOvlUndef; // Overlay state of object
+ OverlayState overlayState = (foreFl) ? kOvlForeground : kOvlUndef; // Overlay state of object
for (uint16 y = 0; y < seq->_lines; y++) { // Each line in object
for (uint16 x = 0; x <= seq->_x2; x++) {
if (*image) { // Non-transparent
@@ -271,7 +271,7 @@ void Screen::displayFrame(const int sx, const int sy, seq_t *seq, const bool for
/**
* Merge rectangles A,B leaving result in B
*/
-void Screen::merge(const rect_t *rectA, rect_t *rectB) {
+void Screen::merge(const Rect *rectA, Rect *rectB) {
debugC(6, kDebugDisplay, "merge()");
int16 xa = rectA->_x + rectA->_dx; // Find x2,y2 for each rectangle
@@ -291,7 +291,7 @@ void Screen::merge(const rect_t *rectA, rect_t *rectB) {
* 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, const int16 len, int16 blen) {
+int16 Screen::mergeLists(Rect *list, Rect *blist, const int16 len, int16 blen) {
debugC(4, kDebugDisplay, "mergeLists()");
int16 coalesce[kBlitListSize]; // List of overlapping rects
@@ -299,7 +299,7 @@ int16 Screen::mergeLists(rect_t *list, rect_t *blist, const int16 len, int16 ble
for (int16 a = 0; a < len; a++, list++) {
// Compile list of overlapping rectangles in blit list
int16 c = 0;
- rect_t *bp = blist;
+ Rect *bp = blist;
for (int16 b = 0; b < blen; b++, bp++) {
if (bp->_dx) // blist entry used
if (isOverlapping(list, bp))
@@ -316,7 +316,7 @@ int16 Screen::mergeLists(rect_t *list, rect_t *blist, const int16 len, int16 ble
// Merge any more blist entries
while (--c) {
- rect_t *cp = &blist[coalesce[c]];
+ Rect *cp = &blist[coalesce[c]];
merge(cp, bp);
cp->_dx = 0; // Delete entry
}
@@ -329,12 +329,12 @@ int16 Screen::mergeLists(rect_t *list, rect_t *blist, const int16 len, int16 ble
* Process the display list
* Trailing args are int16 x,y,dx,dy for the D_ADD operation
*/
-void Screen::displayList(dupdate_t update, ...) {
+void Screen::displayList(Dupdate update, ...) {
debugC(6, kDebugDisplay, "displayList()");
int16 blitLength = 0; // Length of blit list
va_list marker; // Args used for D_ADD operation
- rect_t *p; // Ptr to dlist entry
+ Rect *p; // Ptr to dlist entry
switch (update) {
case kDisplayInit: // Init lists, restore whole screen
@@ -627,18 +627,18 @@ void Screen::hideCursor() {
CursorMan.showMouse(false);
}
-bool Screen::isInX(const int16 x, const rect_t *rect) const {
+bool Screen::isInX(const int16 x, const Rect *rect) const {
return (x >= rect->_x) && (x <= rect->_x + rect->_dx);
}
-bool Screen::isInY(const int16 y, const rect_t *rect) const {
+bool Screen::isInY(const int16 y, const Rect *rect) const {
return (y >= rect->_y) && (y <= rect->_y + rect->_dy);
}
/**
* Check if two rectangles are overlapping
*/
-bool Screen::isOverlapping(const rect_t *rectA, const rect_t *rectB) const {
+bool Screen::isOverlapping(const Rect *rectA, const Rect *rectB) const {
return (isInX(rectA->_x, rectB) || isInX(rectA->_x + rectA->_dx, rectB) || isInX(rectB->_x, rectA) || isInX(rectB->_x + rectB->_dx, rectA)) &&
(isInY(rectA->_y, rectB) || isInY(rectA->_y + rectA->_dy, rectB) || isInY(rectB->_y, rectA) || isInY(rectB->_y + rectB->_dy, rectA));
}
@@ -656,7 +656,7 @@ void Screen::drawBoundaries() {
_vm->_mouse->drawHotspots();
for (int i = 0; i < _vm->_object->_numObj; i++) {
- object_t *obj = &_vm->_object->_objects[i]; // Get pointer to object
+ Object *obj = &_vm->_object->_objects[i]; // Get pointer to object
if (obj->_screenIndex == *_vm->_screen_p) {
if ((obj->_currImagePtr != 0) && (obj->_cycling != kCycleInvisible))
drawRectangle(false, obj->_x + obj->_currImagePtr->_x1, obj->_y + obj->_currImagePtr->_y1,
@@ -730,12 +730,12 @@ void Screen_v1d::loadFontArr(Common::ReadStream &in) {
* processed object by looking down the current column for an overlay
* base byte set (in which case the object is foreground).
*/
-overlayState_t Screen_v1d::findOvl(seq_t *seq_p, image_pt dst_p, uint16 y) {
+OverlayState Screen_v1d::findOvl(Seq *seqPtr, ImagePtr dst_p, uint16 y) {
debugC(4, kDebugDisplay, "findOvl()");
uint16 index = (uint16)(dst_p - _frontBuffer) >> 3;
- for (int i = 0; i < seq_p->_lines-y; i++) { // Each line in object
+ for (int i = 0; i < seqPtr->_lines-y; i++) { // Each line in object
if (_vm->_object->getBaseBoundary(index)) // If any overlay base byte is non-zero then the object is foreground, else back.
return kOvlForeground;
index += kCompLineSize;
@@ -799,10 +799,10 @@ void Screen_v1w::loadFontArr(Common::ReadStream &in) {
* processed object by looking down the current column for an overlay
* base bit set (in which case the object is foreground).
*/
-overlayState_t Screen_v1w::findOvl(seq_t *seq_p, image_pt dst_p, uint16 y) {
+OverlayState Screen_v1w::findOvl(Seq *seqPtr, ImagePtr dst_p, uint16 y) {
debugC(4, kDebugDisplay, "findOvl()");
- for (; y < seq_p->_lines; y++) { // Each line in object
+ for (; y < seqPtr->_lines; y++) { // Each line in object
byte ovb = _vm->_object->getBaseBoundary((uint16)(dst_p - _frontBuffer) >> 3); // Ptr into overlay bits
if (ovb & (0x80 >> ((uint16)(dst_p - _frontBuffer) & 7))) // Overlay bit is set
return kOvlForeground; // Found a bit - must be foreground
diff --git a/engines/hugo/display.h b/engines/hugo/display.h
index 0d8120e916..5fab2f18cc 100644
--- a/engines/hugo/display.h
+++ b/engines/hugo/display.h
@@ -31,14 +31,14 @@
#define HUGO_DISPLAY_H
namespace Hugo {
-enum overlayState_t {kOvlUndef, kOvlForeground, kOvlBackground}; // Overlay state
+enum OverlayState {kOvlUndef, kOvlForeground, kOvlBackground}; // Overlay state
static const int kCenter = -1; // Used to center text in x
class Screen {
public:
- struct rect_t { // Rectangle used in Display list
+ struct Rect { // Rectangle used in Display list
int16 _x; // Position in dib
int16 _y; // Position in dib
int16 _dx; // width
@@ -55,8 +55,8 @@ public:
int16 stringLength(const char *s) const;
void displayBackground();
- void displayFrame(const int sx, const int sy, seq_t *seq, const bool foreFl);
- void displayList(dupdate_t update, ...);
+ void displayFrame(const int sx, const int sy, Seq *seq, const bool foreFl);
+ void displayList(Dupdate update, ...);
void displayRect(const int16 x, const int16 y, const int16 dx, const int16 dy);
void drawBoundaries();
void drawRectangle(const bool filledFl, const int16 x1, const int16 y1, const int16 x2, const int16 y2, const int color);
@@ -67,7 +67,7 @@ public:
void initDisplay();
void initNewScreenDisplay();
void loadPalette(Common::ReadStream &in);
- void moveImage(image_pt srcImage, const int16 x1, const int16 y1, const int16 dx, int16 dy, const int16 width1, image_pt dstImage, const int16 x2, const int16 y2, const int16 width2);
+ void moveImage(ImagePtr srcImage, const int16 x1, const int16 y1, const int16 dx, int16 dy, const int16 width1, ImagePtr dstImage, const int16 x2, const int16 y2, const int16 width2);
void remapPal(uint16 oldIndex, uint16 newIndex);
void resetInventoryObjId();
void restorePal(Common::ReadStream *f);
@@ -80,11 +80,11 @@ public:
void userHelp() const;
void writeStr(int16 sx, const int16 sy, const char *s, const byte color);
- icondib_t &getIconBuffer();
- viewdib_t &getBackBuffer();
- viewdib_t &getBackBufferBackup();
- viewdib_t &getFrontBuffer();
- viewdib_t &getGUIBuffer();
+ Icondib &getIconBuffer();
+ Viewdib &getBackBuffer();
+ Viewdib &getBackBufferBackup();
+ Viewdib &getFrontBuffer();
+ Viewdib &getGUIBuffer();
protected:
HugoEngine *_vm;
@@ -108,37 +108,37 @@ protected:
byte *_mainPalette;
int16 _arrayFontSize[kNumFonts];
- viewdib_t _frontBuffer;
+ Viewdib _frontBuffer;
- inline bool isInX(const int16 x, const rect_t *rect) const;
- inline bool isInY(const int16 y, const rect_t *rect) const;
- inline bool isOverlapping(const rect_t *rectA, const rect_t *rectB) const;
+ inline bool isInX(const int16 x, const Rect *rect) const;
+ inline bool isInY(const int16 y, const Rect *rect) const;
+ inline bool isOverlapping(const Rect *rectA, const Rect *rectB) const;
- virtual overlayState_t findOvl(seq_t *seq_p, image_pt dst_p, uint16 y) = 0;
+ virtual OverlayState findOvl(Seq *seqPtr, ImagePtr dst_p, uint16 y) = 0;
private:
byte *_curPalette;
byte _iconImage[kInvDx * kInvDy];
byte _paletteSize;
- icondib_t _iconBuffer; // Inventory icon DIB
+ Icondib _iconBuffer; // Inventory icon DIB
- int16 mergeLists(rect_t *list, rect_t *blist, const int16 len, int16 blen);
+ int16 mergeLists(Rect *list, Rect *blist, const int16 len, int16 blen);
int16 center(const char *s) const;
- viewdib_t _backBuffer;
- viewdib_t _GUIBuffer; // User interface images
- viewdib_t _backBufferBackup; // Backup _backBuffer during inventory
+ Viewdib _backBuffer;
+ Viewdib _GUIBuffer; // User interface images
+ Viewdib _backBufferBackup; // Backup _backBuffer during inventory
// Formerly static variables used by displayList()
int16 _dlAddIndex, _dlRestoreIndex; // Index into add/restore lists
- rect_t _dlRestoreList[kRectListSize]; // The restore list
- rect_t _dlAddList[kRectListSize]; // The add list
- rect_t _dlBlistList[kBlitListSize]; // The blit list
+ Rect _dlRestoreList[kRectListSize]; // The restore list
+ Rect _dlAddList[kRectListSize]; // The add list
+ Rect _dlBlistList[kBlitListSize]; // The blit list
//
void createPal();
- void merge(const rect_t *rectA, rect_t *rectB);
+ void merge(const Rect *rectA, Rect *rectB);
void writeChr(const int sx, const int sy, const byte color, const char *local_fontdata);
};
@@ -150,7 +150,7 @@ public:
void loadFont(int16 fontId);
void loadFontArr(Common::ReadStream &in);
protected:
- overlayState_t findOvl(seq_t *seq_p, image_pt dst_p, uint16 y);
+ OverlayState findOvl(Seq *seqPtr, ImagePtr dst_p, uint16 y);
};
class Screen_v1w : public Screen {
@@ -161,7 +161,7 @@ public:
void loadFont(int16 fontId);
void loadFontArr(Common::ReadStream &in);
protected:
- overlayState_t findOvl(seq_t *seq_p, image_pt dst_p, uint16 y);
+ OverlayState findOvl(Seq *seqPtr, ImagePtr dst_p, uint16 y);
};
} // End of namespace Hugo
diff --git a/engines/hugo/file.cpp b/engines/hugo/file.cpp
index 219e29a25a..b78a26241b 100644
--- a/engines/hugo/file.cpp
+++ b/engines/hugo/file.cpp
@@ -91,8 +91,8 @@ const char *FileManager::getUifFilename() const {
* Convert 4 planes (RGBI) data to 8-bit DIB format
* Return original plane data ptr
*/
-byte *FileManager::convertPCC(byte *p, const uint16 y, const uint16 bpl, image_pt dataPtr) const {
- debugC(2, kDebugFile, "convertPCC(byte *p, %d, %d, image_pt data_p)", y, bpl);
+byte *FileManager::convertPCC(byte *p, const uint16 y, const uint16 bpl, ImagePtr dataPtr) const {
+ debugC(2, kDebugFile, "convertPCC(byte *p, %d, %d, ImagePtr data_p)", y, bpl);
dataPtr += y * bpl * 8; // Point to correct DIB line
for (int16 r = 0, g = bpl, b = g + bpl, i = b + bpl; r < bpl; r++, g++, b++, i++) { // Each byte in all planes
@@ -107,11 +107,11 @@ byte *FileManager::convertPCC(byte *p, const uint16 y, const uint16 bpl, image_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
+ * Read a pcx file of length len. Use supplied seqPtr and image_p or
+ * allocate space if NULL. Name used for errors. Returns address of seqPtr
* Set first TRUE to initialize b_index (i.e. not reading a sequential image in file).
*/
-seq_t *FileManager::readPCX(Common::ReadStream &f, seq_t *seqPtr, byte *imagePtr, const bool firstFl, const char *name) {
+Seq *FileManager::readPCX(Common::ReadStream &f, Seq *seqPtr, byte *imagePtr, const bool firstFl, const char *name) {
debugC(1, kDebugFile, "readPCX(..., %s)", name);
// Read in the PCC header and check consistency
@@ -134,9 +134,9 @@ seq_t *FileManager::readPCX(Common::ReadStream &f, seq_t *seqPtr, byte *imagePtr
if (_PCCHeader._mfctr != 10)
error("Bad data file format: %s", name);
- // Allocate memory for seq_t if 0
+ // Allocate memory for Seq if 0
if (seqPtr == 0) {
- if ((seqPtr = (seq_t *)malloc(sizeof(seq_t))) == 0)
+ if ((seqPtr = (Seq *)malloc(sizeof(Seq))) == 0)
error("Insufficient memory to run game.");
}
@@ -182,8 +182,8 @@ seq_t *FileManager::readPCX(Common::ReadStream &f, seq_t *seqPtr, byte *imagePtr
/**
* Read object file of PCC images into object supplied
*/
-void FileManager::readImage(const int objNum, object_t *objPtr) {
- debugC(1, kDebugFile, "readImage(%d, object_t *objPtr)", objNum);
+void FileManager::readImage(const int objNum, Object *objPtr) {
+ debugC(1, kDebugFile, "readImage(%d, Object *objPtr)", objNum);
/**
* Structure of object file lookup entry
@@ -215,7 +215,7 @@ void FileManager::readImage(const int objNum, object_t *objPtr) {
}
bool firstImgFl = true; // Initializes pcx read function
- seq_t *seqPtr = 0; // Ptr to sequence structure
+ Seq *seqPtr = 0; // Ptr to sequence structure
// Now read the images into an images list
for (int j = 0; j < objPtr->_seqNumb; j++) { // for each sequence
@@ -239,7 +239,7 @@ void FileManager::readImage(const int objNum, object_t *objPtr) {
seqPtr->_y1 = seqPtr->_lines;
seqPtr->_y2 = 0;
- image_pt dibPtr = seqPtr->_imagePtr;
+ ImagePtr dibPtr = seqPtr->_imagePtr;
for (int y = 0; y < seqPtr->_lines; y++, dibPtr += seqPtr->_bytesPerLine8 - x2) {
for (int x = 0; x < x2; x++) {
if (*dibPtr++) { // Some data found
@@ -382,7 +382,7 @@ bool FileManager::saveGame(const int16 slot, const Common::String &descrip) {
_vm->_object->saveObjects(out);
- const status_t &gameStatus = _vm->getGameStatus();
+ const Status &gameStatus = _vm->getGameStatus();
// Save whether hero image is swapped
out->writeByte(_vm->_heroImage);
@@ -486,7 +486,7 @@ bool FileManager::restoreGame(const int16 slot) {
_vm->_object->swapImages(kHeroIndex, _vm->_heroImage);
_vm->_heroImage = heroImg;
- status_t &gameStatus = _vm->getGameStatus();
+ Status &gameStatus = _vm->getGameStatus();
int score = in->readSint16BE();
_vm->setScore(score);
@@ -514,7 +514,7 @@ bool FileManager::restoreGame(const int16 slot) {
_vm->_maze._firstScreenIndex = in->readByte();
_vm->_scheduler->restoreScreen(*_vm->_screen_p);
- if ((_vm->getGameStatus()._viewState = (vstate_t) in->readByte()) != kViewPlay)
+ if ((_vm->getGameStatus()._viewState = (Vstate) in->readByte()) != kViewPlay)
_vm->_screen->hideCursor();
@@ -624,8 +624,8 @@ void FileManager::readBootFile() {
* This file contains, between others, the bitmaps of the fonts used in the application
* UIF means User interface database (Windows Only)
*/
-uif_hdr_t *FileManager::get_UIFHeader(const uif_t id) {
- debugC(1, kDebugFile, "get_UIFHeader(%d)", id);
+UifHdr *FileManager::getUIFHeader(const Uif id) {
+ debugC(1, kDebugFile, "getUIFHeader(%d)", id);
// Initialize offset lookup if not read yet
if (_firstUIFFl) {
@@ -660,11 +660,11 @@ void FileManager::readUIFItem(const int16 id, byte *buf) {
error("File not found: %s", getUifFilename());
// Seek to data
- uif_hdr_t *_UIFHeaderPtr = get_UIFHeader((uif_t)id);
+ UifHdr *_UIFHeaderPtr = getUIFHeader((Uif)id);
ip.seek(_UIFHeaderPtr->_offset, SEEK_SET);
// We support pcx images and straight data
- seq_t *dummySeq; // Dummy seq_t for image data
+ Seq *dummySeq; // Dummy Seq for image data
switch (id) {
case UIF_IMAGES: // Read uif images file
dummySeq = readPCX(ip, 0, buf, true, getUifFilename());
diff --git a/engines/hugo/file.h b/engines/hugo/file.h
index e7c467a315..151b749ce7 100644
--- a/engines/hugo/file.h
+++ b/engines/hugo/file.h
@@ -34,9 +34,9 @@ namespace Hugo {
/**
* Enumerate overlay file types
*/
-enum ovl_t {kOvlBoundary, kOvlOverlay, kOvlBase};
+enum OvlType {kOvlBoundary, kOvlOverlay, kOvlBase};
-struct uif_hdr_t { // UIF font/image look up
+struct UifHdr { // UIF font/image look up
uint16 _size; // Size of uif item
uint32 _offset; // Offset of item in file
};
@@ -50,7 +50,7 @@ public:
sound_pt getSound(const int16 sound, uint16 *size);
void readBootFile();
- void readImage(const int objNum, object_t *objPtr);
+ void readImage(const int objNum, Object *objPtr);
void readUIFImages();
void readUIFItem(const int16 id, byte *buf);
bool restoreGame(const int16 slot);
@@ -69,7 +69,7 @@ public:
virtual void instructions() const = 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, ImagePtr image, OvlType overlayType) = 0;
virtual const char *fetchString(const int index) = 0;
@@ -84,7 +84,7 @@ protected:
/**
* Structure of scenery file lookup entry
*/
- struct sceneBlock_t {
+ struct SceneBlock {
uint32 _sceneOffset;
uint32 _sceneLength;
uint32 _boundaryOffset;
@@ -95,7 +95,7 @@ protected:
uint32 _baseLength;
};
- struct _PCCHeader_t { // Structure of PCX file header
+ struct PCCHeader { // Structure of PCX file header
byte _mfctr, _vers, _enc, _bpx;
uint16 _x1, _y1, _x2, _y2; // bounding box
uint16 _xres, _yres;
@@ -106,23 +106,23 @@ protected:
}; // Header of a PCC file
bool _firstUIFFl;
- uif_hdr_t _UIFHeader[kMaxUifs]; // Lookup for uif fonts/images
+ UifHdr _UIFHeader[kMaxUifs]; // Lookup for uif fonts/images
Common::File _stringArchive; // Handle for string file
Common::File _sceneryArchive1; // Handle for scenery file
Common::File _objectsArchive; // Handle for objects file
- _PCCHeader_t _PCCHeader;
+ PCCHeader _PCCHeader;
- seq_t *readPCX(Common::ReadStream &f, seq_t *seqPtr, byte *imagePtr, const bool firstFl, const char *name);
+ Seq *readPCX(Common::ReadStream &f, Seq *seqPtr, byte *imagePtr, const bool firstFl, const char *name);
// If this is the first call, read the lookup table
bool _hasReadHeader;
- sound_hdr_t _s_hdr[kMaxSounds]; // Sound lookup table
+ SoundHdr _s_hdr[kMaxSounds]; // Sound lookup table
private:
- byte *convertPCC(byte *p, const uint16 y, const uint16 bpl, image_pt dataPtr) const;
- uif_hdr_t *get_UIFHeader(const uif_t id);
+ byte *convertPCC(byte *p, const uint16 y, const uint16 bpl, ImagePtr dataPtr) const;
+ UifHdr *getUIFHeader(const Uif id);
//Strangerke : Not used?
void printBootText();
@@ -137,7 +137,7 @@ public:
virtual void instructions() const;
virtual void openDatabaseFiles();
virtual void readBackground(const int screenIndex);
- virtual void readOverlay(const int screenNum, image_pt image, ovl_t overlayType);
+ virtual void readOverlay(const int screenNum, ImagePtr image, OvlType overlayType);
virtual const char *fetchString(const int index);
};
@@ -149,7 +149,7 @@ public:
virtual void closeDatabaseFiles();
virtual void openDatabaseFiles();
virtual void readBackground(const int screenIndex);
- virtual void readOverlay(const int screenNum, image_pt image, ovl_t overlayType);
+ virtual void readOverlay(const int screenNum, ImagePtr image, OvlType overlayType);
const char *fetchString(const int index);
private:
char *_fetchStringBuf;
@@ -163,7 +163,7 @@ public:
void closeDatabaseFiles();
void openDatabaseFiles();
void readBackground(const int screenIndex);
- void readOverlay(const int screenNum, image_pt image, ovl_t overlayType);
+ void readOverlay(const int screenNum, ImagePtr image, OvlType overlayType);
private:
Common::File _sceneryArchive2; // Handle for scenery file
};
@@ -181,7 +181,7 @@ public:
FileManager_v1w(HugoEngine *vm);
~FileManager_v1w();
- void readOverlay(const int screenNum, image_pt image, ovl_t overlayType);
+ void readOverlay(const int screenNum, ImagePtr image, OvlType overlayType);
};
} // End of namespace Hugo
diff --git a/engines/hugo/file_v1d.cpp b/engines/hugo/file_v1d.cpp
index c3bb0e275f..e42223fb13 100644
--- a/engines/hugo/file_v1d.cpp
+++ b/engines/hugo/file_v1d.cpp
@@ -55,11 +55,11 @@ void FileManager_v1d::closeDatabaseFiles() {
/**
* Open and read in an overlay file, close file
*/
-void FileManager_v1d::readOverlay(const int screenNum, image_pt image, const ovl_t overlayType) {
+void FileManager_v1d::readOverlay(const int screenNum, ImagePtr image, const OvlType overlayType) {
debugC(1, kDebugFile, "readOverlay(%d, ...)", screenNum);
- const char *ovl_ext[] = {".b", ".o", ".ob"};
- Common::String buf = Common::String(_vm->_text->getScreenNames(screenNum)) + Common::String(ovl_ext[overlayType]);
+ const char *ovlExt[] = {".b", ".o", ".ob"};
+ Common::String buf = Common::String(_vm->_text->getScreenNames(screenNum)) + Common::String(ovlExt[overlayType]);
if (!Common::File::exists(buf)) {
memset(image, 0, kOvlSize);
@@ -70,7 +70,7 @@ void FileManager_v1d::readOverlay(const int screenNum, image_pt image, const ovl
if (!_sceneryArchive1.open(buf))
error("File not found: %s", buf.c_str());
- image_pt tmpImage = image; // temp ptr to overlay file
+ ImagePtr tmpImage = image; // temp ptr to overlay file
_sceneryArchive1.read(tmpImage, kOvlSize);
_sceneryArchive1.close();
@@ -87,7 +87,7 @@ void FileManager_v1d::readBackground(const int screenIndex) {
if (!_sceneryArchive1.open(buf))
error("File not found: %s", buf.c_str());
// Read the image into dummy seq and static dib_a
- seq_t *dummySeq; // Image sequence structure for Read_pcx
+ Seq *dummySeq; // Image sequence structure for Read_pcx
dummySeq = readPCX(_sceneryArchive1, 0, _vm->_screen->getFrontBuffer(), true, _vm->_text->getScreenNames(screenIndex));
free(dummySeq);
_sceneryArchive1.close();
diff --git a/engines/hugo/file_v1w.cpp b/engines/hugo/file_v1w.cpp
index fba13d6915..002a1dc103 100644
--- a/engines/hugo/file_v1w.cpp
+++ b/engines/hugo/file_v1w.cpp
@@ -45,13 +45,13 @@ FileManager_v1w::~FileManager_v1w() {
/**
* Open and read in an overlay file, close file
*/
-void FileManager_v1w::readOverlay(const int screenNum, image_pt image, ovl_t overlayType) {
+void FileManager_v1w::readOverlay(const int screenNum, ImagePtr image, OvlType overlayType) {
debugC(1, kDebugFile, "readOverlay(%d, ...)", screenNum);
- image_pt tmpImage = image; // temp ptr to overlay file
- _sceneryArchive1.seek((uint32)screenNum * sizeof(sceneBlock_t), SEEK_SET);
+ ImagePtr tmpImage = image; // temp ptr to overlay file
+ _sceneryArchive1.seek((uint32)screenNum * sizeof(SceneBlock), SEEK_SET);
- sceneBlock_t sceneBlock; // Database header entry
+ SceneBlock sceneBlock; // Database header entry
sceneBlock._sceneOffset = _sceneryArchive1.readUint32LE();
sceneBlock._sceneLength = _sceneryArchive1.readUint32LE();
sceneBlock._boundaryOffset = _sceneryArchive1.readUint32LE();
diff --git a/engines/hugo/file_v2d.cpp b/engines/hugo/file_v2d.cpp
index 7239e5174a..19c90980b0 100644
--- a/engines/hugo/file_v2d.cpp
+++ b/engines/hugo/file_v2d.cpp
@@ -78,9 +78,9 @@ void FileManager_v2d::closeDatabaseFiles() {
void FileManager_v2d::readBackground(const int screenIndex) {
debugC(1, kDebugFile, "readBackground(%d)", screenIndex);
- _sceneryArchive1.seek((uint32) screenIndex * sizeof(sceneBlock_t), SEEK_SET);
+ _sceneryArchive1.seek((uint32) screenIndex * sizeof(SceneBlock), SEEK_SET);
- sceneBlock_t sceneBlock; // Read a database header entry
+ SceneBlock sceneBlock; // Read a database header entry
sceneBlock._sceneOffset = _sceneryArchive1.readUint32LE();
sceneBlock._sceneLength = _sceneryArchive1.readUint32LE();
sceneBlock._boundaryOffset = _sceneryArchive1.readUint32LE();
@@ -93,7 +93,7 @@ void FileManager_v2d::readBackground(const int screenIndex) {
_sceneryArchive1.seek(sceneBlock._sceneOffset, SEEK_SET);
// Read the image into dummy seq and static dib_a
- seq_t *dummySeq; // Image sequence structure for Read_pcx
+ Seq *dummySeq; // Image sequence structure for Read_pcx
dummySeq = readPCX(_sceneryArchive1, 0, _vm->_screen->getFrontBuffer(), true, _vm->_text->getScreenNames(screenIndex));
free(dummySeq);
}
@@ -101,13 +101,13 @@ void FileManager_v2d::readBackground(const int screenIndex) {
/**
* Open and read in an overlay file, close file
*/
-void FileManager_v2d::readOverlay(const int screenNum, image_pt image, ovl_t overlayType) {
+void FileManager_v2d::readOverlay(const int screenNum, ImagePtr image, OvlType overlayType) {
debugC(1, kDebugFile, "readOverlay(%d, ...)", screenNum);
- image_pt tmpImage = image; // temp ptr to overlay file
- _sceneryArchive1.seek((uint32)screenNum * sizeof(sceneBlock_t), SEEK_SET);
+ ImagePtr tmpImage = image; // temp ptr to overlay file
+ _sceneryArchive1.seek((uint32)screenNum * sizeof(SceneBlock), SEEK_SET);
- sceneBlock_t sceneBlock; // Database header entry
+ SceneBlock sceneBlock; // Database header entry
sceneBlock._sceneOffset = _sceneryArchive1.readUint32LE();
sceneBlock._sceneLength = _sceneryArchive1.readUint32LE();
sceneBlock._boundaryOffset = _sceneryArchive1.readUint32LE();
diff --git a/engines/hugo/file_v3d.cpp b/engines/hugo/file_v3d.cpp
index 34c745efb6..5eb0cfc2c8 100644
--- a/engines/hugo/file_v3d.cpp
+++ b/engines/hugo/file_v3d.cpp
@@ -50,9 +50,9 @@ FileManager_v3d::~FileManager_v3d() {
void FileManager_v3d::readBackground(const int screenIndex) {
debugC(1, kDebugFile, "readBackground(%d)", screenIndex);
- _sceneryArchive1.seek((uint32) screenIndex * sizeof(sceneBlock_t), SEEK_SET);
+ _sceneryArchive1.seek((uint32) screenIndex * sizeof(SceneBlock), SEEK_SET);
- sceneBlock_t sceneBlock; // Read a database header entry
+ SceneBlock sceneBlock; // Read a database header entry
sceneBlock._sceneOffset = _sceneryArchive1.readUint32LE();
sceneBlock._sceneLength = _sceneryArchive1.readUint32LE();
sceneBlock._boundaryOffset = _sceneryArchive1.readUint32LE();
@@ -62,7 +62,7 @@ void FileManager_v3d::readBackground(const int screenIndex) {
sceneBlock._baseOffset = _sceneryArchive1.readUint32LE();
sceneBlock._baseLength = _sceneryArchive1.readUint32LE();
- seq_t *dummySeq; // Image sequence structure for Read_pcx
+ Seq *dummySeq; // Image sequence structure for Read_pcx
if (screenIndex < 20) {
_sceneryArchive1.seek(sceneBlock._sceneOffset, SEEK_SET);
// Read the image into dummy seq and static dib_a
@@ -106,13 +106,13 @@ void FileManager_v3d::closeDatabaseFiles() {
/**
* Open and read in an overlay file, close file
*/
-void FileManager_v3d::readOverlay(const int screenNum, image_pt image, ovl_t overlayType) {
+void FileManager_v3d::readOverlay(const int screenNum, ImagePtr image, OvlType overlayType) {
debugC(1, kDebugFile, "readOverlay(%d, ...)", screenNum);
- image_pt tmpImage = image; // temp ptr to overlay file
- _sceneryArchive1.seek((uint32)screenNum * sizeof(sceneBlock_t), SEEK_SET);
+ ImagePtr tmpImage = image; // temp ptr to overlay file
+ _sceneryArchive1.seek((uint32)screenNum * sizeof(SceneBlock), SEEK_SET);
- sceneBlock_t sceneBlock; // Database header entry
+ SceneBlock sceneBlock; // Database header entry
sceneBlock._sceneOffset = _sceneryArchive1.readUint32LE();
sceneBlock._sceneLength = _sceneryArchive1.readUint32LE();
sceneBlock._boundaryOffset = _sceneryArchive1.readUint32LE();
diff --git a/engines/hugo/game.h b/engines/hugo/game.h
index ab5e2dff56..29e3bf9b55 100644
--- a/engines/hugo/game.h
+++ b/engines/hugo/game.h
@@ -45,7 +45,7 @@ namespace Hugo {
enum {LOOK_NAME = 1, TAKE_NAME}; // Index of name used in showing takeables and in confirming take
// Definitions of 'generic' commands: Max # depends on size of gencmd in
-// the object_t record since each requires 1 bit. Currently up to 16
+// the Object record since each requires 1 bit. Currently up to 16
enum {LOOK = 1, TAKE = 2, DROP = 4, LOOK_S = 8};
enum TEXTCOLORS {
@@ -55,25 +55,25 @@ enum TEXTCOLORS {
_TLIGHTRED, _TLIGHTMAGENTA, _TLIGHTYELLOW, _TBRIGHTWHITE
};
-enum uif_t {U_FONT5, U_FONT6, U_FONT8, UIF_IMAGES, NUM_UIF_ITEMS};
+enum Uif {U_FONT5, U_FONT6, U_FONT8, UIF_IMAGES, NUM_UIF_ITEMS};
static const int kFirstFont = U_FONT5;
/**
* Enumerate ways of cycling a sequence of frames
*/
-enum cycle_t {kCycleInvisible, kCycleAlmostInvisible, kCycleNotCycling, kCycleForward, kCycleBackward};
+enum Cycle {kCycleInvisible, kCycleAlmostInvisible, kCycleNotCycling, kCycleForward, kCycleBackward};
/**
* Enumerate sequence index matching direction of travel
*/
enum {SEQ_RIGHT, SEQ_LEFT, SEQ_DOWN, SEQ_UP};
-enum font_t {LARGE_ROMAN, MED_ROMAN, NUM_GDI_FONTS, INIT_FONTS, DEL_FONTS};
+enum Font {LARGE_ROMAN, MED_ROMAN, NUM_GDI_FONTS, INIT_FONTS, DEL_FONTS};
/**
* Enumerate the different path types for an object
*/
-enum path_t {
+enum Path {
kPathUser, // User has control of object via cursor keys
kPathAuto, // Computer has control, controlled by action lists
kPathQuiet, // Computer has control and no commands allowed
@@ -83,7 +83,7 @@ enum path_t {
kPathWander2 // Same as WANDER, except keeps cycling when stationary
};
-struct hugo_boot_t { // Common HUGO boot file
+struct hugoBoot { // Common HUGO boot file
char _checksum; // Checksum for boot structure (not exit text)
char _registered; // TRUE if registered version, else FALSE
char _pbswitch[8]; // Playback switch string
@@ -94,13 +94,13 @@ struct hugo_boot_t { // Common HUGO boot file
/**
* Game specific type definitions
*/
-typedef byte *image_pt; // ptr to an object image (sprite)
+typedef byte *ImagePtr; // ptr to an object image (sprite)
typedef byte *sound_pt; // ptr to sound (or music) data
/**
* Structure for initializing maze processing
*/
-struct maze_t {
+struct Maze {
bool _enabledFl; // TRUE when maze processing enabled
byte _size; // Size of (square) maze matrix
int _x1, _y1, _x2, _y2; // maze hotspot bounding box
@@ -112,24 +112,24 @@ struct maze_t {
* 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
+struct Seq { // Linked list of images
byte *_imagePtr; // ptr to image
uint16 _bytesPerLine8; // bytes per line (8bits)
uint16 _lines; // lines
uint16 _x1, _x2, _y1, _y2; // Offsets from x,y: data bounding box
- seq_t *_nextSeqPtr; // ptr to next record
+ Seq *_nextSeqPtr; // ptr to next record
};
/**
* The following is an array of structures of above sequences
*/
-struct seqList_t {
+struct SeqList {
uint16 _imageNbr; // Number of images in sequence
- seq_t *_seqPtr; // Ptr to sequence structure
+ Seq *_seqPtr; // Ptr to sequence structure
};
#include "common/pack-start.h" // START STRUCT PACKING
-struct sound_hdr_t { // Sound file lookup entry
+struct SoundHdr { // Sound file lookup entry
uint16 _size; // Size of sound data in bytes
uint32 _offset; // Offset of sound data in file
} PACKED_STRUCT;
@@ -140,17 +140,17 @@ static const int kMaxSeqNumb = 4; // Number of sequences of im
/**
* Following is definition of object attributes
*/
-struct object_t {
+struct Object {
uint16 _nounIndex; // String identifying object
uint16 _dataIndex; // String describing the object
- uint16 *_stateDataIndex; // Added by Strangerke to handle the LOOK_S state-dependant descriptions
- path_t _pathType; // Describe path object follows
+ uint16 *_stateDataIndex; // Added by Strangerke to handle the LOOK_S state-dependant descriptions
+ Path _pathType; // Describe path object follows
int _vxPath, _vyPath; // Delta velocities (e.g. for CHASE)
uint16 _actIndex; // Action list to do on collision with hero
byte _seqNumb; // Number of sequences in list
- seq_t *_currImagePtr; // Sequence image currently in use
- seqList_t _seqList[kMaxSeqNumb]; // Array of sequence structure ptrs and lengths
- cycle_t _cycling; // Whether cycling, forward or backward
+ Seq *_currImagePtr; // Sequence image currently in use
+ SeqList _seqList[kMaxSeqNumb]; // Array of sequence structure ptrs and lengths
+ Cycle _cycling; // Whether cycling, forward or backward
byte _cycleNumb; // No. of times to cycle
byte _frameInterval; // Interval (in ticks) between frames
byte _frameTimer; // Decrementing timer for above
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp
index 7462da0df8..5ae43b8b5a 100644
--- a/engines/hugo/hugo.cpp
+++ b/engines/hugo/hugo.cpp
@@ -106,7 +106,7 @@ GUI::Debugger *HugoEngine::getDebugger() {
return _console;
}
-status_t &HugoEngine::getGameStatus() {
+Status &HugoEngine::getGameStatus() {
return _status;
}
@@ -323,7 +323,7 @@ void HugoEngine::initMachine() {
* Hugo game state machine - called during onIdle
*/
void HugoEngine::runMachine() {
- status_t &gameStatus = getGameStatus();
+ Status &gameStatus = getGameStatus();
// Don't process if gameover
if (gameStatus._gameOverFl)
@@ -639,10 +639,10 @@ void HugoEngine::readScreenFiles(const int screenNum) {
memcpy(_screen->getBackBuffer(), _screen->getFrontBuffer(), sizeof(_screen->getFrontBuffer())); // Make a copy
// Workaround for graphic glitches in DOS versions. Cleaning the overlays fix the problem
- memset(_object->_objBound, '\0', sizeof(overlay_t));
- memset(_object->_boundary, '\0', sizeof(overlay_t));
- memset(_object->_overlay, '\0', sizeof(overlay_t));
- memset(_object->_ovlBase, '\0', sizeof(overlay_t));
+ memset(_object->_objBound, '\0', sizeof(Overlay));
+ memset(_object->_boundary, '\0', sizeof(Overlay));
+ memset(_object->_overlay, '\0', sizeof(Overlay));
+ memset(_object->_ovlBase, '\0', sizeof(Overlay));
_file->readOverlay(screenNum, _object->_boundary, kOvlBoundary); // Boundary file
_file->readOverlay(screenNum, _object->_overlay, kOvlOverlay); // Overlay file
diff --git a/engines/hugo/hugo.h b/engines/hugo/hugo.h
index 68b771faa4..312f2272db 100644
--- a/engines/hugo/hugo.h
+++ b/engines/hugo/hugo.h
@@ -80,18 +80,18 @@ static const int kMaxPath = 256; // Max length of a full path
static const int kHeroMaxWidth = 24; // Maximum width of hero
static const int kHeroMinWidth = 16; // Minimum width of hero
-typedef char command_t[kMaxLineSize + 8]; // Command line (+spare for prompt,cursor)
+typedef char Command[kMaxLineSize + 8]; // Command line (+spare for prompt,cursor)
-struct config_t { // User's config (saved)
- bool _musicFl; // State of Music button/menu item
- bool _soundFl; // State of Sound button/menu item
- bool _turboFl; // State of Turbo button/menu item
- bool _playlist[kMaxTunes]; // Tune playlist
+struct Config { // User's config (saved)
+ bool _musicFl; // State of Music button/menu item
+ bool _soundFl; // State of Sound button/menu item
+ bool _turboFl; // State of Turbo button/menu item
+ bool _playlist[kMaxTunes]; // Tune playlist
};
-typedef byte icondib_t[kXPix * kInvDy]; // Icon bar dib
-typedef byte viewdib_t[(long)kXPix * kYPix]; // Viewport dib
-typedef byte overlay_t[kOvlSize]; // Overlay file
+typedef byte Icondib[kXPix * kInvDy]; // Icon bar dib
+typedef byte Viewdib[(long)kXPix * kYPix]; // Viewport dib
+typedef byte Overlay[kOvlSize]; // Overlay file
enum GameType {
kGameTypeNone = 0,
@@ -131,12 +131,12 @@ enum HugoRegistered {
/**
* Inventory icon bar states
*/
-enum istate_t {kInventoryOff, kInventoryUp, kInventoryDown, kInventoryActive};
+enum Istate {kInventoryOff, kInventoryUp, kInventoryDown, kInventoryActive};
/**
* Game view state machine
*/
-enum vstate_t {kViewIdle, kViewIntroInit, kViewIntro, kViewPlay, kViewInvent, kViewExit};
+enum Vstate {kViewIdle, kViewIntroInit, kViewIntro, kViewPlay, kViewInvent, kViewExit};
/**
* Enumerate whether object is foreground, background or 'floating'
@@ -152,12 +152,12 @@ enum {kPriorityForeground, kPriorityBackground, kPriorityFloating, kPriorityOver
/**
* Display list functions
*/
-enum dupdate_t {kDisplayInit, kDisplayAdd, kDisplayDisplay, kDisplayRestore};
+enum Dupdate {kDisplayInit, kDisplayAdd, kDisplayDisplay, kDisplayRestore};
/**
* Priority for sound effect
*/
-enum priority_t {kSoundPriorityLow, kSoundPriorityMedium, kSoundPriorityHigh};
+enum Priority {kSoundPriorityLow, kSoundPriorityMedium, kSoundPriorityHigh};
enum HugoGameFeatures {
GF_PACKED = (1 << 0) // Database
@@ -170,27 +170,27 @@ enum seqTextEngine {
struct HugoGameDescription;
-struct status_t { // Game status (not saved)
- bool _storyModeFl; // Game is telling story - no commands
- bool _gameOverFl; // Game is over - hero knobbled
- bool _lookFl; // Toolbar "look" button pressed
- bool _recallFl; // Toolbar "recall" button pressed
- bool _newScreenFl; // New screen just loaded in dib_a
- bool _godModeFl; // Allow DEBUG features in live version
- bool _showBoundariesFl; // Flag used to show and hide boundaries,
+struct Status { // Game status (not saved)
+ bool _storyModeFl; // Game is telling story - no commands
+ bool _gameOverFl; // Game is over - hero knobbled
+ bool _lookFl; // Toolbar "look" button pressed
+ bool _recallFl; // Toolbar "recall" button pressed
+ bool _newScreenFl; // New screen just loaded in dib_a
+ bool _godModeFl; // Allow DEBUG features in live version
+ bool _showBoundariesFl; // Flag used to show and hide boundaries,
// used by the console
bool _doQuitFl;
bool _skipIntroFl;
bool _helpFl;
- uint32 _tick; // Current time in ticks
- vstate_t _viewState; // View state machine
- int16 _song; // Current song
+ uint32 _tick; // Current time in ticks
+ Vstate _viewState; // View state machine
+ int16 _song; // Current song
};
/**
* Structure to define an EXIT or other collision-activated hotspot
*/
-struct hotspot_t {
+struct Hotspot {
int _screenIndex; // Screen in which hotspot appears
int _x1, _y1, _x2, _y2; // Bounding box of hotspot
uint16 _actIndex; // Actions to carry out if a 'hit'
@@ -225,19 +225,19 @@ public:
uint16 _numStates;
int8 _normalTPS; // Number of ticks (frames) per second.
// 8 for Win versions, 9 for DOS versions
- object_t *_hero;
+ Object *_hero;
byte *_screen_p;
byte _heroImage;
byte *_screenStates;
- command_t _line; // Line of user text input
- config_t _config; // User's config
+ Command _line; // Line of user text input
+ Config _config; // User's config
int16 *_defltTunes;
uint16 _look;
uint16 _take;
uint16 _drop;
- maze_t _maze; // Maze control structure
- hugo_boot_t _boot; // Boot info structure
+ Maze _maze; // Maze control structure
+ hugoBoot _boot; // Boot info structure
GUI::Debugger *getDebugger();
@@ -246,8 +246,8 @@ public:
const char *_episode;
Common::String _picDir;
- command_t _statusLine;
- command_t _scoreLine;
+ Command _statusLine;
+ Command _scoreLine;
const HugoGameDescription *_gameDescription;
uint32 getFeatures() const;
@@ -279,7 +279,7 @@ public:
void shutdown();
void syncSoundSettings();
- status_t &getGameStatus();
+ Status &getGameStatus();
int getScore() const;
void setScore(const int newScore);
void adjustScore(const int adjustment);
@@ -314,7 +314,7 @@ protected:
private:
static const int kTurboTps = 16; // This many in turbo mode
- status_t _status; // Game status structure
+ Status _status; // Game status structure
uint32 _lastTime;
uint32 _curTime;
diff --git a/engines/hugo/inventory.cpp b/engines/hugo/inventory.cpp
index 151fe0ee13..c2495beadb 100644
--- a/engines/hugo/inventory.cpp
+++ b/engines/hugo/inventory.cpp
@@ -56,7 +56,7 @@ void InventoryHandler::setInventoryObjId(int16 objId) {
_inventoryObjId = objId;
}
-void InventoryHandler::setInventoryState(istate_t state) {
+void InventoryHandler::setInventoryState(Istate state) {
_inventoryState = state;
}
@@ -68,7 +68,7 @@ int16 InventoryHandler::getInventoryObjId() const {
return _inventoryObjId;
}
-istate_t InventoryHandler::getInventoryState() const {
+Istate InventoryHandler::getInventoryState() const {
return _inventoryState;
}
@@ -137,8 +137,8 @@ void InventoryHandler::constructInventory(const int16 imageTotNumb, int displayN
* Process required action for inventory
* Returns objId under cursor (or -1) for INV_GET
*/
-int16 InventoryHandler::processInventory(const invact_t action, ...) {
- debugC(1, kDebugInventory, "processInventory(invact_t action, ...)");
+int16 InventoryHandler::processInventory(const InvAct action, ...) {
+ debugC(1, kDebugInventory, "processInventory(InvAct action, ...)");
int16 imageNumb; // Total number of inventory items
int displayNumb; // Total number displayed/carried
@@ -208,7 +208,7 @@ int16 InventoryHandler::processInventory(const invact_t action, ...) {
* Process inventory state machine
*/
void InventoryHandler::runInventory() {
- status_t &gameStatus = _vm->getGameStatus();
+ Status &gameStatus = _vm->getGameStatus();
debugC(1, kDebugInventory, "runInventory");
diff --git a/engines/hugo/inventory.h b/engines/hugo/inventory.h
index 666cc37b51..5b55c3ec94 100644
--- a/engines/hugo/inventory.h
+++ b/engines/hugo/inventory.h
@@ -34,22 +34,22 @@ namespace Hugo {
/**
* Actions for Process_inventory()
*/
-enum invact_t {kInventoryActionInit, kInventoryActionLeft, kInventoryActionRight, kInventoryActionGet};
+enum InvAct {kInventoryActionInit, kInventoryActionLeft, kInventoryActionRight, kInventoryActionGet};
class InventoryHandler {
public:
InventoryHandler(HugoEngine *vm);
void setInventoryObjId(int16 objId);
- void setInventoryState(istate_t state);
+ void setInventoryState(Istate state);
void freeInvent();
int16 getInventoryObjId() const;
- istate_t getInventoryState() const;
+ Istate getInventoryState() const;
int16 findIconId(int16 objId);
void loadInvent(Common::SeekableReadStream &in);
- int16 processInventory(const invact_t action, ...);
+ int16 processInventory(const InvAct action, ...);
void runInventory();
private:
@@ -59,7 +59,7 @@ private:
int16 _firstIconId; // Index of first icon to display
int16 *_invent;
- istate_t _inventoryState; // Inventory icon bar state
+ Istate _inventoryState; // Inventory icon bar state
int16 _inventoryHeight; // Inventory icon bar height
int16 _inventoryObjId; // Inventory object selected, or -1
byte _maxInvent;
diff --git a/engines/hugo/mouse.cpp b/engines/hugo/mouse.cpp
index 864934a0d3..fef3cca608 100644
--- a/engines/hugo/mouse.cpp
+++ b/engines/hugo/mouse.cpp
@@ -108,7 +108,7 @@ int16 MouseHandler::getHotspotActIndex(const int16 hotspotId) const {
/**
* Shadow-blit supplied string into dib_a at cx,cy and add to display list
*/
-void MouseHandler::cursorText(const char *buffer, const int16 cx, const int16 cy, const uif_t fontId, const int16 color) {
+void MouseHandler::cursorText(const char *buffer, const int16 cx, const int16 cy, const Uif fontId, const int16 color) {
debugC(1, kDebugMouse, "cursorText(%s, %d, %d, %d, %d)", buffer, cx, cy, fontId, color);
_vm->_screen->loadFont(fontId);
@@ -152,7 +152,7 @@ int16 MouseHandler::findExit(const int16 cx, const int16 cy, byte screenId) {
void MouseHandler::processRightClick(const int16 objId, const int16 cx, const int16 cy) {
debugC(1, kDebugMouse, "ProcessRightClick(%d, %d, %d)", objId, cx, cy);
- status_t &gameStatus = _vm->getGameStatus();
+ Status &gameStatus = _vm->getGameStatus();
if (gameStatus._storyModeFl || _vm->_hero->_pathType == kPathQuiet) // Make sure user has control
return;
@@ -168,7 +168,7 @@ void MouseHandler::processRightClick(const int16 objId, const int16 cx, const in
else
_vm->_object->useObject(objId); // Use status.objid on object
} else { // Clicked over viewport object
- object_t *obj = &_vm->_object->_objects[objId];
+ Object *obj = &_vm->_object->_objects[objId];
int16 x, y;
switch (obj->_viewx) { // Where to walk to
case -1: // Walk to object position
@@ -203,9 +203,9 @@ void MouseHandler::processLeftClick(const int16 objId, const int16 cx, const int
debugC(1, kDebugMouse, "ProcessLeftClick(%d, %d, %d)", objId, cx, cy);
int16 i, x, y;
- object_t *obj;
+ Object *obj;
- status_t &gameStatus = _vm->getGameStatus();
+ Status &gameStatus = _vm->getGameStatus();
if (gameStatus._storyModeFl || _vm->_hero->_pathType == kPathQuiet) // Make sure user has control
return;
@@ -284,8 +284,8 @@ void MouseHandler::processLeftClick(const int16 objId, const int16 cx, const int
void MouseHandler::mouseHandler() {
debugC(2, kDebugMouse, "mouseHandler");
- status_t &gameStatus = _vm->getGameStatus();
- istate_t inventState = _vm->_inventory->getInventoryState();
+ Status &gameStatus = _vm->getGameStatus();
+ Istate inventState = _vm->_inventory->getInventoryState();
if ((gameStatus._viewState != kViewPlay) && (inventState != kInventoryActive))
return;
@@ -343,7 +343,7 @@ void MouseHandler::mouseHandler() {
resetRightButton();
}
-void MouseHandler::readHotspot(Common::ReadStream &in, hotspot_t &hotspot) {
+void MouseHandler::readHotspot(Common::ReadStream &in, Hotspot &hotspot) {
hotspot._screenIndex = in.readSint16BE();
hotspot._x1 = in.readSint16BE();
hotspot._y1 = in.readSint16BE();
@@ -359,13 +359,13 @@ void MouseHandler::readHotspot(Common::ReadStream &in, hotspot_t &hotspot) {
* Load hotspots data from hugo.dat
*/
void MouseHandler::loadHotspots(Common::ReadStream &in) {
- hotspot_t *wrkHotspots = 0;
- hotspot_t tmp;
+ Hotspot *wrkHotspots = 0;
+ Hotspot tmp;
memset(&tmp, 0, sizeof(tmp));
for (int varnt = 0; varnt < _vm->_numVariant; varnt++) {
int numRows = in.readUint16BE();
if (varnt == _vm->_gameVariant)
- _hotspots = wrkHotspots = (hotspot_t *)malloc(sizeof(hotspot_t) * numRows);
+ _hotspots = wrkHotspots = (Hotspot *)malloc(sizeof(Hotspot) * numRows);
for (int i = 0; i < numRows; i++)
readHotspot(in, (varnt == _vm->_gameVariant) ? wrkHotspots[i] : tmp);
@@ -377,7 +377,7 @@ void MouseHandler::loadHotspots(Common::ReadStream &in) {
*/
void MouseHandler::drawHotspots() const {
for (int i = 0; _hotspots[i]._screenIndex >= 0; i++) {
- hotspot_t *hotspot = &_hotspots[i];
+ Hotspot *hotspot = &_hotspots[i];
if (hotspot->_screenIndex == _vm->_hero->_screenIndex)
_vm->_screen->drawRectangle(false, hotspot->_x1, hotspot->_y1, hotspot->_x2, hotspot->_y2, _TLIGHTRED);
}
diff --git a/engines/hugo/mouse.h b/engines/hugo/mouse.h
index 35f9e4e87e..e20716f72c 100644
--- a/engines/hugo/mouse.h
+++ b/engines/hugo/mouse.h
@@ -70,17 +70,17 @@ private:
kMsExit = 1
};
- hotspot_t *_hotspots;
+ Hotspot *_hotspots;
bool _leftButtonFl; // Left mouse button pressed
bool _rightButtonFl; // Right button pressed
int _mouseX;
int _mouseY;
bool _jumpExitFl; // Allowed to jump to a screen exit
- void cursorText(const char *buffer, const int16 cx, const int16 cy, const uif_t fontId, const int16 color);
+ void cursorText(const char *buffer, const int16 cx, const int16 cy, const Uif fontId, const int16 color);
void processRightClick(const int16 objId, const int16 cx, const int16 cy);
void processLeftClick(const int16 objId, const int16 cx, const int16 cy);
- void readHotspot(Common::ReadStream &in, hotspot_t &hotspot);
+ void readHotspot(Common::ReadStream &in, Hotspot &hotspot);
};
} // End of namespace Hugo
diff --git a/engines/hugo/object.cpp b/engines/hugo/object.cpp
index 92a04227d6..e0dd0abd49 100644
--- a/engines/hugo/object.cpp
+++ b/engines/hugo/object.cpp
@@ -48,10 +48,10 @@ ObjectHandler::ObjectHandler(HugoEngine *vm) : _vm(vm), _objects(0), _uses(0) {
_numObj = 0;
_objCount = 0;
_usesSize = 0;
- memset(_objBound, '\0', sizeof(overlay_t));
- memset(_boundary, '\0', sizeof(overlay_t));
- memset(_overlay, '\0', sizeof(overlay_t));
- memset(_ovlBase, '\0', sizeof(overlay_t));
+ memset(_objBound, '\0', sizeof(Overlay));
+ memset(_boundary, '\0', sizeof(Overlay));
+ memset(_overlay, '\0', sizeof(Overlay));
+ memset(_ovlBase, '\0', sizeof(Overlay));
}
ObjectHandler::~ObjectHandler() {
@@ -86,7 +86,7 @@ void ObjectHandler::setVelocity(int objIndex, int8 vx, int8 vy) {
_objects[objIndex]._vy = vy;
}
-void ObjectHandler::setPath(int objIndex, path_t pathType, int16 vxPath, int16 vyPath) {
+void ObjectHandler::setPath(int objIndex, Path pathType, int16 vxPath, int16 vyPath) {
_objects[objIndex]._pathType = pathType;
_objects[objIndex]._vxPath = vxPath;
_objects[objIndex]._vyPath = vyPath;
@@ -95,12 +95,12 @@ void ObjectHandler::setPath(int objIndex, path_t pathType, int16 vxPath, int16 v
/**
* Save sequence number and image number in given object
*/
-void ObjectHandler::saveSeq(object_t *obj) {
+void ObjectHandler::saveSeq(Object *obj) {
debugC(1, kDebugObject, "saveSeq");
bool found = false;
for (int i = 0; !found && (i < obj->_seqNumb); i++) {
- seq_t *q = obj->_seqList[i]._seqPtr;
+ Seq *q = obj->_seqList[i]._seqPtr;
for (int j = 0; !found && (j < obj->_seqList[i]._imageNbr); j++) {
if (obj->_currImagePtr == q) {
found = true;
@@ -114,12 +114,12 @@ void ObjectHandler::saveSeq(object_t *obj) {
}
/**
- * Set up cur_seq_p from stored sequence and image number in object
+ * Set up cur_seqPtr from stored sequence and image number in object
*/
-void ObjectHandler::restoreSeq(object_t *obj) {
+void ObjectHandler::restoreSeq(Object *obj) {
debugC(1, kDebugObject, "restoreSeq");
- seq_t *q = obj->_seqList[obj->_curSeqNum]._seqPtr;
+ Seq *q = obj->_seqList[obj->_curSeqNum]._seqPtr;
for (int j = 0; j < obj->_curImageNum; j++)
q = q->_nextSeqPtr;
obj->_currImagePtr = q;
@@ -134,7 +134,7 @@ void ObjectHandler::useObject(int16 objId) {
const char *verb; // Background verb to use directly
int16 inventObjId = _vm->_inventory->getInventoryObjId();
- object_t *obj = &_objects[objId]; // Ptr to object
+ Object *obj = &_objects[objId]; // Ptr to object
if (inventObjId == -1) {
// Get or use objid directly
if ((obj->_genericCmd & TAKE) || obj->_objValue) // Get collectible item
@@ -153,12 +153,12 @@ void ObjectHandler::useObject(int16 objId) {
_vm->_text->getNoun(obj->_nounIndex, 0));
// Check valid use of objects and override verb if necessary
- for (uses_t *use = _uses; use->_objId != _numObj; use++) {
+ for (Uses *use = _uses; use->_objId != _numObj; use++) {
if (inventObjId == use->_objId) {
// Look for secondary object, if found use matching verb
bool foundFl = false;
- for (target_t *target = use->_targets; target->_nounIndex != 0; target++)
+ for (Target *target = use->_targets; target->_nounIndex != 0; target++)
if (target->_nounIndex == obj->_nounIndex) {
foundFl = true;
sprintf(_vm->_line, "%s %s %s", _vm->_text->getVerb(target->_verbIndex, 0),
@@ -195,12 +195,12 @@ int16 ObjectHandler::findObject(uint16 x, uint16 y) {
int16 objIndex = -1; // Index of found object
uint16 y2Max = 0; // Greatest y2
- object_t *obj = _objects;
+ Object *obj = _objects;
// Check objects on screen
for (int i = 0; i < _numObj; i++, obj++) {
// Object must be in current screen and "useful"
if (obj->_screenIndex == *_vm->_screen_p && (obj->_genericCmd || obj->_objValue || obj->_cmdIndex)) {
- seq_t *curImage = obj->_currImagePtr;
+ Seq *curImage = obj->_currImagePtr;
// Object must have a visible image...
if (curImage != 0 && obj->_cycling != kCycleInvisible) {
// If cursor inside object
@@ -233,7 +233,7 @@ int16 ObjectHandler::findObject(uint16 x, uint16 y) {
* Issue "Look at <object>" command
* Note special case of swapped hero image
*/
-void ObjectHandler::lookObject(object_t *obj) {
+void ObjectHandler::lookObject(Object *obj) {
debugC(1, kDebugObject, "lookObject");
if (obj == _vm->_hero)
@@ -252,10 +252,10 @@ void ObjectHandler::freeObjects() {
if (_vm->_hero != 0 && _vm->_hero->_seqList[0]._seqPtr != 0) {
// Free all sequence lists and image data
for (int16 i = 0; i < _numObj; i++) {
- object_t *obj = &_objects[i];
+ Object *obj = &_objects[i];
for (int16 j = 0; j < obj->_seqNumb; j++) {
- seq_t *seq = obj->_seqList[j]._seqPtr;
- seq_t *next;
+ Seq *seq = obj->_seqList[j]._seqPtr;
+ Seq *next;
if (seq == 0) // Failure during database load
break;
if (seq->_imagePtr != 0) {
@@ -300,8 +300,8 @@ void ObjectHandler::freeObjects() {
int ObjectHandler::y2comp(const void *a, const void *b) {
debugC(6, kDebugObject, "y2comp");
- const object_t *p1 = &HugoEngine::get()._object->_objects[*(const byte *)a];
- const object_t *p2 = &HugoEngine::get()._object->_objects[*(const byte *)b];
+ const Object *p1 = &HugoEngine::get()._object->_objects[*(const byte *)a];
+ const Object *p2 = &HugoEngine::get()._object->_objects[*(const byte *)b];
if (p1 == p2)
// Why does qsort try the same indexes?
@@ -345,7 +345,7 @@ void ObjectHandler::showTakeables() {
debugC(1, kDebugObject, "showTakeables");
for (int j = 0; j < _numObj; j++) {
- object_t *obj = &_objects[j];
+ Object *obj = &_objects[j];
if ((obj->_cycling != kCycleInvisible) &&
(obj->_screenIndex == *_vm->_screen_p) &&
(((TAKE & obj->_genericCmd) == TAKE) || obj->_objValue)) {
@@ -357,10 +357,10 @@ void ObjectHandler::showTakeables() {
/**
* Find a clear space around supplied object that hero can walk to
*/
-bool ObjectHandler::findObjectSpace(object_t *obj, int16 *destx, int16 *desty) {
+bool ObjectHandler::findObjectSpace(Object *obj, int16 *destx, int16 *desty) {
debugC(1, kDebugObject, "findObjectSpace(obj, %d, %d)", *destx, *desty);
- seq_t *curImage = obj->_currImagePtr;
+ Seq *curImage = obj->_currImagePtr;
int16 y = obj->_y + curImage->_y2 - 1;
bool foundFl = true;
@@ -399,11 +399,11 @@ bool ObjectHandler::findObjectSpace(object_t *obj, int16 *destx, int16 *desty) {
return foundFl;
}
-void ObjectHandler::readUse(Common::ReadStream &in, uses_t &curUse) {
+void ObjectHandler::readUse(Common::ReadStream &in, Uses &curUse) {
curUse._objId = in.readSint16BE();
curUse._dataIndex = in.readUint16BE();
uint16 numSubElem = in.readUint16BE();
- curUse._targets = (target_t *)malloc(sizeof(target_t) * numSubElem);
+ curUse._targets = (Target *)malloc(sizeof(Target) * numSubElem);
for (int j = 0; j < numSubElem; j++) {
curUse._targets[j]._nounIndex = in.readUint16BE();
curUse._targets[j]._verbIndex = in.readUint16BE();
@@ -413,7 +413,7 @@ void ObjectHandler::readUse(Common::ReadStream &in, uses_t &curUse) {
* Load _uses from Hugo.dat
*/
void ObjectHandler::loadObjectUses(Common::ReadStream &in) {
- uses_t tmpUse;
+ Uses tmpUse;
tmpUse._targets = 0;
//Read _uses
@@ -421,7 +421,7 @@ void ObjectHandler::loadObjectUses(Common::ReadStream &in) {
uint16 numElem = in.readUint16BE();
if (varnt == _vm->_gameVariant) {
_usesSize = numElem;
- _uses = (uses_t *)malloc(sizeof(uses_t) * numElem);
+ _uses = (Uses *)malloc(sizeof(Uses) * numElem);
}
for (int i = 0; i < numElem; i++) {
@@ -436,7 +436,7 @@ void ObjectHandler::loadObjectUses(Common::ReadStream &in) {
}
}
-void ObjectHandler::readObject(Common::ReadStream &in, object_t &curObject) {
+void ObjectHandler::readObject(Common::ReadStream &in, Object &curObject) {
curObject._nounIndex = in.readUint16BE();
curObject._dataIndex = in.readUint16BE();
uint16 numSubElem = in.readUint16BE();
@@ -448,7 +448,7 @@ void ObjectHandler::readObject(Common::ReadStream &in, object_t &curObject) {
for (int j = 0; j < numSubElem; j++)
curObject._stateDataIndex[j] = in.readUint16BE();
- curObject._pathType = (path_t) in.readSint16BE();
+ curObject._pathType = (Path) in.readSint16BE();
curObject._vxPath = in.readSint16BE();
curObject._vyPath = in.readSint16BE();
curObject._actIndex = in.readUint16BE();
@@ -465,7 +465,7 @@ void ObjectHandler::readObject(Common::ReadStream &in, object_t &curObject) {
curObject._seqList[j]._seqPtr = 0;
}
- curObject._cycling = (cycle_t)in.readByte();
+ curObject._cycling = (Cycle)in.readByte();
curObject._cycleNumb = in.readByte();
curObject._frameInterval = in.readByte();
curObject._frameTimer = in.readByte();
@@ -497,7 +497,7 @@ void ObjectHandler::readObject(Common::ReadStream &in, object_t &curObject) {
*/
void ObjectHandler::loadObjectArr(Common::ReadStream &in) {
debugC(6, kDebugObject, "loadObject(&in)");
- object_t tmpObject;
+ Object tmpObject;
tmpObject._stateDataIndex = 0;
for (int varnt = 0; varnt < _vm->_numVariant; varnt++) {
@@ -505,7 +505,7 @@ void ObjectHandler::loadObjectArr(Common::ReadStream &in) {
if (varnt == _vm->_gameVariant) {
_objCount = numElem;
- _objects = (object_t *)malloc(sizeof(object_t) * numElem);
+ _objects = (Object *)malloc(sizeof(Object) * numElem);
}
for (int i = 0; i < numElem; i++) {
@@ -559,7 +559,7 @@ void ObjectHandler::restoreAllSeq() {
*/
void ObjectHandler::saveObjects(Common::WriteStream *out) {
for (int i = 0; i < _numObj; i++) {
- // Save where curr_seq_p is pointing to
+ // Save where curr_seqPtr is pointing to
saveSeq(&_objects[i]);
out->writeByte(_objects[i]._pathType);
@@ -594,10 +594,10 @@ void ObjectHandler::saveObjects(Common::WriteStream *out) {
*/
void ObjectHandler::restoreObjects(Common::SeekableReadStream *in) {
for (int i = 0; i < _numObj; i++) {
- _objects[i]._pathType = (path_t) in->readByte();
+ _objects[i]._pathType = (Path) in->readByte();
_objects[i]._vxPath = in->readSint16BE();
_objects[i]._vyPath = in->readSint16BE();
- _objects[i]._cycling = (cycle_t) in->readByte();
+ _objects[i]._cycling = (Cycle) in->readByte();
_objects[i]._cycleNumb = in->readByte();
_objects[i]._frameTimer = in->readByte();
_objects[i]._screenIndex = in->readByte();
@@ -782,7 +782,7 @@ void ObjectHandler::clearScreenBoundary(const int x1, const int x2, const int y)
/**
* An object has collided with a boundary. See if any actions are required
*/
-void ObjectHandler::boundaryCollision(object_t *obj) {
+void ObjectHandler::boundaryCollision(Object *obj) {
debugC(1, kDebugEngine, "boundaryCollision");
if (obj == _vm->_hero) {
diff --git a/engines/hugo/object.h b/engines/hugo/object.h
index 8f8043dbbc..fd0d731a98 100644
--- a/engines/hugo/object.h
+++ b/engines/hugo/object.h
@@ -34,15 +34,15 @@
namespace Hugo {
-struct target_t { // Secondary target for action
+struct Target { // Secondary target for action
uint16 _nounIndex; // Secondary object
uint16 _verbIndex; // Action on secondary object
};
-struct uses_t { // Define uses of certain objects
+struct Uses { // Define uses of certain objects
int16 _objId; // Primary object
uint16 _dataIndex; // String if no secondary object matches
- target_t *_targets; // List of secondary targets
+ Target *_targets; // List of secondary targets
};
class ObjectHandler {
@@ -50,12 +50,12 @@ public:
ObjectHandler(HugoEngine *vm);
virtual ~ObjectHandler();
- overlay_t _objBound;
- overlay_t _boundary; // Boundary overlay file
- overlay_t _overlay; // First overlay file
- overlay_t _ovlBase; // First overlay base file
+ Overlay _objBound;
+ Overlay _boundary; // Boundary overlay file
+ Overlay _overlay; // First overlay file
+ Overlay _ovlBase; // First overlay base file
- object_t *_objects;
+ Object *_objects;
uint16 _numObj;
byte getBoundaryOverlay(uint16 index) const;
@@ -65,7 +65,7 @@ public:
int deltaX(const int x1, const int x2, const int vx, int y) const;
int deltaY(const int x1, const int x2, const int vy, const int y) const;
- void boundaryCollision(object_t *obj);
+ void boundaryCollision(Object *obj);
void clearBoundary(const int x1, const int x2, const int y);
void clearScreenBoundary(const int x1, const int x2, const int y);
void storeBoundary(const int x1, const int x2, const int y);
@@ -76,7 +76,7 @@ public:
virtual void swapImages(int objIndex1, int objIndex2) = 0;
bool isCarrying(uint16 wordIndex);
- bool findObjectSpace(object_t *obj, int16 *destx, int16 *desty);
+ bool findObjectSpace(Object *obj, int16 *destx, int16 *desty);
int calcMaxScore();
int16 findObject(uint16 x, uint16 y);
@@ -84,14 +84,14 @@ public:
void loadObjectArr(Common::ReadStream &in);
void loadObjectUses(Common::ReadStream &in);
void loadNumObj(Common::ReadStream &in);
- void lookObject(object_t *obj);
+ void lookObject(Object *obj);
void readObjectImages();
- void readObject(Common::ReadStream &in, object_t &curObject);
- void readUse(Common::ReadStream &in, uses_t &curUse);
+ void readObject(Common::ReadStream &in, Object &curObject);
+ void readUse(Common::ReadStream &in, Uses &curUse);
void restoreAllSeq();
void restoreObjects(Common::SeekableReadStream *in);
void saveObjects(Common::WriteStream *out);
- void saveSeq(object_t *obj);
+ void saveSeq(Object *obj);
void setCarriedScreen(int screenNum);
void showTakeables();
void useObject(int16 objId);
@@ -101,7 +101,7 @@ public:
bool isCarried(int objIndex) const;
void setCarry(int objIndex, bool val);
void setVelocity(int objIndex, int8 vx, int8 vy);
- void setPath(int objIndex, path_t pathType, int16 vxPath, int16 vyPath);
+ void setPath(int objIndex, Path pathType, int16 vxPath, int16 vyPath);
protected:
HugoEngine *_vm;
@@ -110,11 +110,11 @@ protected:
static const int kEdge2 = kEdge * 2; // Push object further back on edge collision
static const int kMaxObjNumb = 128; // Used in Update_images()
- uint16 _objCount;
- uses_t *_uses;
- uint16 _usesSize;
+ uint16 _objCount;
+ Uses *_uses;
+ uint16 _usesSize;
- void restoreSeq(object_t *obj);
+ void restoreSeq(Object *obj);
inline bool checkBoundary(int16 x, int16 y);
template<typename T>
diff --git a/engines/hugo/object_v1d.cpp b/engines/hugo/object_v1d.cpp
index 7b8f90e189..e5fedb3b2a 100644
--- a/engines/hugo/object_v1d.cpp
+++ b/engines/hugo/object_v1d.cpp
@@ -59,21 +59,21 @@ void ObjectHandler_v1d::updateImages() {
debugC(5, kDebugObject, "updateImages");
// Initialize the index array to visible objects in current screen
- int num_objs = 0;
+ int objNumb = 0;
byte objindex[kMaxObjNumb]; // Array of indeces to objects
for (int i = 0; i < _numObj; i++) {
- object_t *obj = &_objects[i];
+ Object *obj = &_objects[i];
if ((obj->_screenIndex == *_vm->_screen_p) && (obj->_cycling >= kCycleAlmostInvisible))
- objindex[num_objs++] = i;
+ objindex[objNumb++] = i;
}
// Sort the objects into increasing y+y2 (painter's algorithm)
- qsort(objindex, num_objs, sizeof(objindex[0]), y2comp);
+ qsort(objindex, objNumb, sizeof(objindex[0]), y2comp);
// Add each visible object to display list
- for (int i = 0; i < num_objs; i++) {
- object_t *obj = &_objects[objindex[i]];
+ for (int i = 0; i < objNumb; i++) {
+ Object *obj = &_objects[objindex[i]];
// Count down inter-frame timer
if (obj->_frameTimer)
obj->_frameTimer--;
@@ -90,7 +90,7 @@ void ObjectHandler_v1d::updateImages() {
_vm->_screen->displayFrame(obj->_x, obj->_y, obj->_currImagePtr->_nextSeqPtr, false);
break;
case kCycleBackward: {
- seq_t *seqPtr = obj->_currImagePtr;
+ Seq *seqPtr = obj->_currImagePtr;
if (!obj->_frameTimer) { // Show next frame
while (seqPtr->_nextSeqPtr != obj->_currImagePtr)
seqPtr = seqPtr->_nextSeqPtr;
@@ -107,8 +107,8 @@ void ObjectHandler_v1d::updateImages() {
_vm->_scheduler->waitForRefresh();
// Cycle any animating objects
- for (int i = 0; i < num_objs; i++) {
- object_t *obj = &_objects[objindex[i]];
+ for (int i = 0; i < objNumb; i++) {
+ Object *obj = &_objects[objindex[i]];
if (obj->_cycling != kCycleInvisible) {
// Only if it's visible
if (obj->_cycling == kCycleAlmostInvisible)
@@ -140,7 +140,7 @@ void ObjectHandler_v1d::updateImages() {
case kCycleBackward: {
if (!obj->_frameTimer) {
// Time to step to prev frame
- seq_t *seqPtr = obj->_currImagePtr;
+ Seq *seqPtr = obj->_currImagePtr;
while (obj->_currImagePtr->_nextSeqPtr != seqPtr)
obj->_currImagePtr = obj->_currImagePtr->_nextSeqPtr;
// Find out if this is first frame of sequence
@@ -183,8 +183,8 @@ void ObjectHandler_v1d::moveObjects() {
// and store all (visible) object baselines into the boundary file.
// Don't store foreground or background objects
for (int i = 0; i < _numObj; i++) {
- object_t *obj = &_objects[i]; // Get pointer to object
- seq_t *currImage = obj->_currImagePtr; // Get ptr to current image
+ Object *obj = &_objects[i]; // Get pointer to object
+ Seq *currImage = obj->_currImagePtr; // Get ptr to current image
if (obj->_screenIndex == *_vm->_screen_p) {
switch (obj->_pathType) {
case kPathChase: {
@@ -271,13 +271,13 @@ void ObjectHandler_v1d::moveObjects() {
// Move objects, allowing for boundaries
for (int i = 0; i < _numObj; i++) {
- object_t *obj = &_objects[i]; // Get pointer to object
+ Object *obj = &_objects[i]; // Get pointer to object
if ((obj->_screenIndex == *_vm->_screen_p) && (obj->_vx || obj->_vy)) {
// Only process if it's moving
// Do object movement. Delta_x,y return allowed movement in x,y
// to move as close to a boundary as possible without crossing it.
- seq_t *currImage = obj->_currImagePtr; // Get ptr to current image
+ Seq *currImage = obj->_currImagePtr; // Get ptr to current image
// object coordinates
int x1 = obj->_x + currImage->_x1; // Left edge of object
int x2 = obj->_x + currImage->_x2; // Right edge
@@ -325,15 +325,15 @@ void ObjectHandler_v1d::moveObjects() {
// Clear all object baselines from the boundary file.
for (int i = 0; i < _numObj; i++) {
- object_t *obj = &_objects[i]; // Get pointer to object
- seq_t *currImage = obj->_currImagePtr; // Get ptr to current image
+ Object *obj = &_objects[i]; // Get pointer to object
+ Seq *currImage = obj->_currImagePtr; // Get ptr to current image
if ((obj->_screenIndex == *_vm->_screen_p) && (obj->_cycling > kCycleAlmostInvisible) && (obj->_priority == kPriorityFloating))
clearBoundary(obj->_oldx + currImage->_x1, obj->_oldx + currImage->_x2, obj->_oldy + currImage->_y2);
}
// If maze mode is enabled, do special maze processing
if (_vm->_maze._enabledFl) {
- seq_t *currImage = _vm->_hero->_currImagePtr;// Get ptr to current image
+ Seq *currImage = _vm->_hero->_currImagePtr;// Get ptr to current image
// hero coordinates
int x1 = _vm->_hero->_x + currImage->_x1; // Left edge of object
int x2 = _vm->_hero->_x + currImage->_x2; // Right edge
@@ -352,8 +352,8 @@ void ObjectHandler_v1d::moveObjects() {
void ObjectHandler_v1d::swapImages(int objIndex1, int objIndex2) {
debugC(1, kDebugObject, "swapImages(%d, %d)", objIndex1, objIndex2);
- seqList_t tmpSeqList[kMaxSeqNumb];
- int seqListSize = sizeof(seqList_t) * kMaxSeqNumb;
+ SeqList tmpSeqList[kMaxSeqNumb];
+ int seqListSize = sizeof(SeqList) * kMaxSeqNumb;
memmove(tmpSeqList, _objects[objIndex1]._seqList, seqListSize);
memmove(_objects[objIndex1]._seqList, _objects[objIndex2]._seqList, seqListSize);
@@ -365,8 +365,8 @@ void ObjectHandler_v1d::swapImages(int objIndex1, int objIndex2) {
void ObjectHandler_v1d::homeIn(int objIndex1, const int objIndex2, const int8 objDx, const int8 objDy) {
// object obj1 will home in on object obj2
- object_t *obj1 = &_objects[objIndex1];
- object_t *obj2 = &_objects[objIndex2];
+ Object *obj1 = &_objects[objIndex1];
+ Object *obj2 = &_objects[objIndex2];
obj1->_pathType = kPathAuto;
int dx = obj1->_x + obj1->_currImagePtr->_x1 - obj2->_x - obj2->_currImagePtr->_x1;
int dy = obj1->_y + obj1->_currImagePtr->_y1 - obj2->_y - obj2->_currImagePtr->_y1;
diff --git a/engines/hugo/object_v1w.cpp b/engines/hugo/object_v1w.cpp
index dd3de5fe40..e1e8496d9d 100644
--- a/engines/hugo/object_v1w.cpp
+++ b/engines/hugo/object_v1w.cpp
@@ -59,21 +59,21 @@ void ObjectHandler_v1w::updateImages() {
debugC(5, kDebugObject, "updateImages");
// Initialize the index array to visible objects in current screen
- int num_objs = 0;
+ int objNumb = 0;
byte objindex[kMaxObjNumb]; // Array of indeces to objects
for (int i = 0; i < _numObj; i++) {
- object_t *obj = &_objects[i];
+ Object *obj = &_objects[i];
if ((obj->_screenIndex == *_vm->_screen_p) && (obj->_cycling >= kCycleAlmostInvisible))
- objindex[num_objs++] = i;
+ objindex[objNumb++] = i;
}
// Sort the objects into increasing y+y2 (painter's algorithm)
- qsort(objindex, num_objs, sizeof(objindex[0]), y2comp);
+ qsort(objindex, objNumb, sizeof(objindex[0]), y2comp);
// Add each visible object to display list
- for (int i = 0; i < num_objs; i++) {
- object_t *obj = &_objects[objindex[i]];
+ for (int i = 0; i < objNumb; i++) {
+ Object *obj = &_objects[objindex[i]];
// Count down inter-frame timer
if (obj->_frameTimer)
obj->_frameTimer--;
@@ -90,7 +90,7 @@ void ObjectHandler_v1w::updateImages() {
_vm->_screen->displayFrame(obj->_x, obj->_y, obj->_currImagePtr->_nextSeqPtr, obj->_priority == kPriorityOverOverlay);
break;
case kCycleBackward: {
- seq_t *seqPtr = obj->_currImagePtr;
+ Seq *seqPtr = obj->_currImagePtr;
if (!obj->_frameTimer) { // Show next frame
while (seqPtr->_nextSeqPtr != obj->_currImagePtr)
seqPtr = seqPtr->_nextSeqPtr;
@@ -105,8 +105,8 @@ void ObjectHandler_v1w::updateImages() {
}
// Cycle any animating objects
- for (int i = 0; i < num_objs; i++) {
- object_t *obj = &_objects[objindex[i]];
+ for (int i = 0; i < objNumb; i++) {
+ Object *obj = &_objects[objindex[i]];
if (obj->_cycling != kCycleInvisible) {
// Only if it's visible
if (obj->_cycling == kCycleAlmostInvisible)
@@ -138,7 +138,7 @@ void ObjectHandler_v1w::updateImages() {
case kCycleBackward: {
if (!obj->_frameTimer) {
// Time to step to prev frame
- seq_t *seqPtr = obj->_currImagePtr;
+ Seq *seqPtr = obj->_currImagePtr;
while (obj->_currImagePtr->_nextSeqPtr != seqPtr)
obj->_currImagePtr = obj->_currImagePtr->_nextSeqPtr;
// Find out if this is first frame of sequence
@@ -180,8 +180,8 @@ void ObjectHandler_v1w::moveObjects() {
// and store all (visible) object baselines into the boundary file.
// Don't store foreground or background objects
for (int i = 0; i < _numObj; i++) {
- object_t *obj = &_objects[i]; // Get pointer to object
- seq_t *currImage = obj->_currImagePtr; // Get ptr to current image
+ Object *obj = &_objects[i]; // Get pointer to object
+ Seq *currImage = obj->_currImagePtr; // Get ptr to current image
if (obj->_screenIndex == *_vm->_screen_p) {
switch (obj->_pathType) {
case kPathChase:
@@ -281,13 +281,13 @@ void ObjectHandler_v1w::moveObjects() {
// Move objects, allowing for boundaries
for (int i = 0; i < _numObj; i++) {
- object_t *obj = &_objects[i]; // Get pointer to object
+ Object *obj = &_objects[i]; // Get pointer to object
if ((obj->_screenIndex == *_vm->_screen_p) && (obj->_vx || obj->_vy)) {
// Only process if it's moving
// Do object movement. Delta_x,y return allowed movement in x,y
// to move as close to a boundary as possible without crossing it.
- seq_t *currImage = obj->_currImagePtr; // Get ptr to current image
+ Seq *currImage = obj->_currImagePtr; // Get ptr to current image
// object coordinates
int x1 = obj->_x + currImage->_x1; // Left edge of object
int x2 = obj->_x + currImage->_x2; // Right edge
@@ -335,15 +335,15 @@ void ObjectHandler_v1w::moveObjects() {
// Clear all object baselines from the boundary file.
for (int i = 0; i < _numObj; i++) {
- object_t *obj = &_objects[i]; // Get pointer to object
- seq_t *currImage = obj->_currImagePtr; // Get ptr to current image
+ Object *obj = &_objects[i]; // Get pointer to object
+ Seq *currImage = obj->_currImagePtr; // Get ptr to current image
if ((obj->_screenIndex == *_vm->_screen_p) && (obj->_cycling > kCycleAlmostInvisible) && (obj->_priority == kPriorityFloating))
clearBoundary(obj->_oldx + currImage->_x1, obj->_oldx + currImage->_x2, obj->_oldy + currImage->_y2);
}
// If maze mode is enabled, do special maze processing
if (_vm->_maze._enabledFl) {
- seq_t *currImage = _vm->_hero->_currImagePtr; // Get ptr to current image
+ Seq *currImage = _vm->_hero->_currImagePtr; // Get ptr to current image
// hero coordinates
int x1 = _vm->_hero->_x + currImage->_x1; // Left edge of object
int x2 = _vm->_hero->_x + currImage->_x2; // Right edge
@@ -364,8 +364,8 @@ void ObjectHandler_v1w::swapImages(int objIndex1, int objIndex2) {
saveSeq(&_objects[objIndex1]);
- seqList_t tmpSeqList[kMaxSeqNumb];
- int seqListSize = sizeof(seqList_t) * kMaxSeqNumb;
+ SeqList tmpSeqList[kMaxSeqNumb];
+ int seqListSize = sizeof(SeqList) * kMaxSeqNumb;
memmove(tmpSeqList, _objects[objIndex1]._seqList, seqListSize);
memmove(_objects[objIndex1]._seqList, _objects[objIndex2]._seqList, seqListSize);
diff --git a/engines/hugo/object_v2d.cpp b/engines/hugo/object_v2d.cpp
index 025374521c..f0d83269d5 100644
--- a/engines/hugo/object_v2d.cpp
+++ b/engines/hugo/object_v2d.cpp
@@ -59,21 +59,21 @@ void ObjectHandler_v2d::updateImages() {
debugC(5, kDebugObject, "updateImages");
// Initialize the index array to visible objects in current screen
- int num_objs = 0;
+ int objNumb = 0;
byte objindex[kMaxObjNumb]; // Array of indeces to objects
for (int i = 0; i < _numObj; i++) {
- object_t *obj = &_objects[i];
+ Object *obj = &_objects[i];
if ((obj->_screenIndex == *_vm->_screen_p) && (obj->_cycling >= kCycleAlmostInvisible))
- objindex[num_objs++] = i;
+ objindex[objNumb++] = i;
}
// Sort the objects into increasing y+y2 (painter's algorithm)
- qsort(objindex, num_objs, sizeof(objindex[0]), y2comp);
+ qsort(objindex, objNumb, sizeof(objindex[0]), y2comp);
// Add each visible object to display list
- for (int i = 0; i < num_objs; i++) {
- object_t *obj = &_objects[objindex[i]];
+ for (int i = 0; i < objNumb; i++) {
+ Object *obj = &_objects[objindex[i]];
// Count down inter-frame timer
if (obj->_frameTimer)
obj->_frameTimer--;
@@ -90,7 +90,7 @@ void ObjectHandler_v2d::updateImages() {
_vm->_screen->displayFrame(obj->_x, obj->_y, obj->_currImagePtr->_nextSeqPtr, obj->_priority == kPriorityOverOverlay);
break;
case kCycleBackward: {
- seq_t *seqPtr = obj->_currImagePtr;
+ Seq *seqPtr = obj->_currImagePtr;
if (!obj->_frameTimer) { // Show next frame
while (seqPtr->_nextSeqPtr != obj->_currImagePtr)
seqPtr = seqPtr->_nextSeqPtr;
@@ -107,8 +107,8 @@ void ObjectHandler_v2d::updateImages() {
_vm->_scheduler->waitForRefresh();
// Cycle any animating objects
- for (int i = 0; i < num_objs; i++) {
- object_t *obj = &_objects[objindex[i]];
+ for (int i = 0; i < objNumb; i++) {
+ Object *obj = &_objects[objindex[i]];
if (obj->_cycling != kCycleInvisible) {
// Only if it's visible
if (obj->_cycling == kCycleAlmostInvisible)
@@ -140,7 +140,7 @@ void ObjectHandler_v2d::updateImages() {
case kCycleBackward: {
if (!obj->_frameTimer) {
// Time to step to prev frame
- seq_t *seqPtr = obj->_currImagePtr;
+ Seq *seqPtr = obj->_currImagePtr;
while (obj->_currImagePtr->_nextSeqPtr != seqPtr)
obj->_currImagePtr = obj->_currImagePtr->_nextSeqPtr;
// Find out if this is first frame of sequence
@@ -183,8 +183,8 @@ void ObjectHandler_v2d::moveObjects() {
// and store all (visible) object baselines into the boundary file.
// Don't store foreground or background objects
for (int i = 0; i < _numObj; i++) {
- object_t *obj = &_objects[i]; // Get pointer to object
- seq_t *currImage = obj->_currImagePtr; // Get ptr to current image
+ Object *obj = &_objects[i]; // Get pointer to object
+ Seq *currImage = obj->_currImagePtr; // Get ptr to current image
if (obj->_screenIndex == *_vm->_screen_p) {
switch (obj->_pathType) {
case kPathChase:
@@ -284,13 +284,13 @@ void ObjectHandler_v2d::moveObjects() {
// Move objects, allowing for boundaries
for (int i = 0; i < _numObj; i++) {
- object_t *obj = &_objects[i]; // Get pointer to object
+ Object *obj = &_objects[i]; // Get pointer to object
if ((obj->_screenIndex == *_vm->_screen_p) && (obj->_vx || obj->_vy)) {
// Only process if it's moving
// Do object movement. Delta_x,y return allowed movement in x,y
// to move as close to a boundary as possible without crossing it.
- seq_t *currImage = obj->_currImagePtr; // Get ptr to current image
+ Seq *currImage = obj->_currImagePtr; // Get ptr to current image
// object coordinates
int x1 = obj->_x + currImage->_x1; // Left edge of object
int x2 = obj->_x + currImage->_x2; // Right edge
@@ -338,15 +338,15 @@ void ObjectHandler_v2d::moveObjects() {
// Clear all object baselines from the boundary file.
for (int i = 0; i < _numObj; i++) {
- object_t *obj = &_objects[i]; // Get pointer to object
- seq_t *currImage = obj->_currImagePtr; // Get ptr to current image
+ Object *obj = &_objects[i]; // Get pointer to object
+ Seq *currImage = obj->_currImagePtr; // Get ptr to current image
if ((obj->_screenIndex == *_vm->_screen_p) && (obj->_cycling > kCycleAlmostInvisible) && (obj->_priority == kPriorityFloating))
clearBoundary(obj->_oldx + currImage->_x1, obj->_oldx + currImage->_x2, obj->_oldy + currImage->_y2);
}
// If maze mode is enabled, do special maze processing
if (_vm->_maze._enabledFl) {
- seq_t *currImage = _vm->_hero->_currImagePtr; // Get ptr to current image
+ Seq *currImage = _vm->_hero->_currImagePtr; // Get ptr to current image
// hero coordinates
int x1 = _vm->_hero->_x + currImage->_x1; // Left edge of object
int x2 = _vm->_hero->_x + currImage->_x2; // Right edge
@@ -359,8 +359,8 @@ void ObjectHandler_v2d::moveObjects() {
void ObjectHandler_v2d::homeIn(const int objIndex1, const int objIndex2, const int8 objDx, const int8 objDy) {
// object obj1 will home in on object obj2
- object_t *obj1 = &_objects[objIndex1];
- object_t *obj2 = &_objects[objIndex2];
+ Object *obj1 = &_objects[objIndex1];
+ Object *obj2 = &_objects[objIndex2];
obj1->_pathType = kPathAuto;
int dx = obj1->_x + obj1->_currImagePtr->_x1 - obj2->_x - obj2->_currImagePtr->_x1;
int dy = obj1->_y + obj1->_currImagePtr->_y1 - obj2->_y - obj2->_currImagePtr->_y1;
diff --git a/engines/hugo/object_v3d.cpp b/engines/hugo/object_v3d.cpp
index 15d5fcd936..13c9c8c93d 100644
--- a/engines/hugo/object_v3d.cpp
+++ b/engines/hugo/object_v3d.cpp
@@ -64,8 +64,8 @@ void ObjectHandler_v3d::moveObjects() {
// and store all (visible) object baselines into the boundary file.
// Don't store foreground or background objects
for (int i = 0; i < _numObj; i++) {
- object_t *obj = &_objects[i]; // Get pointer to object
- seq_t *currImage = obj->_currImagePtr; // Get ptr to current image
+ Object *obj = &_objects[i]; // Get pointer to object
+ Seq *currImage = obj->_currImagePtr; // Get ptr to current image
if (obj->_screenIndex == *_vm->_screen_p) {
switch (obj->_pathType) {
case kPathChase:
@@ -166,13 +166,13 @@ void ObjectHandler_v3d::moveObjects() {
// Move objects, allowing for boundaries
for (int i = 0; i < _numObj; i++) {
- object_t *obj = &_objects[i]; // Get pointer to object
+ Object *obj = &_objects[i]; // Get pointer to object
if ((obj->_screenIndex == *_vm->_screen_p) && (obj->_vx || obj->_vy)) {
// Only process if it's moving
// Do object movement. Delta_x,y return allowed movement in x,y
// to move as close to a boundary as possible without crossing it.
- seq_t *currImage = obj->_currImagePtr; // Get ptr to current image
+ Seq *currImage = obj->_currImagePtr; // Get ptr to current image
// object coordinates
int x1 = obj->_x + currImage->_x1; // Left edge of object
int x2 = obj->_x + currImage->_x2; // Right edge
@@ -220,15 +220,15 @@ void ObjectHandler_v3d::moveObjects() {
// Clear all object baselines from the boundary file.
for (int i = 0; i < _numObj; i++) {
- object_t *obj = &_objects[i]; // Get pointer to object
- seq_t *currImage = obj->_currImagePtr; // Get ptr to current image
+ Object *obj = &_objects[i]; // Get pointer to object
+ Seq *currImage = obj->_currImagePtr; // Get ptr to current image
if ((obj->_screenIndex == *_vm->_screen_p) && (obj->_cycling > kCycleAlmostInvisible) && (obj->_priority == kPriorityFloating))
clearBoundary(obj->_oldx + currImage->_x1, obj->_oldx + currImage->_x2, obj->_oldy + currImage->_y2);
}
// If maze mode is enabled, do special maze processing
if (_vm->_maze._enabledFl) {
- seq_t *currImage = _vm->_hero->_currImagePtr;// Get ptr to current image
+ Seq *currImage = _vm->_hero->_currImagePtr;// Get ptr to current image
// hero coordinates
int x1 = _vm->_hero->_x + currImage->_x1; // Left edge of object
int x2 = _vm->_hero->_x + currImage->_x2; // Right edge
@@ -249,8 +249,8 @@ void ObjectHandler_v3d::swapImages(int objIndex1, int objIndex2) {
saveSeq(&_objects[objIndex1]);
- seqList_t tmpSeqList[kMaxSeqNumb];
- int seqListSize = sizeof(seqList_t) * kMaxSeqNumb;
+ SeqList tmpSeqList[kMaxSeqNumb];
+ int seqListSize = sizeof(SeqList) * kMaxSeqNumb;
memmove(tmpSeqList, _objects[objIndex1]._seqList, seqListSize);
memmove(_objects[objIndex1]._seqList, _objects[objIndex2]._seqList, seqListSize);
diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp
index 3b0eb1d979..68343a0374 100644
--- a/engines/hugo/parser.cpp
+++ b/engines/hugo/parser.cpp
@@ -99,7 +99,7 @@ void Parser::loadCmdList(Common::ReadStream &in) {
}
-void Parser::readBG(Common::ReadStream &in, background_t &curBG) {
+void Parser::readBG(Common::ReadStream &in, Background &curBG) {
curBG._verbIndex = in.readUint16BE();
curBG._nounIndex = in.readUint16BE();
curBG._commentIndex = in.readSint16BE();
@@ -112,7 +112,7 @@ void Parser::readBG(Common::ReadStream &in, background_t &curBG) {
* Read _backgrounObjects from Hugo.dat
*/
void Parser::loadBackgroundObjects(Common::ReadStream &in) {
- background_t tmpBG;
+ Background tmpBG;
memset(&tmpBG, 0, sizeof(tmpBG));
for (int varnt = 0; varnt < _vm->_numVariant; varnt++) {
@@ -120,13 +120,13 @@ void Parser::loadBackgroundObjects(Common::ReadStream &in) {
if (varnt == _vm->_gameVariant) {
_backgroundObjectsSize = numElem;
- _backgroundObjects = (background_t **)malloc(sizeof(background_t *) * numElem);
+ _backgroundObjects = (Background **)malloc(sizeof(Background *) * numElem);
}
for (int i = 0; i < numElem; i++) {
uint16 numSubElem = in.readUint16BE();
if (varnt == _vm->_gameVariant)
- _backgroundObjects[i] = (background_t *)malloc(sizeof(background_t) * numSubElem);
+ _backgroundObjects[i] = (Background *)malloc(sizeof(Background) * numSubElem);
for (int j = 0; j < numSubElem; j++)
readBG(in, (varnt == _vm->_gameVariant) ? _backgroundObjects[i][j] : tmpBG);
@@ -138,15 +138,15 @@ void Parser::loadBackgroundObjects(Common::ReadStream &in) {
* Read _catchallList from Hugo.dat
*/
void Parser::loadCatchallList(Common::ReadStream &in) {
- background_t *wrkCatchallList = 0;
- background_t tmpBG;
+ Background *wrkCatchallList = 0;
+ Background tmpBG;
memset(&tmpBG, 0, sizeof(tmpBG));
for (int varnt = 0; varnt < _vm->_numVariant; varnt++) {
uint16 numElem = in.readUint16BE();
if (varnt == _vm->_gameVariant)
- _catchallList = wrkCatchallList = (background_t *)malloc(sizeof(background_t) * numElem);
+ _catchallList = wrkCatchallList = (Background *)malloc(sizeof(Background) * numElem);
for (int i = 0; i < numElem; i++)
readBG(in, (varnt == _vm->_gameVariant) ? wrkCatchallList[i] : tmpBG);
@@ -164,7 +164,7 @@ void Parser::loadArrayReqs(Common::SeekableReadStream &in) {
const char *Parser::useBG(const char *name) {
debugC(1, kDebugEngine, "useBG(%s)", name);
- objectList_t p = _backgroundObjects[*_vm->_screen_p];
+ ObjectList p = _backgroundObjects[*_vm->_screen_p];
for (int i = 0; p[i]._verbIndex != 0; i++) {
if ((name == _vm->_text->getNoun(p[i]._nounIndex, 0) &&
p[i]._verbIndex != _vm->_look) &&
@@ -208,7 +208,7 @@ void Parser::switchTurbo() {
void Parser::charHandler() {
debugC(4, kDebugParser, "charHandler");
- status_t &gameStatus = _vm->getGameStatus();
+ Status &gameStatus = _vm->getGameStatus();
// Check for one or more characters in ring buffer
while (_getIndex != _putIndex) {
@@ -268,7 +268,7 @@ void Parser::charHandler() {
void Parser::keyHandler(Common::Event event) {
debugC(1, kDebugParser, "keyHandler(%d)", event.kbd.keycode);
- status_t &gameStatus = _vm->getGameStatus();
+ Status &gameStatus = _vm->getGameStatus();
uint16 nChar = event.kbd.keycode;
if (event.kbd.flags & (Common::KBD_ALT | Common::KBD_SCRL))
diff --git a/engines/hugo/parser.h b/engines/hugo/parser.h
index 18f4916b1e..e72c46f591 100644
--- a/engines/hugo/parser.h
+++ b/engines/hugo/parser.h
@@ -64,7 +64,7 @@ struct cmd {
* 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 {
+struct Background {
uint16 _verbIndex;
uint16 _nounIndex;
int _commentIndex; // Index of comment produced on match
@@ -73,7 +73,7 @@ struct background_t {
byte _bonusIndex; // Index of bonus score (0 = no bonus)
};
-typedef background_t *objectList_t;
+typedef Background *ObjectList;
class Parser {
public:
@@ -97,7 +97,7 @@ public:
virtual void lineHandler() = 0;
virtual void showInventory() const = 0;
- virtual void takeObject(object_t *obj) = 0;
+ virtual void takeObject(Object *obj) = 0;
protected:
HugoEngine *_vm;
@@ -105,18 +105,18 @@ protected:
int16 _cmdLineIndex; // Index into line
uint32 _cmdLineTick; // For flashing cursor
char _cmdLineCursor;
- command_t _cmdLine; // Build command line
+ Command _cmdLine; // Build command line
uint16 _backgroundObjectsSize;
uint16 _cmdListSize;
uint16 **_arrayReqs;
- background_t **_backgroundObjects;
- background_t *_catchallList;
+ Background **_backgroundObjects;
+ Background *_catchallList;
cmd **_cmdList;
const char *findNoun() const;
const char *findVerb() const;
- void readBG(Common::ReadStream &in, background_t &curBG);
+ void readBG(Common::ReadStream &in, Background &curBG);
void readCmd(Common::ReadStream &in, cmd &curCmd);
void showDosInventory() const;
@@ -136,17 +136,17 @@ public:
virtual void lineHandler();
virtual void showInventory() const;
- virtual void takeObject(object_t *obj);
+ virtual void takeObject(Object *obj);
protected:
- virtual void dropObject(object_t *obj);
+ virtual void dropObject(Object *obj);
const char *findNextNoun(const char *noun) const;
- bool isBackgroundWord_v1(const char *noun, const char *verb, objectList_t obj) const;
- bool isCatchallVerb_v1(bool testNounFl, const char *noun, const char *verb, objectList_t obj) const;
- bool isGenericVerb_v1(const char *word, object_t *obj);
- bool isNear_v1(const char *verb, const char *noun, object_t *obj, char *comment) const;
- bool isObjectVerb_v1(const char *word, object_t *obj);
+ bool isBackgroundWord_v1(const char *noun, const char *verb, ObjectList obj) const;
+ bool isCatchallVerb_v1(bool testNounFl, const char *noun, const char *verb, ObjectList obj) const;
+ bool isGenericVerb_v1(const char *word, Object *obj);
+ bool isNear_v1(const char *verb, const char *noun, Object *obj, char *comment) const;
+ bool isObjectVerb_v1(const char *word, Object *obj);
};
class Parser_v2d : public Parser_v1d {
@@ -164,13 +164,13 @@ public:
virtual void lineHandler();
protected:
- void dropObject(object_t *obj);
- bool isBackgroundWord_v3(objectList_t obj) const;
- bool isCatchallVerb_v3(objectList_t obj) const;
- bool isGenericVerb_v3(object_t *obj, char *comment);
- bool isNear_v3(object_t *obj, const char *verb, char *comment) const;
- bool isObjectVerb_v3(object_t *obj, char *comment);
- void takeObject(object_t *obj);
+ void dropObject(Object *obj);
+ bool isBackgroundWord_v3(ObjectList obj) const;
+ bool isCatchallVerb_v3(ObjectList obj) const;
+ bool isGenericVerb_v3(Object *obj, char *comment);
+ bool isNear_v3(Object *obj, const char *verb, char *comment) const;
+ bool isObjectVerb_v3(Object *obj, char *comment);
+ void takeObject(Object *obj);
};
class Parser_v1w : public Parser_v3d {
diff --git a/engines/hugo/parser_v1d.cpp b/engines/hugo/parser_v1d.cpp
index aa43cce536..f29a03f796 100644
--- a/engines/hugo/parser_v1d.cpp
+++ b/engines/hugo/parser_v1d.cpp
@@ -78,7 +78,7 @@ const char *Parser_v1d::findNextNoun(const char *noun) const {
* If object not near, return suitable string; may be similar object closer
* If radius is -1, treat radius as infinity
*/
-bool Parser_v1d::isNear_v1(const char *verb, const char *noun, object_t *obj, char *comment) const {
+bool Parser_v1d::isNear_v1(const char *verb, const char *noun, Object *obj, char *comment) const {
debugC(1, kDebugParser, "isNear(%s, %s, obj, %s)", verb, noun, comment);
if (!noun && !obj->_verbOnlyFl) { // No noun specified & object not context senesitive
@@ -140,8 +140,8 @@ bool Parser_v1d::isNear_v1(const char *verb, const char *noun, object_t *obj, ch
* 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_v1(const char *word, object_t *obj) {
- debugC(1, kDebugParser, "isGenericVerb(%s, object_t *obj)", word);
+bool Parser_v1d::isGenericVerb_v1(const char *word, Object *obj) {
+ debugC(1, kDebugParser, "isGenericVerb(%s, Object *obj)", word);
if (!obj->_genericCmd)
return false;
@@ -181,8 +181,8 @@ bool Parser_v1d::isGenericVerb_v1(const char *word, object_t *obj) {
* and if it passes, perform the actions in the action list. If the verb
* is catered for, return TRUE
*/
-bool Parser_v1d::isObjectVerb_v1(const char *word, object_t *obj) {
- debugC(1, kDebugParser, "isObjectVerb(%s, object_t *obj)", word);
+bool Parser_v1d::isObjectVerb_v1(const char *word, Object *obj) {
+ debugC(1, kDebugParser, "isObjectVerb(%s, Object *obj)", word);
// First, find matching verb in cmd list
uint16 cmdIndex = obj->_cmdIndex; // ptr to list of commands
@@ -231,7 +231,7 @@ bool Parser_v1d::isObjectVerb_v1(const char *word, object_t *obj) {
* 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_v1(const char *noun, const char *verb, objectList_t obj) const {
+bool Parser_v1d::isBackgroundWord_v1(const char *noun, const char *verb, ObjectList obj) const {
debugC(1, kDebugParser, "isBackgroundWord(%s, %s, object_list_t obj)", noun, verb);
if (!noun)
@@ -249,8 +249,8 @@ bool Parser_v1d::isBackgroundWord_v1(const char *noun, const char *verb, objectL
/**
* Do all things necessary to carry an object
*/
-void Parser_v1d::takeObject(object_t *obj) {
- debugC(1, kDebugParser, "takeObject(object_t *obj)");
+void Parser_v1d::takeObject(Object *obj) {
+ debugC(1, kDebugParser, "takeObject(Object *obj)");
obj->_carriedFl = true;
if (obj->_seqNumb) // Don't change if no image to display
@@ -264,8 +264,8 @@ void Parser_v1d::takeObject(object_t *obj) {
/**
* Do all necessary things to drop an object
*/
-void Parser_v1d::dropObject(object_t *obj) {
- debugC(1, kDebugParser, "dropObject(object_t *obj)");
+void Parser_v1d::dropObject(Object *obj) {
+ debugC(1, kDebugParser, "dropObject(Object *obj)");
obj->_carriedFl = false;
obj->_screenIndex = *_vm->_screen_p;
@@ -281,7 +281,7 @@ void Parser_v1d::dropObject(object_t *obj) {
* Print text for possible background object. Return TRUE if match found
* If test_noun TRUE, must have a noun given
*/
-bool Parser_v1d::isCatchallVerb_v1(bool testNounFl, const char *noun, const char *verb, objectList_t obj) const {
+bool Parser_v1d::isCatchallVerb_v1(bool testNounFl, const char *noun, const char *verb, ObjectList obj) const {
debugC(1, kDebugParser, "isCatchallVerb(%d, %s, %s, object_list_t obj)", (testNounFl) ? 1 : 0, noun, verb);
if (_vm->_maze._enabledFl)
@@ -305,7 +305,7 @@ bool Parser_v1d::isCatchallVerb_v1(bool testNounFl, const char *noun, const char
void Parser_v1d::lineHandler() {
debugC(1, kDebugParser, "lineHandler()");
- status_t &gameStatus = _vm->getGameStatus();
+ Status &gameStatus = _vm->getGameStatus();
// Toggle God Mode
if (!strncmp(_vm->_line, "PPG", 3)) {
@@ -403,7 +403,7 @@ void Parser_v1d::lineHandler() {
noun = findNextNoun(noun); // Find a noun in the line
// Must try at least once for objects allowing verb-context
for (int i = 0; i < _vm->_object->_numObj; i++) {
- object_t *obj = &_vm->_object->_objects[i];
+ Object *obj = &_vm->_object->_objects[i];
if (isNear_v1(verb, noun, obj, farComment)) {
if (isObjectVerb_v1(verb, obj) // Foreground object
|| isGenericVerb_v1(verb, obj))// Common action type
@@ -424,7 +424,7 @@ void Parser_v1d::lineHandler() {
}
void Parser_v1d::showInventory() const {
- status_t &gameStatus = _vm->getGameStatus();
+ Status &gameStatus = _vm->getGameStatus();
if (gameStatus._viewState == kViewPlay) {
if (gameStatus._gameOverFl)
_vm->gameOverMsg();
diff --git a/engines/hugo/parser_v1w.cpp b/engines/hugo/parser_v1w.cpp
index 832e6fd1b0..8c0da63554 100644
--- a/engines/hugo/parser_v1w.cpp
+++ b/engines/hugo/parser_v1w.cpp
@@ -56,7 +56,7 @@ Parser_v1w::~Parser_v1w() {
void Parser_v1w::lineHandler() {
debugC(1, kDebugParser, "lineHandler()");
- status_t &gameStatus = _vm->getGameStatus();
+ Status &gameStatus = _vm->getGameStatus();
// Toggle God Mode
if (!strncmp(_vm->_line, "PPG", 3)) {
@@ -147,7 +147,7 @@ void Parser_v1w::lineHandler() {
// Test for nearby objects referenced explicitly
for (int i = 0; i < _vm->_object->_numObj; i++) {
- object_t *obj = &_vm->_object->_objects[i];
+ Object *obj = &_vm->_object->_objects[i];
if (isWordPresent(_vm->_text->getNounArray(obj->_nounIndex))) {
if (isObjectVerb_v3(obj, farComment) || isGenericVerb_v3(obj, farComment))
return;
@@ -157,7 +157,7 @@ void Parser_v1w::lineHandler() {
// Test for nearby objects that only require a verb
// Note comment is unused if not near.
for (int i = 0; i < _vm->_object->_numObj; i++) {
- object_t *obj = &_vm->_object->_objects[i];
+ Object *obj = &_vm->_object->_objects[i];
if (obj->_verbOnlyFl) {
char contextComment[kCompLineSize * 5] = ""; // Unused comment for context objects
if (isObjectVerb_v3(obj, contextComment) || isGenericVerb_v3(obj, contextComment))
@@ -200,8 +200,8 @@ void Parser_v1w::lineHandler() {
}
void Parser_v1w::showInventory() const {
- status_t &gameStatus = _vm->getGameStatus();
- istate_t inventState = _vm->_inventory->getInventoryState();
+ Status &gameStatus = _vm->getGameStatus();
+ Istate inventState = _vm->_inventory->getInventoryState();
if (gameStatus._gameOverFl) {
_vm->gameOverMsg();
} else if ((inventState == kInventoryOff) && (gameStatus._viewState == kViewPlay)) {
diff --git a/engines/hugo/parser_v2d.cpp b/engines/hugo/parser_v2d.cpp
index 2daf3c5e9f..674836b90e 100644
--- a/engines/hugo/parser_v2d.cpp
+++ b/engines/hugo/parser_v2d.cpp
@@ -55,7 +55,7 @@ Parser_v2d::~Parser_v2d() {
void Parser_v2d::lineHandler() {
debugC(1, kDebugParser, "lineHandler()");
- status_t &gameStatus = _vm->getGameStatus();
+ Status &gameStatus = _vm->getGameStatus();
// Toggle God Mode
if (!strncmp(_vm->_line, "PPG", 3)) {
@@ -153,7 +153,7 @@ void Parser_v2d::lineHandler() {
noun = findNextNoun(noun); // Find a noun in the line
// Must try at least once for objects allowing verb-context
for (int i = 0; i < _vm->_object->_numObj; i++) {
- object_t *obj = &_vm->_object->_objects[i];
+ Object *obj = &_vm->_object->_objects[i];
if (isNear_v1(verb, noun, obj, farComment)) {
if (isObjectVerb_v1(verb, obj) // Foreground object
|| isGenericVerb_v1(verb, obj))// Common action type
diff --git a/engines/hugo/parser_v3d.cpp b/engines/hugo/parser_v3d.cpp
index abfe263f6e..9bbaf49f67 100644
--- a/engines/hugo/parser_v3d.cpp
+++ b/engines/hugo/parser_v3d.cpp
@@ -55,7 +55,7 @@ Parser_v3d::~Parser_v3d() {
void Parser_v3d::lineHandler() {
debugC(1, kDebugParser, "lineHandler()");
- status_t &gameStatus = _vm->getGameStatus();
+ Status &gameStatus = _vm->getGameStatus();
// Toggle God Mode
if (!strncmp(_vm->_line, "PPG", 3)) {
@@ -149,7 +149,7 @@ void Parser_v3d::lineHandler() {
// Test for nearby objects referenced explicitly
for (int i = 0; i < _vm->_object->_numObj; i++) {
- object_t *obj = &_vm->_object->_objects[i];
+ Object *obj = &_vm->_object->_objects[i];
if (isWordPresent(_vm->_text->getNounArray(obj->_nounIndex))) {
if (isObjectVerb_v3(obj, farComment) || isGenericVerb_v3(obj, farComment))
return;
@@ -159,7 +159,7 @@ void Parser_v3d::lineHandler() {
// Test for nearby objects that only require a verb
// Note comment is unused if not near.
for (int i = 0; i < _vm->_object->_numObj; i++) {
- object_t *obj = &_vm->_object->_objects[i];
+ Object *obj = &_vm->_object->_objects[i];
if (obj->_verbOnlyFl) {
char contextComment[kCompLineSize * 5] = ""; // Unused comment for context objects
if (isObjectVerb_v3(obj, contextComment) || isGenericVerb_v3(obj, contextComment))
@@ -204,8 +204,8 @@ void Parser_v3d::lineHandler() {
* 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_v3d::isObjectVerb_v3(object_t *obj, char *comment) {
- debugC(1, kDebugParser, "isObjectVerb(object_t *obj, %s)", comment);
+bool Parser_v3d::isObjectVerb_v3(Object *obj, char *comment) {
+ debugC(1, kDebugParser, "isObjectVerb(Object *obj, %s)", comment);
// First, find matching verb in cmd list
uint16 cmdIndex = obj->_cmdIndex; // ptr to list of commands
@@ -259,8 +259,8 @@ bool Parser_v3d::isObjectVerb_v3(object_t *obj, char *comment) {
/**
* Test whether command line contains one of the generic actions
*/
-bool Parser_v3d::isGenericVerb_v3(object_t *obj, char *comment) {
- debugC(1, kDebugParser, "isGenericVerb(object_t *obj, %s)", comment);
+bool Parser_v3d::isGenericVerb_v3(Object *obj, char *comment) {
+ debugC(1, kDebugParser, "isGenericVerb(Object *obj, %s)", comment);
if (!obj->_genericCmd)
return false;
@@ -313,8 +313,8 @@ bool Parser_v3d::isGenericVerb_v3(object_t *obj, char *comment) {
* If radius is -1, treat radius as infinity
* Verb is included to determine correct comment if not near
*/
-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);
+bool Parser_v3d::isNear_v3(Object *obj, const char *verb, char *comment) const {
+ debugC(1, kDebugParser, "isNear(Object *obj, %s, %s)", verb, comment);
if (obj->_carriedFl) // Object is being carried
return true;
@@ -368,8 +368,8 @@ bool Parser_v3d::isNear_v3(object_t *obj, const char *verb, char *comment) const
/**
* Do all things necessary to carry an object
*/
-void Parser_v3d::takeObject(object_t *obj) {
- debugC(1, kDebugParser, "takeObject(object_t *obj)");
+void Parser_v3d::takeObject(Object *obj) {
+ debugC(1, kDebugParser, "takeObject(Object *obj)");
obj->_carriedFl = true;
if (obj->_seqNumb) { // Don't change if no image to display
@@ -385,8 +385,8 @@ void Parser_v3d::takeObject(object_t *obj) {
/**
* Do all necessary things to drop an object
*/
-void Parser_v3d::dropObject(object_t *obj) {
- debugC(1, kDebugParser, "dropObject(object_t *obj)");
+void Parser_v3d::dropObject(Object *obj) {
+ debugC(1, kDebugParser, "dropObject(Object *obj)");
obj->_carriedFl = false;
obj->_screenIndex = *_vm->_screen_p;
@@ -407,7 +407,7 @@ void Parser_v3d::dropObject(object_t *obj) {
* 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_v3d::isCatchallVerb_v3(objectList_t obj) const {
+bool Parser_v3d::isCatchallVerb_v3(ObjectList obj) const {
debugC(1, kDebugParser, "isCatchallVerb(object_list_t obj)");
if (_vm->_maze._enabledFl)
@@ -435,7 +435,7 @@ bool Parser_v3d::isCatchallVerb_v3(objectList_t obj) const {
* Search for matching verb/noun pairs in background command list
* Print text for possible background object. Return TRUE if match found
*/
-bool Parser_v3d::isBackgroundWord_v3(objectList_t obj) const {
+bool Parser_v3d::isBackgroundWord_v3(ObjectList obj) const {
debugC(1, kDebugParser, "isBackgroundWord(object_list_t obj)");
if (_vm->_maze._enabledFl)
diff --git a/engines/hugo/route.cpp b/engines/hugo/route.cpp
index 873cb587af..45d72bafb1 100644
--- a/engines/hugo/route.cpp
+++ b/engines/hugo/route.cpp
@@ -61,7 +61,7 @@ int16 Route::getRouteIndex() const {
void Route::setDirection(const uint16 keyCode) {
debugC(1, kDebugRoute, "setDirection(%d)", keyCode);
- object_t *obj = _vm->_hero; // Pointer to hero object
+ Object *obj = _vm->_hero; // Pointer to hero object
// Set first image in sequence
switch (keyCode) {
@@ -107,7 +107,7 @@ void Route::setDirection(const uint16 keyCode) {
void Route::setWalk(const uint16 direction) {
debugC(1, kDebugRoute, "setWalk(%d)", direction);
- object_t *obj = _vm->_hero; // Pointer to hero object
+ Object *obj = _vm->_hero; // Pointer to hero object
if (_vm->getGameStatus()._storyModeFl || obj->_pathType != kPathUser) // Make sure user has control
return;
@@ -188,8 +188,8 @@ void Route::segment(int16 x, int16 y) {
debugC(1, kDebugRoute, "segment(%d, %d)", x, y);
// Note: use of static - can't waste stack
- static image_pt p; // Ptr to _boundaryMap[y]
- static segment_t *seg_p; // Ptr to segment
+ static ImagePtr p; // Ptr to _boundaryMap[y]
+ static Segment *segPtr; // Ptr to segment
// Bomb out if stack exhausted
// Vinterstum: Is this just a safeguard, or actually used?
@@ -285,10 +285,10 @@ void Route::segment(int16 x, int16 y) {
_fullSegmentFl = true;
} else {
// Create segment
- seg_p = &_segment[_segmentNumb];
- seg_p->_y = y;
- seg_p->_x1 = x1;
- seg_p->_x2 = x2;
+ segPtr = &_segment[_segmentNumb];
+ segPtr->_y = y;
+ segPtr->_x1 = x1;
+ segPtr->_x2 = x2;
_segmentNumb++;
}
}
@@ -332,7 +332,7 @@ bool Route::findRoute(const int16 cx, const int16 cy) {
int16 heroy = _vm->_hero->_y + _vm->_hero->_currImagePtr->_y2; // Hero baseline
// Store all object baselines into objbound (except hero's = [0])
- object_t *obj; // Ptr to object
+ Object *obj; // Ptr to object
int i;
for (i = 1, obj = &_vm->_object->_objects[i]; i < _vm->_object->_numObj; i++, obj++) {
if ((obj->_screenIndex == *_vm->_screen_p) && (obj->_cycling != kCycleInvisible) && (obj->_priority == kPriorityFloating))
@@ -382,18 +382,18 @@ bool Route::findRoute(const int16 cx, const int16 cy) {
// Look ahead for furthest straight line
for (int16 j = i + 1; j < _segmentNumb; j++) {
- segment_t *seg_p = &_segment[j];
+ Segment *segPtr = &_segment[j];
// Can we get to this segment from previous node?
- if (seg_p->_x1 <= routeNode->x && seg_p->_x2 >= routeNode->x + _heroWidth - 1) {
- routeNode->y = seg_p->_y; // Yes, keep updating node
+ if (segPtr->_x1 <= routeNode->x && segPtr->_x2 >= routeNode->x + _heroWidth - 1) {
+ routeNode->y = segPtr->_y; // Yes, keep updating node
} else {
// No, create another node on previous segment to reach it
if ((routeNode = newNode()) == 0) // Add new route node
return false; // Too many nodes
// Find overlap between old and new segments
- int16 x1 = MAX(_segment[j - 1]._x1, seg_p->_x1);
- int16 x2 = MIN(_segment[j - 1]._x2, seg_p->_x2);
+ int16 x1 = MAX(_segment[j - 1]._x1, segPtr->_x1);
+ int16 x2 = MIN(_segment[j - 1]._x2, segPtr->_x2);
// If room, add a little offset to reduce staircase effect
int16 dx = kHeroMaxWidth >> 1;
@@ -500,7 +500,7 @@ void Route::processRoute() {
* go_for is the purpose, id indexes the exit or object to walk to
* Returns FALSE if route not found
*/
-bool Route::startRoute(const go_t routeType, const int16 objId, int16 cx, int16 cy) {
+bool Route::startRoute(const RouteType routeType, const int16 objId, int16 cx, int16 cy) {
debugC(1, kDebugRoute, "startRoute(%d, %d, %d, %d)", routeType, objId, cx, cy);
// Don't attempt to walk if user does not have control
diff --git a/engines/hugo/route.h b/engines/hugo/route.h
index 53b0dd0f88..716829a201 100644
--- a/engines/hugo/route.h
+++ b/engines/hugo/route.h
@@ -37,11 +37,11 @@ namespace Hugo {
/**
* Purpose of an automatic route
*/
-enum go_t {kRouteSpace, kRouteExit, kRouteLook, kRouteGet};
+enum RouteType {kRouteSpace, kRouteExit, kRouteLook, kRouteGet};
-struct segment_t { // Search segment
- int16 _y; // y position
- int16 _x1, _x2; // Range of segment
+struct Segment { // Search segment
+ int16 _y; // y position
+ int16 _x1, _x2; // Range of segment
};
class Route {
@@ -52,7 +52,7 @@ public:
int16 getRouteIndex() const;
void processRoute();
- bool startRoute(const go_t routeType, const int16 objId, int16 cx, int16 cy);
+ bool startRoute(const RouteType routeType, const int16 objId, int16 cx, int16 cy);
void setDirection(const uint16 keyCode);
void setWalk(const uint16 direction);
@@ -66,12 +66,12 @@ private:
uint16 _oldWalkDirection; // Last direction char
- int16 _routeIndex; // Index into route list, or -1
- go_t _routeType; // Purpose of an automatic route
- int16 _routeObjId; // Index of exit of object walking to
+ int16 _routeIndex; // Index into route list, or -1
+ RouteType _routeType; // Purpose of an automatic route
+ int16 _routeObjId; // Index of exit of object walking to
byte _boundaryMap[kYPix][kXPix]; // Boundary byte map
- segment_t _segment[kMaxSeg]; // List of points in fill-path
+ Segment _segment[kMaxSeg]; // List of points in fill-path
Common::Point _route[kMaxNodes]; // List of nodes in route (global)
int16 _segmentNumb; // Count number of segments
int16 _routeListIndex; // Index into route list
diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp
index 0e57b08f19..3bbec6670e 100644
--- a/engines/hugo/schedule.cpp
+++ b/engines/hugo/schedule.cpp
@@ -83,12 +83,12 @@ void Scheduler::initEventQueue() {
/**
* Return a ptr to an event structure from the free list
*/
-event_t *Scheduler::getQueue() {
+Event *Scheduler::getQueue() {
debugC(4, kDebugSchedule, "getQueue");
if (!_freeEvent) // Error: no more events available
error("An error has occurred: %s", "getQueue");
- event_t *resEvent = _freeEvent;
+ Event *resEvent = _freeEvent;
_freeEvent = _freeEvent->_nextEvent;
resEvent->_nextEvent = 0;
return resEvent;
@@ -175,8 +175,8 @@ void Scheduler::newScreen(const int screenIndex) {
}
// 1. Clear out all local events
- event_t *curEvent = _headEvent; // The earliest event
- event_t *wrkEvent; // Event ptr
+ Event *curEvent = _headEvent; // The earliest event
+ Event *wrkEvent; // Event ptr
while (curEvent) { // While mature events found
wrkEvent = curEvent->_nextEvent; // Save p (becomes undefined after Del)
if (curEvent->_localActionFl)
@@ -259,7 +259,7 @@ void Scheduler::loadPoints(Common::SeekableReadStream &in) {
uint16 numElem = in.readUint16BE();
if (varnt == _vm->_gameVariant) {
_numBonuses = numElem;
- _points = (point_t *)malloc(sizeof(point_t) * _numBonuses);
+ _points = (Point *)malloc(sizeof(Point) * _numBonuses);
for (int i = 0; i < _numBonuses; i++) {
_points[i]._score = in.readByte();
_points[i]._scoredFl = false;
@@ -270,10 +270,10 @@ void Scheduler::loadPoints(Common::SeekableReadStream &in) {
}
}
-void Scheduler::readAct(Common::ReadStream &in, act &curAct) {
+void Scheduler::readAct(Common::ReadStream &in, Act &curAct) {
uint16 numSubAct;
- curAct._a0._actType = (action_t) in.readByte();
+ curAct._a0._actType = (Action) in.readByte();
switch (curAct._a0._actType) {
case ANULL: // -1
break;
@@ -285,7 +285,7 @@ void Scheduler::readAct(Common::ReadStream &in, act &curAct) {
curAct._a1._timer = in.readSint16BE();
curAct._a1._objIndex = in.readSint16BE();
curAct._a1._cycleNumb = in.readSint16BE();
- curAct._a1._cycle = (cycle_t) in.readByte();
+ curAct._a1._cycle = (Cycle) in.readByte();
break;
case INIT_OBJXY: // 2
curAct._a2._timer = in.readSint16BE();
@@ -393,7 +393,7 @@ void Scheduler::readAct(Common::ReadStream &in, act &curAct) {
break;
case DEL_EVENTS: // 20
curAct._a20._timer = in.readSint16BE();
- curAct._a20._actTypeDel = (action_t) in.readByte();
+ curAct._a20._actTypeDel = (Action) in.readByte();
break;
case GAMEOVER: // 21
curAct._a21._timer = in.readSint16BE();
@@ -553,20 +553,20 @@ void Scheduler::readAct(Common::ReadStream &in, act &curAct) {
void Scheduler::loadActListArr(Common::ReadStream &in) {
debugC(6, kDebugSchedule, "loadActListArr(&in)");
- act tmpAct;
+ Act tmpAct;
int numElem, numSubElem;
for (int varnt = 0; varnt < _vm->_numVariant; varnt++) {
numElem = in.readUint16BE();
if (varnt == _vm->_gameVariant) {
_actListArrSize = numElem;
- _actListArr = (act **)malloc(sizeof(act *) * _actListArrSize);
+ _actListArr = (Act **)malloc(sizeof(Act *) * _actListArrSize);
}
for (int i = 0; i < numElem; i++) {
numSubElem = in.readUint16BE();
if (varnt == _vm->_gameVariant)
- _actListArr[i] = (act *)malloc(sizeof(act) * (numSubElem + 1));
+ _actListArr[i] = (Act *)malloc(sizeof(Act) * (numSubElem + 1));
for (int j = 0; j < numSubElem; j++) {
if (varnt == _vm->_gameVariant) {
readAct(in, _actListArr[i][j]);
@@ -708,7 +708,7 @@ void Scheduler::saveEvents(Common::WriteStream *f) {
// Convert event ptrs to indexes
for (int16 i = 0; i < kMaxEvents; i++) {
- event_t *wrkEvent = &_events[i];
+ Event *wrkEvent = &_events[i];
// fix up action pointer (to do better)
int16 index, subElem;
@@ -1039,7 +1039,7 @@ void Scheduler::saveActions(Common::WriteStream *f) const {
/*
* Find the index in the action list to be able to serialize the action to save game
*/
-void Scheduler::findAction(const act* action, int16* index, int16* subElem) {
+void Scheduler::findAction(const Act *action, int16 *index, int16 *subElem) {
assert(index && subElem);
if (!action) {
@@ -1104,7 +1104,7 @@ void Scheduler::restoreEvents(Common::ReadStream *f) {
if ((index == -1) && (subElem == -1))
_events[i]._action = 0;
else
- _events[i]._action = (act *)&_actListArr[index][subElem];
+ _events[i]._action = (Act *)&_actListArr[index][subElem];
_events[i]._localActionFl = (f->readByte() == 1) ? true : false;
_events[i]._time = f->readUint32BE();
@@ -1112,8 +1112,8 @@ void Scheduler::restoreEvents(Common::ReadStream *f) {
int16 prevIndex = f->readSint16BE();
int16 nextIndex = f->readSint16BE();
- _events[i]._prevEvent = (prevIndex == -1) ? (event_t *)0 : &_events[prevIndex];
- _events[i]._nextEvent = (nextIndex == -1) ? (event_t *)0 : &_events[nextIndex];
+ _events[i]._prevEvent = (prevIndex == -1) ? (Event *)0 : &_events[prevIndex];
+ _events[i]._nextEvent = (nextIndex == -1) ? (Event *)0 : &_events[nextIndex];
}
_freeEvent = (freeIndex == -1) ? 0 : &_events[freeIndex];
_headEvent = (headIndex == -1) ? 0 : &_events[headIndex];
@@ -1121,7 +1121,7 @@ void Scheduler::restoreEvents(Common::ReadStream *f) {
// Adjust times to fit our time
uint32 curTime = getTicks();
- event_t *wrkEvent = _headEvent; // The earliest event
+ Event *wrkEvent = _headEvent; // The earliest event
while (wrkEvent) { // While mature events found
wrkEvent->_time = wrkEvent->_time - saveTime + curTime;
wrkEvent = wrkEvent->_nextEvent;
@@ -1132,11 +1132,11 @@ void Scheduler::restoreEvents(Common::ReadStream *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::insertAction(act *action) {
+void Scheduler::insertAction(Act *action) {
debugC(1, kDebugSchedule, "insertAction() - Action type A%d", action->_a0._actType);
// First, get and initialize the event structure
- event_t *curEvent = getQueue();
+ Event *curEvent = getQueue();
curEvent->_action = action;
switch (action->_a0._actType) { // Assign whether local or global
case AGSCHEDULE:
@@ -1158,7 +1158,7 @@ void Scheduler::insertAction(act *action) {
_tailEvent = _headEvent = curEvent;
curEvent->_nextEvent = curEvent->_prevEvent = 0;
} else {
- event_t *wrkEvent = _tailEvent; // Search from latest time back
+ Event *wrkEvent = _tailEvent; // Search from latest time back
bool found = false;
while (wrkEvent && !found) {
@@ -1189,14 +1189,14 @@ void Scheduler::insertAction(act *action) {
* 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::doAction(event_t *curEvent) {
+Event *Scheduler::doAction(Event *curEvent) {
debugC(1, kDebugSchedule, "doAction - Event action type : %d", curEvent->_action->_a0._actType);
- status_t &gameStatus = _vm->getGameStatus();
- act *action = curEvent->_action;
- object_t *obj1;
- int dx, dy;
- event_t *wrkEvent; // Save ev_p->next_p for return
+ Status &gameStatus = _vm->getGameStatus();
+ Act *action = curEvent->_action;
+ Object *obj1;
+ int dx, dy;
+ Event *wrkEvent; // Save ev_p->next_p for return
switch (action->_a0._actType) {
case ANULL: // Big NOP from DEL_EVENTS
@@ -1236,7 +1236,7 @@ event_t *Scheduler::doAction(event_t *curEvent) {
_vm->_object->_objects[action->_a9._objIndex]._state = action->_a9._newState;
break;
case INIT_PATH: // act10: Initialize an object path and velocity
- _vm->_object->setPath(action->_a10._objIndex, (path_t) action->_a10._newPathType, action->_a10._vxPath, action->_a10._vyPath);
+ _vm->_object->setPath(action->_a10._objIndex, (Path) action->_a10._newPathType, action->_a10._vxPath, action->_a10._vyPath);
break;
case COND_R: // act11: action lists conditional on object state
if (_vm->_object->_objects[action->_a11._objIndex]._state == action->_a11._stateReq)
@@ -1441,7 +1441,7 @@ event_t *Scheduler::doAction(event_t *curEvent) {
* was modified to allow deletes anywhere in the list, and the DEL_EVENT
* action was modified to perform the actual delete.
*/
-void Scheduler::delQueue(event_t *curEvent) {
+void Scheduler::delQueue(Event *curEvent) {
debugC(4, kDebugSchedule, "delQueue()");
if (curEvent == _headEvent) { // If p was the head ptr
@@ -1468,10 +1468,10 @@ void Scheduler::delQueue(event_t *curEvent) {
/**
* Delete all the active events of a given type
*/
-void Scheduler::delEventType(const action_t _actTypeDel) {
+void Scheduler::delEventType(const Action _actTypeDel) {
// Note: actions are not deleted here, simply turned into NOPs!
- event_t *wrkEvent = _headEvent; // The earliest event
- event_t *saveEvent;
+ Event *wrkEvent = _headEvent; // The earliest event
+ Event *saveEvent;
while (wrkEvent) { // While events found in list
saveEvent = wrkEvent->_nextEvent;
@@ -1525,13 +1525,13 @@ void Scheduler_v1d::runScheduler() {
debugC(6, kDebugSchedule, "runScheduler");
uint32 ticker = getTicks(); // The time now, in ticks
- event_t *curEvent = _headEvent; // The earliest event
+ Event *curEvent = _headEvent; // The earliest event
while (curEvent && (curEvent->_time <= ticker)) // While mature events found
curEvent = doAction(curEvent); // Perform the action (returns next_p)
}
-void Scheduler_v1d::promptAction(act *action) {
+void Scheduler_v1d::promptAction(Act *action) {
Common::String response;
response = Utils::promptBox(_vm->_file->fetchString(action->_a3._promptIndex));
@@ -1574,7 +1574,7 @@ const char *Scheduler_v2d::getCypher() const {
return "Copyright 1991, Gray Design Associates";
}
-void Scheduler_v2d::promptAction(act *action) {
+void Scheduler_v2d::promptAction(Act *action) {
Common::String response;
response = Utils::promptBox(_vm->_file->fetchString(action->_a3._promptIndex));
@@ -1639,7 +1639,7 @@ void Scheduler_v1w::runScheduler() {
debugC(6, kDebugSchedule, "runScheduler");
uint32 ticker = getTicks(); // The time now, in ticks
- event_t *curEvent = _headEvent; // The earliest event
+ Event *curEvent = _headEvent; // The earliest event
while (curEvent && (curEvent->_time <= ticker)) // While mature events found
curEvent = doAction(curEvent); // Perform the action (returns next_p)
diff --git a/engines/hugo/schedule.h b/engines/hugo/schedule.h
index 74a65a5c64..37851f1ebc 100644
--- a/engines/hugo/schedule.h
+++ b/engines/hugo/schedule.h
@@ -37,7 +37,7 @@ namespace Hugo {
/**
* Following defines the action types and action list
*/
-enum action_t { // Parameters:
+enum Action { // Parameters:
ANULL = 0xff, // Special NOP used to 'delete' events in DEL_EVENTS
ASCHEDULE = 0, // 0 - Ptr to action list to be rescheduled
START_OBJ, // 1 - Object number
@@ -56,7 +56,7 @@ enum action_t { // Parameters:
SWAP_IMAGES, // 13 - Swap 2 object images
COND_SCR, // 14 - Conditional on current screen
AUTOPILOT, // 15 - Set object to home in on another (stationary) object
- INIT_OBJ_SEQ, // 16 - Object number, sequence index to set curr_seq_p to
+ INIT_OBJ_SEQ, // 16 - Object number, sequence index to set curr_seqPtr to
SET_STATE_BITS, // 17 - Objnum, mask to OR with obj states word
CLEAR_STATE_BITS, // 18 - Objnum, mask to ~AND with obj states word
TEST_STATE_BITS, // 19 - Objnum, mask to test obj states word
@@ -88,33 +88,33 @@ enum action_t { // Parameters:
COND_ROUTE, // 45 - Conditional on route in progress
INIT_JUMPEXIT, // 46 - Initialize status.jumpexit
INIT_VIEW, // 47 - Initialize viewx, viewy, dir
- INIT_OBJ_FRAME, // 48 - Object number, seq,frame to set curr_seq_p to
+ INIT_OBJ_FRAME, // 48 - Object number, seq,frame to set curr_seqPtr to
OLD_SONG = 49 // Added by Strangerke - Set currently playing sound, old way: that is, using a string index instead of a reference in a file
};
struct act0 { // Type 0 - Schedule
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
uint16 _actIndex; // Ptr to an action list
};
struct act1 { // Type 1 - Start an object
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The object number
int _cycleNumb; // Number of times to cycle
- cycle_t _cycle; // Direction to start cycling
+ Cycle _cycle; // Direction to start cycling
};
struct act2 { // Type 2 - Initialize an object coords
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The object number
int _x, _y; // Coordinates
};
struct act3 { // Type 3 - Prompt user for text
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
uint16 _promptIndex; // Index of prompt string
int *_responsePtr; // Array of indexes to valid response string(s) (terminate list with -1)
@@ -124,54 +124,54 @@ struct act3 { // Type 3 - Prompt user for
};
struct act4 { // Type 4 - Set new background color
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
long _newBackgroundColor; // New color
};
struct act5 { // Type 5 - Initialize an object velocity
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The object number
int _vx, _vy; // velocity
};
struct act6 { // Type 6 - Initialize an object carrying
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The object number
bool _carriedFl; // carrying
};
struct act7 { // Type 7 - Initialize an object to hero's coords
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The object number
};
struct act8 { // Type 8 - switch to new screen
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _screenIndex; // The new screen number
};
struct act9 { // Type 9 - Initialize an object state
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The object number
byte _newState; // New state
};
struct act10 { // Type 10 - Initialize an object path type
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The object number
int _newPathType; // New path type
- int8 _vxPath, _vyPath; // Max delta velocities e.g. for CHASE
+ int8 _vxPath, _vyPath; // Max delta velocities e.g. for CHASE
};
struct act11 { // Type 11 - Conditional on object's state
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The object number
byte _stateReq; // Required state
@@ -180,20 +180,20 @@ struct act11 { // Type 11 - Conditional on
};
struct act12 { // Type 12 - Simple text box
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _stringIndex; // Index (enum) of string in strings.dat
};
struct act13 { // Type 13 - Swap first object image with second
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex1; // Index of first object
int _objIndex2; // 2nd
};
struct act14 { // Type 14 - Conditional on current screen
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The required object
int _screenReq; // The required screen number
@@ -202,7 +202,7 @@ struct act14 { // Type 14 - Conditional on
};
struct act15 { // Type 15 - Home in on an object
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex1; // The object number homing in
int _objIndex2; // The object number to home in on
@@ -211,29 +211,29 @@ struct act15 { // Type 15 - Home in on an o
// Note: Don't set a sequence at time 0 of a new screen, it causes
// problems clearing the boundary bits of the object! timer > 0 is safe
-struct act16 { // Type 16 - Set curr_seq_p to seq
- action_t _actType; // The type of action
+struct act16 { // Type 16 - Set curr_seqPtr to seq
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The object number
int _seqIndex; // The index of seq array to set to
};
struct act17 { // Type 17 - SET obj individual state bits
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The object number
int _stateMask; // The mask to OR with current obj state
};
struct act18 { // Type 18 - CLEAR obj individual state bits
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The object number
int _stateMask; // The mask to ~AND with current obj state
};
struct act19 { // Type 19 - TEST obj individual state bits
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The object number
int _stateMask; // The mask to AND with current obj state
@@ -242,35 +242,35 @@ struct act19 { // Type 19 - TEST obj indivi
};
struct act20 { // Type 20 - Remove all events with this type of action
- action_t _actType; // The type of action
- int _timer; // Time to set off the action
- action_t _actTypeDel; // The action type to remove
+ Action _actType; // The type of action
+ int _timer; // Time to set off the action
+ Action _actTypeDel; // The action type to remove
};
struct act21 { // Type 21 - Gameover. Disable hero & commands
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
};
struct act22 { // Type 22 - Initialize an object to hero's coords
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The object number
};
struct act23 { // Type 23 - Exit game back to DOS
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
};
struct act24 { // Type 24 - Get bonus score
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _pointIndex; // Index into points array
};
struct act25 { // Type 25 - Conditional on bounding box
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The required object number
int _x1, _y1, _x2, _y2; // The bounding box
@@ -279,25 +279,25 @@ struct act25 { // Type 25 - Conditional on
};
struct act26 { // Type 26 - Play a sound
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int16 _soundIndex; // Sound index in data file
};
struct act27 { // Type 27 - Add object's value to score
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // object number
};
struct act28 { // Type 28 - Subtract object's value from score
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // object number
};
struct act29 { // Type 29 - Conditional on object carried
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The required object number
uint16 _actPassIndex; // Ptr to action list if success
@@ -305,7 +305,7 @@ struct act29 { // Type 29 - Conditional on
};
struct act30 { // Type 30 - Start special maze processing
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
byte _mazeSize; // Size of (square) maze
int _x1, _y1, _x2, _y2; // Bounding box of maze
@@ -314,39 +314,39 @@ struct act30 { // Type 30 - Start special m
};
struct act31 { // Type 31 - Exit special maze processing
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
};
struct act32 { // Type 32 - Init fbg field of object
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The object number
byte _priority; // Value of foreground/background field
};
struct act33 { // Type 33 - Init screen field of object
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The object number
int _screenIndex; // Screen number
};
struct act34 { // Type 34 - Global Schedule
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
uint16 _actIndex; // Ptr to an action list
};
struct act35 { // Type 35 - Remappe palette
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int16 _oldColorIndex; // Old color index, 0..15
int16 _newColorIndex; // New color index, 0..15
};
struct act36 { // Type 36 - Conditional on noun mentioned
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
uint16 _nounIndex; // The required noun (list)
uint16 _actPassIndex; // Ptr to action list if success
@@ -354,14 +354,14 @@ struct act36 { // Type 36 - Conditional on
};
struct act37 { // Type 37 - Set new screen state
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _screenIndex; // The screen number
byte _newState; // The new state
};
struct act38 { // Type 38 - Position lips
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _lipsObjIndex; // The LIPS object
int _objIndex; // The object to speak
@@ -370,19 +370,19 @@ struct act38 { // Type 38 - Position lips
};
struct act39 { // Type 39 - Init story mode
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
bool _storyModeFl; // New state of story_mode flag
};
struct act40 { // Type 40 - Unsolicited text box
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _stringIndex; // Index (enum) of string in strings.dat
};
struct act41 { // Type 41 - Conditional on bonus scored
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _bonusIndex; // Index into bonus list
uint16 _actPassIndex; // Index of the action list if scored for the first time
@@ -390,13 +390,13 @@ struct act41 { // Type 41 - Conditional on
};
struct act42 { // Type 42 - Text box with "take" string
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The object taken
};
struct act43 { // Type 43 - Prompt user for Yes or No
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _promptIndex; // index of prompt string
uint16 _actYesIndex; // Ptr to action list if YES
@@ -404,12 +404,12 @@ struct act43 { // Type 43 - Prompt user for
};
struct act44 { // Type 44 - Stop any route in progress
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
};
struct act45 { // Type 45 - Conditional on route in progress
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _routeIndex; // Must be >= current status.rindex
uint16 _actPassIndex; // Ptr to action list if en-route
@@ -417,13 +417,13 @@ struct act45 { // Type 45 - Conditional on
};
struct act46 { // Type 46 - Init status.jumpexit
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
bool _jumpExitFl; // New state of jumpexit flag
};
struct act47 { // Type 47 - Init viewx,viewy,dir
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The object
int16 _viewx; // object.viewx
@@ -431,8 +431,8 @@ struct act47 { // Type 47 - Init viewx,view
int16 _direction; // object.dir
};
-struct act48 { // Type 48 - Set curr_seq_p to frame n
- action_t _actType; // The type of action
+struct act48 { // Type 48 - Set curr_seqPtr to frame n
+ Action _actType; // The type of action
int _timer; // Time to set off the action
int _objIndex; // The object number
int _seqIndex; // The index of seq array to set to
@@ -440,12 +440,12 @@ struct act48 { // Type 48 - Set curr_seq_p
};
struct act49 { // Added by Strangerke - Type 49 - Play a song (DOS way)
- action_t _actType; // The type of action
+ Action _actType; // The type of action
int _timer; // Time to set off the action
uint16 _songIndex; // Song index in string array
};
-union act {
+union Act {
act0 _a0;
act1 _a1;
act2 _a2;
@@ -498,18 +498,18 @@ union act {
act49 _a49;
};
-struct event_t {
- act *_action; // Ptr to action to perform
- bool _localActionFl; // true if action is only for this screen
- uint32 _time; // (absolute) time to perform action
- struct event_t *_prevEvent; // Chain to previous event
- struct event_t *_nextEvent; // Chain to next event
+struct Event {
+ Act *_action; // Ptr to action to perform
+ bool _localActionFl; // true if action is only for this screen
+ uint32 _time; // (absolute) time to perform action
+ struct Event *_prevEvent; // Chain to previous event
+ struct Event *_nextEvent; // Chain to next event
};
/**
* Following are points for achieving certain actions.
*/
-struct point_t {
+struct Point {
byte _score; // The value of the point
bool _scoredFl; // Whether scored yet
};
@@ -554,36 +554,36 @@ protected:
uint16 **_screenActs;
byte _numBonuses;
- point_t *_points;
+ Point *_points;
uint32 _curTick; // Current system time in ticks
uint32 _oldTime; // The previous wall time in ticks
uint32 _refreshTimeout;
- event_t *_freeEvent; // Free list of event structures
- event_t *_headEvent; // Head of list (earliest time)
- event_t *_tailEvent; // Tail of list (latest time)
- event_t _events[kMaxEvents]; // Statically declare event structures
+ Event *_freeEvent; // Free list of event structures
+ Event *_headEvent; // Head of list (earliest time)
+ Event *_tailEvent; // Tail of list (latest time)
+ Event _events[kMaxEvents]; // Statically declare event structures
- act **_actListArr;
+ Act **_actListArr;
virtual const char *getCypher() const = 0;
virtual uint32 getTicks() = 0;
- virtual void promptAction(act *action) = 0;
+ virtual void promptAction(Act *action) = 0;
- event_t *doAction(event_t *curEvent);
- event_t *getQueue();
+ Event *doAction(Event *curEvent);
+ Event *getQueue();
uint32 getDosTicks(const bool updateFl);
uint32 getWinTicks() const;
- void delEventType(const action_t actTypeDel);
- void delQueue(event_t *curEvent);
- void findAction(const act* action, int16* index, int16* subElem);
- void insertAction(act *action);
- void readAct(Common::ReadStream &in, act &curAct);
+ void delEventType(const Action actTypeDel);
+ void delQueue(Event *curEvent);
+ void findAction(const Act* action, int16* index, int16* subElem);
+ void insertAction(Act *action);
+ void readAct(Common::ReadStream &in, Act &curAct);
void restoreActions(Common::ReadStream *f);
void restoreEvents(Common::ReadStream *f);
void restorePoints(Common::ReadStream *in);
@@ -605,7 +605,7 @@ public:
protected:
virtual const char *getCypher() const;
virtual uint32 getTicks();
- virtual void promptAction(act *action);
+ virtual void promptAction(Act *action);
};
class Scheduler_v2d : public Scheduler_v1d {
@@ -618,7 +618,7 @@ public:
protected:
virtual const char *getCypher() const;
- void promptAction(act *action);
+ void promptAction(Act *action);
};
class Scheduler_v3d : public Scheduler_v2d {
diff --git a/engines/hugo/sound.cpp b/engines/hugo/sound.cpp
index 463a19ae8c..a8b4759d9b 100644
--- a/engines/hugo/sound.cpp
+++ b/engines/hugo/sound.cpp
@@ -174,8 +174,8 @@ void SoundHandler::toggleSound() {
_vm->_config._soundFl = !_vm->_config._soundFl;
}
-void SoundHandler::playMIDI(sound_pt seq_p, uint16 size) {
- _midiPlayer->play(seq_p, size);
+void SoundHandler::playMIDI(sound_pt seqPtr, uint16 size) {
+ _midiPlayer->play(seqPtr, size);
}
/**