aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2015-12-08 09:19:00 +0100
committerWillem Jan Palenstijn2015-12-23 21:33:55 +0100
commit3a1ee647610efa61a053d7f2fc0951e6248cb915 (patch)
tree2c91eeba381631410f726e2d4ef68d133e06af12 /engines
parent9cc70b6f03ecaafdf8696a03e74dce11942cb07e (diff)
downloadscummvm-rg350-3a1ee647610efa61a053d7f2fc0951e6248cb915.tar.gz
scummvm-rg350-3a1ee647610efa61a053d7f2fc0951e6248cb915.tar.bz2
scummvm-rg350-3a1ee647610efa61a053d7f2fc0951e6248cb915.zip
LAB: Review spacing
Diffstat (limited to 'engines')
-rw-r--r--engines/lab/anim.cpp11
-rw-r--r--engines/lab/detection.cpp57
-rw-r--r--engines/lab/engine.cpp29
-rw-r--r--engines/lab/eventman.cpp36
-rw-r--r--engines/lab/graphics.cpp47
-rw-r--r--engines/lab/image.h13
-rw-r--r--engines/lab/interface.cpp4
-rw-r--r--engines/lab/intro.cpp13
-rw-r--r--engines/lab/lab.h3
-rw-r--r--engines/lab/labsets.h16
-rw-r--r--engines/lab/map.cpp59
-rw-r--r--engines/lab/processroom.cpp24
-rw-r--r--engines/lab/savegame.cpp2
-rw-r--r--engines/lab/special.cpp23
-rw-r--r--engines/lab/timing.cpp10
15 files changed, 157 insertions, 190 deletions
diff --git a/engines/lab/anim.cpp b/engines/lab/anim.cpp
index a9e7860e55..d8b3b2feb3 100644
--- a/engines/lab/anim.cpp
+++ b/engines/lab/anim.cpp
@@ -247,17 +247,16 @@ void Anim::diffNextFrame() {
/* A separate task launched by readDiff. Plays the DIFF. */
/*****************************************************************************/
void Anim::playDiff(byte *buffer) {
- _waitSec = 0L;
+ _waitSec = 0L;
_waitMicros = 0L;
_delayMicros = 0L;
- _header = 0;
+ _header = 0;
_curBit = 0;
_frameNum = 0;
- _numChunks = 1;
- _donePal = false;
+ _numChunks = 1;
+ _donePal = false;
_stopPlayingEnd = false;
-
- _isPlaying = true;
+ _isPlaying = true;
if (_doBlack) {
_doBlack = false;
diff --git a/engines/lab/detection.cpp b/engines/lab/detection.cpp
index b61b4e4313..67890da1ea 100644
--- a/engines/lab/detection.cpp
+++ b/engines/lab/detection.cpp
@@ -102,14 +102,14 @@ static const ADGameDescription labDescriptions[] = {
};
static const char *const directoryGlobs[] = {
- "fonts",
+ "fonts",
"game",
"pict",
"spict",
"rooms",
"h2",
"intro",
- 0
+ 0
};
namespace Lab {
@@ -167,10 +167,9 @@ bool LabMetaEngine::hasFeature(MetaEngineFeature f) const {
}
bool Lab::LabEngine::hasFeature(EngineFeature f) const {
- return
- (f == kSupportsRTL);
- //(f == kSupportsLoadingDuringRuntime) ||
- //(f == kSupportsSavingDuringRuntime);
+ return (f == kSupportsRTL);
+ //(f == kSupportsLoadingDuringRuntime) ||
+ //(f == kSupportsSavingDuringRuntime);
}
SaveStateList LabMetaEngine::listSaves(const char *target) const {
@@ -186,17 +185,17 @@ SaveStateList LabMetaEngine::listSaves(const char *target) const {
SaveStateList saveList;
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
- // Obtain the last 3 digits of the filename, since they correspond to the save slot
- int slotNum = atoi(file->c_str() + file->size() - 3);
+ // Obtain the last 3 digits of the filename, since they correspond to the save slot
+ int slotNum = atoi(file->c_str() + file->size() - 3);
- if (slotNum >= 0 && slotNum <= 999) {
- Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str());
- if (in) {
+ if (slotNum >= 0 && slotNum <= 999) {
+ Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str());
+ if (in) {
if (Lab::readSaveGameHeader(in, header))
- saveList.push_back(SaveStateDescriptor(slotNum, header._descr.getDescription()));
- delete in;
- }
- }
+ saveList.push_back(SaveStateDescriptor(slotNum, header._descr.getDescription()));
+ delete in;
+ }
+ }
}
return saveList;
@@ -219,14 +218,14 @@ void LabMetaEngine::removeSaveState(const char *target, int slot) const {
Common::sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
- // Obtain the last 3 digits of the filename, since they correspond to the save slot
- int slotNum = atoi(file->c_str() + file->size() - 3);
-
- // Rename every slot greater than the deleted slot,
- if (slotNum > slot) {
- saveFileMan->renameSavefile(file->c_str(), filename.c_str());
- filename = Common::String::format("%s.%03u", target, ++slot);
- }
+ // Obtain the last 3 digits of the filename, since they correspond to the save slot
+ int slotNum = atoi(file->c_str() + file->size() - 3);
+
+ // Rename every slot greater than the deleted slot,
+ if (slotNum > slot) {
+ saveFileMan->renameSavefile(file->c_str(), filename.c_str());
+ filename = Common::String::format("%s.%03u", target, ++slot);
+ }
}
}
@@ -235,20 +234,20 @@ SaveStateDescriptor LabMetaEngine::querySaveMetaInfos(const char *target, int sl
Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(filename.c_str());
if (in) {
- Lab::SaveGameHeader header;
+ Lab::SaveGameHeader header;
bool successfulRead = Lab::readSaveGameHeader(in, header);
- delete in;
+ delete in;
- if (successfulRead) {
- SaveStateDescriptor desc(slot, header._descr.getDescription());
+ if (successfulRead) {
+ SaveStateDescriptor desc(slot, header._descr.getDescription());
// Do not allow save slot 0 (used for auto-saving) to be deleted or
// overwritten.
//desc.setDeletableFlag(slot != 0);
//desc.setWriteProtectedFlag(slot == 0);
- return header._descr;
- }
+ return header._descr;
+ }
}
return SaveStateDescriptor();
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp
index d2e7a55cc6..3e76e161e8 100644
--- a/engines/lab/engine.cpp
+++ b/engines/lab/engine.cpp
@@ -452,8 +452,8 @@ void LabEngine::mainGameLoop() {
if ((_cptr->_closeUpType == SPECIALLOCK) && _mainDisplay) /* LAB: Labyrinth specific code */
showCombination(_curFileName);
else if (((_cptr->_closeUpType == SPECIALBRICK) ||
- (_cptr->_closeUpType == SPECIALBRICKNOMOUSE)) &&
- _mainDisplay) /* LAB: Labyrinth specific code */
+ (_cptr->_closeUpType == SPECIALBRICKNOMOUSE)) &&
+ _mainDisplay) /* LAB: Labyrinth specific code */
showTile(_curFileName, (bool)(_cptr->_closeUpType == SPECIALBRICKNOMOUSE));
else
_graphics->readPict(_curFileName, false);
@@ -558,7 +558,7 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
if ((msgClass == RAWKEY) && (!_graphics->_longWinInFront)) {
if (code == 13) { /* The return key */
- msgClass = MOUSEBUTTONS;
+ msgClass = MOUSEBUTTONS;
Qualifier = IEQUALIFIER_LEFTBUTTON;
curPos = _event->getMousePos();
} else if (getPlatform() == Common::kPlatformWindows &&
@@ -568,8 +568,7 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
_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;
@@ -599,8 +598,7 @@ 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;
@@ -645,10 +643,9 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
}
if (_graphics->_longWinInFront) {
- if ((msgClass == RAWKEY) ||
- ((msgClass == MOUSEBUTTONS) &&
- ((IEQUALIFIER_LEFTBUTTON & Qualifier) ||
- (IEQUALIFIER_RBUTTON & Qualifier)))) {
+ if ((msgClass == RAWKEY) || ((msgClass == MOUSEBUTTONS) &&
+ ((IEQUALIFIER_LEFTBUTTON & Qualifier) ||
+ (IEQUALIFIER_RBUTTON & Qualifier)))) {
_graphics->_longWinInFront = false;
_graphics->_doNotDrawMessage = false;
_graphics->drawPanel();
@@ -857,8 +854,7 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
curInv++;
}
- if ((curInv <= _numInv) && _conditions->in(curInv) &&
- _inventory[curInv]._bitmapName)
+ if ((curInv <= _numInv) && _conditions->in(curInv) && _inventory[curInv]._bitmapName)
_nextFileName = getInvName(curInv);
_graphics->screenUpdate();
@@ -944,8 +940,8 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
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" */
+ (actionMode == 2) /* Open up a "door" */ ||
+ (actionMode == 3)) { /* Close a "door" */
if (doActionRule(curPos, actionMode, _roomNum, &_cptr))
_curFileName = _newFileName;
else if (!doActionRule(curPos, actionMode, 0, &_cptr)) {
@@ -967,8 +963,7 @@ 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;
diff --git a/engines/lab/eventman.cpp b/engines/lab/eventman.cpp
index 4c50cb78c3..b840c0a720 100644
--- a/engines/lab/eventman.cpp
+++ b/engines/lab/eventman.cpp
@@ -34,21 +34,23 @@
namespace Lab {
-static byte MouseData[] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 7, 1, 0, 0, 0, 0, 0, 0, 0,
- 1, 7, 7, 1, 0, 0, 0, 0, 0, 0,
- 1, 7, 7, 7, 1, 0, 0, 0, 0, 0,
- 1, 7, 7, 7, 7, 1, 0, 0, 0, 0,
- 1, 7, 7, 7, 7, 7, 1, 0, 0, 0,
- 1, 7, 7, 7, 7, 7, 7, 1, 0, 0,
- 1, 7, 7, 7, 7, 7, 7, 7, 1, 0,
- 1, 7, 7, 7, 7, 7, 1, 1, 1, 1,
- 1, 7, 7, 1, 7, 7, 1, 0, 0, 0,
- 1, 7, 1, 0, 1, 7, 7, 1, 0, 0,
- 1, 1, 0, 0, 1, 7, 7, 1, 0, 0,
- 0, 0, 0, 0, 0, 1, 7, 7, 1, 0,
- 0, 0, 0, 0, 0, 1, 7, 7, 1, 0,
- 0, 0, 0, 0, 0, 0, 1, 1, 0, 0};
+static byte MouseData[] = {
+ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 7, 1, 0, 0, 0, 0, 0, 0, 0,
+ 1, 7, 7, 1, 0, 0, 0, 0, 0, 0,
+ 1, 7, 7, 7, 1, 0, 0, 0, 0, 0,
+ 1, 7, 7, 7, 7, 1, 0, 0, 0, 0,
+ 1, 7, 7, 7, 7, 7, 1, 0, 0, 0,
+ 1, 7, 7, 7, 7, 7, 7, 1, 0, 0,
+ 1, 7, 7, 7, 7, 7, 7, 7, 1, 0,
+ 1, 7, 7, 7, 7, 7, 1, 1, 1, 1,
+ 1, 7, 7, 1, 7, 7, 1, 0, 0, 0,
+ 1, 7, 1, 0, 1, 7, 7, 1, 0, 0,
+ 1, 1, 0, 0, 1, 7, 7, 1, 0, 0,
+ 0, 0, 0, 0, 0, 1, 7, 7, 1, 0,
+ 0, 0, 0, 0, 0, 1, 7, 7, 1, 0,
+ 0, 0, 0, 0, 0, 0, 1, 1, 0, 0
+};
#define MOUSE_WIDTH 10
#define MOUSE_HEIGHT 15
@@ -152,7 +154,6 @@ void EventManager::updateMouse() {
_vm->_graphics->screenUpdate();
}
-
/*****************************************************************************/
/* Initializes the mouse. */
/*****************************************************************************/
@@ -163,7 +164,6 @@ void EventManager::initMouse() {
setMousePos(Common::Point(0, 0));
}
-
/*****************************************************************************/
/* Shows the mouse. */
/*****************************************************************************/
@@ -198,7 +198,6 @@ Common::Point EventManager::getMousePos() {
return Common::Point(_mousePos.x / 2, _mousePos.y);
}
-
/*****************************************************************************/
/* Moves the mouse to new co-ordinates. */
/*****************************************************************************/
@@ -212,7 +211,6 @@ void EventManager::setMousePos(Common::Point pos) {
processInput();
}
-
/*****************************************************************************/
/* Checks whether or not the mouse buttons have been pressed, and the last */
/* co-ordinates of the button press. leftbutton tells whether to check the */
diff --git a/engines/lab/graphics.cpp b/engines/lab/graphics.cpp
index 8da54cc90a..aa118eb420 100644
--- a/engines/lab/graphics.cpp
+++ b/engines/lab/graphics.cpp
@@ -138,8 +138,7 @@ void DisplayMan::freePict() {
static void getWord(char *wordBuffer, const char *mainBuffer, uint16 *wordWidth) {
uint16 width = 0;
- while ((mainBuffer[width] != ' ') && mainBuffer[width] &&
- (mainBuffer[width] != '\n')) {
+ while ((mainBuffer[width] != ' ') && mainBuffer[width] && (mainBuffer[width] != '\n')) {
wordBuffer[width] = mainBuffer[width];
width++;
}
@@ -190,16 +189,18 @@ void DisplayMan::getLine(TextFont *tf, char *lineBuffer, const char **mainBuffer
/* Note: Every individual word MUST be int16 enough to fit on a line, and */
/* 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, /* Cords */
- uint16 y1, uint16 x2, uint16 y2, const char *str) { /* The text itself */
+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 */
+ uint16 x2, uint16 y2,
+ const char *str) { /* The text itself */
TextFont *_msgFont = (TextFont *)font;
char linebuffer[256];
const char *temp;
@@ -272,16 +273,18 @@ 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, /* Cords */
- uint16 y1, uint16 x2, uint16 y2, const char *str) { /* The text itself */
+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 */
+ uint16 x2, uint16 y2,
+ const char *str) { /* The text itself */
uint32 res, vgabyte = _screenBytesPerPage;
byte *tmp = _currentDisplayBuffer;
diff --git a/engines/lab/image.h b/engines/lab/image.h
index f443f4c1c3..7f2c1ed5c5 100644
--- a/engines/lab/image.h
+++ b/engines/lab/image.h
@@ -36,20 +36,19 @@ namespace Lab {
class Image {
public:
uint16 _width;
- uint16 _height;
+ uint16 _height;
byte *_imageData;
- Image() : _width(0), _height(0), _imageData(0) {}
- Image(int w, int h, byte *d) : _width(w), _height(h), _imageData(d) {}
+ Image() : _width(0), _height(0), _imageData(0) {}
+ Image(int w, int h, byte *d) : _width(w), _height(h), _imageData(d) {}
Image(Common::File *s);
- void drawImage(uint16 x, uint16 y);
- void drawMaskImage(uint16 x, uint16 y);
- void readScreenImage(uint16 x, uint16 y);
+ void drawImage(uint16 x, uint16 y);
+ void drawMaskImage(uint16 x, uint16 y);
+ void readScreenImage(uint16 x, uint16 y);
void blitBitmap(uint16 xs, uint16 ys, Image *ImDest, uint16 xd, uint16 yd, uint16 width, uint16 height, byte masked);
};
-
} // End of namespace Lab
#endif // LAB_H
diff --git a/engines/lab/interface.cpp b/engines/lab/interface.cpp
index 7f6776a054..4e514ea652 100644
--- a/engines/lab/interface.cpp
+++ b/engines/lab/interface.cpp
@@ -113,8 +113,8 @@ Gadget *LabEngine::checkNumGadgetHit(GadgetList *gadgetList, uint16 key) {
for (GadgetList::iterator gadgetItr = gadgetList->begin(); gadgetItr != gadgetList->end(); ++gadgetItr) {
Gadget *gadget = *gadgetItr;
if ((gkey - 1 == gadget->_gadgetID || (gkey == 0 && gadget->_gadgetID == 9) ||
- (gadget->_keyEquiv != 0 && makeGadgetKeyEquiv(key) == gadget->_keyEquiv))
- && !(GADGETOFF & gadget->_flags)) {
+ (gadget->_keyEquiv != 0 && makeGadgetKeyEquiv(key) == gadget->_keyEquiv))
+ && !(GADGETOFF & gadget->_flags)) {
_event->mouseHide();
gadget->_altImage->drawImage(gadget->x, gadget->y);
_event->mouseShow();
diff --git a/engines/lab/intro.cpp b/engines/lab/intro.cpp
index da44916a92..2af4f448a2 100644
--- a/engines/lab/intro.cpp
+++ b/engines/lab/intro.cpp
@@ -54,14 +54,13 @@ void Intro::introEatMessages() {
return;
else {
if (((msg->_msgClass == MOUSEBUTTONS) && (IEQUALIFIER_RBUTTON & msg->_qualifier)) ||
- ((msg->_msgClass == RAWKEY) && (msg->_code == 27))
+ ((msg->_msgClass == RAWKEY) && (msg->_code == 27))
)
_quitIntro = true;
}
}
}
-
/*****************************************************************************/
/* Reads in a picture. */
/*****************************************************************************/
@@ -156,7 +155,7 @@ void Intro::doPictText(const char *filename, TextFont *msgFont, bool isScreen) {
code = msg->_code;
if (((cls == MOUSEBUTTONS) && (IEQUALIFIER_RBUTTON & qualifier)) ||
- ((cls == RAWKEY) && (code == 27))) {
+ ((cls == RAWKEY) && (code == 27))) {
_quitIntro = true;
if (isScreen)
@@ -278,8 +277,8 @@ void Intro::introSequence() {
break;
palette[i] = ((_vm->_anim->_diffPalette[i * 3] >> 2) << 8) +
- ((_vm->_anim->_diffPalette[i * 3 + 1] >> 2) << 4) +
- (_vm->_anim->_diffPalette[i * 3 + 2] >> 2);
+ ((_vm->_anim->_diffPalette[i * 3 + 1] >> 2) << 4) +
+ (_vm->_anim->_diffPalette[i * 3 + 2] >> 2);
}
_vm->_music->updateMusic();
@@ -337,8 +336,8 @@ void Intro::introSequence() {
for (uint16 i = 0; i < 16; i++) {
palette[i] = ((_vm->_anim->_diffPalette[i * 3] >> 2) << 8) +
- ((_vm->_anim->_diffPalette[i * 3 + 1] >> 2) << 4) +
- (_vm->_anim->_diffPalette[i * 3 + 2] >> 2);
+ ((_vm->_anim->_diffPalette[i * 3 + 1] >> 2) << 4) +
+ (_vm->_anim->_diffPalette[i * 3 + 2] >> 2);
}
doPictText("i.1", msgFont, true);
diff --git a/engines/lab/lab.h b/engines/lab/lab.h
index fb2d20d5a4..7dec75f0a6 100644
--- a/engines/lab/lab.h
+++ b/engines/lab/lab.h
@@ -132,8 +132,7 @@ public:
const char *_curFileName;
const char *_nextFileName;
- const char *_newFileName; /* When ProcessRoom.c decides to change the filename
- of the current picture. */
+ const char *_newFileName; /* When ProcessRoom.c decides to change the filename of the current picture. */
TextFont *_msgFont;
GadgetList _moveGadgetList;
GadgetList _invGadgetList;
diff --git a/engines/lab/labsets.h b/engines/lab/labsets.h
index 3251ee18a3..647730db6e 100644
--- a/engines/lab/labsets.h
+++ b/engines/lab/labsets.h
@@ -41,19 +41,19 @@ class LabEngine;
class LargeSet {
public:
- LargeSet(uint16 last, LabEngine *vm);
- ~LargeSet();
- bool in(uint16 element);
- void inclElement(uint16 element);
- void exclElement(uint16 element);
- bool readInitialConditions(const char *fileName);
+ LargeSet(uint16 last, LabEngine *vm);
+ ~LargeSet();
+ bool in(uint16 element);
+ void inclElement(uint16 element);
+ void exclElement(uint16 element);
+ bool readInitialConditions(const char *fileName);
private:
LabEngine *_vm;
public:
- uint16 _lastElement;
- uint16 *_array;
+ uint16 _lastElement;
+ uint16 *_array;
};
} // End of namespace Lab
diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp
index 8c71d1a6a6..405d7b82ea 100644
--- a/engines/lab/map.cpp
+++ b/engines/lab/map.cpp
@@ -357,9 +357,6 @@ static void getUpFloor(uint16 *Floor, bool *isfloor) {
} while ((!onFloor(*Floor)) && (*Floor <= CARNIVAL));
}
-
-
-
/*****************************************************************************/
/* Figures out which floor, if any, should be gone to if the down arrow is */
/* hit. */
@@ -391,10 +388,6 @@ static void getDownFloor(uint16 *Floor, bool *isfloor) {
} while ((!onFloor(*Floor)) && *Floor);
}
-
-
-
-
/*****************************************************************************/
/* Draws the map */
/*****************************************************************************/
@@ -422,9 +415,9 @@ void LabEngine::drawMap(uint16 CurRoom, uint16 CurMsg, uint16 Floor, bool fadeou
}
}
- if ((Maps[CurRoom].PageNumber == Floor) /* Makes sure the X is drawn in corridors */
- && _roomsFound->in(CurRoom) /* NOTE: this here on purpose just in case there's some weird condition, like the surreal maze where there are no rooms */
- && Maps[CurRoom].x)
+ /* 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);
tempfloor = Floor;
@@ -529,8 +522,7 @@ void LabEngine::processMap(uint16 CurRoom) {
MouseX = Msg->_mouseX;
MouseY = Msg->_mouseY;
- if (((Class == MOUSEBUTTONS) && (IEQUALIFIER_RBUTTON & Qualifier)) ||
- ((Class == RAWKEY) && (Code == 27)))
+ if (((Class == MOUSEBUTTONS) && (IEQUALIFIER_RBUTTON & Qualifier)) || ((Class == RAWKEY) && (Code == 27)))
return;
if (Class == GADGETUP) {
@@ -557,59 +549,49 @@ void LabEngine::processMap(uint16 CurRoom) {
} else
CurFloor = OldFloor;
}
- }
-
- else if ((Class == MOUSEBUTTONS) && (IEQUALIFIER_LEFTBUTTON & Qualifier)) {
+ } else if ((Class == MOUSEBUTTONS) && (IEQUALIFIER_LEFTBUTTON & Qualifier)) {
if ((CurFloor == LOWERFLOOR) && (MouseX >= mapScaleX(538)) && (MouseY >= mapScaleY(277))
- && (MouseX <= mapScaleX(633)) && (MouseY <= mapScaleY(352))
- && onFloor(SURMAZEFLOOR)) {
+ && (MouseX <= mapScaleX(633)) && (MouseY <= mapScaleY(352))
+ && onFloor(SURMAZEFLOOR)) {
CurFloor = SURMAZEFLOOR;
_graphics->fade(false, 0);
drawMap(CurRoom, CurMsg, CurFloor, false, false);
_graphics->fade(true, 0);
- }
-
- else if ((CurFloor == MIDDLEFLOOR) && (MouseX >= mapScaleX(358)) && (MouseY >= mapScaleY(71))
- && (MouseX <= mapScaleX(452)) && (MouseY <= mapScaleY(147))
- && onFloor(CARNIVAL)) {
+ } else if ((CurFloor == MIDDLEFLOOR) && (MouseX >= mapScaleX(358)) && (MouseY >= mapScaleY(71))
+ && (MouseX <= mapScaleX(452)) && (MouseY <= mapScaleY(147))
+ && onFloor(CARNIVAL)) {
CurFloor = CARNIVAL;
_graphics->fade(false, 0);
drawMap(CurRoom, CurMsg, CurFloor, false, false);
_graphics->fade(true, 0);
- }
-
- else if ((CurFloor == MIDDLEFLOOR) && (MouseX >= mapScaleX(557)) && (MouseY >= mapScaleY(325))
- && (MouseX <= mapScaleX(653)) && (MouseY <= mapScaleY(401))
- && onFloor(MEDMAZEFLOOR)) {
+ } else if ((CurFloor == MIDDLEFLOOR) && (MouseX >= mapScaleX(557)) && (MouseY >= mapScaleY(325))
+ && (MouseX <= mapScaleX(653)) && (MouseY <= mapScaleY(401))
+ && onFloor(MEDMAZEFLOOR)) {
CurFloor = MEDMAZEFLOOR;
_graphics->fade(false, 0);
drawMap(CurRoom, CurMsg, CurFloor, false, false);
_graphics->fade(true, 0);
- }
-
- else if ((CurFloor == UPPERFLOOR) && (MouseX >= mapScaleX(524)) && (MouseY >= mapScaleY(97))
- && (MouseX <= mapScaleX(645)) && (MouseY <= mapScaleY(207))
- && onFloor(HEDGEMAZEFLOOR)) {
+ } else if ((CurFloor == UPPERFLOOR) && (MouseX >= mapScaleX(524)) && (MouseY >= mapScaleY(97))
+ && (MouseX <= mapScaleX(645)) && (MouseY <= mapScaleY(207))
+ && onFloor(HEDGEMAZEFLOOR)) {
CurFloor = HEDGEMAZEFLOOR;
_graphics->fade(false, 0);
drawMap(CurRoom, CurMsg, CurFloor, false, false);
_graphics->fade(true, 0);
- }
-
- else if (MouseX > mapScaleX(314)) {
+ } else if (MouseX > mapScaleX(314)) {
OldMsg = CurMsg;
for (uint16 i = 1; i <= MaxRooms; i++) {
roomCoords(i, &x1, &y1, &x2, &y2);
if ((Maps[i].PageNumber == CurFloor)
- && _roomsFound->in(i)
- && (MouseX >= x1) && (MouseX <= x2)
- && (MouseY >= y1) && (MouseY <= y2)) {
+ && _roomsFound->in(i)
+ && (MouseX >= x1) && (MouseX <= x2)
+ && (MouseY >= y1) && (MouseY <= y2)) {
CurMsg = i;
}
}
@@ -647,7 +629,6 @@ void LabEngine::processMap(uint16 CurRoom) {
}
}
-
/*****************************************************************************/
/* Does the map processing. */
/*****************************************************************************/
diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp
index fa270ded61..e037522acf 100644
--- a/engines/lab/processroom.cpp
+++ b/engines/lab/processroom.cpp
@@ -104,7 +104,7 @@ static CloseData *getObject(uint16 x, uint16 y, CloseDataPtr lcptr) {
while (lcptr != NULL) {
if ((x >= g_lab->_utils->scaleX(lcptr->x1)) && (y >= g_lab->_utils->scaleY(lcptr->y1)) &&
- (x <= g_lab->_utils->scaleX(lcptr->x2)) && (y <= g_lab->_utils->scaleY(lcptr->y2)))
+ (x <= g_lab->_utils->scaleX(lcptr->x2)) && (y <= g_lab->_utils->scaleY(lcptr->y2)))
return lcptr;
lcptr = lcptr->_nextCloseUp;
@@ -124,8 +124,8 @@ static CloseDataPtr findCPtrMatch(CloseDataPtr cpmain, CloseDataPtr list) {
while (list) {
if ((cpmain->x1 == list->x1) && (cpmain->x2 == list->x2) &&
- (cpmain->y1 == list->y1) && (cpmain->y2 == list->y2) &&
- (cpmain->_depth == list->_depth))
+ (cpmain->y1 == list->y1) && (cpmain->y2 == list->y2) &&
+ (cpmain->_depth == list->_depth))
return list;
cptr = findCPtrMatch(cpmain, list->_subCloseUps);
@@ -278,8 +278,8 @@ bool takeItem(uint16 x, uint16 y, CloseDataPtr *cptr) {
while (lcptr != NULL) {
if ((x >= g_lab->_utils->scaleX(lcptr->x1)) && (y >= g_lab->_utils->scaleY(lcptr->y1)) &&
- (x <= g_lab->_utils->scaleX(lcptr->x2)) && (y <= g_lab->_utils->scaleY(lcptr->y2)) &&
- (lcptr->_closeUpType < 0)) {
+ (x <= g_lab->_utils->scaleX(lcptr->x2)) && (y <= g_lab->_utils->scaleY(lcptr->y2)) &&
+ (lcptr->_closeUpType < 0)) {
g_lab->_conditions->inclElement(abs(lcptr->_closeUpType));
return true;
}
@@ -449,8 +449,7 @@ void LabEngine::doActions(Action *aptr, CloseDataPtr *lcptr) {
_anim->diffNextFrame();
getTime(&curSecs, &curMicros);
- if ((curSecs > startSecs) || ((curSecs == startSecs) &&
- (curMicros >= startMicros)))
+ if ((curSecs > startSecs) || ((curSecs == startSecs) && (curMicros >= startMicros)))
break;
}
}
@@ -582,9 +581,8 @@ static bool doActionRuleSub(int16 action, int16 roomNum, CloseDataPtr lcptr, Clo
if (((*rule)->_ruleType == ACTION) &&
(((*rule)->_param1 == action) || (((*rule)->_param1 == 0) && allowDefaults))) {
if ((((*rule)->_param2 == lcptr->_closeUpType) ||
- (((*rule)->_param2 == 0) && allowDefaults))
- ||
- ((action == 1) && ((*rule)->_param2 == (-lcptr->_closeUpType)))) {
+ (((*rule)->_param2 == 0) && allowDefaults)) ||
+ ((action == 1) && ((*rule)->_param2 == (-lcptr->_closeUpType)))) {
if (checkConditions((*rule)->_condition)) {
g_lab->doActions((*rule)->_actionList, set);
return true;
@@ -635,7 +633,7 @@ static bool doOperateRuleSub(int16 itemNum, int16 roomNum, CloseDataPtr lcptr, C
for (RuleList::iterator rule = rules->begin(); rule != rules->end(); ++rule) {
if (((*rule)->_ruleType == OPERATE) &&
- (((*rule)->_param1 == itemNum) || (((*rule)->_param1 == 0) && allowDefaults)) &&
+ (((*rule)->_param1 == itemNum) || (((*rule)->_param1 == 0) && allowDefaults)) &&
(((*rule)->_param2 == lcptr->_closeUpType) || (((*rule)->_param2 == 0) && allowDefaults))) {
if (checkConditions((*rule)->_condition)) {
g_lab->doActions((*rule)->_actionList, set);
@@ -711,8 +709,8 @@ bool doTurn(uint16 from, uint16 to, CloseDataPtr *lcptr) {
for (RuleList::iterator rule = rules->begin(); rule != rules->end(); ++rule) {
if (((*rule)->_ruleType == TURN) ||
- (((*rule)->_ruleType == TURNFROMTO) &&
- ((*rule)->_param1 == from) && ((*rule)->_param2 == to))) {
+ (((*rule)->_ruleType == TURNFROMTO) &&
+ ((*rule)->_param1 == from) && ((*rule)->_param2 == to))) {
if (checkConditions((*rule)->_condition)) {
g_lab->doActions((*rule)->_actionList, lcptr);
return true;
diff --git a/engines/lab/savegame.cpp b/engines/lab/savegame.cpp
index 23e73c5bfb..bf3f8a4504 100644
--- a/engines/lab/savegame.cpp
+++ b/engines/lab/savegame.cpp
@@ -164,8 +164,6 @@ bool saveGame(uint16 Direction, uint16 Quarters, int slot, Common::String desc)
return true;
}
-
-
/*****************************************************************************/
/* Reads the game from disk. */
/*****************************************************************************/
diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp
index 469d8ab9d8..0d92772a39 100644
--- a/engines/lab/special.cpp
+++ b/engines/lab/special.cpp
@@ -62,12 +62,12 @@ Image *MonButton;
#define INCL(BITSET,BIT) ((BITSET) |= (BIT))
#define SETBIT(BITSET,BITNUM) INCL(BITSET, (1 << (BITNUM)))
#define INBIT(BITSET,BITNUM) ( ((1 << (BITNUM)) & (BITSET)) > 0 )
-#define BRIDGE0 148
-#define BRIDGE1 104
-#define DIRTY 175
-#define NONEWS 135
-#define NOCLEAN 152
-#define QUARTERNUM 30
+#define BRIDGE0 148
+#define BRIDGE1 104
+#define DIRTY 175
+#define NONEWS 135
+#define NOCLEAN 152
+#define QUARTERNUM 30
static byte *loadBackPict(const char *fileName, bool tomem) {
@@ -83,8 +83,8 @@ static byte *loadBackPict(const char *fileName, bool tomem) {
for (uint16 i = 0; i < 16; i++) {
hipal[i] = ((g_lab->_anim->_diffPalette[i * 3] >> 2) << 8) +
- ((g_lab->_anim->_diffPalette[i * 3 + 1] >> 2) << 4) +
- ((g_lab->_anim->_diffPalette[i * 3 + 2] >> 2));
+ ((g_lab->_anim->_diffPalette[i * 3 + 1] >> 2) << 4) +
+ ((g_lab->_anim->_diffPalette[i * 3 + 2] >> 2));
}
g_lab->_anim->_noPalChange = false;
@@ -282,7 +282,6 @@ static void turnPage(bool FromLeft) {
}
}
-
/*****************************************************************************/
/* Draws the journal from page x. */
/*****************************************************************************/
@@ -347,7 +346,7 @@ void LabEngine::processJournal() {
GadID = Msg->_code;
if (((Class == MOUSEBUTTONS) && (IEQUALIFIER_RBUTTON & Qualifier)) ||
- ((Class == RAWKEY) && (GadID == 27)))
+ ((Class == RAWKEY) && (GadID == 27)))
return;
else if (Class == GADGETUP) {
@@ -385,7 +384,7 @@ void LabEngine::doJournal() {
JBackImage._width = _graphics->_screenWidth;
JBackImage._height = _graphics->_screenHeight;
- JBackImage._imageData = NULL;
+ JBackImage._imageData = NULL;
ScreenImage = JBackImage;
ScreenImage._imageData = _graphics->getCurrentDrawingBuffer();
@@ -558,7 +557,7 @@ void LabEngine::processMonitor(char *ntext, TextFont *monitorFont, bool isintera
Code = Msg->_code;
if (((Class == MOUSEBUTTONS) && (IEQUALIFIER_RBUTTON & Qualifier)) ||
- ((Class == RAWKEY) && (Code == 27)))
+ ((Class == RAWKEY) && (Code == 27)))
return;
else if ((Class == MOUSEBUTTONS) && (IEQUALIFIER_LEFTBUTTON & Qualifier)) {
diff --git a/engines/lab/timing.cpp b/engines/lab/timing.cpp
index ba3dd40846..63a2b946bc 100644
--- a/engines/lab/timing.cpp
+++ b/engines/lab/timing.cpp
@@ -56,7 +56,7 @@ void LabEngine::microDelay(uint32 secs, uint32 micros) {
void LabEngine::getTime(uint32 *secs, uint32 *micros) {
uint32 t = g_system->getMillis();
- *secs = t / 1000;
+ *secs = t / 1000;
*micros = t % 1000;
}
@@ -66,7 +66,7 @@ void LabEngine::getTime(uint32 *secs, uint32 *micros) {
void LabEngine::addCurTime(uint32 sec, uint32 micros, uint32 *timeSec, uint32 *timeMicros) {
getTime(timeSec, timeMicros);
- (*timeSec) += sec;
+ (*timeSec) += sec;
(*timeMicros) += micros;
if (*timeMicros >= ONESECOND) {
@@ -80,7 +80,7 @@ void LabEngine::addCurTime(uint32 sec, uint32 micros, uint32 *timeSec, uint32 *t
/* time2, returns 0. */
/*****************************************************************************/
void LabEngine::anyTimeDiff(uint32 sec1, uint32 micros1, uint32 sec2, uint32 micros2, uint32 *diffSecs, uint32 *diffMicros) {
- *diffSecs = 0;
+ *diffSecs = 0;
*diffMicros = 0;
if (sec1 > sec2)
@@ -89,10 +89,10 @@ void LabEngine::anyTimeDiff(uint32 sec1, uint32 micros1, uint32 sec2, uint32 mic
return;
if (micros1 > micros2) {
- *diffSecs = sec2 - sec1 - 1;
+ *diffSecs = sec2 - sec1 - 1;
*diffMicros = (ONESECOND - micros1) + micros2;
} else {
- *diffSecs = sec2 - sec1;
+ *diffSecs = sec2 - sec1;
*diffMicros = micros2 - micros1;
}
}