1 /*KJL************************************************************************** 2 * HUDDEFS.H - * 3 * * 4 * this file contains all the prototypes of the platform-dependent functions * 5 * called in hud.c. * 6 **************************************************************************KJL*/ 7 8 #ifndef _huddefs_h 9 #define _huddefs_h 1 10 11 #ifdef __cplusplus 12 extern "C" { 13 #endif 14 15 /*KJL**************************************************************************************** 16 * D E F I N E S * 17 ****************************************************************************************KJL*/ 18 19 /*KJL************************************************************************************** 20 * Motion Tracker defines - Range is currently 30 metres. Don't worry about those casts to * 21 * floats, they're only there to ensure accuracy and are preprocessed away. For example, * 22 * 65536*65536 will probably cause an overflow in the preprocessor so I've used floats to * 23 * avoid this. * 24 **************************************************************************************KJL*/ 25 #define MOTIONTRACKER_RANGE ((int)((float)30000*(float)GlobalScale)) 26 #define MOTIONTRACKER_RANGE_SQUARED (MOTIONTRACKER_RANGE*MOTIONTRACKER_RANGE) 27 #define MOTIONTRACKER_SCALE (int)((65536.0*65536.0)/(float)MOTIONTRACKER_RANGE) 28 #define MOTIONTRACKER_SPEED (MUL_FIXED((65536*2),MotionTrackerSpeed)) 29 #define MOTIONTRACKER_MAXBLIPS 10 30 #define MOTIONTRACKER_SMALLESTSCANLINESIZE 2200 31 32 typedef struct 33 { 34 int X; 35 int Y; 36 int Brightness; 37 } BLIP_TYPE; 38 /*KJL************************************************* 39 * Speed at which gunsight moves when smart-targeting * 40 *************************************************KJL*/ 41 #define SMART_TARGETING_SPEED 4 42 43 #define SMART_TARGETING_RANGE 1000000 44 45 46 /*KJL********************************************* 47 * Numerical digits which occur in the marine HUD * 48 *********************************************KJL*/ 49 enum MARINE_HUD_DIGIT 50 { 51 MARINE_HUD_MOTIONTRACKER_UNITS=0, 52 MARINE_HUD_MOTIONTRACKER_TENS, 53 MARINE_HUD_MOTIONTRACKER_HUNDREDS, 54 MARINE_HUD_MOTIONTRACKER_THOUSANDS, 55 56 MARINE_HUD_HEALTH_UNITS, 57 MARINE_HUD_HEALTH_TENS, 58 MARINE_HUD_HEALTH_HUNDREDS, 59 60 MARINE_HUD_ENERGY_UNITS, 61 MARINE_HUD_ENERGY_TENS, 62 MARINE_HUD_ENERGY_HUNDREDS, 63 64 MARINE_HUD_ARMOUR_UNITS, 65 MARINE_HUD_ARMOUR_TENS, 66 MARINE_HUD_ARMOUR_HUNDREDS, 67 68 MARINE_HUD_PRIMARY_AMMO_ROUNDS_UNITS, 69 MARINE_HUD_PRIMARY_AMMO_ROUNDS_TENS, 70 MARINE_HUD_PRIMARY_AMMO_ROUNDS_HUNDREDS, 71 72 MARINE_HUD_PRIMARY_AMMO_MAGAZINES_UNITS, 73 MARINE_HUD_PRIMARY_AMMO_MAGAZINES_TENS, 74 75 MARINE_HUD_SECONDARY_AMMO_ROUNDS_UNITS, 76 MARINE_HUD_SECONDARY_AMMO_ROUNDS_TENS, 77 MARINE_HUD_SECONDARY_AMMO_ROUNDS_HUNDREDS, 78 79 MARINE_HUD_SECONDARY_AMMO_MAGAZINES_UNITS, 80 MARINE_HUD_SECONDARY_AMMO_MAGAZINES_TENS, 81 82 MAX_NO_OF_MARINE_HUD_DIGITS 83 }; 84 /*KJL*********************************************** 85 * Numerical digits which occur in the predator HUD * 86 ***********************************************KJL*/ 87 enum PREDATOR_HUD_DIGIT 88 { 89 PREDATOR_HUD_ARMOUR_1, 90 PREDATOR_HUD_ARMOUR_2, 91 PREDATOR_HUD_ARMOUR_3, 92 PREDATOR_HUD_ARMOUR_4, 93 PREDATOR_HUD_ARMOUR_5, 94 95 PREDATOR_HUD_HEALTH_1, 96 PREDATOR_HUD_HEALTH_2, 97 PREDATOR_HUD_HEALTH_3, 98 PREDATOR_HUD_HEALTH_4, 99 PREDATOR_HUD_HEALTH_5, 100 101 /* 102 PREDATOR_HUD_THREATDISPLAY_1, 103 PREDATOR_HUD_THREATDISPLAY_2, 104 PREDATOR_HUD_THREATDISPLAY_3, 105 PREDATOR_HUD_THREATDISPLAY_4, 106 PREDATOR_HUD_THREATDISPLAY_5, 107 PREDATOR_HUD_THREATDISPLAY_6, 108 PREDATOR_HUD_THREATDISPLAY_7, 109 PREDATOR_HUD_THREATDISPLAY_8, 110 */ 111 MAX_NO_OF_PREDATOR_HUD_DIGITS 112 }; 113 114 enum ALIEN_HUD_DIGIT 115 { 116 ALIEN_HUD_HEALTH_UNITS, 117 ALIEN_HUD_HEALTH_TENS, 118 ALIEN_HUD_HEALTH_HUNDREDS, 119 120 MAX_NO_OF_ALIEN_HUD_DIGITS 121 }; 122 123 extern char ValueOfHUDDigit[]; 124 125 enum GUNSIGHT_SHAPE 126 { 127 GUNSIGHT_CROSSHAIR=0, 128 GUNSIGHT_GREENBOX, 129 GUNSIGHT_REDBOX, 130 GUNSIGHT_REDDIAMOND, 131 132 MAX_NO_OF_GUNSIGHT_SHAPES 133 }; 134 135 enum COMMON_HUD_DIGIT_ID 136 { 137 COMMON_HUD_DIGIT_HEALTH_UNITS, 138 COMMON_HUD_DIGIT_HEALTH_TENS, 139 COMMON_HUD_DIGIT_HEALTH_HUNDREDS, 140 141 COMMON_HUD_DIGIT_ARMOUR_UNITS, 142 COMMON_HUD_DIGIT_ARMOUR_TENS, 143 COMMON_HUD_DIGIT_ARMOUR_HUNDREDS, 144 145 MAX_NO_OF_COMMON_HUD_DIGITS 146 }; 147 148 /*KJL**************************************************************************************** 149 * P R O T O T Y P E S * 150 ****************************************************************************************KJL*/ 151 extern void PlatformSpecificInitMarineHUD(void); 152 /*KJL**************************************************************************************** 153 * Okay. From now on everyone will call the fn above which loads and initialises ALL the gfx * 154 * required for a marine, eg. weapons, motion tracker stuff, gun sights, et al. * 155 * And sets up the riff mode RWH 156 ****************************************************************************************KJL*/ 157 extern void PlatformSpecificInitPredatorHUD(void); 158 /*KJL****************** 159 * Ditto for predator. * 160 ******************KJL*/ 161 extern void PlatformSpecificInitAlienHUD(void); 162 /*RWH***************** 163 * Ditto for alien. * 164 ******************REH*/ 165 extern void PlatformSpecificExitingHUD(void); 166 /*KJL****************************************************************************************** 167 * Use this to pass your list of graphics to be drawn to your GPU. * 168 ******************************************************************************************KJL*/ 169 170 extern void PlatformSpecificEnteringHUD(void); 171 /*KJL************************************************** 172 * Made to complement PlatformSpecificExitingHUD() fn. * 173 **************************************************KJL*/ 174 175 extern void BLTMotionTrackerToHUD(int scanLineSize); 176 /*KJL****************************************************************************************** 177 * draw motion tracker with its expanding scanline * 178 * 0 <= scanLineSize <= 65536 and denotes the scanline's on-screen radius (65536 = full size). * 179 ******************************************************************************************KJL*/ 180 181 extern void BLTMotionTrackerBlipToHUD(int x, int y, int brightness); 182 /*KJL******************************************************************** 183 * -65536 <= x <= 65536, 0 <= y <= 65536, 0 <= brightness <= 65536 * 184 * (x=0,y=0) refers to the motiontracker's centre. (ie. centre hotspot) * 185 * brightness=65536 means brightest blip, 0 means darkest blip * 186 ********************************************************************KJL*/ 187 188 extern void BLTMarineNumericsToHUD(enum MARINE_HUD_DIGIT digitsToDraw); 189 extern void BLTPredatorNumericsToHUD(void); 190 extern void BLTAlienNumericsToHUD(void); 191 /*KJL******************************************************************** 192 * Draws ALL the numeric digits (pertinent to the Marine) to the HUD. * 193 * * 194 * Ok, here's a quick explanation of how it's supposed to work: * 195 * * 196 * In hud.c there is a global array of chars called ValueOfHUDDigit[]. * 197 * The index of the array takes a value from the MARINE_HUD_DIGIT enum * 198 * which occurs later in this file, and each char in the array holds a * 199 * single digit, ie. a value from 0 to 9 inclusive. For example, * 200 * ValueOfHUDDigit[MARINE_HUD_HEALTH_TENS] holds the 'tens' digit of the * 201 * players health, say 5 if the players health was 152. So, the function * 202 * BLTMarineNumericsToHUD() simply goes through the array blitting each * 203 * digit to its correct position on screen. I do this by having another * 204 * array which holds the X,Y coords and font number for each digit, and * 205 * implementing a fn which takes the parameters (digit value,x,y,font) * 206 * and does the actual blitting. This is in avp/win95/ddplat.cpp. * 207 ********************************************************************KJL*/ 208 209 extern void BLTGunSightToScreen(int screenX, int screenY, enum GUNSIGHT_SHAPE gunsightShape); 210 /*KJL**************************************************************** 211 * screenX & screenY are in pixels (scaled to SDB so should be okay) * 212 * (centre hotspot) * 213 * gunsightShape determines which sight to blit to screen. * 214 ****************************************************************KJL*/ 215 216 217 extern void InitHUD(void); 218 219 extern void BLTAlienOverlayToHUD(void); 220 /*KJL************************** 221 * Draw simple graphic overlay * 222 **************************KJL*/ 223 224 extern void BLTPredatorOverlayToHUD(void); 225 /*KJL************************** 226 * Draw simple graphic overlay * 227 **************************KJL*/ 228 229 230 extern void KillHUD(void); 231 /*KJL********************* 232 * Free memory of HUD gfx * 233 *********************KJL*/ 234 235 236 237 /* KJL 11:00:22 05/20/97 - On-screen messaging system */ 238 #define ON_SCREEN_MESSAGE_LIFETIME (ONE_FIXED*2) 239 240 extern void NewOnScreenMessage(unsigned char *messagePtr); 241 /*KJL******************************************************************** 242 * The text pointed to by the messagePtr will be displayed on screen for * 243 * the time defined in ON_SCREEN_MESSAGE_LIFETIME. Any previous message * 244 * still being displayed will be overwritten. * 245 ********************************************************************KJL*/ 246 247 #ifdef __cplusplus 248 }; /* end of C-Linkage spec */ 249 #endif 250 251 #endif /* one-time only guard */ 252