LAB: Use // for comments

This commit is contained in:
Strangerke 2015-12-08 11:27:34 +01:00 committed by Willem Jan Palenstijn
parent 21fc36bfad
commit 2d0fab7f4c
21 changed files with 332 additions and 267 deletions

View File

@ -78,7 +78,8 @@ void Anim::readBlock(void *Buffer, uint32 Size, byte **File) {
}
void Anim::diffNextFrame(bool onlyDiffData) {
if (_header == 65535) /* Already done. */
if (_header == 65535)
// Already done.
return;
if (_vm->_graphics->_dispBitMap._flags & BITMAPF_VIDEO) {
@ -127,7 +128,8 @@ void Anim::diffNextFrame(bool onlyDiffData) {
if (_vm->_graphics->_dispBitMap._flags & BITMAPF_VIDEO)
_vm->_graphics->screenUpdate();
return; /* done with the next frame. */
// done with the next frame.
return;
}
_vm->_music->updateMusic();
@ -231,7 +233,8 @@ void Anim::diffNextFrame(bool onlyDiffData) {
return;
}
_frameNum = 4; /* Random frame number so it never gets back to 2 */
// Random frame number so it never gets back to 2
_frameNum = 4;
_diffFile = _buffer;
break;

View File

@ -93,9 +93,9 @@ public:
DIFFHeader _headerdata;
char _diffPalette[256 * 3];
bool _waitForEffect; /* Wait for each sound effect to finish before continuing. */
bool _doBlack; /* Black the screen before new picture */
bool _noPalChange; /* Don't change the palette. */
bool _waitForEffect; // Wait for each sound effect to finish before continuing.
bool _doBlack; // Black the screen before new picture
bool _noPalChange; // Don't change the palette.
BitMap _rawDiffBM;
bool readDiff(byte *buffer, bool playOnce, bool onlyDiffData = false);
@ -106,6 +106,6 @@ public:
} // End of namespace Lab
#endif /* LAB_DIFF_H */
#endif // LAB_DIFF_H

View File

@ -39,10 +39,10 @@
namespace Lab {
/* Global parser data */
// Global parser data
bool ispal = false;
/* LAB: Labyrinth specific code for the special puzzles */
// LAB: Labyrinth specific code for the special puzzles
#define SPECIALLOCK 100
#define SPECIALBRICK 101
#define SPECIALBRICKNOMOUSE 102
@ -97,7 +97,8 @@ void LabEngine::drawRoomMessage(uint16 curInv, CloseDataPtr closePtr) {
if (_alternate) {
if ((curInv <= _numInv) && _conditions->in(curInv) && _inventory[curInv]._bitmapName) {
if ((curInv == LAMPNUM) && _conditions->in(LAMPON)) /* LAB: Labyrinth specific */
if ((curInv == LAMPNUM) && _conditions->in(LAMPON))
// LAB: Labyrinth specific
drawStaticMessage(kTextLampOn);
else if (_inventory[curInv]._many > 1) {
Common::String roomMessage = Common::String(_inventory[curInv]._name) + " (" + Common::String::format("%d", _inventory[curInv]._many) + ")";
@ -277,7 +278,8 @@ void LabEngine::interfaceOn() {
* If the user hits the "Use" gadget; things that can get used on themselves.
*/
bool LabEngine::doUse(uint16 curInv) {
if (curInv == MAPNUM) { /* LAB: Labyrinth specific */
if (curInv == MAPNUM) {
// LAB: Labyrinth specific
drawStaticMessage(kTextUseMap);
interfaceOff();
_anim->stopDiff();
@ -287,7 +289,8 @@ bool LabEngine::doUse(uint16 curInv) {
_graphics->setPalette(initcolors, 8);
_graphics->drawMessage(NULL);
_graphics->drawPanel();
} else if (curInv == JOURNALNUM) { /* LAB: Labyrinth specific */
} else if (curInv == JOURNALNUM) {
// LAB: Labyrinth specific
drawStaticMessage(kTextUseJournal);
interfaceOff();
_anim->stopDiff();
@ -296,7 +299,8 @@ bool LabEngine::doUse(uint16 curInv) {
doJournal();
_graphics->drawPanel();
_graphics->drawMessage(NULL);
} else if (curInv == LAMPNUM) { /* LAB: Labyrinth specific */
} else if (curInv == LAMPNUM) {
// LAB: Labyrinth specific
interfaceOff();
if (_conditions->in(LAMPON)) {
@ -314,19 +318,23 @@ bool LabEngine::doUse(uint16 curInv) {
_anim->_doBlack = false;
_nextFileName = getInvName(curInv);
} else if (curInv == BELTNUM) { /* LAB: Labyrinth specific */
} else if (curInv == BELTNUM) {
// LAB: Labyrinth specific
if (!_conditions->in(BELTGLOW))
_conditions->inclElement(BELTGLOW);
_anim->_doBlack = false;
_nextFileName = getInvName(curInv);
} else if (curInv == WHISKEYNUM) { /* LAB: Labyrinth specific */
} else if (curInv == WHISKEYNUM) {
// LAB: Labyrinth specific
_conditions->inclElement(USEDHELMET);
drawStaticMessage(kTextUseWhiskey);
} else if (curInv == PITHHELMETNUM) { /* LAB: Labyrinth specific */
} else if (curInv == PITHHELMETNUM) {
// LAB: Labyrinth specific
_conditions->inclElement(USEDHELMET);
drawStaticMessage(kTextUsePith);
} else if (curInv == HELMETNUM) { /* LAB: Labyrinth specific */
} else if (curInv == HELMETNUM) {
// LAB: Labyrinth specific
_conditions->inclElement(USEDHELMET);
drawStaticMessage(kTextUseHelmet);
} else
@ -411,8 +419,7 @@ void LabEngine::mainGameLoop() {
perFlipGadget(actionMode);
/* Set up initial picture. */
// Set up initial picture.
while (1) {
_event->processInput(true);
@ -424,7 +431,7 @@ void LabEngine::mainGameLoop() {
_music->resumeBackMusic();
/* Sees what kind of close up we're in and does the appropriate stuff, if any. */
// Sees what kind of close up we're in and does the appropriate stuff, if any.
if (doCloseUp(_cptr)) {
_cptr = NULL;
@ -432,27 +439,31 @@ void LabEngine::mainGameLoop() {
_graphics->screenUpdate();
}
/* Sets the current picture properly on the screen */
// Sets the current picture properly on the screen
if (_mainDisplay)
_nextFileName = getPictName(&_cptr);
if (_noUpdateDiff) {
_roomsFound->inclElement(_roomNum); /* Potentially entered another room */
// Potentially entered another room
_roomsFound->inclElement(_roomNum);
forceDraw |= (strcmp(_nextFileName, _curFileName) != 0);
_noUpdateDiff = false;
_curFileName = _nextFileName;
} else if (strcmp(_nextFileName, _curFileName) != 0) {
interfaceOff();
_roomsFound->inclElement(_roomNum); /* Potentially entered another room */
// Potentially entered another room
_roomsFound->inclElement(_roomNum);
_curFileName = _nextFileName;
if (_cptr) {
if ((_cptr->_closeUpType == SPECIALLOCK) && _mainDisplay) /* LAB: Labyrinth specific code */
if ((_cptr->_closeUpType == SPECIALLOCK) && _mainDisplay)
// LAB: Labyrinth specific code
showCombination(_curFileName);
else if (((_cptr->_closeUpType == SPECIALBRICK) ||
(_cptr->_closeUpType == SPECIALBRICKNOMOUSE)) &&
_mainDisplay) /* LAB: Labyrinth specific code */
_mainDisplay)
// LAB: Labyrinth specific code
showTile(_curFileName, (bool)(_cptr->_closeUpType == SPECIALBRICKNOMOUSE));
else
_graphics->readPict(_curFileName, false);
@ -476,11 +487,13 @@ void LabEngine::mainGameLoop() {
}
}
_music->updateMusic(); /* Make sure we check the music at least after every message */
// Make sure we check the music at least after every message
_music->updateMusic();
interfaceOn();
IntuiMessage *curMsg = getMsg();
if (curMsg == NULL) { /* Does music load and next animation frame when you've run out of messages */
if (curMsg == NULL) {
// Does music load and next animation frame when you've run out of messages
gotMessage = false;
_music->checkRoomMusic();
_music->updateMusic();
@ -556,18 +569,20 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
_anim->_doBlack = false;
if ((msgClass == RAWKEY) && (!_graphics->_longWinInFront)) {
if (code == 13) { /* The return key */
if (code == 13) {
// The return key
msgClass = MOUSEBUTTONS;
Qualifier = IEQUALIFIER_LEFTBUTTON;
curPos = _event->getMousePos();
} else if (getPlatform() == Common::kPlatformWindows &&
(code == 'b' || code == 'B')) { /* Start bread crumbs */
} else if (getPlatform() == Common::kPlatformWindows && (code == 'b' || code == 'B')) {
// Start bread crumbs
_breadCrumbs[0]._roomNum = 0;
_numCrumbs = 0;
_droppingCrumbs = true;
mayShowCrumbIndicator();
_graphics->screenUpdate();
} else if (code == 'f' || code == 'F' || code == 'r' || code == 'R') { /* Follow bread crumbs */
} else if (code == 'f' || code == 'F' || code == 'r' || code == 'R') {
// Follow bread crumbs
if (_droppingCrumbs) {
if (_numCrumbs > 0) {
_followingCrumbs = true;
@ -583,7 +598,8 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
_graphics->_doNotDrawMessage = false;
_mainDisplay = true;
interfaceOn(); /* Sets the correct gadget list */
// Sets the correct gadget list
interfaceOn();
_graphics->drawPanel();
drawRoomMessage(curInv, _cptr);
_graphics->screenUpdate();
@ -597,7 +613,8 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
_graphics->screenUpdate();
}
}
} else if ((code == 315) || (code == 'x') || (code == 'X') || (code == 'q') || (code == 'Q')) { /* Quit? */
} else if ((code == 315) || (code == 'x') || (code == 'X') || (code == 'q') || (code == 'Q')) {
// Quit?
_graphics->_doNotDrawMessage = false;
_graphics->drawMessage("Do you want to quit? (Y/N)");
doit = false;
@ -605,10 +622,12 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
interfaceOff();
while (1) {
_music->updateMusic(); /* Make sure we check the music at least after every message */
// Make sure we check the music at least after every message
_music->updateMusic();
curMsg = getMsg();
if (curMsg == NULL) { /* Does music load and next animation frame when you've run out of messages */
if (curMsg == NULL) {
// Does music load and next animation frame when you've run out of messages
_music->updateMusic();
_anim->diffNextFrame();
} else {
@ -632,9 +651,11 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
forceDraw = true;
interfaceOn();
}
} else if (code == 9) { /* TAB key */
} else if (code == 9) {
// TAB key
msgClass = DELTAMOVE;
} else if (code == 27) { /* ESC key */
} else if (code == 27) {
// ESC key
_cptr = NULL;
}
@ -667,8 +688,8 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
_alternate = true;
_anim->_doBlack = true;
_graphics->_doNotDrawMessage = false;
interfaceOn(); /* Sets the correct gadget list */
// Sets the correct gadget list
interfaceOn();
_mainDisplay = false;
if (lastInv && _conditions->in(lastInv)) {
@ -700,7 +721,8 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
mayShowCrumbIndicator();
_graphics->screenUpdate();
} else if (gadgetId >= 6) { /* Arrow Gadgets */
} else if (gadgetId >= 6) {
// Arrow Gadgets
_cptr = NULL;
hcptr = NULL;
@ -734,7 +756,8 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
if (oldRoomNum != _roomNum) {
drawStaticMessage(kTextGoForward);
_roomsFound->inclElement(_roomNum); /* Potentially entered a new room */
// Potentially entered a new room
_roomsFound->inclElement(_roomNum);
_curFileName = " ";
forceDraw = true;
} else {
@ -798,7 +821,8 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
_graphics->_doNotDrawMessage = false;
_mainDisplay = true;
interfaceOn(); /* Sets the correct gadget list */
// Sets the correct gadget list
interfaceOn();
_graphics->drawPanel();
drawRoomMessage(curInv, _cptr);
@ -833,7 +857,8 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
} else if (gadgetId == 1) {
if (!doUse(curInv)) {
uint16 oldActionMode = actionMode;
actionMode = 5; /* Use button */
// Use button
actionMode = 5;
if (oldActionMode < 5)
perFlipGadget(oldActionMode);
@ -857,27 +882,31 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
_nextFileName = getInvName(curInv);
_graphics->screenUpdate();
} else if (gadgetId == 3) { /* Left gadget */
} else if (gadgetId == 3) {
// Left gadget
decIncInv(&curInv, true);
lastInv = curInv;
_graphics->_doNotDrawMessage = false;
drawRoomMessage(curInv, _cptr);
_graphics->screenUpdate();
} else if (gadgetId == 4) { /* Right gadget */
} else if (gadgetId == 4) {
// Right gadget
decIncInv(&curInv, false);
lastInv = curInv;
_graphics->_doNotDrawMessage = false;
drawRoomMessage(curInv, _cptr);
_graphics->screenUpdate();
} else if (gadgetId == 5) { /* bread crumbs */
} else if (gadgetId == 5) {
// bread crumbs
_breadCrumbs[0]._roomNum = 0;
_numCrumbs = 0;
_droppingCrumbs = true;
mayShowCrumbIndicator();
_graphics->screenUpdate();
} else if (gadgetId == 6) { /* follow crumbs */
} else if (gadgetId == 6) {
// follow crumbs
if (_droppingCrumbs) {
if (_numCrumbs > 0) {
_followingCrumbs = true;
@ -892,7 +921,8 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
_graphics->_doNotDrawMessage = false;
_mainDisplay = true;
interfaceOn(); /* Sets the correct gadget list */
// Sets the correct gadget list
interfaceOn();
_graphics->drawPanel();
drawRoomMessage(curInv, _cptr);
_graphics->screenUpdate();
@ -913,7 +943,8 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
doit = false;
if (_cptr) {
if ((_cptr->_closeUpType == SPECIALLOCK) && _mainDisplay) /* LAB: Labyrinth specific code */
if ((_cptr->_closeUpType == SPECIALLOCK) && _mainDisplay)
// LAB: Labyrinth specific code
mouseCombination(curPos);
else if ((_cptr->_closeUpType == SPECIALBRICK) && _mainDisplay)
mouseTile(curPos);
@ -927,7 +958,8 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
hcptr = NULL;
eatMessages();
if (actionMode == 0) { /* Take something. */
if (actionMode == 0) {
// Take something.
if (doActionRule(Common::Point(curPos.x, curPos.y), actionMode, _roomNum, &_cptr))
_curFileName = _newFileName;
else if (takeItem(curPos.x, curPos.y, &_cptr))
@ -938,16 +970,16 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
_curFileName = _newFileName;
else if (curPos.y < (_utils->vgaScaleY(149) + _utils->svgaCord(2)))
drawStaticMessage(kTextNothing);
} else if ((actionMode == 1) /* Manipulate an object */ ||
(actionMode == 2) /* Open up a "door" */ ||
(actionMode == 3)) { /* Close a "door" */
} else if ((actionMode == 1) || (actionMode == 2) || (actionMode == 3)) {
// Manipulate an object, Open up a "door" or Close a "door"
if (doActionRule(curPos, actionMode, _roomNum, &_cptr))
_curFileName = _newFileName;
else if (!doActionRule(curPos, actionMode, 0, &_cptr)) {
if (curPos.y < (_utils->vgaScaleY(149) + _utils->svgaCord(2)))
drawStaticMessage(kTextNothing);
}
} else if (actionMode == 4) { /* Look at closeups */
} else if (actionMode == 4) {
// Look at closeups
tempcptr = _cptr;
setCurClose(curPos, &tempcptr);
@ -962,7 +994,8 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
drawStaticMessage(kTextNothing);
} else if (curPos.y < (_utils->vgaScaleY(149) + _utils->svgaCord(2)))
drawStaticMessage(kTextNothing);
} else if ((actionMode == 5) && _conditions->in(curInv)) { /* Use an item on something else */
} else if ((actionMode == 5) && _conditions->in(curInv)) {
// Use an item on something else
if (doOperateRule(curPos.x, curPos.y, curInv, &_cptr)) {
_curFileName = _newFileName;
@ -1009,7 +1042,8 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
_anim->_doBlack = true;
_graphics->_doNotDrawMessage = false;
_mainDisplay = true;
interfaceOn(); /* Sets the correct gadget list */
// Sets the correct gadget list
interfaceOn();
if (_alternate) {
if (lastInv && _conditions->in(lastInv))
@ -1046,7 +1080,8 @@ void LabEngine::go() {
_event->mouseShow();
mainGameLoop();
if (_quitLab) { /* Won the game */
if (_quitLab) {
// Won the game
_graphics->blackAllScreen();
_graphics->readPict("P:End/L2In.1", true);

View File

@ -114,7 +114,8 @@ EventManager::EventManager(LabEngine *vm) : _vm(vm) {
}
void EventManager::mouseHandler(int flag, Common::Point pos) {
if (flag & 0x02) { /* Left mouse button click */
if (flag & 0x02) {
// Left mouse button click
Gadget *tmp = NULL;
if (_screenGadgetList)
tmp = checkGadgetHit(_screenGadgetList, _vm->_isHiRes ? pos : Common::Point(pos.x / 2, pos.y));
@ -125,7 +126,8 @@ void EventManager::mouseHandler(int flag, Common::Point pos) {
_leftClick = true;
}
if (flag & 0x08) /* Right mouse button click */
if (flag & 0x08)
// Right mouse button click
_rightClick = true;
}
@ -263,7 +265,7 @@ bool EventManager::haveNextChar() {
void EventManager::processInput(bool can_delay) {
Common::Event event;
if (1 /*!g_IgnoreProcessInput*/) {
if (1) { //!g_IgnoreProcessInput
int flags = 0;
while (g_system->getEventManager()->pollEvent(event)) {
switch (event.type) {

View File

@ -77,4 +77,4 @@ public:
} // End of namespace Lab
#endif /* LAB_EVENTMAN_H */
#endif // LAB_EVENTMAN_H

View File

@ -62,9 +62,7 @@ DisplayMan::~DisplayMan() {
freePict();
}
/*---------------------------------------------------------------------------*/
/*------ From readPict.c. Reads in pictures and animations from disk. ------*/
/*---------------------------------------------------------------------------*/
// From readPict.c. Reads in pictures and animations from disk.
void DisplayMan::loadPict(const char *filename) {
Common::File *bitmapFile = _vm->_resource->openDataFile(filename);
@ -126,11 +124,9 @@ void DisplayMan::freePict() {
_curBitmap = NULL;
}
/*---------------------------------------------------------------------------*/
/*------------ Does all the text rendering to the message boxes. ------------*/
/*---------------------------------------------------------------------------*/
/*----- The flowText routines -----*/
//---------------------------------------------------------------------------
//------------ Does all the text rendering to the message boxes. ------------
//---------------------------------------------------------------------------
/**
* Extracts the first word from a string.
@ -189,17 +185,17 @@ void DisplayMan::getLine(TextFont *tf, char *lineBuffer, const char **mainBuffer
* each line less than 255 characters.
*/
uint32 DisplayMan::flowText(
void *font, /* the TextAttr pointer */
int16 spacing, /* How much vertical spacing between the lines */
byte pencolor, /* pen number to use for text */
byte backpen, /* the background color */
bool fillback, /* Whether to fill the background */
bool centerh, /* Whether to center the text horizontally */
bool centerv, /* Whether to center the text vertically */
bool output, /* Whether to output any text */
uint16 x1, uint16 y1, /* Cords */
void *font, // the TextAttr pointer
int16 spacing, // How much vertical spacing between the lines
byte pencolor, // pen number to use for text
byte backpen, // the background color
bool fillback, // Whether to fill the background
bool centerh, // Whether to center the text horizontally
bool centerv, // Whether to center the text vertically
bool output, // Whether to output any text
uint16 x1, uint16 y1, // Cords
uint16 x2, uint16 y2,
const char *str) { /* The text itself */
const char *str) { // The text itself
TextFont *_msgFont = (TextFont *)font;
char linebuffer[256];
const char *temp;
@ -254,16 +250,18 @@ uint32 DisplayMan::flowText(
return (str - temp);
}
uint32 DisplayMan::flowTextScaled(void *font, /* the TextAttr pointer */
int16 spacing, /* How much vertical spacing between the lines */
byte penColor, /* pen number to use for text */
byte backPen, /* the background color */
bool fillBack, /* Whether to fill the background */
bool centerX, /* Whether to center the text horizontally */
bool centerY, /* Whether to center the text vertically */
bool output, /* Whether to output any text */
uint16 x1, uint16 y1, /* Cords */
uint16 x2, uint16 y2, const char *str) {
uint32 DisplayMan::flowTextScaled(
void *font, // the TextAttr pointer
int16 spacing, // How much vertical spacing between the lines
byte penColor, // pen number to use for text
byte backPen, // the background color
bool fillBack, // Whether to fill the background
bool centerX, // Whether to center the text horizontally
bool centerY, // Whether to center the text vertically
bool output, // Whether to output any text
uint16 x1, uint16 y1, // Cords
uint16 x2, uint16 y2,
const char *str) {
return flowText(font, spacing, penColor, backPen, fillBack, centerX, centerY, output,
_vm->_utils->vgaScaleX(x1), _vm->_utils->vgaScaleY(y1),
_vm->_utils->vgaScaleX(x2), _vm->_utils->vgaScaleY(y2), str);
@ -273,17 +271,17 @@ uint32 DisplayMan::flowTextScaled(void *font, /* the TextAttr pointer */
* Calls flowText, but flows it to memory. Same restrictions as flowText.
*/
uint32 DisplayMan::flowTextToMem(Image *destIm,
void *font, /* the TextAttr pointer */
int16 spacing, /* How much vertical spacing between the lines */
byte pencolor, /* pen number to use for text */
byte backpen, /* the background color */
bool fillback, /* Whether to fill the background */
bool centerh, /* Whether to center the text horizontally */
bool centerv, /* Whether to center the text vertically */
bool output, /* Whether to output any text */
uint16 x1, uint16 y1, /* Cords */
void *font, // the TextAttr pointer
int16 spacing, // How much vertical spacing between the lines
byte pencolor, // pen number to use for text
byte backpen, // the background color
bool fillback, // Whether to fill the background
bool centerh, // Whether to center the text horizontally
bool centerv, // Whether to center the text vertically
bool output, // Whether to output any text
uint16 x1, uint16 y1, // Cords
uint16 x2, uint16 y2,
const char *str) { /* The text itself */
const char *str) { // The text itself
uint32 res, vgabyte = _screenBytesPerPage;
byte *tmp = _currentDisplayBuffer;
@ -298,13 +296,15 @@ uint32 DisplayMan::flowTextToMem(Image *destIm,
return res;
}
/*----- The control panel stuff -----*/
//----- The control panel stuff -----
void DisplayMan::createBox(uint16 y2) {
setAPen(7); /* Message box area */
// Message box area
setAPen(7);
rectFillScaled(4, 154, 315, y2 - 2);
setAPen(0); /* Box around message area */
// Box around message area
setAPen(0);
drawHLine(_vm->_utils->vgaScaleX(2), _vm->_utils->vgaScaleY(152), _vm->_utils->vgaScaleX(317));
drawVLine(_vm->_utils->vgaScaleX(317), _vm->_utils->vgaScaleY(152), _vm->_utils->vgaScaleY(y2));
drawHLine(_vm->_utils->vgaScaleX(2), _vm->_utils->vgaScaleY(y2), _vm->_utils->vgaScaleX(317));
@ -323,7 +323,8 @@ int32 DisplayMan::longDrawMessage(const char *str) {
if (!_longWinInFront) {
_longWinInFront = true;
setAPen(3); /* Clear Area */
// Clear Area
setAPen(3);
rectFill(0, _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319), _vm->_utils->vgaScaleY(199));
}
@ -367,37 +368,45 @@ void DisplayMan::drawMessage(const char *str) {
void DisplayMan::drawPanel() {
_vm->_event->mouseHide();
setAPen(3); /* Clear Area */
// Clear Area
setAPen(3);
rectFill(0, _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319), _vm->_utils->vgaScaleY(199));
setAPen(0); /* First Line */
drawHLine(0, _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319));
setAPen(5); /* Second Line */
drawHLine(0, _vm->_utils->vgaScaleY(149) + 1 + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319));
/* Gadget Separators */
// First Line
setAPen(0);
drawHLine(0, _vm->_utils->vgaScaleY(170), _vm->_utils->vgaScaleX(319)); /* First black line to separate buttons */
drawHLine(0, _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319));
// Second Line
setAPen(5);
drawHLine(0, _vm->_utils->vgaScaleY(149) + 1 + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319));
// Gadget Separators
setAPen(0);
// First black line to separate buttons
drawHLine(0, _vm->_utils->vgaScaleY(170), _vm->_utils->vgaScaleX(319));
if (!_vm->_alternate) {
setAPen(4);
drawHLine(0, _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleX(319)); /* The horizontal lines under the black one */
// The horizontal lines under the black one
drawHLine(0, _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleX(319));
drawGadgetList(&_vm->_moveGadgetList);
} else {
if (_vm->getPlatform() != Common::kPlatformWindows) {
drawVLine(_vm->_utils->vgaScaleX(124), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199)); /* Vertical Black lines */
// Vertical Black lines
drawVLine(_vm->_utils->vgaScaleX(124), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199));
drawVLine(_vm->_utils->vgaScaleX(194), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199));
} else {
drawVLine(_vm->_utils->vgaScaleX(90), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199)); /* Vertical Black lines */
// Vertical Black lines
drawVLine(_vm->_utils->vgaScaleX(90), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199));
drawVLine(_vm->_utils->vgaScaleX(160), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199));
drawVLine(_vm->_utils->vgaScaleX(230), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199));
}
setAPen(4);
drawHLine(0, _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleX(122)); /* The horizontal lines under the black one */
// The horizontal lines under the black one
drawHLine(0, _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleX(122));
drawHLine(_vm->_utils->vgaScaleX(126), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleX(192));
drawHLine(_vm->_utils->vgaScaleX(196), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleX(319));
drawVLine(_vm->_utils->vgaScaleX(1), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198)); /* The vertical high light lines */
// The vertical high light lines
drawVLine(_vm->_utils->vgaScaleX(1), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198));
if (_vm->getPlatform() != Common::kPlatformWindows) {
drawVLine(_vm->_utils->vgaScaleX(126), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198));
@ -426,7 +435,7 @@ bool DisplayMan::setUpScreens() {
_vm->_moveImages[i] = new Image(controlFile);
delete controlFile;
/* Creates the gadgets for the movement control panel */
// Creates the gadgets for the movement control panel
uint16 y = _vm->_utils->vgaScaleY(173) - _vm->_utils->svgaCord(2);
// The key mapping was only set for the Windows version.
@ -726,9 +735,9 @@ void DisplayMan::text(TextFont *tf, uint16 x, uint16 y, uint16 color, const char
if (templeft <= 0) {
curpage++;
VGATemp = (byte *)(VGATop - templeft);
/* Set up VGATempLine for next line */
// Set up VGATempLine for next line
VGATempLine -= _screenBytesPerPage;
/* Set up LeftInSegment for next line */
// Set up LeftInSegment for next line
LeftInSegment += _screenBytesPerPage + templeft;
templeft += _screenBytesPerPage;
}

View File

@ -95,43 +95,44 @@ public:
void setAPen(byte pennum);
void rectFill(uint16 x1, uint16 y1, uint16 x2, uint16 y2);
void rectFillScaled(uint16 x1, uint16 y1, uint16 x2, uint16 y2);
/* Window text stuff */
uint32 flowText(void *font, /* the TextAttr pointer */
int16 spacing, /* How much vertical spacing between the lines */
byte pencolor, /* pen number to use for text */
byte backpen, /* the background color */
bool fillback, /* Whether to fill the background */
bool centerh, /* Whether to center the text horizontally */
bool centerv, /* Whether to center the text vertically */
bool output, /* Whether to output any text */
uint16 x1, uint16 y1, /* Cords */
uint16 x2, uint16 y2,
const char *text); /* The text itself */
// Window text stuff
uint32 flowText(void *font, // the TextAttr pointer
int16 spacing, // How much vertical spacing between the lines
byte pencolor, // pen number to use for text
byte backpen, // the background color
bool fillback, // Whether to fill the background
bool centerh, // Whether to center the text horizontally
bool centerv, // Whether to center the text vertically
bool output, // Whether to output any text
uint16 x1, uint16 y1, // Cords
uint16 x2, uint16 y2,
const char *text); // The text itself
uint32 flowTextScaled(void *font, /* the TextAttr pointer */
int16 spacing, /* How much vertical spacing between the lines */
byte pencolor, /* pen number to use for text */
byte backpen, /* the background color */
bool fillback, /* Whether to fill the background */
bool centerh, /* Whether to center the text horizontally */
bool centerv, /* Whether to center the text vertically */
bool output, /* Whether to output any text */
uint16 x1, uint16 y1, /* Cords */
uint16 x2, uint16 y2,
const char *text); /* The text itself */
uint32 flowTextScaled(
void *font, // the TextAttr pointer
int16 spacing, // How much vertical spacing between the lines
byte pencolor, // pen number to use for text
byte backpen, // the background color
bool fillback, // Whether to fill the background
bool centerh, // Whether to center the text horizontally
bool centerv, // Whether to center the text vertically
bool output, // Whether to output any text
uint16 x1, uint16 y1, // Cords
uint16 x2, uint16 y2,
const char *text); // The text itself
uint32 flowTextToMem(Image *destIm,
void *font, /* the TextAttr pointer */
int16 spacing, /* How much vertical spacing between the lines */
byte pencolor, /* pen number to use for text */
byte backpen, /* the background color */
bool fillback, /* Whether to fill the background */
bool centerh, /* Whether to center the text horizontally */
bool centerv, /* Whether to center the text vertically */
bool output, /* Whether to output any text */
uint16 x1, uint16 y1, /* Cords */
uint16 x2, uint16 y2,
const char *str); /* The text itself */
void *font, // the TextAttr pointer
int16 spacing, // How much vertical spacing between the lines
byte pencolor, // pen number to use for text
byte backpen, // the background color
bool fillback, // Whether to fill the background
bool centerh, // Whether to center the text horizontally
bool centerv, // Whether to center the text vertically
bool output, // Whether to output any text
uint16 x1, uint16 y1, // Cords
uint16 x2, uint16 y2,
const char *str); // The text itself
void drawHLine(uint16 x, uint16 y1, uint16 y2);
void drawVLine(uint16 x1, uint16 y, uint16 x2);

View File

@ -145,15 +145,18 @@ IntuiMessage *LabEngine::getMsg() {
IMessage._gadgetID = curgad->_gadgetID;
IMessage._qualifier = qualifiers;
return &IMessage;
} else if (_event->mouseButton(&IMessage._mouseX, &IMessage._mouseY, true)) { /* Left Button */
} else if (_event->mouseButton(&IMessage._mouseX, &IMessage._mouseY, true)) {
// Left Button
IMessage._qualifier = IEQUALIFIER_LEFTBUTTON | qualifiers;
IMessage._msgClass = MOUSEBUTTONS;
return &IMessage;
} else if (_event->mouseButton(&IMessage._mouseX, &IMessage._mouseY, false)) { /* Right Button */
} else if (_event->mouseButton(&IMessage._mouseX, &IMessage._mouseY, false)) {
// Right Button
IMessage._qualifier = IEQUALIFIER_RBUTTON | qualifiers;
IMessage._msgClass = MOUSEBUTTONS;
return &IMessage;
} else if (_event->keyPress(&IMessage._code)) { /* Keyboard key */
} else if (_event->keyPress(&IMessage._code)) {
// Keyboard key
curgad = checkNumGadgetHit(_event->_screenGadgetList, IMessage._code);
if (curgad) {

View File

@ -50,12 +50,12 @@ struct Gadget {
Image *_image, *_altImage;
};
/* Defines for the GadgetFlags portion */
// Defines for the GadgetFlags portion
#define GADGETOFF 0x01
typedef Common::List<Gadget *> GadgetList;
/* Defines for the Class variable in IntuiMessage */
// Defines for the Class variable in IntuiMessage
#define SIZEVERIFY 0x00000001
#define NEWSIZE 0x00000002
#define REFRESHWINDOW 0x00000004
@ -73,14 +73,14 @@ typedef Common::List<Gadget *> GadgetList;
#define NEWPREFS 0x00004000
#define DISKINSERTED 0x00008000
#define DISKREMOVED 0x00010000
#define WBENCHMESSAGE 0x00020000 /* System use only */
#define WBENCHMESSAGE 0x00020000 // System use only
#define ACTIVEWINDOW 0x00040000
#define INACTIVEWINDOW 0x00080000
#define DELTAMOVE 0x00100000
#define VANULLLAKEY 0x00200000
/* Defines for the Qualifier variable in IntuiMessage */
// Defines for the Qualifier variable in IntuiMessage
#define IEQUALIFIER_LSHIFT 0x0001
#define IEQUALIFIER_RSHIFT 0x0002
#define IEQUALIFIER_CAPSLOCK 0x0004
@ -103,9 +103,9 @@ typedef Common::List<Gadget *> GadgetList;
#define VKEY_LTARROW 276
/*---------------------------------------------------------------------------*/
/*--------------------------- Function Prototypes ---------------------------*/
/*---------------------------------------------------------------------------*/
//---------------------------------------------------------------------------
//--------------------------- Function Prototypes ---------------------------
//---------------------------------------------------------------------------
Gadget *createButton(uint16 x, uint16 y, uint16 id, uint16 key, Image *im, Image *imalt);
void freeButtonList(GadgetList *gadgetList);
@ -116,4 +116,4 @@ IntuiMessage *getMsg();
} // End of namespace Lab
#endif /* LAB_INTEFACE_H */
#endif // LAB_INTEFACE_H

View File

@ -132,7 +132,8 @@ public:
const char *_curFileName;
const char *_nextFileName;
const char *_newFileName; /* When ProcessRoom.c decides to change the filename of the current picture. */
// When ProcessRoom.c decides to change the filename of the current picture.
const char *_newFileName;
TextFont *_msgFont;
GadgetList _moveGadgetList;
GadgetList _invGadgetList;

View File

@ -40,7 +40,7 @@ namespace Lab {
class LabEngine;
/* Direction defines */
// Direction defines
#define NORTH 0
#define SOUTH 1
#define EAST 2
@ -53,9 +53,9 @@ struct SaveGameHeader {
uint16 _direction;
};
/*--------------------------*/
/*----- From saveGame.c ----*/
/*--------------------------*/
//--------------------------
//----- From saveGame.c ----
//--------------------------
bool saveGame(uint16 Direction, uint16 Quarters, int slot, Common::String desc);
bool loadGame(uint16 *Direction, uint16 *Quarters, int slot);
@ -63,4 +63,4 @@ bool readSaveGameHeader(Common::InSaveFile *in, SaveGameHeader &header);
} // End of namespace Lab
#endif /* LAB_LABFUN_H */
#endif // LAB_LABFUN_H

View File

@ -33,9 +33,9 @@
namespace Lab {
/*---------------------------*/
/*----- From LabSets.c ------*/
/*---------------------------*/
//---------------------------
//----- From LabSets.c ------
//---------------------------
class LabEngine;

View File

@ -415,8 +415,9 @@ void LabEngine::drawMap(uint16 CurRoom, uint16 CurMsg, uint16 Floor, bool fadeou
}
}
/* Makes sure the X is drawn in corridors */
/* NOTE: this here on purpose just in case there's some weird condition, like the surreal maze where there are no rooms */
// Makes sure the X is drawn in corridors
// NOTE: this here on purpose just in case there's some weird
// condition, like the surreal maze where there are no rooms
if ((Maps[CurRoom].PageNumber == Floor) && _roomsFound->in(CurRoom) && Maps[CurRoom].x)
drawRoom(CurRoom, true);
@ -483,7 +484,8 @@ void LabEngine::processMap(uint16 CurRoom) {
CurFloor = Maps[CurRoom].PageNumber;
while (1) {
_music->updateMusic(); /* Make sure we check the music at least after every message */
// Make sure we check the music at least after every message
_music->updateMusic();
Msg = getMsg();
if (Msg == NULL) {
@ -526,9 +528,11 @@ void LabEngine::processMap(uint16 CurRoom) {
return;
if (Class == GADGETUP) {
if (GadgetID == 0) { /* Quit menu button */
if (GadgetID == 0) {
// Quit menu button
return;
} else if (GadgetID == 1) { /* Up arrow */
} else if (GadgetID == 1) {
// Up arrow
OldFloor = CurFloor;
getUpFloor(&CurFloor, &drawmap);
@ -538,7 +542,8 @@ void LabEngine::processMap(uint16 CurRoom) {
_graphics->fade(true, 0);
} else
CurFloor = OldFloor;
} else if (GadgetID == 2) { /* Down arrow */
} else if (GadgetID == 2) {
// Down arrow
OldFloor = CurFloor;
getDownFloor(&CurFloor, &drawmap);

View File

@ -272,9 +272,12 @@ void Music::changeMusic(const char *newmusic) {
}
_file = g_lab->_resource->openDataFile(newmusic);
_musicOn = true; /* turn it off */
// turn music off
_musicOn = true;
setMusic(false);
_musicOn = false; /* turn it back on */
// turn it back on
_musicOn = false;
setMusic(true);
}

View File

@ -41,9 +41,9 @@ namespace Lab {
class LabEngine;
/*---------------------------*/
/*----- From LabMusic.c -----*/
/*---------------------------*/
//---------------------------
//----- From LabMusic.c -----
//---------------------------
#define MAXBUFFERS 5L
@ -98,4 +98,4 @@ private:
} // End of namespace Lab
#endif /* LAB_MUSIC_H */
#endif // LAB_MUSIC_H

View File

@ -39,12 +39,11 @@
namespace Lab {
/* Global parser data */
#define NOFILE "no file"
/*****************************************************************************/
/* Generates a random number. */
/*****************************************************************************/
/**
* Generates a random number.
*/
uint16 getRandom(uint16 max) {
uint32 secs, micros;
@ -52,9 +51,9 @@ uint16 getRandom(uint16 max) {
return ((micros + secs) % max);
}
/*****************************************************************************/
/* Checks whether all the conditions in a condition list are met. */
/*****************************************************************************/
/**
* Checks whether all the conditions in a condition list are met.
*/
static bool checkConditions(int16 *condition) {
if (condition == NULL)
return true;
@ -73,9 +72,9 @@ static bool checkConditions(int16 *condition) {
return res;
}
/*****************************************************************************/
/* Gets the current ViewDataPointer. */
/*****************************************************************************/
/**
* Gets the current ViewDataPointer.
*/
ViewData *getViewData(uint16 roomNum, uint16 direction) {
if (!g_lab->_rooms[roomNum]._roomMsg)
g_lab->_resource->readViews(roomNum);
@ -92,9 +91,9 @@ ViewData *getViewData(uint16 roomNum, uint16 direction) {
return view;
}
/*****************************************************************************/
/* Gets an object, if any, from the user's click on the screen. */
/*****************************************************************************/
/**
* Gets an object, if any, from the user's click on the screen.
*/
static CloseData *getObject(uint16 x, uint16 y, CloseDataPtr lcptr) {
if (lcptr == NULL) {
lcptr = getViewData(g_lab->_roomNum, g_lab->_direction)->_closeUps;
@ -113,12 +112,12 @@ static CloseData *getObject(uint16 x, uint16 y, CloseDataPtr lcptr) {
return NULL;
}
/*****************************************************************************/
/* Goes through the list of closeups to find a match. */
/* NYI: Known bug here. If there are two objects that have closeups, and */
/* some of the closeups have the same hit boxes, then this returns the */
/* first occurence of the object with the same hit box. */
/*****************************************************************************/
/**
* Goes through the list of closeups to find a match.
* NYI: Known bug here. If there are two objects that have closeups, and
* some of the closeups have the same hit boxes, then this returns the
* first occurence of the object with the same hit box.
*/
static CloseDataPtr findCPtrMatch(CloseDataPtr cpmain, CloseDataPtr list) {
CloseDataPtr cptr;
@ -139,9 +138,9 @@ static CloseDataPtr findCPtrMatch(CloseDataPtr cpmain, CloseDataPtr list) {
return NULL;
}
/*****************************************************************************/
/* Returns the current picture name. */
/*****************************************************************************/
/**
* Returns the current picture name.
*/
char *LabEngine::getPictName(CloseDataPtr *lcptr) {
ViewData *viewPtr = getViewData(g_lab->_roomNum, g_lab->_direction);
@ -155,9 +154,9 @@ char *LabEngine::getPictName(CloseDataPtr *lcptr) {
return viewPtr->_graphicName;
}
/*****************************************************************************/
/* Draws the current direction to the screen. */
/*****************************************************************************/
/**
* Draws the current direction to the screen.
*/
void LabEngine::drawDirection(CloseDataPtr lcptr) {
if (lcptr != NULL && lcptr->_message) {
_graphics->drawMessage(lcptr->_message);
@ -183,9 +182,9 @@ void LabEngine::drawDirection(CloseDataPtr lcptr) {
_graphics->drawMessage(message.c_str());
}
/*****************************************************************************/
/* process a arrow gadget movement. */
/*****************************************************************************/
/**
* process a arrow gadget movement.
*/
uint16 processArrow(uint16 curDirection, uint16 arrow) {
if (arrow == 1) { // Forward
uint16 room = 1;
@ -227,9 +226,9 @@ uint16 processArrow(uint16 curDirection, uint16 arrow) {
return curDirection;
}
/*****************************************************************************/
/* Sets the current close up data. */
/*****************************************************************************/
/**
* Sets the current close up data.
*/
void setCurClose(Common::Point pos, CloseDataPtr *cptr, bool useAbsoluteCoords) {
CloseDataPtr lcptr;
uint16 x1, y1, x2, y2;
@ -261,9 +260,9 @@ void setCurClose(Common::Point pos, CloseDataPtr *cptr, bool useAbsoluteCoords)
}
}
/*****************************************************************************/
/* Takes the currently selected item. */
/*****************************************************************************/
/**
* Takes the currently selected item.
*/
bool takeItem(uint16 x, uint16 y, CloseDataPtr *cptr) {
CloseDataPtr lcptr;
@ -290,9 +289,9 @@ bool takeItem(uint16 x, uint16 y, CloseDataPtr *cptr) {
return false;
}
/*****************************************************************************/
/* Processes the action list. */
/*****************************************************************************/
/**
* Processes the action list.
*/
void LabEngine::doActions(Action *aptr, CloseDataPtr *lcptr) {
while (aptr) {
_music->updateMusic();
@ -327,7 +326,8 @@ void LabEngine::doActions(Action *aptr, CloseDataPtr *lcptr) {
case LOADDIFF:
if (aptr->_data)
_graphics->loadPict((char *)aptr->_data); /* Puts a file into memory */
// Puts a file into memory
_graphics->loadPict((char *)aptr->_data);
break;
@ -520,7 +520,8 @@ void LabEngine::doActions(Action *aptr, CloseDataPtr *lcptr) {
_anim->_doBlack = (_cptr == NULL);
else if (aptr->_param1 == 2)
_anim->_doBlack = (_cptr != NULL);
else if (aptr->_param1 == 5) { /* inverse the palette */
else if (aptr->_param1 == 5) {
// inverse the palette
for (uint16 idx = (8 * 3); idx < (255 * 3); idx++)
_anim->_diffPalette[idx] = 255 - _anim->_diffPalette[idx];
@ -528,16 +529,19 @@ void LabEngine::doActions(Action *aptr, CloseDataPtr *lcptr) {
_graphics->setPalette(_anim->_diffPalette, 256);
waitTOF();
waitTOF();
} else if (aptr->_param1 == 4) { /* white the palette */
} else if (aptr->_param1 == 4) {
// white the palette
_graphics->whiteScreen();
waitTOF();
waitTOF();
} else if (aptr->_param1 == 6) { /* Restore the palette */
} else if (aptr->_param1 == 6) {
// Restore the palette
waitTOF();
_graphics->setPalette(_anim->_diffPalette, 256);
waitTOF();
waitTOF();
} else if (aptr->_param1 == 7) { /* Quick pause */
} else if (aptr->_param1 == 7) {
// Quick pause
waitTOF();
waitTOF();
waitTOF();
@ -563,9 +567,9 @@ void LabEngine::doActions(Action *aptr, CloseDataPtr *lcptr) {
_music->_doNotFilestopSoundEffect = false;
}
/*****************************************************************************/
/* Does the work for doActionRule. */
/*****************************************************************************/
/**
* Does the work for doActionRule.
*/
static bool doActionRuleSub(int16 action, int16 roomNum, CloseDataPtr lcptr, CloseDataPtr *set, bool allowDefaults) {
action++;
@ -595,9 +599,9 @@ static bool doActionRuleSub(int16 action, int16 roomNum, CloseDataPtr lcptr, Clo
return false;
}
/*****************************************************************************/
/* Goes through the rules if an action is taken. */
/*****************************************************************************/
/**
* Goes through the rules if an action is taken.
*/
bool doActionRule(Common::Point pos, int16 action, int16 roomNum, CloseDataPtr *lcptr) {
if (roomNum)
g_lab->_newFileName = NOFILE;
@ -618,9 +622,9 @@ bool doActionRule(Common::Point pos, int16 action, int16 roomNum, CloseDataPtr *
return false;
}
/*****************************************************************************/
/* Does the work for doActionRule. */
/*****************************************************************************/
/**
* Does the work for doActionRule.
*/
static bool doOperateRuleSub(int16 itemNum, int16 roomNum, CloseDataPtr lcptr, CloseDataPtr *set, bool allowDefaults) {
if (lcptr)
if (lcptr->_closeUpType > 0) {
@ -646,9 +650,9 @@ static bool doOperateRuleSub(int16 itemNum, int16 roomNum, CloseDataPtr lcptr, C
return false;
}
/*****************************************************************************/
/* Goes through the rules if the user tries to operate an item on an object. */
/*****************************************************************************/
/**
* Goes through the rules if the user tries to operate an item on an object.
*/
bool doOperateRule(int16 x, int16 y, int16 ItemNum, CloseDataPtr *lcptr) {
CloseDataPtr tlcptr;
@ -680,9 +684,9 @@ bool doOperateRule(int16 x, int16 y, int16 ItemNum, CloseDataPtr *lcptr) {
return false;
}
/*****************************************************************************/
/* Goes through the rules if the user tries to go forward. */
/*****************************************************************************/
/**
* Goes through the rules if the user tries to go forward.
*/
bool doGoForward(CloseDataPtr *lcptr) {
RuleList *rules = g_lab->_rooms[g_lab->_roomNum]._rules;
@ -698,9 +702,9 @@ bool doGoForward(CloseDataPtr *lcptr) {
return false;
}
/*****************************************************************************/
/* Goes through the rules if the user tries to turn. */
/*****************************************************************************/
/**
* Goes through the rules if the user tries to turn.
*/
bool doTurn(uint16 from, uint16 to, CloseDataPtr *lcptr) {
from++;
to++;
@ -721,9 +725,9 @@ bool doTurn(uint16 from, uint16 to, CloseDataPtr *lcptr) {
return false;
}
/*****************************************************************************/
/* Goes through the rules if the user tries to go to the main view */
/*****************************************************************************/
/**
* Goes through the rules if the user tries to go to the main view
*/
bool doMainView(CloseDataPtr *lcptr) {
RuleList *rules = g_lab->_rooms[g_lab->_roomNum]._rules;
for (RuleList::iterator rule = rules->begin(); rule != rules->end(); ++rule) {

View File

@ -33,7 +33,7 @@
namespace Lab {
/*------------------------------- Action types ------------------------------*/
//------------------------------- Action types ------------------------------
#define PLAYSOUND 1
#define PLAYSOUNDCONT 2
#define SHOWDIFF 3
@ -71,7 +71,7 @@ namespace Lab {
#define CSHOWMESSAGE 35
#define PLAYSOUNDB 36
/* Rule Types */
// Rule Types
#define ACTION 1
#define OPERATE 2
#define GOFORWARD 3
@ -80,7 +80,7 @@ namespace Lab {
#define GOMAINVIEW 6
#define TURNFROMTO 7
/*----------------------------- Rule Type Action ----------------------------*/
//----------------------------- Rule Type Action ----------------------------
#define TAKE 1
#define MOVE 2
#define OPENDOOR 3
@ -93,8 +93,8 @@ namespace Lab {
typedef struct CloseData {
uint16 x1, y1, x2, y2;
int16 _closeUpType; /* if > 0, an object. If < 0, an item */
uint16 _depth; /* Level of the closeup. */
int16 _closeUpType; // if > 0, an object. If < 0, an item
uint16 _depth; // Level of the closeup.
char *_graphicName;
char *_message;
CloseData *_nextCloseUp;
@ -115,7 +115,7 @@ struct Action {
int16 _param1;
int16 _param2;
int16 _param3;
byte *_data; /* Message, or a pointer to array of messages. */
byte *_data; // Message, or a pointer to array of messages.
Action *_nextAction;
};
@ -147,15 +147,15 @@ struct InventoryData {
char *_bitmapName;
};
/* Map Flags */
// Map Flags
/* Where the doors are; in a corridor, assumed to be left doors */
// Where the doors are; in a corridor, assumed to be left doors
#define NORTHDOOR 1L
#define EASTDOOR 2L
#define SOUTHDOOR 4L
#define WESTDOOR 8L
/* Where the doors are in corridors; M means middle, R means right, B means bottom */
// Where the doors are in corridors; M means middle, R means right, B means bottom
#define NORTHMDOOR 16L
#define NORTHRDOOR 32L
#define SOUTHMDOOR 64L
@ -166,7 +166,7 @@ struct InventoryData {
#define WESTMDOOR 64L
#define WESTBDOOR 128L
/* Special Map ID's */
// Special Map ID's
#define NORMAL 0
#define UPARROWROOM 1
#define DOWNARROWROOM 2
@ -203,4 +203,4 @@ bool doMainView(CloseDataPtr *lcptr);
} // End of namespace Lab
#endif /* LAB_PROCESSROOM_H */
#endif // LAB_PROCESSROOM_H

View File

@ -122,4 +122,4 @@ private:
} // End of namespace Lab
#endif /* LAB_RESOURCE_H */
#endif // LAB_RESOURCE_H

View File

@ -37,13 +37,9 @@
#include "lab/labfun.h"
namespace Lab {
// Labyrinth of Time ScummVM
#define SAVEGAME_ID MKTAG('L', 'O', 'T', 'S')
#define SAVEGAME_VERSION 1
/*----- The machine independent section of saveGame.c -----*/
void writeSaveGameHeader(Common::OutSaveFile *out, const Common::String &saveName) {
out->writeUint32BE(SAVEGAME_ID);

View File

@ -335,7 +335,8 @@ void LabEngine::processJournal() {
uint16 Qualifier, GadID;
while (1) {
_music->updateMusic(); /* Make sure we check the music at least after every message */
// Make sure we check the music at least after every message
_music->updateMusic();
Msg = getMsg();
if (Msg == NULL) {
@ -544,7 +545,8 @@ void LabEngine::processMonitor(char *ntext, TextFont *monitorFont, bool isintera
}
}
_music->updateMusic(); /* Make sure we check the music at least after every message */
// Make sure we check the music at least after every message
_music->updateMusic();
Msg = getMsg();
if (Msg == NULL) {

View File

@ -140,7 +140,8 @@ void LabEngine::changeTile(uint16 col, uint16 row) {
}
if (check) {
_conditions->inclElement(BRICKOPEN); /* unlocked combination */
// unlocked combination
_conditions->inclElement(BRICKOPEN);
_anim->_doBlack = true;
_graphics->readPict("p:Up/BDOpen", true);
}