22 #ifndef SCUMM_HE_MOONBASE_MAP_MIF_H 23 #define SCUMM_HE_MOONBASE_MAP_MIF_H 27 #include "scumm/he/intern_he.h" 31 #define MAX_TILE_COUNT 80 33 #include "common/pack-start.h" 40 struct EnergyPoolLoc {
52 uint16 numEnergyPools;
54 uint16 terrainStates[80][161];
58 EnergyPoolLoc poolLocs[49];
61 PixelLoc fourPlayerPoints[4];
62 PixelLoc threePlayerPoints[3];
63 PixelLoc twoPlayerPoints[2];
64 PixelLoc twoVTwoPoints[4];
65 PixelLoc oneVThreePoints[4];
66 PixelLoc oneVTwoPoints[3];
69 memset(
this, 0,
sizeof(MapFile));
72 memset(fourPlayerPoints, 0xFF,
sizeof(fourPlayerPoints));
73 memset(threePlayerPoints, 0xFF,
sizeof(threePlayerPoints));
74 memset(twoPlayerPoints, 0xFF,
sizeof(twoPlayerPoints));
75 memset(twoVTwoPoints, 0xFF,
sizeof(twoVTwoPoints));
76 memset(oneVThreePoints, 0xFF,
sizeof(oneVThreePoints));
77 memset(oneVTwoPoints, 0xFF,
sizeof(oneVTwoPoints));
81 #include "common/pack-end.h" 87 void generateMap(MapFile *map);
92 byte _cornerMap[MAX_TILE_COUNT][MAX_TILE_COUNT] = { {}, {} };
93 int8 _centerMap[MAX_TILE_COUNT][MAX_TILE_COUNT] = { {}, {} };
96 void defineStartLocations(MapFile *map);
97 void defineEnergyPools(MapFile *map);
98 void makeCraters(MapFile *map);
99 uint16 findTileFor(
int x,
int y);
101 inline char tlCenter(
int x,
int y)
const {
102 return _centerMap[(0 == x) ? _dimension - 1 : x - 1][(0 == y) ? _dimension - 1 : y - 1];
105 inline char tCenter(
int x,
int y)
const {
106 return _centerMap[x][(0 == y) ? _dimension - 1 : y - 1];
109 inline char trCenter(
int x,
int y)
const {
110 return _centerMap[(x + 1) % _dimension][(0 == y) ? _dimension - 1 : y - 1];
113 inline char lCenter(
int x,
int y)
const {
114 return _centerMap[(0 == x) ? _dimension - 1 : x - 1][y];
117 inline char rCenter(
int x,
int y)
const {
118 return _centerMap[(x + 1) % _dimension][y];
121 inline char blCenter(
int x,
int y)
const {
122 return _centerMap[(0 == x) ? _dimension - 1 : x - 1][(y + 1) % _dimension];
125 inline char bCenter(
int x,
int y)
const {
126 return _centerMap[x][(y + 1) % _dimension];
129 inline char brCenter(
int x,
int y)
const {
130 return _centerMap[(x + 1) % _dimension][(y + 1) % _dimension];
133 inline byte tlCorner(
int x,
int y)
const {
134 return _cornerMap[x][y];
137 inline byte trCorner(
int x,
int y)
const {
138 return _cornerMap[(x + 1) % _dimension][y];
141 inline byte blCorner(
int x,
int y)
const {
142 return _cornerMap[x][(y + 1) % _dimension];
145 inline byte brCorner(
int x,
int y)
const {
146 return _cornerMap[(x + 1) % _dimension][(y + 1) % _dimension];
149 inline byte ttllCorner(
int x,
int y)
const {
150 return tlCorner((x == 0) ? _dimension - 1 : x - 1, (y == 0) ? _dimension - 1: y - 1);
153 inline byte ttlCorner(
int x,
int y)
const {
154 return trCorner((x == 0) ? _dimension - 1 : x - 1, (y == 0) ? _dimension - 1: y - 1);
157 inline byte ttrCorner(
int x,
int y)
const {
158 return tlCorner((x + 1) % _dimension, (y == 0) ? _dimension - 1: y - 1);
161 inline byte ttrrCorner(
int x,
int y)
const {
162 return trCorner((x + 1) % _dimension, (y == 0) ? _dimension - 1: y - 1);
165 inline byte tllCorner(
int x,
int y)
const {
166 return tlCorner((x == 0) ? _dimension - 1 : x - 1, y);
169 inline byte trrCorner(
int x,
int y)
const {
170 return trCorner((x + 1) % _dimension, y);
173 inline byte bllCorner(
int x,
int y)
const {
174 return blCorner((x == 0) ? _dimension - 1 : x - 1, y);
177 inline byte brrCorner(
int x,
int y)
const {
178 return brCorner((x + 1) % _dimension, y);
181 inline byte bbllCorner(
int x,
int y)
const {
182 return blCorner((x == 0) ? _dimension - 1 : x - 1, (y + 1) % _dimension);
185 inline byte bblCorner(
int x,
int y)
const {
186 return brCorner((x == 0) ? _dimension - 1 : x - 1, (y + 1) % _dimension);
189 inline byte bbrCorner(
int x,
int y)
const {
190 return blCorner((x + 1) % _dimension, (y + 1) % _dimension);
193 inline byte bbrrCorner(
int x,
int y)
const {
194 return brCorner((x + 1) % _dimension, (y + 1) % _dimension);
203 #endif // SCUMM_HE_MOONBASE_MAP_MIF_H