26 #ifndef SAGA2_IDTYPES_H 27 #define SAGA2_IDTYPES_H 33 typedef uint32 ChunkID;
34 #define MakeID(a,b,c,d) ((d<<24L)|(c<<16L)|(b<<8L)|a) 40 typedef uint16 ObjectID;
44 const ObjectID Nothing = 0,
55 typedef uint16 TileID;
57 const int16 nullID = -1;
63 typedef int16 PlayerActorID;
84 MetaTileID(int16 m, int16 i) : map(m), index(i) {}
97 bool operator == (
const MetaTileID &
id)
const {
98 return map ==
id.map && index ==
id.index;
101 bool operator != (
const MetaTileID &
id)
const {
102 return map !=
id.map || index !=
id.index;
113 const int kActiveItemIndexMask = 0x1FFF;
114 const int kActiveItemMapMask = 0xE000;
115 const int kActiveItemMapShift = 13;
117 const int16 kActiveItemIndexNullID = 0x1FFF;
123 #include "common/pack-start.h" 141 val((m << kActiveItemMapShift) | (i & kActiveItemIndexMask)) {
159 return val ==
id.val;
163 return val !=
id.val;
170 void setMapNum(int16 m) {
171 val &= ~kActiveItemMapMask;
172 val |= (m << kActiveItemMapShift);
176 return (uint16)val >> kActiveItemMapShift;
179 void setIndexNum(int16 i) {
180 val &= ~kActiveItemIndexMask;
181 val |= i & kActiveItemIndexMask;
184 int16 getIndexNum() {
185 return val & kActiveItemIndexMask;
188 #include "common/pack-end.h" 204 typedef int16 TaskID;
205 const TaskID NoTask = -1;
207 typedef int16 TaskStackID;
208 const TaskStackID NoTaskStack = -1;
214 typedef int16 TimerID;
220 typedef int16 SensorID;
226 typedef int16 BandID;
227 const BandID NoBand = -1;
231 typedef uint16 weaponID;
233 typedef uint32 hResID;
235 typedef uint8 ColorTable[256];
238 #define offsetof(type,field) (uint32)&(((type *)0)->field) 241 #define maxuint8 0xff 242 #define maxint16 0x7fff 243 #define minint16 0x8000 244 #define maxuint16 0xffff 245 #define maxint32 0x7fffffff 248 kActorListID =
MKTAG(
'A',
'C',
'T',
'O')
252 const int kNumViews = 3;
268 enum effectDamageTypes {
274 kDamageProjectile = 3,
280 kDamageLightning = 8,
284 kDamageToUndead = 11,
285 kDamageDirMagic = 12,
297 kTileMaxHeight = 160,
298 kTileDX = (kTileWidth / 2),
299 kTileDY = (kTileHeight / 2),
302 kTileDXMask = (kTileDX - 1),
303 kTileDYMask = (kTileDY - 1),
314 kTileUVMask = (kTileUVSize - 1)
320 kSectorSize = kTileUVSize * 8 * 4,
321 kSectorShift = kTileUVShift + 3 + 2,
322 kSectorMask = (kSectorSize - 1)
328 kPlatMask = kPlatformWidth - 1,
330 kPlatUVSize = kTileUVSize * kPlatformWidth
335 kMetaTileWidth = kTileWidth * kPlatformWidth,
336 kMetaTileHeight = kTileHeight * kPlatformWidth,
337 kMetaDX = kMetaTileWidth / 2,
338 kMetaDY = kMetaTileHeight / 2
343 kSubTileMask = kSubTileSize - 1,
346 kTileSubMask = kTileSubSize - 1,
352 kSubTileDX = (kTileDX / 4),
353 kSubTileDY = (kTileDY / 4),
354 kSubTileDXShift = (kTileDXShift - 2),
355 kSubTileDYShift = (kTileDYShift - 2)
359 kSubTileMaskUShift = 4,
360 kSubTileMaskVShift = 1
375 kNumSaveLoadPanels = 3,
376 kNumSaveLoadBtns = 4,
377 kNumSaveLoadTexts = 1,
382 kSLDBoxX = (640 - kSLDBoxXSize) / 2,
383 kSLDBoxY = (480 - kSLDBoxYSize) / 3,
395 kNumOptionsPanels = 3,
397 kNumOptionsTexts = 8,
402 kOptBoxX = (640 - kOptBoxXSize) / 2,
403 kOptBoxY = (480 - kOptBoxYSize) / 3,
416 kButtonYOffset = kOptTPHeight + 7,
417 kPushButtonWidth = 121,
418 kPushButtonHeight = 30,
424 kSmallTextOffset = 80
429 kNumMessagePanels = 1,
431 kNumMessageTexts = 2,
437 kMesBoxX = (640 - kMesBoxXSize) / 2,
438 kMesBoxY = (480 - kMesBoxYSize) / 3
445 kTileRectWidth = 448 - 8,
446 kTileRectHeight = 428 - 8
451 kMaxActiveSpells = 8,
452 kBaseBubbleSpriteIndex = 111,
453 kBubbleSpriteCount = 8
458 kMinAutoAggressionVitality = 5,
463 kObjectVolumeArraySize = 128
Definition: idtypes.h:119
Definition: idtypes.h:124
#define MKTAG(a0, a1, a2, a3)
Definition: endian.h:188