diff options
-rw-r--r-- | engines/lab/lab.h | 7 | ||||
-rw-r--r-- | engines/lab/savegame.cpp | 6 | ||||
-rw-r--r-- | engines/lab/tilepuzzle.cpp | 27 | ||||
-rw-r--r-- | engines/lab/tilepuzzle.h | 42 | ||||
-rw-r--r-- | engines/lab/utils.cpp | 30 | ||||
-rw-r--r-- | engines/lab/utils.h | 32 |
6 files changed, 77 insertions, 67 deletions
diff --git a/engines/lab/lab.h b/engines/lab/lab.h index 74fbd2a8ae..42b1305410 100644 --- a/engines/lab/lab.h +++ b/engines/lab/lab.h @@ -454,7 +454,14 @@ private: void performAction(uint16 actionMode, Common::Point curPos, uint16 &curInv); private: + /** + * Writes the game out to disk. + */ bool saveGame(int slot, const Common::String desc); + + /** + * Reads the game from disk. + */ bool loadGame(int slot); void writeSaveGameHeader(Common::OutSaveFile *out, const Common::String &saveName); }; diff --git a/engines/lab/savegame.cpp b/engines/lab/savegame.cpp index a0d7fe9667..70330a00d2 100644 --- a/engines/lab/savegame.cpp +++ b/engines/lab/savegame.cpp @@ -119,9 +119,6 @@ bool readSaveGameHeader(Common::InSaveFile *in, SaveGameHeader &header) { return true; } -/** - * Writes the game out to disk. - */ bool LabEngine::saveGame(int slot, const Common::String desc) { Common::String fileName = generateSaveFileName(slot); Common::SaveFileManager *saveFileManager = g_system->getSavefileManager(); @@ -162,9 +159,6 @@ bool LabEngine::saveGame(int slot, const Common::String desc) { return true; } -/** - * Reads the game from disk. - */ bool LabEngine::loadGame(int slot) { Common::String fileName = generateSaveFileName(slot); Common::SaveFileManager *saveFileManager = g_system->getSavefileManager(); diff --git a/engines/lab/tilepuzzle.cpp b/engines/lab/tilepuzzle.cpp index a22f51f747..54507fd85c 100644 --- a/engines/lab/tilepuzzle.cpp +++ b/engines/lab/tilepuzzle.cpp @@ -95,9 +95,6 @@ TilePuzzle::~TilePuzzle() { } } -/** - * Processes mouse clicks and changes the combination. - */ void TilePuzzle::mouseTile(Common::Point pos) { Common::Point realPos = _vm->_utils->vgaUnscale(pos); @@ -111,9 +108,6 @@ void TilePuzzle::mouseTile(Common::Point pos) { changeTile(tileX, tileY); } -/** - * Changes the combination number of one of the slots - */ void TilePuzzle::changeTile(uint16 col, uint16 row) { int16 scrolltype = -1; @@ -180,9 +174,6 @@ void TilePuzzle::changeTile(uint16 col, uint16 row) { } } -/** - * Processes mouse clicks and changes the combination. - */ void TilePuzzle::mouseCombination(Common::Point pos) { Common::Point realPos = _vm->_utils->vgaUnscale(pos); @@ -206,9 +197,6 @@ void TilePuzzle::mouseCombination(Common::Point pos) { changeCombination(number); } -/** - * Draws the images of the combination lock to the display bitmap. - */ void TilePuzzle::doTile(bool showsolution) { uint16 row = 0, col = 0, rowm, colm, num; int16 rows, cols; @@ -248,9 +236,6 @@ void TilePuzzle::doTile(bool showsolution) { } } -/** - * Reads in a backdrop picture. - */ void TilePuzzle::showTile(const Common::String filename, bool showSolution) { _vm->_anim->_doBlack = true; _vm->_anim->_noPalChange = true; @@ -271,9 +256,6 @@ void TilePuzzle::showTile(const Common::String filename, bool showSolution) { _vm->_graphics->setPalette(_vm->_anim->_diffPalette, 256); } -/** - * Does the scrolling for the tiles on the tile puzzle. - */ void TilePuzzle::doTileScroll(uint16 col, uint16 row, uint16 scrolltype) { int16 dX = 0, dY = 0, dx = 0, dy = 0, sx = 0, sy = 0; int last = 0; @@ -315,9 +297,6 @@ void TilePuzzle::doTileScroll(uint16 col, uint16 row, uint16 scrolltype) { delete[] buffer; } -/** - * Changes the combination number of one of the slots - */ void TilePuzzle::changeCombination(uint16 number) { const int solution[6] = { 0, 4, 0, 8, 7, 2 }; @@ -368,17 +347,11 @@ void TilePuzzle::scrollRaster(int16 dx, int16 dy, uint16 x1, uint16 y1, uint16 x _vm->_graphics->scrollDisplayY(dy, x1, y1, x2, y2, buffer); } -/** - * Draws the images of the combination lock to the display bitmap. - */ void TilePuzzle::doCombination() { for (int i = 0; i <= 5; i++) _numberImages[_combination[i]]->drawImage(_vm->_utils->vgaScaleX(COMBINATION_X[i]), _vm->_utils->vgaScaleY(65)); } -/** - * Reads in a backdrop picture. - */ void TilePuzzle::showCombination(const Common::String filename) { _vm->_anim->_doBlack = true; _vm->_anim->_noPalChange = true; diff --git a/engines/lab/tilepuzzle.h b/engines/lab/tilepuzzle.h index 65870b058d..dd4abba8ec 100644 --- a/engines/lab/tilepuzzle.h +++ b/engines/lab/tilepuzzle.h @@ -49,20 +49,54 @@ public: TilePuzzle(LabEngine *vm); virtual ~TilePuzzle(); + /** + * Processes mouse clicks and changes the combination. + */ void mouseTile(Common::Point pos); - void showTile(const Common::String filename, bool showSolution); + + /** + * Processes mouse clicks and changes the combination. + */ void mouseCombination(Common::Point pos); + + /** + * Reads in a backdrop picture. + */ void showCombination(const Common::String filename); + + /** + * Reads in a backdrop picture. + */ + void showTile(const Common::String filename, bool showSolution); void save(Common::OutSaveFile *file); void load(Common::InSaveFile *file); private: + /** + * Changes the combination number of one of the slots + */ + void changeCombination(uint16 number); + + /** + * Changes the combination number of one of the slots + */ + void changeTile(uint16 col, uint16 row); + + /** + * Draws the images of the combination lock to the display bitmap. + */ + void doCombination(); + + /** + * Draws the images of the combination lock to the display bitmap. + */ void doTile(bool showsolution); + + /** + * Does the scrolling for the tiles on the tile puzzle. + */ void doTileScroll(uint16 col, uint16 row, uint16 scrolltype); - void changeCombination(uint16 number); void scrollRaster(int16 dx, int16 dy, uint16 x1, uint16 y1, uint16 x2, uint16 y2, byte *buffer); - void doCombination(); - void changeTile(uint16 col, uint16 row); }; } // End of namespace Lab diff --git a/engines/lab/utils.cpp b/engines/lab/utils.cpp index 3de15404c9..aeb76e6605 100644 --- a/engines/lab/utils.cpp +++ b/engines/lab/utils.cpp @@ -38,10 +38,6 @@ Utils::Utils(LabEngine *vm) : _vm(vm), _rnd("lab") { _dataBytesPerRow = 0; } -/** - * Scales the x co-ordinates to that of the new display. In the room parser - * file, co-ordinates are set up on a 360x336 display. - */ uint16 Utils::scaleX(uint16 x) { if (_vm->_isHiRes) return (uint16)((x * 16) / 9); @@ -49,10 +45,6 @@ uint16 Utils::scaleX(uint16 x) { return (uint16)((x * 8) / 9); } -/** - * Scales the y co-ordinates to that of the new display. In the room parser - * file, co-ordinates are set up on a 368x336 display. - */ uint16 Utils::scaleY(uint16 y) { if (_vm->_isHiRes) return (y + (y / 14)); @@ -82,9 +74,6 @@ Common::Rect Utils::mapRectScale(int16 x1, int16 y1, int16 x2, int16 y2) { return Common::Rect(mapScaleX(x1), mapScaleY(y1), mapScaleX(x2), mapScaleY(y2)); } -/** - * Scales the VGA coords to SVGA if necessary; otherwise, returns VGA coords. - */ int16 Utils::vgaScaleX(int16 x) { if (_vm->_isHiRes) return (x * 2); @@ -92,9 +81,6 @@ int16 Utils::vgaScaleX(int16 x) { return x; } -/** - * Scales the VGA coords to SVGA if necessary; otherwise, returns VGA coords. - */ int16 Utils::vgaScaleY(int16 y) { if (_vm->_isHiRes) return ((y * 12) / 5); @@ -113,9 +99,6 @@ uint16 Utils::svgaCord(uint16 cord) { return 0; } -/** - * Converts SVGA coords to VGA if necessary, otherwise returns VGA coords. - */ Common::Point Utils::vgaUnscale(Common::Point pos) { Common::Point result; if (_vm->_isHiRes) { @@ -127,10 +110,6 @@ Common::Point Utils::vgaUnscale(Common::Point pos) { return result; } -/** - * Undiffs a piece of memory when header size is a byte, and copy/skip size - * is also a byte or a word. - */ template<typename T> void Utils::unDiff(T *dest, Common::File *sourceFile) { byte bytesPerWord = sizeof(T); @@ -162,12 +141,6 @@ void Utils::unDiff(T *dest, Common::File *sourceFile) { } } -/*------------------------- unDiff Vertical Memory --------------------------*/ - -/** - * Undiffs a piece of memory when header size is a byte, and copy/skip size - * is a byte or a word or a double word. - */ template<typename T> void Utils::verticalUnDiff(T *dest, Common::File *sourceFile, uint16 bytesPerRow) { uint16 counter = 0; @@ -262,9 +235,6 @@ void Utils::verticalRunLengthDecode(byte *dest, Common::File *sourceFile, uint16 } } -/** - * Does the undiffing between the bitmaps. - */ void Utils::unDiff(byte *newBuf, byte *oldBuf, Common::File *sourceFile, uint16 bytesPerRow, bool isVertical) { sourceFile->skip(1); byte bufType = sourceFile->readByte(); diff --git a/engines/lab/utils.h b/engines/lab/utils.h index 333d532c9a..a7bb42007e 100644 --- a/engines/lab/utils.h +++ b/engines/lab/utils.h @@ -38,9 +38,16 @@ private: LabEngine *_vm; uint16 _dataBytesPerRow; + /** + * Undiffs a piece of memory based on the header size. + */ template<typename T> void unDiff(T *dest, Common::File *sourceFile); + /** + * Undiffs a piece of memory when header size is a byte, and copy/skip size + * is a byte or a word or a double word. + */ template<typename T> void verticalUnDiff(T *dest, Common::File *sourceFile, uint16 bytesPerRow); @@ -49,17 +56,42 @@ public: Common::RandomSource _rnd; + /** + * Scales the x co-ordinates to that of the new display. In the room parser + * file, co-ordinates are set up on a 360x336 display. + */ uint16 scaleX(uint16 x); + + /** + * Scales the y co-ordinates to that of the new display. In the room parser + * file, co-ordinates are set up on a 368x336 display. + */ uint16 scaleY(uint16 y); Common::Rect rectScale(int16 x1, int16 y1, int16 x2, int16 y2); + + /** + * Scales the VGA x coords to SVGA if necessary; otherwise, returns VGA coords. + */ int16 vgaScaleX(int16 x); + + /** + * Scales the VGA y coords to SVGA if necessary; otherwise, returns VGA coords. + */ int16 vgaScaleY(int16 y); Common::Rect vgaRectScale(int16 x1, int16 y1, int16 x2, int16 y2); uint16 svgaCord(uint16 cord); uint16 mapScaleX(uint16 x); uint16 mapScaleY(uint16 y); Common::Rect mapRectScale(int16 x1, int16 y1, int16 x2, int16 y2); + + /** + * Converts SVGA coords to VGA if necessary, otherwise returns VGA coords. + */ Common::Point vgaUnscale(Common::Point pos); + + /** + * Does the undiffing between the bitmaps. + */ void unDiff(byte *newBuf, byte *oldBuf, Common::File *sourceFile, uint16 bytesPerRow, bool isVertical); void runLengthDecode(byte *dest, Common::File *sourceFile); void verticalRunLengthDecode(byte *dest, Common::File *sourceFile, uint16 bytesPerRow); |