[Scummvm-cvs-logs] scummvm master -> 31e08b923cd120e0428a5b78eec0dd4d63e3c13d

wjp wjp at usecode.org
Sun Apr 21 00:25:58 CEST 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
31e08b923c HOPKINS: MAX_LINES cleanup


Commit: 31e08b923cd120e0428a5b78eec0dd4d63e3c13d
    https://github.com/scummvm/scummvm/commit/31e08b923cd120e0428a5b78eec0dd4d63e3c13d
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2013-04-20T15:24:48-07:00

Commit Message:
HOPKINS: MAX_LINES cleanup

Changed paths:
    engines/hopkins/hopkins.h
    engines/hopkins/lines.cpp
    engines/hopkins/lines.h



diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h
index 499f0c4..b5de387 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 3fe72d8..0848260 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 9e397cc..2eeafda 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;






More information about the Scummvm-git-logs mailing list