27 #ifndef ICB_PX_COMMON_H 28 #define ICB_PX_COMMON_H 30 #include "common/scummsys.h" 32 #include "engines/icb/common/px_rcutypes.h" 36 #define PXNULL (0xffffffff) 40 #define PSX_FIXED_POINT_SCALE 4096 42 #define PSX_FLOAT_POINT_SHIFT 12 43 #define PSX_FLOAT_POINT_SCALE (1 << PSX_FLOAT_POINT_SHIFT) 44 #define PSX_ANGLE_POINT_SCALE 4096 45 #define PSX_DOUBLE_POINT_SCALE 4096 50 #define FT_MACRO(a, b, c, d) (a | (b << 8) | (c << 16) | (d << 24)) 54 unusedFT_COMPILED_GAME_OBJECT,
60 unusedFT_FN_ROUTINES_DAT,
61 unusedFT_OBJECTS_SCRIPTS_DAT,
62 unusedFT_LINKED_SCRIPTS,
63 unusedFT_LINKED_OBJECTS,
83 FT_COMPILED_SCRIPTS = FT_MACRO(
'C',
'S',
'C',
'R'),
84 FT_LINKED_SCRIPTS = FT_MACRO(
'L',
'S',
'C',
'R'),
85 FT_LINKED_OBJECTS = FT_MACRO(
'L',
'O',
'B',
'J'),
86 FT_COMPILED_GAME_OBJECT = FT_MACRO(
'C',
'O',
'B',
'J'),
87 FT_FN_ROUTINES_DAT = FT_MACRO(
'F',
'N',
'D',
'T'),
88 FT_COMBINED_OBJECT = FT_MACRO(
'C',
'M',
'B',
'O'),
89 FT_COMPILED_TEXT = FT_MACRO(
'C',
'M',
'P',
'T'),
90 FT_LINKED_TEXT = FT_MACRO(
'L',
'N',
'K',
'T'),
92 FT_COMPILED_SFX = FT_MACRO(
'S',
'F',
'X',
' '),
93 FT_LINKED_SFX = FT_MACRO(
'S',
'F',
'X',
'L'),
94 FT_REMORA_MAP = FT_MACRO(
'R',
'M',
'A',
'P')
98 #define STANDARD_HEADER_NAME_LENGTH 32 // Max length of the header name 106 char name[STANDARD_HEADER_NAME_LENGTH];
116 typedef float PXreal;
117 typedef float PXfloat;
118 typedef double PXdouble;
119 #define REAL_ZERO 0.0f 120 #define REAL_ONE 1.0f 121 #define REAL_TWO 2.0f 122 #define REAL_MIN FLT_MIN 123 #define REAL_MAX FLT_MAX 124 #define REAL_LARGE 100000.0f 126 #define FLOAT_ZERO 0.0f 127 #define FLOAT_QUARTER 0.25f 128 #define FLOAT_HALF 0.5f 129 #define FLOAT_ONE 1.0f 130 #define FLOAT_TWO 2.0f 131 #define FLOAT_MIN FLT_MIN 132 #define FLOAT_MAX FLT_MAX 133 #define FLOAT_LARGE 100000.0f 135 #define ZERO_TURN 0.0f 136 #define QUARTER_TURN 0.25f 137 #define HALF_TURN 0.5f 138 #define FULL_TURN 1.0f 140 #define TWO_PI (2.0f * M_PI) 144 #define PAN_SCALE_FACTOR PSX_ANGLE_POINT_SCALE 147 #define DEGREES_TO_RADIANS(x) ((x * TWO_PI) / 360.0f) 148 #define RADIANS_TO_DEGREES(x) (x * (180.0f / PI)) 151 #define PXreal2PXdouble(x) (double)(x) 153 #define PXdouble2PXreal(x) (float)(x) 156 #define PXreal2PXfloat(x) (x) 158 #define PXfloat2PXreal(x) (x) 213 inline uint16 READ_LE_U16(
const void *p) {
214 const uint8 *data = (
const uint8 *)p;
215 return (uint16)((data[1] << 8) | data[0]);
218 inline uint32 READ_LE_U32(
const void *p) {
219 const uint8 *data = (
const uint8 *)p;
220 return (uint32)(((uint32)data[3] << 24) | ((uint32)data[2] << 16) | ((uint32)data[1] << 8) | (uint32)data[0]);
223 #if defined(SCUMM_LITTLE_ENDIAN) 225 #define FROM_LE_FLOAT32(a) ((float)(a)) 229 #define FROM_LE_FLOAT32(a) ((float)(SWAP_BYTES_32(a))) 233 #define MKTAG(a0, a1, a2, a3) ((uint32)((a3) | ((a2) << 8) | ((a1) << 16) | ((a0) << 24))) 237 #endif // #ifndef _PX_INC_PROJECT_X_COMMON_H Definition: px_common.h:166
Definition: px_common.h:109
Definition: px_common.h:193
Definition: px_common.h:172
Definition: px_common.h:200
Definition: px_common.h:100
Definition: px_common.h:179
Definition: px_common.h:160