aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2013-04-21 00:23:45 +0200
committerWillem Jan Palenstijn2013-04-21 00:24:48 +0200
commit31e08b923cd120e0428a5b78eec0dd4d63e3c13d (patch)
treeb549bd9a28b3c2e2357d9a82fc6beb61b0667c2c
parentb97edfcbe0f53f0d6416c25128647441f0ff50b6 (diff)
downloadscummvm-rg350-31e08b923cd120e0428a5b78eec0dd4d63e3c13d.tar.gz
scummvm-rg350-31e08b923cd120e0428a5b78eec0dd4d63e3c13d.tar.bz2
scummvm-rg350-31e08b923cd120e0428a5b78eec0dd4d63e3c13d.zip
HOPKINS: MAX_LINES cleanup
-rw-r--r--engines/hopkins/hopkins.h2
-rw-r--r--engines/hopkins/lines.cpp2
-rw-r--r--engines/hopkins/lines.h6
3 files changed, 5 insertions, 5 deletions
diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h
index 499f0c466d..b5de387894 100644
--- a/engines/hopkins/hopkins.h
+++ b/engines/hopkins/hopkins.h
@@ -74,8 +74,6 @@ enum {
#define SCREEN_WIDTH 640
#define SCREEN_HEIGHT 480
-#define MAX_LINES 400
-
/**
* A wrapper macro used around three character constants, like 'END', to
* ensure portability. Typical usage: MKTAG24('E','N','D').
diff --git a/engines/hopkins/lines.cpp b/engines/hopkins/lines.cpp
index 3fe72d83b0..08482607c9 100644
--- a/engines/hopkins/lines.cpp
+++ b/engines/hopkins/lines.cpp
@@ -252,7 +252,7 @@ void LinesManager::addZoneLine(int idx, int fromX, int fromY, int destX, int des
* Add Line
*/
void LinesManager::addLine(int lineIdx, Directions direction, int fromX, int fromY, int destX, int destY) {
- assert (lineIdx <= MAX_LINES);
+ assert (lineIdx < MAX_LINES);
if (_linesNumb < lineIdx)
_linesNumb = lineIdx;
diff --git a/engines/hopkins/lines.h b/engines/hopkins/lines.h
index 9e397cca3d..2eeafdac09 100644
--- a/engines/hopkins/lines.h
+++ b/engines/hopkins/lines.h
@@ -40,6 +40,8 @@ struct LigneZoneItem {
#define INVALID_LINE_VALUE 1300
+#define MAX_LINES 400
+
struct RouteItem;
struct LigneItem {
@@ -111,7 +113,7 @@ private:
int _pathFindingMaxDepth;
SmoothItem _smoothRoute[4000];
Directions _smoothMoveDirection;
- LigneZoneItem _zoneLine[401];
+ LigneZoneItem _zoneLine[MAX_LINES+1];
SegmentItem _segment[101];
SquareZoneItem _squareZone[101];
int _currentSegmentId;
@@ -134,7 +136,7 @@ private:
RouteItem *_testRoute0;
RouteItem *_testRoute1;
int16 *_lineBuf;
- LigneItem _lineItem[400];
+ LigneItem _lineItem[MAX_LINES];
RouteItem _bestRoute[8001];
int _zoneSkipCount;
int _oldMouseZoneId;