| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#ifndef __TR_TYPES_H |
| 24 |
#define __TR_TYPES_H |
| 25 |
|
| 26 |
|
| 27 |
#define MAX_DLIGHTS 32 // can't be increased, because bit flags are used on surfaces |
| 28 |
|
| 29 |
#define REFENTITYNUM_BITS 10 // can't be increased without changing drawsurf bit packing |
| 30 |
#define REFENTITYNUM_MASK ((1<<REFENTITYNUM_BITS) - 1) |
| 31 |
|
| 32 |
|
| 33 |
#define MAX_REFENTITIES ((1<<REFENTITYNUM_BITS) - 1) |
| 34 |
#define REFENTITYNUM_WORLD ((1<<REFENTITYNUM_BITS) - 1) |
| 35 |
|
| 36 |
|
| 37 |
#define RF_MINLIGHT 0x0001 // allways have some light (viewmodel, some items) |
| 38 |
#define RF_THIRD_PERSON 0x0002 // don't draw through eyes, only mirrors (player bodies, chat sprites) |
| 39 |
#define RF_FIRST_PERSON 0x0004 // only draw through eyes (view weapon, damage blood blob) |
| 40 |
#define RF_DEPTHHACK 0x0008 // for view weapon Z crunching |
| 41 |
|
| 42 |
#define RF_CROSSHAIR 0x0010 // This item is a cross hair and will draw over everything similar to |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
#define RF_NOSHADOW 0x0040 // don't add stencil shadows |
| 48 |
|
| 49 |
#define RF_LIGHTING_ORIGIN 0x0080 // use refEntity->lightingOrigin instead of refEntity->origin |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
#define RF_SHADOW_PLANE 0x0100 // use refEntity->shadowPlane |
| 55 |
#define RF_WRAP_FRAMES 0x0200 // mod the model frames by the maxframes to allow continuous |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
#define RDF_NOWORLDMODEL 0x0001 // used for player configuration screen |
| 60 |
#define RDF_HYPERSPACE 0x0004 // teleportation effect |
| 61 |
|
| 62 |
typedef struct { |
| 63 |
vec3_t xyz; |
| 64 |
float st[2]; |
| 65 |
byte modulate[4]; |
| 66 |
} polyVert_t; |
| 67 |
|
| 68 |
typedef struct poly_s { |
| 69 |
qhandle_t hShader; |
| 70 |
int numVerts; |
| 71 |
polyVert_t *verts; |
| 72 |
} poly_t; |
| 73 |
|
| 74 |
typedef enum { |
| 75 |
RT_MODEL, |
| 76 |
RT_POLY, |
| 77 |
RT_SPRITE, |
| 78 |
RT_BEAM, |
| 79 |
RT_RAIL_CORE, |
| 80 |
RT_RAIL_RINGS, |
| 81 |
RT_LIGHTNING, |
| 82 |
RT_PORTALSURFACE, |
| 83 |
|
| 84 |
RT_MAX_REF_ENTITY_TYPE |
| 85 |
} refEntityType_t; |
| 86 |
|
| 87 |
typedef struct { |
| 88 |
refEntityType_t reType; |
| 89 |
int renderfx; |
| 90 |
|
| 91 |
qhandle_t hModel; |
| 92 |
|
| 93 |
|
| 94 |
vec3_t lightingOrigin; |
| 95 |
float shadowPlane; |
| 96 |
|
| 97 |
vec3_t axis[3]; |
| 98 |
qboolean nonNormalizedAxes; |
| 99 |
float origin[3]; |
| 100 |
int frame; |
| 101 |
|
| 102 |
|
| 103 |
float oldorigin[3]; |
| 104 |
int oldframe; |
| 105 |
float backlerp; |
| 106 |
|
| 107 |
|
| 108 |
int skinNum; |
| 109 |
qhandle_t customSkin; |
| 110 |
qhandle_t customShader; |
| 111 |
|
| 112 |
|
| 113 |
byte shaderRGBA[4]; |
| 114 |
float shaderTexCoord[2]; |
| 115 |
float shaderTime; |
| 116 |
|
| 117 |
|
| 118 |
float radius; |
| 119 |
float rotation; |
| 120 |
} refEntity_t; |
| 121 |
|
| 122 |
|
| 123 |
#define MAX_RENDER_STRINGS 8 |
| 124 |
#define MAX_RENDER_STRING_LENGTH 32 |
| 125 |
|
| 126 |
typedef struct { |
| 127 |
int x, y, width, height; |
| 128 |
float fov_x, fov_y; |
| 129 |
vec3_t vieworg; |
| 130 |
vec3_t viewaxis[3]; |
| 131 |
|
| 132 |
|
| 133 |
int time; |
| 134 |
|
| 135 |
int rdflags; |
| 136 |
|
| 137 |
|
| 138 |
byte areamask[MAX_MAP_AREA_BYTES]; |
| 139 |
|
| 140 |
|
| 141 |
char text[MAX_RENDER_STRINGS][MAX_RENDER_STRING_LENGTH]; |
| 142 |
} refdef_t; |
| 143 |
|
| 144 |
|
| 145 |
typedef enum { |
| 146 |
STEREO_CENTER, |
| 147 |
STEREO_LEFT, |
| 148 |
STEREO_RIGHT |
| 149 |
} stereoFrame_t; |
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
typedef enum { |
| 160 |
TC_NONE, |
| 161 |
TC_S3TC, |
| 162 |
TC_S3TC_ARB |
| 163 |
} textureCompression_t; |
| 164 |
|
| 165 |
typedef enum { |
| 166 |
GLDRV_ICD, |
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
GLDRV_STANDALONE, |
| 172 |
GLDRV_VOODOO |
| 173 |
} glDriverType_t; |
| 174 |
|
| 175 |
typedef enum { |
| 176 |
GLHW_GENERIC, |
| 177 |
GLHW_3DFX_2D3D, |
| 178 |
|
| 179 |
|
| 180 |
GLHW_RIVA128, |
| 181 |
GLHW_RAGEPRO, |
| 182 |
GLHW_PERMEDIA2 |
| 183 |
} glHardwareType_t; |
| 184 |
|
| 185 |
typedef struct { |
| 186 |
char renderer_string[MAX_STRING_CHARS]; |
| 187 |
char vendor_string[MAX_STRING_CHARS]; |
| 188 |
char version_string[MAX_STRING_CHARS]; |
| 189 |
char extensions_string[BIG_INFO_STRING]; |
| 190 |
|
| 191 |
int maxTextureSize; |
| 192 |
int numTextureUnits; |
| 193 |
|
| 194 |
int colorBits, depthBits, stencilBits; |
| 195 |
|
| 196 |
glDriverType_t driverType; |
| 197 |
glHardwareType_t hardwareType; |
| 198 |
|
| 199 |
qboolean deviceSupportsGamma; |
| 200 |
textureCompression_t textureCompression; |
| 201 |
qboolean textureEnvAddAvailable; |
| 202 |
|
| 203 |
int vidWidth, vidHeight; |
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
float windowAspect; |
| 208 |
|
| 209 |
int displayFrequency; |
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
qboolean isFullscreen; |
| 215 |
qboolean stereoEnabled; |
| 216 |
qboolean smpActive; |
| 217 |
} glconfig_t; |
| 218 |
|
| 219 |
#endif |