27 #ifndef ICB_RAB_API_HH 28 #define ICB_RAB_API_HH 30 #include "engines/icb/gfx/psx_pcdefines.h" 31 #include "engines/icb/gfx/rap_api.h" 36 #define RAB_API_SCHEMA 7 37 #define RAB_API_ID "RAB" 41 #define ALL_ANGLES_32_BYTE_SIZE (4) 42 #define ALL_DELTAS_24_BYTE_SIZE (3) 43 #define ALL_DELTAS_16_BYTE_SIZE (2) 44 #define ALL_DELTAS_8_BYTE_SIZE (1) 46 #define NONZERO_ANGLES_32_BYTE_SIZE (5) 47 #define NONZERO_DELTAS_24_BYTE_SIZE (4) 48 #define NONZERO_DELTAS_16_BYTE_SIZE (3) 49 #define NONZERO_DELTAS_8_BYTE_SIZE (2) 51 #define ZERO_ANGLE (0) 53 #define DELTA_24_NBITS (8) 54 #define DELTA_16_NBITS (5) 55 #define DELTA_8_NBITS (2) 57 #define DELTA_24_ZERO (((1 << (DELTA_24_NBITS - 1)) << (DELTA_24_NBITS + DELTA_24_NBITS)) | ((1 << (DELTA_24_NBITS - 1)) << (DELTA_24_NBITS)) | (1 << (DELTA_24_NBITS - 1))) 58 #define DELTA_16_ZERO (((1 << (DELTA_16_NBITS - 1)) << (DELTA_16_NBITS + DELTA_16_NBITS)) | ((1 << (DELTA_16_NBITS - 1)) << (DELTA_16_NBITS)) | (1 << (DELTA_16_NBITS - 1))) 59 #define DELTA_8_ZERO (((1 << (DELTA_8_NBITS - 1)) << (DELTA_8_NBITS + DELTA_8_NBITS)) | ((1 << (DELTA_8_NBITS - 1)) << (DELTA_8_NBITS)) | (1 << (DELTA_8_NBITS - 1))) 82 #define DataTypeMask (1 << 7) 83 #define DataTypeDeltas (1 << 7) 84 #define DataTypeAngles (0) 87 #define DataStoreZeroMask (1 << 6) 88 #define DataStoreZero (1 << 6) 89 #define DataDontStoreZero (0) 92 #define DataSizeBitMask (0xF) 94 #define ALL_ANGLES_32_TYPESIZE (DataTypeAngles | DataStoreZero | 4) 95 #define ALL_DELTAS_24_TYPESIZE (DataTypeDeltas | DataStoreZero | 3) 96 #define ALL_DELTAS_16_TYPESIZE (DataTypeDeltas | DataStoreZero | 2) 97 #define ALL_DELTAS_8_TYPESIZE (DataTypeDeltas | DataStoreZero | 1) 99 #define NONZERO_ANGLES_32_TYPESIZE (DataTypeAngles | DataDontStoreZero | 4) 100 #define NONZERO_DELTAS_24_TYPESIZE (DataTypeDeltas | DataDontStoreZero | 3) 101 #define NONZERO_DELTAS_16_TYPESIZE (DataTypeDeltas | DataDontStoreZero | 2) 102 #define NONZERO_DELTAS_8_TYPESIZE (DataTypeDeltas | DataDontStoreZero | 1) 105 #define COMP_ANGLE_RANGE (1 << 10) 106 #define COMP_ANGLE_SHIFT (2) 107 #define COMP_VX_SHIFT (20) 108 #define COMP_VY_SHIFT (10) 109 #define COMP_VZ_SHIFT (0) 110 #define COMP_VX_MASK (0x3FF) 111 #define COMP_VY_MASK (0x3FF) 112 #define COMP_VZ_MASK (0x3FF) 114 #define COMP_EXTRA_SHIFT (0) 115 #define COMP_DELTA_RANGE (COMP_ANGLE_RANGE) 135 typedef uint32 CompTriplet;
154 uint32 currentFrameOffset;
157 uint32 frameOffsets[1];
163 static Bone_Frame *GetCurrentFrame(
RabAPI *rab) {
return (
Bone_Frame *)((uint8 *)(rab->id + FROM_LE_32(rab->currentFrameOffset))); }
165 static FrameData *GetFrameData(
RabAPI *rab,
const int32 f) {
return (
FrameData *)((uint8 *)(rab->id + FROM_LE_32(rab->frameOffsets[f]))); }
171 int32 CompressSVECTOR(
SVECTOR rotin, uint32 *rotout);
175 inline void ExpandSVECTOR(CompTriplet rotin,
SVECTOR *rotout) {
178 rotout->vx = (int16)(((int16)(rotin >> COMP_VX_SHIFT) & COMP_VX_MASK) << COMP_ANGLE_SHIFT);
180 rotout->vy = (int16)(((int16)(rotin >> COMP_VY_SHIFT) & COMP_VY_MASK) << COMP_ANGLE_SHIFT);
182 rotout->vz = (int16)(((int16)(rotin >> COMP_VZ_SHIFT) & COMP_VZ_MASK) << COMP_ANGLE_SHIFT);
187 #endif // #ifndef RAB_API_HH Definition: rab_api.h:160
Definition: px_capri_maths.h:53
Definition: rab_api.h:125
Definition: psx_pcdefines.h:41
Definition: rab_api.h:137
Definition: rab_api.h:141
Definition: rab_api.h:146
Definition: rab_api.h:130
Definition: rab_api.h:118
Definition: px_capri_maths.h:38