LAB: More work on the comments

This commit is contained in:
Strangerke 2015-12-20 02:42:52 +01:00 committed by Willem Jan Palenstijn
parent ee4e67a731
commit 28c74aed05
9 changed files with 224 additions and 172 deletions

View file

@ -240,17 +240,11 @@ void Anim::diffNextFrame(bool onlyDiffData) {
} }
} }
/**
* Stops an animation from running.
*/
void Anim::stopDiff() { void Anim::stopDiff() {
if (_isPlaying && _isAnim) if (_isPlaying && _isAnim)
_vm->_graphics->blackScreen(); _vm->_graphics->blackScreen();
} }
/**
* Stops an animation from running.
*/
void Anim::stopDiffEnd() { void Anim::stopDiffEnd() {
if (!_isPlaying) if (!_isPlaying)
return; return;
@ -262,9 +256,6 @@ void Anim::stopDiffEnd() {
} }
} }
/**
* Reads in a DIFF file.
*/
void Anim::readDiff(Common::File *diffFile, bool playOnce, bool onlyDiffData) { void Anim::readDiff(Common::File *diffFile, bool playOnce, bool onlyDiffData) {
_playOnce = playOnce; _playOnce = playOnce;
_delayMicros = 0; _delayMicros = 0;

View file

@ -83,9 +83,20 @@ public:
bool _noPalChange; // Don't change the palette. bool _noPalChange; // Don't change the palette.
BitMap _rawDiffBM; BitMap _rawDiffBM;
/**
* Reads in a DIFF file.
*/
void readDiff(Common::File *diffFile, bool playOnce, bool onlyDiffData = false); void readDiff(Common::File *diffFile, bool playOnce, bool onlyDiffData = false);
void diffNextFrame(bool onlyDiffData = false); void diffNextFrame(bool onlyDiffData = false);
/**
* Stops an animation from running.
*/
void stopDiff(); void stopDiff();
/**
* Stops an animation from running.
*/
void stopDiffEnd(); void stopDiffEnd();
}; };

View file

@ -120,9 +120,6 @@ void LabEngine::setQuarters(uint16 quarters) {
_inventory[kItemQuarter]._quantity = quarters; _inventory[kItemQuarter]._quantity = quarters;
} }
/**
* Draws the message for the room.
*/
void LabEngine::drawRoomMessage(uint16 curInv, CloseDataPtr closePtr) { void LabEngine::drawRoomMessage(uint16 curInv, CloseDataPtr closePtr) {
if (_lastTooLong) { if (_lastTooLong) {
_lastTooLong = false; _lastTooLong = false;
@ -158,9 +155,6 @@ void LabEngine::freeScreens() {
} }
} }
/**
* Permanently flips the imagery of a button.
*/
void LabEngine::perFlipButton(uint16 buttonId) { void LabEngine::perFlipButton(uint16 buttonId) {
for (ButtonList::iterator button = _moveButtonList.begin(); button != _moveButtonList.end(); ++button) { for (ButtonList::iterator button = _moveButtonList.begin(); button != _moveButtonList.end(); ++button) {
Button *topButton = *button; Button *topButton = *button;
@ -180,9 +174,6 @@ void LabEngine::perFlipButton(uint16 buttonId) {
} }
} }
/**
* Eats all the available messages.
*/
void LabEngine::eatMessages() { void LabEngine::eatMessages() {
IntuiMessage *msg; IntuiMessage *msg;
@ -191,9 +182,6 @@ void LabEngine::eatMessages() {
} while (msg && !g_engine->shouldQuit()); } while (msg && !g_engine->shouldQuit());
} }
/**
* Checks whether the close up is one of the special case closeups.
*/
bool LabEngine::doCloseUp(CloseDataPtr closePtr) { bool LabEngine::doCloseUp(CloseDataPtr closePtr) {
if (!closePtr) if (!closePtr)
return false; return false;
@ -258,9 +246,6 @@ bool LabEngine::doCloseUp(CloseDataPtr closePtr) {
return true; return true;
} }
/**
* Gets the current inventory name.
*/
Common::String LabEngine::getInvName(uint16 curInv) { Common::String LabEngine::getInvName(uint16 curInv) {
if (_mainDisplay) if (_mainDisplay)
return _inventory[curInv]._bitmapName; return _inventory[curInv]._bitmapName;
@ -288,9 +273,6 @@ Common::String LabEngine::getInvName(uint16 curInv) {
return _inventory[curInv]._bitmapName; return _inventory[curInv]._bitmapName;
} }
/**
* Turns the interface off.
*/
void LabEngine::interfaceOff() { void LabEngine::interfaceOff() {
if (!_interfaceOff) { if (!_interfaceOff) {
_event->attachButtonList(nullptr); _event->attachButtonList(nullptr);
@ -299,9 +281,6 @@ void LabEngine::interfaceOff() {
} }
} }
/**
* Turns the interface on.
*/
void LabEngine::interfaceOn() { void LabEngine::interfaceOn() {
if (_interfaceOff) { if (_interfaceOff) {
_interfaceOff = false; _interfaceOff = false;
@ -316,9 +295,6 @@ void LabEngine::interfaceOn() {
_event->attachButtonList(&_moveButtonList); _event->attachButtonList(&_moveButtonList);
} }
/**
* If the user hits the "Use" button; things that can get used on themselves.
*/
bool LabEngine::doUse(uint16 curInv) { bool LabEngine::doUse(uint16 curInv) {
switch (curInv) { switch (curInv) {
case kItemMap: case kItemMap:
@ -385,9 +361,6 @@ bool LabEngine::doUse(uint16 curInv) {
} }
} }
/**
* Decrements the current inventory number.
*/
void LabEngine::decIncInv(uint16 *curInv, bool decreaseFl) { void LabEngine::decIncInv(uint16 *curInv, bool decreaseFl) {
int8 step = (decreaseFl) ? -1 : 1; int8 step = (decreaseFl) ? -1 : 1;
uint newInv = *curInv + step; uint newInv = *curInv + step;
@ -417,9 +390,6 @@ void LabEngine::decIncInv(uint16 *curInv, bool decreaseFl) {
} }
} }
/**
* The main game loop.
*/
void LabEngine::mainGameLoop() { void LabEngine::mainGameLoop() {
uint16 actionMode = 4; uint16 actionMode = 4;
uint16 curInv = kItemMap; uint16 curInv = kItemMap;
@ -1148,9 +1118,6 @@ void LabEngine::go() {
_music->freeMusic(); _music->freeMusic();
} }
/**
* New code to allow quick(er) return navigation in game.
*/
int LabEngine::followCrumbs() { int LabEngine::followCrumbs() {
// NORTH, SOUTH, EAST, WEST // NORTH, SOUTH, EAST, WEST
int movement[4][4] = { int movement[4][4] = {

View file

@ -45,10 +45,6 @@ Intro::Intro(LabEngine *vm) : _vm(vm) {
_introDoBlack = false; _introDoBlack = false;
} }
/**
* Goes through, and responds to all the intuition messages currently in the
* message queue.
*/
void Intro::introEatMessages() { void Intro::introEatMessages() {
while (1) { while (1) {
IntuiMessage *msg = _vm->_event->getMsg(); IntuiMessage *msg = _vm->_event->getMsg();
@ -67,9 +63,6 @@ void Intro::introEatMessages() {
} }
} }
/**
* Reads in a picture.
*/
void Intro::doPictText(const char *filename, TextFont *msgFont, bool isScreen) { void Intro::doPictText(const char *filename, TextFont *msgFont, bool isScreen) {
Common::String path = Common::String("Lab:rooms/Intro/") + filename; Common::String path = Common::String("Lab:rooms/Intro/") + filename;
@ -196,9 +189,6 @@ void Intro::doPictText(const char *filename, TextFont *msgFont, bool isScreen) {
} // while(1) } // while(1)
} }
/**
* Does a one second delay, but checks the music while doing it.
*/
void Intro::musicDelay() { void Intro::musicDelay() {
_vm->_music->updateMusic(); _vm->_music->updateMusic();
@ -227,9 +217,6 @@ void Intro::nReadPict(const char *filename, bool playOnce) {
_vm->_graphics->readPict(finalFileName.c_str(), playOnce); _vm->_graphics->readPict(finalFileName.c_str(), playOnce);
} }
/**
* Does the introduction sequence for Labyrinth.
*/
void Intro::introSequence() { void Intro::introSequence() {
uint16 palette[16] = { uint16 palette[16] = {
0x0000, 0x0855, 0x0FF9, 0x0EE7, 0x0000, 0x0855, 0x0FF9, 0x0EE7,

View file

@ -36,11 +36,27 @@ namespace Lab {
class Intro { class Intro {
public: public:
Intro(LabEngine *vm); Intro(LabEngine *vm);
/**
* Does the introduction sequence for Labyrinth.
*/
void introSequence(); void introSequence();
private: private:
/**
* Goes through, and responds to all the intuition messages currently in the
* message queue.
*/
void introEatMessages(); void introEatMessages();
/**
* Reads in a picture.
*/
void doPictText(const char *Filename, TextFont *msgFont, bool isscreen); void doPictText(const char *Filename, TextFont *msgFont, bool isscreen);
/**
* Does a one second delay, but checks the music while doing it.
*/
void musicDelay(); void musicDelay();
void nReadPict(const char *Filename, bool PlayOnce); void nReadPict(const char *Filename, bool PlayOnce);

View file

@ -188,6 +188,10 @@ public:
void changeVolume(int delta); void changeVolume(int delta);
uint16 getDirection() { return _direction; } uint16 getDirection() { return _direction; }
/**
* Returns the current picture name.
*/
Common::String getPictName(CloseDataPtr *closePtrList); Common::String getPictName(CloseDataPtr *closePtrList);
uint16 getQuarters(); uint16 getQuarters();
void setDirection(uint16 direction) { _direction = direction; }; void setDirection(uint16 direction) { _direction = direction; };
@ -195,61 +199,254 @@ public:
void waitTOF(); void waitTOF();
private: private:
/**
* Checks whether all the conditions in a condition list are met.
*/
bool checkConditions(int16 *condition); bool checkConditions(int16 *condition);
/**
* Decrements the current inventory number.
*/
void decIncInv(uint16 *CurInv, bool dec); void decIncInv(uint16 *CurInv, bool dec);
/**
* Processes the action list.
*/
void doActions(Action *actionList, CloseDataPtr *closePtrList); void doActions(Action *actionList, CloseDataPtr *closePtrList);
/**
* Goes through the rules if an action is taken.
*/
bool doActionRule(Common::Point pos, int16 action, int16 roomNum, CloseDataPtr *closePtrList); bool doActionRule(Common::Point pos, int16 action, int16 roomNum, CloseDataPtr *closePtrList);
/**
* Does the work for doActionRule.
*/
bool doActionRuleSub(int16 action, int16 roomNum, CloseDataPtr closePtr, CloseDataPtr *setCloseList, bool allowDefaults); bool doActionRuleSub(int16 action, int16 roomNum, CloseDataPtr closePtr, CloseDataPtr *setCloseList, bool allowDefaults);
/**
* Checks whether the close up is one of the special case closeups.
*/
bool doCloseUp(CloseDataPtr closePtr); bool doCloseUp(CloseDataPtr closePtr);
/**
* Goes through the rules if the user tries to go forward.
*/
bool doGoForward(CloseDataPtr *closePtrList); bool doGoForward(CloseDataPtr *closePtrList);
/**
* Does the journal processing.
*/
void doJournal(); void doJournal();
/**
* Goes through the rules if the user tries to go to the main view
*/
bool doMainView(CloseDataPtr *closePtrList); bool doMainView(CloseDataPtr *closePtrList);
/**
* Does the map processing.
*/
void doMap(uint16 curRoom); void doMap(uint16 curRoom);
/**
* Does what's necessary for the monitor.
*/
void doMonitor(Common::String background, Common::String textfile, bool isinteractive, Common::Rect textRect); void doMonitor(Common::String background, Common::String textfile, bool isinteractive, Common::Rect textRect);
/**
* Does the things to properly set up the detective notes.
*/
void doNotes(); void doNotes();
/**
* Does the work for doActionRule.
*/
bool doOperateRuleSub(int16 itemNum, int16 roomNum, CloseDataPtr closePtr, CloseDataPtr *setCloseList, bool allowDefaults); bool doOperateRuleSub(int16 itemNum, int16 roomNum, CloseDataPtr closePtr, CloseDataPtr *setCloseList, bool allowDefaults);
/**
* Goes through the rules if the user tries to operate an item on an object.
*/
bool doOperateRule(Common::Point pos, int16 ItemNum, CloseDataPtr *closePtrList); bool doOperateRule(Common::Point pos, int16 ItemNum, CloseDataPtr *closePtrList);
/**
* Goes through the rules if the user tries to turn.
*/
bool doTurn(uint16 from, uint16 to, CloseDataPtr *closePtrList); bool doTurn(uint16 from, uint16 to, CloseDataPtr *closePtrList);
/**
* If the user hits the "Use" button; things that can get used on themselves.
*/
bool doUse(uint16 curInv); bool doUse(uint16 curInv);
/**
* Does the things to properly set up the old west newspaper. Assumes that
* OpenHiRes already called.
*/
void doWestPaper(); void doWestPaper();
/**
* Draws the current direction to the screen.
*/
void drawDirection(CloseDataPtr closePtr); void drawDirection(CloseDataPtr closePtr);
/**
* Draws the journal from page x.
*/
void drawJournal(uint16 wipenum, bool needFade); void drawJournal(uint16 wipenum, bool needFade);
/**
* Draws the text to the back journal screen to the appropriate Page number
*/
void drawJournalText(); void drawJournalText();
/**
* Draws the map
*/
void drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fadeOut, bool fadeIn); void drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fadeOut, bool fadeIn);
/**
* Draws the text for the monitor.
*/
void drawMonText(char *text, TextFont *monitorFont, Common::Rect textRect, bool isinteractive); void drawMonText(char *text, TextFont *monitorFont, Common::Rect textRect, bool isinteractive);
/**
* Draws a room map.
*/
void drawRoomMap(uint16 curRoom, bool drawMarkFl); void drawRoomMap(uint16 curRoom, bool drawMarkFl);
/**
* Draws the message for the room.
*/
void drawRoomMessage(uint16 curInv, CloseDataPtr closePtr); void drawRoomMessage(uint16 curInv, CloseDataPtr closePtr);
void drawStaticMessage(byte index); void drawStaticMessage(byte index);
/**
* Eats all the available messages.
*/
void eatMessages(); void eatMessages();
/**
* Goes through the list of closeups to find a match.
* @note 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
* occurrence of the object with the same hit box.
*/
CloseDataPtr findClosePtrMatch(CloseDataPtr closePtr, CloseDataPtr closePtrList); CloseDataPtr findClosePtrMatch(CloseDataPtr closePtr, CloseDataPtr closePtrList);
/**
* Checks if a floor has been visited.
*/
bool floorVisited(uint16 floorNum); bool floorVisited(uint16 floorNum);
/**
* New code to allow quick(er) return navigation in game.
*/
int followCrumbs(); int followCrumbs();
void freeMapData(); void freeMapData();
void freeScreens(); void freeScreens();
bool fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Common::Point tmpPos, bool fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Common::Point tmpPos,
uint16 &curInv, IntuiMessage *curMsg, bool &forceDraw, uint16 buttonId, uint16 &actionMode); uint16 &curInv, IntuiMessage *curMsg, bool &forceDraw, uint16 buttonId, uint16 &actionMode);
/**
* Gets the current inventory name.
*/
Common::String getInvName(uint16 curInv); Common::String getInvName(uint16 curInv);
/**
* Returns the floor to show when the down arrow is pressed
* @note The original did not show all the visited floors, but we do
*/
uint16 getLowerFloor(uint16 floorNum); uint16 getLowerFloor(uint16 floorNum);
/**
* Gets an object, if any, from the user's click on the screen.
*/
CloseData *getObject(Common::Point pos, CloseDataPtr closePtr); CloseData *getObject(Common::Point pos, CloseDataPtr closePtr);
/**
* Returns the floor to show when the up arrow is pressed
* @note The original did not show all the visited floors, but we do
*/
uint16 getUpperFloor(uint16 floorNum); uint16 getUpperFloor(uint16 floorNum);
/**
* Gets the current ViewDataPointer.
*/
ViewData *getViewData(uint16 roomNum, uint16 direction); ViewData *getViewData(uint16 roomNum, uint16 direction);
/**
* Turns the interface off.
*/
void interfaceOff(); void interfaceOff();
/**
* Turns the interface on.
*/
void interfaceOn(); void interfaceOn();
/**
* Loads in the data for the journal.
*/
void loadJournalData(); void loadJournalData();
/**
* Loads in the map data.
*/
void loadMapData(); void loadMapData();
/**
* The main game loop.
*/
void mainGameLoop(); void mainGameLoop();
void showLab2Teaser(); void showLab2Teaser();
void mayShowCrumbIndicator(); void mayShowCrumbIndicator();
void mayShowCrumbIndicatorOff(); void mayShowCrumbIndicatorOff();
/**
* Permanently flips the imagery of a button.
*/
void perFlipButton(uint16 buttonId); void perFlipButton(uint16 buttonId);
/**
* process a arrow button movement.
*/
uint16 processArrow(uint16 curDirection, uint16 arrow); uint16 processArrow(uint16 curDirection, uint16 arrow);
/**
* Processes user input.
*/
void processJournal(); void processJournal();
/**
* Processes the map.
*/
void processMap(uint16 curRoom); void processMap(uint16 curRoom);
/**
* Processes user input.
*/
void processMonitor(char *ntext, TextFont *monitorFont, bool isInteractive, Common::Rect textRect); void processMonitor(char *ntext, TextFont *monitorFont, bool isInteractive, Common::Rect textRect);
/**
* Figures out what a room's coordinates should be.
*/
Common::Rect roomCoords(uint16 curRoom); Common::Rect roomCoords(uint16 curRoom);
bool saveRestoreGame(); bool saveRestoreGame();
/**
* Sets the current close up data.
*/
void setCurrentClose(Common::Point pos, CloseDataPtr *closePtrList, bool useAbsoluteCoords); void setCurrentClose(Common::Point pos, CloseDataPtr *closePtrList, bool useAbsoluteCoords);
/**
* Takes the currently selected item.
*/
bool takeItem(Common::Point pos, CloseDataPtr *closePtrList); bool takeItem(Common::Point pos, CloseDataPtr *closePtrList);
/**
* Does the turn page wipe.
*/
void turnPage(bool fromLeft); void turnPage(bool fromLeft);
bool processKey(IntuiMessage *curMsg, uint32 &msgClass, uint16 &qualifier, Common::Point &curPos, uint16 &curInv, bool &forceDraw, uint16 code); bool processKey(IntuiMessage *curMsg, uint32 &msgClass, uint16 &qualifier, Common::Point &curPos, uint16 &curInv, bool &forceDraw, uint16 code);
void processMainButton(uint16 &curInv, uint16 &lastInv, uint16 &oldDirection, bool &forceDraw, uint16 buttonId, uint16 &actionMode); void processMainButton(uint16 &curInv, uint16 &lastInv, uint16 &oldDirection, bool &forceDraw, uint16 buttonId, uint16 &actionMode);

View file

@ -56,9 +56,6 @@ enum MapFloor {
kFloorCarnival kFloorCarnival
}; };
/**
* Loads in the map data.
*/
void LabEngine::loadMapData() { void LabEngine::loadMapData() {
Common::File *mapImages = _resource->openDataFile("P:MapImage"); Common::File *mapImages = _resource->openDataFile("P:MapImage");
@ -134,9 +131,6 @@ void LabEngine::freeMapData() {
_maps = nullptr; _maps = nullptr;
} }
/**
* Figures out what a room's coordinates should be.
*/
Common::Rect LabEngine::roomCoords(uint16 curRoom) { Common::Rect LabEngine::roomCoords(uint16 curRoom) {
Image *curRoomImg = nullptr; Image *curRoomImg = nullptr;
@ -173,9 +167,6 @@ Common::Rect LabEngine::roomCoords(uint16 curRoom) {
return Common::Rect(x1, y1, x2, y2); return Common::Rect(x1, y1, x2, y2);
} }
/**
* Draws a room map.
*/
void LabEngine::drawRoomMap(uint16 curRoom, bool drawMarkFl) { void LabEngine::drawRoomMap(uint16 curRoom, bool drawMarkFl) {
uint16 drawX, drawY, offset; uint16 drawX, drawY, offset;
@ -307,9 +298,6 @@ void LabEngine::drawRoomMap(uint16 curRoom, bool drawMarkFl) {
_imgMapX[_direction]->drawImage(drawX, drawY); _imgMapX[_direction]->drawImage(drawX, drawY);
} }
/**
* Checks if a floor has been visited.
*/
bool LabEngine::floorVisited(uint16 floorNum) { bool LabEngine::floorVisited(uint16 floorNum) {
for (uint16 i = 1; i <= _maxRooms; i++) { for (uint16 i = 1; i <= _maxRooms; i++) {
if ((_maps[i]._pageNumber == floorNum) && _roomsFound->in(i) && _maps[i]._x) if ((_maps[i]._pageNumber == floorNum) && _roomsFound->in(i) && _maps[i]._x)
@ -319,10 +307,6 @@ bool LabEngine::floorVisited(uint16 floorNum) {
return false; return false;
} }
/**
* Returns the floor to show when the up arrow is pressed
* Note: The original did not show all the visited floors, but we do
*/
uint16 LabEngine::getUpperFloor(uint16 floorNum) { uint16 LabEngine::getUpperFloor(uint16 floorNum) {
if ((floorNum == kFloorCarnival) || (floorNum == kFloorNone)) if ((floorNum == kFloorCarnival) || (floorNum == kFloorNone))
return kFloorNone; return kFloorNone;
@ -334,10 +318,6 @@ uint16 LabEngine::getUpperFloor(uint16 floorNum) {
return kFloorNone; return kFloorNone;
} }
/**
* Returns the floor to show when the down arrow is pressed
* Note: The original did not show all the visited floors, but we do
*/
uint16 LabEngine::getLowerFloor(uint16 floorNum) { uint16 LabEngine::getLowerFloor(uint16 floorNum) {
if ((floorNum == kFloorLower) || (floorNum == kFloorNone)) if ((floorNum == kFloorLower) || (floorNum == kFloorNone))
return kFloorNone; return kFloorNone;
@ -349,9 +329,6 @@ uint16 LabEngine::getLowerFloor(uint16 floorNum) {
return kFloorNone; return kFloorNone;
} }
/**
* Draws the map
*/
void LabEngine::drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fadeOut, bool fadeIn) { void LabEngine::drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fadeOut, bool fadeIn) {
_event->mouseHide(); _event->mouseHide();
@ -413,9 +390,6 @@ void LabEngine::drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fad
_event->mouseShow(); _event->mouseShow();
} }
/**
* Processes the map.
*/
void LabEngine::processMap(uint16 curRoom) { void LabEngine::processMap(uint16 curRoom) {
byte place = 1; byte place = 1;
uint16 curMsg = curRoom; uint16 curMsg = curRoom;
@ -570,9 +544,6 @@ void LabEngine::processMap(uint16 curRoom) {
} }
} }
/**
* Does the map processing.
*/
void LabEngine::doMap(uint16 curRoom) { void LabEngine::doMap(uint16 curRoom) {
static uint16 amigaMapPalette[] = { static uint16 amigaMapPalette[] = {
0x0BA8, 0x0C11, 0x0A74, 0x0076, 0x0BA8, 0x0C11, 0x0A74, 0x0076,

View file

@ -44,9 +44,6 @@ namespace Lab {
#define NOFILE "no file" #define NOFILE "no file"
/**
* Checks whether all the conditions in a condition list are met.
*/
bool LabEngine::checkConditions(int16 *condition) { bool LabEngine::checkConditions(int16 *condition) {
if (!condition) if (!condition)
return true; return true;
@ -65,9 +62,6 @@ bool LabEngine::checkConditions(int16 *condition) {
return res; return res;
} }
/**
* Gets the current ViewDataPointer.
*/
ViewData *LabEngine::getViewData(uint16 roomNum, uint16 direction) { ViewData *LabEngine::getViewData(uint16 roomNum, uint16 direction) {
if (_rooms[roomNum]._roomMsg == "") if (_rooms[roomNum]._roomMsg == "")
_resource->readViews(roomNum); _resource->readViews(roomNum);
@ -84,9 +78,6 @@ ViewData *LabEngine::getViewData(uint16 roomNum, uint16 direction) {
return view; return view;
} }
/**
* Gets an object, if any, from the user's click on the screen.
*/
CloseData *LabEngine::getObject(Common::Point pos, CloseDataPtr closePtr) { CloseData *LabEngine::getObject(Common::Point pos, CloseDataPtr closePtr) {
CloseDataPtr wrkClosePtr; CloseDataPtr wrkClosePtr;
if (!closePtr) if (!closePtr)
@ -106,12 +97,6 @@ CloseData *LabEngine::getObject(Common::Point pos, CloseDataPtr closePtr) {
return nullptr; return nullptr;
} }
/**
* 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 occurrence of the object with the same hit box.
*/
CloseDataPtr LabEngine::findClosePtrMatch(CloseDataPtr closePtr, CloseDataPtr closePtrList) { CloseDataPtr LabEngine::findClosePtrMatch(CloseDataPtr closePtr, CloseDataPtr closePtrList) {
CloseDataPtr resClosePtr; CloseDataPtr resClosePtr;
@ -132,9 +117,6 @@ CloseDataPtr LabEngine::findClosePtrMatch(CloseDataPtr closePtr, CloseDataPtr cl
return nullptr; return nullptr;
} }
/**
* Returns the current picture name.
*/
Common::String LabEngine::getPictName(CloseDataPtr *closePtrList) { Common::String LabEngine::getPictName(CloseDataPtr *closePtrList) {
ViewData *viewPtr = getViewData(_roomNum, _direction); ViewData *viewPtr = getViewData(_roomNum, _direction);
@ -148,9 +130,6 @@ Common::String LabEngine::getPictName(CloseDataPtr *closePtrList) {
return viewPtr->_graphicName; return viewPtr->_graphicName;
} }
/**
* Draws the current direction to the screen.
*/
void LabEngine::drawDirection(CloseDataPtr closePtr) { void LabEngine::drawDirection(CloseDataPtr closePtr) {
if (closePtr && closePtr->_message != "") { if (closePtr && closePtr->_message != "") {
_graphics->drawMessage(closePtr->_message.c_str()); _graphics->drawMessage(closePtr->_message.c_str());
@ -176,9 +155,6 @@ void LabEngine::drawDirection(CloseDataPtr closePtr) {
_graphics->drawMessage(message.c_str()); _graphics->drawMessage(message.c_str());
} }
/**
* process a arrow button movement.
*/
uint16 LabEngine::processArrow(uint16 curDirection, uint16 arrow) { uint16 LabEngine::processArrow(uint16 curDirection, uint16 arrow) {
if (arrow == 1) { // Forward if (arrow == 1) { // Forward
uint16 room = _rooms[_roomNum]._doors[curDirection]; uint16 room = _rooms[_roomNum]._doors[curDirection];
@ -210,9 +186,6 @@ uint16 LabEngine::processArrow(uint16 curDirection, uint16 arrow) {
return curDirection; return curDirection;
} }
/**
* Sets the current close up data.
*/
void LabEngine::setCurrentClose(Common::Point pos, CloseDataPtr *closePtrList, bool useAbsoluteCoords) { void LabEngine::setCurrentClose(Common::Point pos, CloseDataPtr *closePtrList, bool useAbsoluteCoords) {
CloseDataPtr closePtr; CloseDataPtr closePtr;
@ -237,9 +210,6 @@ void LabEngine::setCurrentClose(Common::Point pos, CloseDataPtr *closePtrList, b
} }
} }
/**
* Takes the currently selected item.
*/
bool LabEngine::takeItem(Common::Point pos, CloseDataPtr *closePtrList) { bool LabEngine::takeItem(Common::Point pos, CloseDataPtr *closePtrList) {
CloseDataPtr closePtr; CloseDataPtr closePtr;
@ -265,9 +235,6 @@ bool LabEngine::takeItem(Common::Point pos, CloseDataPtr *closePtrList) {
return false; return false;
} }
/**
* Processes the action list.
*/
void LabEngine::doActions(Action *actionList, CloseDataPtr *closePtrList) { void LabEngine::doActions(Action *actionList, CloseDataPtr *closePtrList) {
while (actionList) { while (actionList) {
_music->updateMusic(); _music->updateMusic();
@ -539,9 +506,6 @@ void LabEngine::doActions(Action *actionList, CloseDataPtr *closePtrList) {
} }
} }
/**
* Does the work for doActionRule.
*/
bool LabEngine::doActionRuleSub(int16 action, int16 roomNum, CloseDataPtr closePtr, CloseDataPtr *setCloseList, bool allowDefaults) { bool LabEngine::doActionRuleSub(int16 action, int16 roomNum, CloseDataPtr closePtr, CloseDataPtr *setCloseList, bool allowDefaults) {
action++; action++;
@ -571,9 +535,6 @@ bool LabEngine::doActionRuleSub(int16 action, int16 roomNum, CloseDataPtr closeP
return false; return false;
} }
/**
* Goes through the rules if an action is taken.
*/
bool LabEngine::doActionRule(Common::Point pos, int16 action, int16 roomNum, CloseDataPtr *closePtrList) { bool LabEngine::doActionRule(Common::Point pos, int16 action, int16 roomNum, CloseDataPtr *closePtrList) {
if (roomNum) if (roomNum)
_newFileName = NOFILE; _newFileName = NOFILE;
@ -594,9 +555,6 @@ bool LabEngine::doActionRule(Common::Point pos, int16 action, int16 roomNum, Clo
return false; return false;
} }
/**
* Does the work for doActionRule.
*/
bool LabEngine::doOperateRuleSub(int16 itemNum, int16 roomNum, CloseDataPtr closePtr, CloseDataPtr *setCloseList, bool allowDefaults) { bool LabEngine::doOperateRuleSub(int16 itemNum, int16 roomNum, CloseDataPtr closePtr, CloseDataPtr *setCloseList, bool allowDefaults) {
if (closePtr) if (closePtr)
if (closePtr->_closeUpType > 0) { if (closePtr->_closeUpType > 0) {
@ -622,9 +580,6 @@ bool LabEngine::doOperateRuleSub(int16 itemNum, int16 roomNum, CloseDataPtr clos
return false; return false;
} }
/**
* Goes through the rules if the user tries to operate an item on an object.
*/
bool LabEngine::doOperateRule(Common::Point pos, int16 ItemNum, CloseDataPtr *closePtrList) { bool LabEngine::doOperateRule(Common::Point pos, int16 ItemNum, CloseDataPtr *closePtrList) {
_newFileName = NOFILE; _newFileName = NOFILE;
CloseDataPtr closePtr = getObject(pos, *closePtrList); CloseDataPtr closePtr = getObject(pos, *closePtrList);
@ -653,9 +608,6 @@ bool LabEngine::doOperateRule(Common::Point pos, int16 ItemNum, CloseDataPtr *cl
return false; return false;
} }
/**
* Goes through the rules if the user tries to go forward.
*/
bool LabEngine::doGoForward(CloseDataPtr *closePtrList) { bool LabEngine::doGoForward(CloseDataPtr *closePtrList) {
RuleList *rules = _rooms[_roomNum]._rules; RuleList *rules = _rooms[_roomNum]._rules;
@ -672,9 +624,6 @@ bool LabEngine::doGoForward(CloseDataPtr *closePtrList) {
return false; return false;
} }
/**
* Goes through the rules if the user tries to turn.
*/
bool LabEngine::doTurn(uint16 from, uint16 to, CloseDataPtr *closePtrList) { bool LabEngine::doTurn(uint16 from, uint16 to, CloseDataPtr *closePtrList) {
from++; from++;
to++; to++;
@ -695,9 +644,6 @@ bool LabEngine::doTurn(uint16 from, uint16 to, CloseDataPtr *closePtrList) {
return false; return false;
} }
/**
* Goes through the rules if the user tries to go to the main view
*/
bool LabEngine::doMainView(CloseDataPtr *closePtrList) { bool LabEngine::doMainView(CloseDataPtr *closePtrList) {
RuleList *rules = _rooms[_roomNum]._rules; RuleList *rules = _rooms[_roomNum]._rules;
for (RuleList::iterator rule = rules->begin(); rule != rules->end(); ++rule) { for (RuleList::iterator rule = rules->begin(); rule != rules->end(); ++rule) {

View file

@ -47,9 +47,6 @@ namespace Lab {
#define NONEWS 135 #define NONEWS 135
#define NOCLEAN 152 #define NOCLEAN 152
/**
* Does the things to properly set up the detective notes.
*/
void LabEngine::doNotes() { void LabEngine::doNotes() {
TextFont *noteFont = _resource->getFont("F:Note.fon"); TextFont *noteFont = _resource->getFont("F:Note.fon");
Common::String noteText = _resource->getText("Lab:Rooms/Notes"); Common::String noteText = _resource->getText("Lab:Rooms/Notes");
@ -60,10 +57,6 @@ void LabEngine::doNotes() {
_graphics->closeFont(&noteFont); _graphics->closeFont(&noteFont);
} }
/**
* Does the things to properly set up the old west newspaper. Assumes that
* OpenHiRes already called.
*/
void LabEngine::doWestPaper() { void LabEngine::doWestPaper() {
TextFont *paperFont = _resource->getFont("F:News22.fon"); TextFont *paperFont = _resource->getFont("F:News22.fon");
Common::String paperText = _resource->getText("Lab:Rooms/Date"); Common::String paperText = _resource->getText("Lab:Rooms/Date");
@ -100,9 +93,6 @@ void LabEngine::doWestPaper() {
_graphics->setPalette(_anim->_diffPalette, 256); _graphics->setPalette(_anim->_diffPalette, 256);
} }
/**
* Loads in the data for the journal.
*/
void LabEngine::loadJournalData() { void LabEngine::loadJournalData() {
if (_journalFont) if (_journalFont)
_graphics->closeFont(&_journalFont); _graphics->closeFont(&_journalFont);
@ -158,9 +148,6 @@ void LabEngine::loadJournalData() {
_screenImage->_imageData = _graphics->getCurrentDrawingBuffer(); _screenImage->_imageData = _graphics->getCurrentDrawingBuffer();
} }
/**
* Draws the text to the back journal screen to the appropriate Page number
*/
void LabEngine::drawJournalText() { void LabEngine::drawJournalText() {
uint16 drawingToPage = 1; uint16 drawingToPage = 1;
int charsDrawn = 0; int charsDrawn = 0;
@ -196,9 +183,6 @@ void LabEngine::drawJournalText() {
_lastPage = (*curText == 0); _lastPage = (*curText == 0);
} }
/**
* Does the turn page wipe.
*/
void LabEngine::turnPage(bool fromLeft) { void LabEngine::turnPage(bool fromLeft) {
if (fromLeft) { if (fromLeft) {
for (int i = 0; i < _graphics->_screenWidth; i += 8) { for (int i = 0; i < _graphics->_screenWidth; i += 8) {
@ -217,9 +201,6 @@ void LabEngine::turnPage(bool fromLeft) {
} }
} }
/**
* Draws the journal from page x.
*/
void LabEngine::drawJournal(uint16 wipenum, bool needFade) { void LabEngine::drawJournal(uint16 wipenum, bool needFade) {
_event->mouseHide(); _event->mouseHide();
_music->updateMusic(); _music->updateMusic();
@ -244,9 +225,6 @@ void LabEngine::drawJournal(uint16 wipenum, bool needFade) {
_event->mouseShow(); _event->mouseShow();
} }
/**
* Processes user input.
*/
void LabEngine::processJournal() { void LabEngine::processJournal() {
while (1) { while (1) {
// Make sure we check the music at least after every message // Make sure we check the music at least after every message
@ -285,9 +263,6 @@ void LabEngine::processJournal() {
} }
} }
/**
* Does the journal processing.
*/
void LabEngine::doJournal() { void LabEngine::doJournal() {
_graphics->blackAllScreen(); _graphics->blackAllScreen();
_lastPage = false; _lastPage = false;
@ -319,9 +294,6 @@ void LabEngine::doJournal() {
_graphics->blackScreen(); _graphics->blackScreen();
} }
/**
* Draws the text for the monitor.
*/
void LabEngine::drawMonText(char *text, TextFont *monitorFont, Common::Rect textRect, bool isinteractive) { void LabEngine::drawMonText(char *text, TextFont *monitorFont, Common::Rect textRect, bool isinteractive) {
uint16 drawingToPage = 0, yspacing = 0; uint16 drawingToPage = 0, yspacing = 0;
int charsDrawn = 0; int charsDrawn = 0;
@ -379,9 +351,6 @@ void LabEngine::drawMonText(char *text, TextFont *monitorFont, Common::Rect text
_event->mouseShow(); _event->mouseShow();
} }
/**
* Processes user input.
*/
void LabEngine::processMonitor(char *ntext, TextFont *monitorFont, bool isInteractive, Common::Rect textRect) { void LabEngine::processMonitor(char *ntext, TextFont *monitorFont, bool isInteractive, Common::Rect textRect) {
Common::String startFileName = _monitorTextFilename; Common::String startFileName = _monitorTextFilename;
CloseDataPtr startClosePtr = _closeDataPtr, lastClosePtr[10]; CloseDataPtr startClosePtr = _closeDataPtr, lastClosePtr[10];
@ -474,9 +443,6 @@ void LabEngine::processMonitor(char *ntext, TextFont *monitorFont, bool isIntera
} }
} }
/**
* Does what's necessary for the monitor.
*/
void LabEngine::doMonitor(Common::String background, Common::String textfile, bool isinteractive, Common::Rect textRect) { void LabEngine::doMonitor(Common::String background, Common::String textfile, bool isinteractive, Common::Rect textRect) {
Common::Rect scaledRect = _utils->vgaRectScale(textRect.left, textRect.top, textRect.right, textRect.bottom); Common::Rect scaledRect = _utils->vgaRectScale(textRect.left, textRect.top, textRect.right, textRect.bottom);
_monitorTextFilename = textfile; _monitorTextFilename = textfile;