| | 1 | #ifndef _included_decal_h_ /* Is this your first time? */ |
| | 2 | #define _included_decal_h_ 1 |
| | 3 | |
| | 4 | #include "vision.h" |
| | 5 | #include "prototyp.h" |
| | 6 | |
| | 7 | #define MAX_NO_OF_DECALS 2048 |
| | 8 | |
| | 9 | enum DECAL_ID |
| | 10 | { |
| | 11 | DECAL_FMV=0, |
| | 12 | DECAL_SCORCHED, |
| | 13 | DECAL_BULLETHOLE, |
| | 14 | |
| | 15 | DECAL_PREDATOR_BLOOD, |
| | 16 | DECAL_ALIEN_BLOOD, |
| | 17 | DECAL_HUMAN_BLOOD, |
| | 18 | DECAL_ANDROID_BLOOD, |
| | 19 | |
| | 20 | DECAL_PREDATOR_BLOOD_SPLASH, |
| | 21 | DECAL_ALIEN_BLOOD_SPLASH, |
| | 22 | DECAL_HUMAN_BLOOD_SPLASH, |
| | 23 | DECAL_ANDROID_BLOOD_SPLASH, |
| | 24 | |
| | 25 | DECAL_LASERTARGET, |
| | 26 | DECAL_SHAFTOFLIGHT, |
| | 27 | DECAL_SHAFTOFLIGHT_OUTER, |
| | 28 | |
| | 29 | MAX_NO_OF_DECAL_IDS |
| | 30 | }; |
| | 31 | |
| | 32 | typedef struct |
| | 33 | { |
| | 34 | enum DECAL_ID DecalID; |
| | 35 | VECTORCH Vertices[4]; |
| | 36 | VECTORCH Direction[4]; |
| | 37 | VECTORCH Centre; |
| | 38 | int ModuleIndex; |
| | 39 | int CurrentSize; |
| | 40 | int TargetSize; |
| | 41 | int UOffset; |
| | 42 | |
| | 43 | } DECAL; |
| | 44 | |
| | 45 | typedef struct |
| | 46 | { |
| | 47 | enum DECAL_ID DecalID; |
| | 48 | VECTORCH Vertices[4]; |
| | 49 | int ModuleIndex; |
| | 50 | int UOffset; |
| | 51 | |
| | 52 | } FIXED_DECAL; |
| | 53 | |
| | 54 | typedef struct |
| | 55 | { |
| | 56 | enum DECAL_ID DecalID; |
| | 57 | VECTORCH Vertices[4]; |
| | 58 | VECTORCH Centre; |
| | 59 | |
| | 60 | } OBJECT_DECAL; |
| | 61 | |
| | 62 | enum TRANSLUCENCY_TYPE |
| | 63 | { |
| | 64 | TRANSLUCENCY_OFF, |
| | 65 | TRANSLUCENCY_NORMAL, |
| | 66 | TRANSLUCENCY_INVCOLOUR, |
| | 67 | TRANSLUCENCY_COLOUR, |
| | 68 | TRANSLUCENCY_GLOWING, |
| | 69 | TRANSLUCENCY_DARKENINGCOLOUR, |
| | 70 | TRANSLUCENCY_JUSTSETZ, |
| | 71 | TRANSLUCENCY_NOT_SET |
| | 72 | }; |
| | 73 | |
| | 74 | typedef struct |
| | 75 | { |
| | 76 | int StartU; |
| | 77 | int StartV; |
| | 78 | int EndU; |
| | 79 | int EndV; |
| | 80 | |
| | 81 | int MinSize; |
| | 82 | int MaxSize; |
| | 83 | int GrowthRate; |
| | 84 | |
| | 85 | int MaxSubclassNumber; |
| | 86 | int UOffsetForSubclass; |
| | 87 | |
| | 88 | enum TRANSLUCENCY_TYPE TranslucencyType; |
| | 89 | |
| | 90 | uint8_t Alpha; |
| | 91 | uint8_t RedScale[NUMBER_OF_VISION_MODES]; |
| | 92 | uint8_t GreenScale[NUMBER_OF_VISION_MODES]; |
| | 93 | uint8_t BlueScale[NUMBER_OF_VISION_MODES]; |
| | 94 | |
| | 95 | unsigned int IsLit:1; |
| | 96 | unsigned int CanCombine:1; |
| | 97 | |
| | 98 | } DECAL_DESC; |
| | 99 | |
| | 100 | typedef struct |
| | 101 | { |
| | 102 | VECTORCH Position[3]; |
| | 103 | VECTORCH Normal[3]; |
| | 104 | VECTORCH LightSource; |
| | 105 | char DotIsOnPlayer; |
| | 106 | int TargetID; |
| | 107 | |
| | 108 | } THREE_LASER_DOT_DESC; |
| | 109 | |
| | 110 | void InitialiseDecalSystem(void); |
| | 111 | void MakeDecal(enum DECAL_ID decalID, VECTORCH *normalPtr, VECTORCH *positionPtr, int moduleIndex); |
| | 112 | void AddDecal(enum DECAL_ID decalID, VECTORCH *normalPtr, VECTORCH *positionPtr, int moduleIndex); |
| | 113 | void HandleDecalSystem(void); |
| | 114 | |
| | 115 | struct section_data; // hmodel.h |
| | 116 | void AddDecalToHModel(VECTORCH *normalPtr, VECTORCH *positionPtr, struct section_data *sectionPtr); |
| | 117 | void ScanHModelForDecals(DISPLAYBLOCK *objectPtr, struct section_data *sectionDataPtr); |
| | 118 | |
| | 119 | FIXED_DECAL* AllocateFixedDecal(void); |
| | 120 | void RemoveFixedDecal(void); |
| | 121 | void RemoveAllFixedDecals(void); |
| | 122 | |
| | 123 | extern DECAL_DESC DecalDescription[]; |
| | 124 | extern THREE_LASER_DOT_DESC PredatorLaserTarget; |
| | 125 | |
| | 126 | extern FIXED_DECAL FixedDecalStorage[]; |
| | 127 | extern int NumFixedDecals; |
| | 128 | extern int CurrentFixedDecalIndex; |
| | 129 | extern void DecalSystem_End(); |
| | 130 | extern void DecalSystem_Setup(); |
| | 131 | extern void RenderLaserTarget(THREE_LASER_DOT_DESC *laserTargetPtr); |
| | 132 | |
| | 133 | #define MAX_NO_OF_DECALS_PER_HIERARCHICAL_SECTION 32 |
| | 134 | #endif |