[Scummvm-cvs-logs] scummvm master -> 2bad773046f530f3b58c44ba8879bd4f562c2078

Strangerke Strangerke at scummvm.org
Sun Dec 27 01:11:56 CET 2015


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:
2bad773046 LAB: Use an enum for special room ids


Commit: 2bad773046f530f3b58c44ba8879bd4f562c2078
    https://github.com/scummvm/scummvm/commit/2bad773046f530f3b58c44ba8879bd4f562c2078
Author: Strangerke (strangerke at scummvm.org)
Date: 2015-12-27T01:05:43+01:00

Commit Message:
LAB: Use an enum for special room ids

Changed paths:
    engines/lab/map.cpp
    engines/lab/processroom.h



diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp
index 6bd91c1..f7b2cfe 100644
--- a/engines/lab/map.cpp
+++ b/engines/lab/map.cpp
@@ -90,7 +90,7 @@ void LabEngine::loadMapData() {
 		_maps[i]._x = mapFile->readUint16LE();
 		_maps[i]._y = mapFile->readUint16LE();
 		_maps[i]._pageNumber = mapFile->readUint16LE();
-		_maps[i]._specialID = mapFile->readUint16LE();
+		_maps[i]._specialID = (SpecialRoom) mapFile->readUint16LE();
 		_maps[i]._mapFlags = mapFile->readUint32LE();
 	}
 
@@ -133,18 +133,18 @@ Common::Rect LabEngine::roomCoords(uint16 curRoom) {
 	Image *curRoomImg = nullptr;
 
 	switch (_maps[curRoom]._specialID) {
-	case NORMAL:
-	case UPARROWROOM:
-	case DOWNARROWROOM:
+	case kNormalRoom:
+	case kUpArrowRoom:
+	case kDownArrowRoom:
 		curRoomImg = _imgRoom;
 		break;
-	case BRIDGEROOM:
+	case kBridgeRoom:
 		curRoomImg = _imgBridge;
 		break;
-	case VCORRIDOR:
+	case kVerticalCorridor:
 		curRoomImg = _imgVRoom;
 		break;
-	case HCORRIDOR:
+	case kHorizontalCorridor:
 		curRoomImg = _imgHRoom;
 		break;
 	default:
@@ -173,12 +173,12 @@ void LabEngine::drawRoomMap(uint16 curRoom, bool drawMarkFl) {
 	uint32 flags = _maps[curRoom]._mapFlags;
 
 	switch (_maps[curRoom]._specialID) {
-	case NORMAL:
-	case UPARROWROOM:
-	case DOWNARROWROOM:
-		if (_maps[curRoom]._specialID == NORMAL)
+	case kNormalRoom:
+	case kUpArrowRoom:
+	case kDownArrowRoom:
+		if (_maps[curRoom]._specialID == kNormalRoom)
 			_imgRoom->drawImage(x, y);
-		else if (_maps[curRoom]._specialID == DOWNARROWROOM)
+		else if (_maps[curRoom]._specialID == kDownArrowRoom)
 			_imgDownArrowRoom->drawImage(x, y);
 		else
 			_imgUpArrowRoom->drawImage(x, y);
@@ -204,7 +204,7 @@ void LabEngine::drawRoomMap(uint16 curRoom, bool drawMarkFl) {
 
 		break;
 
-	case BRIDGEROOM:
+	case kBridgeRoom:
 		_imgBridge->drawImage(x, y);
 
 		drawX = x + (_imgBridge->_width - _imgMapX[_direction]->_width) / 2;
@@ -212,7 +212,7 @@ void LabEngine::drawRoomMap(uint16 curRoom, bool drawMarkFl) {
 
 		break;
 
-	case VCORRIDOR:
+	case kVerticalCorridor:
 		_imgVRoom->drawImage(x, y);
 
 		offset = (_imgVRoom->_width - _imgPath->_width) / 2;
@@ -250,7 +250,7 @@ void LabEngine::drawRoomMap(uint16 curRoom, bool drawMarkFl) {
 
 		break;
 
-	case HCORRIDOR:
+	case kHorizontalCorridor:
 		_imgHRoom->drawImage(x, y);
 
 		offset = (_imgRoom->_width - _imgPath->_width) / 2;
diff --git a/engines/lab/processroom.h b/engines/lab/processroom.h
index ee8a973..8ddf5ad 100644
--- a/engines/lab/processroom.h
+++ b/engines/lab/processroom.h
@@ -119,13 +119,20 @@ enum MapDoors {
 	kDoorBottomWest = 128
 };
 
-// Special Map ID's
-#define     NORMAL           0
-#define     UPARROWROOM      1
-#define     DOWNARROWROOM    2
-#define     BRIDGEROOM       3
-#define     VCORRIDOR        4
-#define     HCORRIDOR        5
+enum SpecialRoom {
+	kNormalRoom = 0,
+	kUpArrowRoom,
+	kDownArrowRoom,
+	kBridgeRoom,
+	kVerticalCorridor,
+	kHorizontalCorridor,
+	kMedMaze,
+	kHedgeMaze,
+	kSurMaze,
+	kMultiMazeF1,
+	kMultiMazeF2,
+	kMultiMazeF3
+};
 
 #if defined(WIN32)
 #pragma pack(push, 1)
@@ -177,7 +184,8 @@ struct InventoryData {
 };
 
 struct MapData {
-	uint16 _x, _y, _pageNumber, _specialID;
+	uint16 _x, _y, _pageNumber;
+	SpecialRoom _specialID;
 	uint32 _mapFlags;
 };
 






More information about the Scummvm-git-logs mailing list