26 #ifndef SAGA2_SPRITE_H 27 #define SAGA2_SPRITE_H 29 #include "saga2/rect.h" 66 Sprite *sprite(int16 index) {
67 return sprites[index];
86 enum spriteFacingDirections {
98 const int kNumPoseFacings = 8;
110 kActorFlipped = (1 << 0),
111 kLeftObjectFlipped = (1 << 1),
112 kRightObjectFlipped = (1 << 2),
116 kLeftObjectInFront = (1 << 3),
117 kRightObjectInFront = (1 << 4),
118 kLeftOverRight = (1 << 5)
123 uint8 actorFrameIndex,
125 uint8 leftObjectIndex,
148 uint16 start[kNumPoseFacings];
149 uint16 count[kNumPoseFacings];
157 uint32 numAnimations;
170 typedef uint8 ColorTable[256];
202 enum spriteEffectFlags {
203 kSprFXGhosted = (1 << 0),
204 kSprFXTerrainMask = (1 << 1),
205 kSprFXGhostIfObscured = (1 << 2)
228 enum spriteBankNums {
229 kSprStandBankNum = 0,
247 enum spriteBankBits {
248 kSprStandBank = (1 << kSprStandBankNum),
249 kSprWalkBank = (1 << kSprWalkBankNum),
250 kSprRunBank = (1 << kSprRunBankNum),
251 kSprKneelBank = (1 << kSprKneelBankNum),
252 kSprLeapBank = (1 << kSprLeapBankNum),
253 kSprClimbBank = (1 << kSprClimbBankNum),
254 kSprTalkBank = (1 << kSprTalkBankNum),
255 kSprFight1HBank = (1 << kSprFight1HBankNum),
256 kSprFight2HBank = (1 << kSprFight2HBankNum),
257 kSprFireBank = (1 << kSprFireBankNum),
258 kSprPassiveBank = (1 << kSprPassiveBankNum),
259 kSprUpStairsBank = (1 << kSprUpStairsBankNum),
260 kSprDnStairsBank = (1 << kSprDnStairsBankNum),
261 kSprSitBank = (1 << kSprSitBankNum)
281 void loadSpriteBanks(int16 banksNeeded);
284 bool isBankLoaded(int16 bank) {
285 return _spriteBanks[bank] !=
nullptr;
289 void requestBank(int16 bank) {
291 if (!isBankLoaded(bank))
292 loadSpriteBanks((int16)(1 << bank));
296 if (_poseList ==
nullptr)
299 if (num >= (
int)_poseList->numAnimations) {
300 warning(
"ActorPose:animation(), animation number is too high, %d >= %d", num, _poseList->numAnimations);
305 return _poseList->animations[num];
311 if (_poseList ==
nullptr)
314 if (num < 0 || num >= anim->count[dir])
317 num += anim->start[dir];
319 if (num >= (
int)_poseList->numPoses) {
320 warning(
"ActorPose::pose(), pose number is too high, %d >= %d", num, _poseList->numPoses);
324 return _poseList->poses[num];
333 void cleanupSprites();
341 void DrawCompositeMaskedSprite(
348 bool *obscured = NULL);
351 void DrawColorMappedSprite(
358 void ExpandColorMappedSprite(
364 uint8 GetSpritePixel(
370 uint16 visiblePixelsInSprite(
379 void buildColorTable(
void warning(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
Definition: memstream.h:194
Definition: tcoords.h:127