aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2015-12-12 19:21:38 +0200
committerWillem Jan Palenstijn2015-12-23 21:34:00 +0100
commit0c0b2da235bfbbc3a11ef9677137d5a77f5b35a2 (patch)
tree80f8d6017737753f0f9cd98228ea5580a066fe6f /engines
parent4fb53ad170f483bbce2e27643cd3ee1fa604cebd (diff)
downloadscummvm-rg350-0c0b2da235bfbbc3a11ef9677137d5a77f5b35a2.tar.gz
scummvm-rg350-0c0b2da235bfbbc3a11ef9677137d5a77f5b35a2.tar.bz2
scummvm-rg350-0c0b2da235bfbbc3a11ef9677137d5a77f5b35a2.zip
LAB: Move some defines which are only used in the tile puzzle
Diffstat (limited to 'engines')
-rw-r--r--engines/lab/lab.h6
-rw-r--r--engines/lab/tilepuzzle.cpp26
2 files changed, 18 insertions, 14 deletions
diff --git a/engines/lab/lab.h b/engines/lab/lab.h
index 9581925146..639983b55e 100644
--- a/engines/lab/lab.h
+++ b/engines/lab/lab.h
@@ -67,12 +67,6 @@ enum GameFeatures {
};
#define ONESECOND 1000
-#define BRICKOPEN 115
-#define COMBINATIONUNLOCKED 130
-#define LEFTSCROLL 1
-#define RIGHTSCROLL 2
-#define UPSCROLL 3
-#define DOWNSCROLL 4
typedef Common::List<Gadget *> GadgetList;
diff --git a/engines/lab/tilepuzzle.cpp b/engines/lab/tilepuzzle.cpp
index 782bcda483..4d461a8c07 100644
--- a/engines/lab/tilepuzzle.cpp
+++ b/engines/lab/tilepuzzle.cpp
@@ -43,6 +43,16 @@
namespace Lab {
+#define BRICKOPEN 115
+#define COMBINATIONUNLOCKED 130
+
+enum TileScroll {
+ kScrollLeft = 1,
+ kScrollRight = 2,
+ kScrollUp = 3,
+ kScrollDown = 4
+};
+
const uint16 INIT_TILE[4][4] = {
{ 1, 5, 9, 13 },
{ 2, 6, 10, 14 },
@@ -111,7 +121,7 @@ void TilePuzzle::changeTile(uint16 col, uint16 row) {
if (_curTile[col][row - 1] == 0) {
_curTile[col][row - 1] = _curTile[col][row];
_curTile[col][row] = 0;
- scrolltype = DOWNSCROLL;
+ scrolltype = kScrollDown;
}
}
@@ -119,7 +129,7 @@ void TilePuzzle::changeTile(uint16 col, uint16 row) {
if (_curTile[col - 1][row] == 0) {
_curTile[col - 1][row] = _curTile[col][row];
_curTile[col][row] = 0;
- scrolltype = RIGHTSCROLL;
+ scrolltype = kScrollRight;
}
}
@@ -127,7 +137,7 @@ void TilePuzzle::changeTile(uint16 col, uint16 row) {
if (_curTile[col][row + 1] == 0) {
_curTile[col][row + 1] = _curTile[col][row];
_curTile[col][row] = 0;
- scrolltype = UPSCROLL;
+ scrolltype = kScrollUp;
}
}
@@ -135,7 +145,7 @@ void TilePuzzle::changeTile(uint16 col, uint16 row) {
if (_curTile[col + 1][row] == 0) {
_curTile[col + 1][row] = _curTile[col][row];
_curTile[col][row] = 0;
- scrolltype = LEFTSCROLL;
+ scrolltype = kScrollLeft;
}
}
@@ -269,20 +279,20 @@ void TilePuzzle::doTileScroll(uint16 col, uint16 row, uint16 scrolltype) {
int16 dX = 0, dY = 0, dx = 0, dy = 0, sx = 0, sy = 0;
uint16 last = 0;
- if (scrolltype == LEFTSCROLL) {
+ if (scrolltype == kScrollLeft) {
dX = _vm->_utils->vgaScaleX(5);
sx = _vm->_utils->vgaScaleX(5);
last = 6;
- } else if (scrolltype == RIGHTSCROLL) {
+ } else if (scrolltype == kScrollRight) {
dX = _vm->_utils->vgaScaleX(-5);
dx = _vm->_utils->vgaScaleX(-5);
sx = _vm->_utils->vgaScaleX(5);
last = 6;
- } else if (scrolltype == UPSCROLL) {
+ } else if (scrolltype == kScrollUp) {
dY = _vm->_utils->vgaScaleY(5);
sy = _vm->_utils->vgaScaleY(5);
last = 5;
- } else if (scrolltype == DOWNSCROLL) {
+ } else if (scrolltype == kScrollDown) {
dY = _vm->_utils->vgaScaleY(-5);
dy = _vm->_utils->vgaScaleY(-5);
sy = _vm->_utils->vgaScaleY(5);