|
|
1.1.1.4 ! root 1: /* ! 2: Copyright (C) 1997-2001 Id Software, Inc. ! 3: ! 4: This program is free software; you can redistribute it and/or ! 5: modify it under the terms of the GNU General Public License ! 6: as published by the Free Software Foundation; either version 2 ! 7: of the License, or (at your option) any later version. ! 8: ! 9: This program is distributed in the hope that it will be useful, ! 10: but WITHOUT ANY WARRANTY; without even the implied warranty of ! 11: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ! 12: ! 13: See the GNU General Public License for more details. ! 14: ! 15: You should have received a copy of the GNU General Public License ! 16: along with this program; if not, write to the Free Software ! 17: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! 18: ! 19: */ ! 20: #ifndef __REF_H ! 21: #define __REF_H 1.1 root 22: 23: #include "../qcommon/qcommon.h" 1.1.1.2 root 24: 1.1 root 25: #define MAX_DLIGHTS 32 26: #define MAX_ENTITIES 128 27: #define MAX_PARTICLES 4096 28: #define MAX_LIGHTSTYLES 256 1.1.1.2 root 29: 1.1 root 30: #define POWERSUIT_SCALE 4.0F 1.1.1.2 root 31: 1.1 root 32: #define SHELL_RED_COLOR 0xF2 33: #define SHELL_GREEN_COLOR 0xD0 34: #define SHELL_BLUE_COLOR 0xF3 1.1.1.2 root 35: 1.1 root 36: #define SHELL_RG_COLOR 0xDC 1.1.1.3 root 37: //#define SHELL_RB_COLOR 0x86 38: #define SHELL_RB_COLOR 0x68 1.1 root 39: #define SHELL_BG_COLOR 0x78 1.1.1.2 root 40: 1.1.1.3 root 41: //ROGUE 42: #define SHELL_DOUBLE_COLOR 0xDF // 223 43: #define SHELL_HALF_DAM_COLOR 0x90 44: #define SHELL_CYAN_COLOR 0x72 45: //ROGUE 46: 1.1 root 47: #define SHELL_WHITE_COLOR 0xD7 1.1.1.2 root 48: 1.1 root 49: typedef struct entity_s 50: { 51: struct model_s *model; // opaque type outside refresh 52: float angles[3]; 1.1.1.2 root 53: 1.1 root 54: /* 55: ** most recent data 56: */ 57: float origin[3]; // also used as RF_BEAM's "from" 58: int frame; // also used as RF_BEAM's diameter 1.1.1.2 root 59: 1.1 root 60: /* 61: ** previous data for lerping 62: */ 63: float oldorigin[3]; // also used as RF_BEAM's "to" 64: int oldframe; 1.1.1.2 root 65: 1.1 root 66: /* 67: ** misc 68: */ 69: float backlerp; // 0.0 = current, 1.0 = old 70: int skinnum; // also used as RF_BEAM's palette index 1.1.1.2 root 71: 1.1 root 72: int lightstyle; // for flashing entities 73: float alpha; // ignore if RF_TRANSLUCENT isn't set 1.1.1.2 root 74: 1.1 root 75: struct image_s *skin; // NULL for inline skin 76: int flags; 1.1.1.2 root 77: 1.1 root 78: } entity_t; 1.1.1.2 root 79: 1.1 root 80: #define ENTITY_FLAGS 68 1.1.1.2 root 81: 1.1 root 82: typedef struct 83: { 84: vec3_t origin; 85: vec3_t color; 86: float intensity; 87: } dlight_t; 1.1.1.2 root 88: 1.1 root 89: typedef struct 90: { 91: vec3_t origin; 92: int color; 93: float alpha; 94: } particle_t; 1.1.1.2 root 95: 1.1 root 96: typedef struct 97: { 98: float rgb[3]; // 0.0 - 2.0 99: float white; // highest of rgb 100: } lightstyle_t; 1.1.1.2 root 101: 1.1 root 102: typedef struct 103: { 104: int x, y, width, height;// in virtual screen coordinates 105: float fov_x, fov_y; 106: float vieworg[3]; 107: float viewangles[3]; 108: float blend[4]; // rgba 0-1 full screen blend 109: float time; // time is uesed to auto animate 110: int rdflags; // RDF_UNDERWATER, etc 1.1.1.2 root 111: 1.1 root 112: byte *areabits; // if not NULL, only areas with set bits will be drawn 1.1.1.2 root 113: 1.1 root 114: lightstyle_t *lightstyles; // [MAX_LIGHTSTYLES] 1.1.1.2 root 115: 1.1 root 116: int num_entities; 117: entity_t *entities; 1.1.1.2 root 118: 1.1 root 119: int num_dlights; 120: dlight_t *dlights; 1.1.1.2 root 121: 1.1 root 122: int num_particles; 123: particle_t *particles; 124: } refdef_t; 1.1.1.2 root 125: 126: 127: 1.1 root 128: #define API_VERSION 3 1.1.1.2 root 129: 1.1 root 130: // 131: // these are the functions exported by the refresh module 132: // 133: typedef struct 134: { 135: // if api_version is different, the dll cannot be used 136: int api_version; 1.1.1.2 root 137: 1.1 root 138: // called when the library is loaded 139: qboolean (*Init) ( void *hinstance, void *wndproc ); 1.1.1.2 root 140: 1.1 root 141: // called before the library is unloaded 142: void (*Shutdown) (void); 1.1.1.2 root 143: 1.1 root 144: // All data that will be used in a level should be 145: // registered before rendering any frames to prevent disk hits, 146: // but they can still be registered at a later time 147: // if necessary. 148: // 149: // EndRegistration will free any remaining data that wasn't registered. 150: // Any model_s or skin_s pointers from before the BeginRegistration 151: // are no longer valid after EndRegistration. 152: // 153: // Skins and images need to be differentiated, because skins 154: // are flood filled to eliminate mip map edge errors, and pics have 155: // an implicit "pics/" prepended to the name. (a pic name that starts with a 156: // slash will not use the "pics/" prefix or the ".pcx" postfix) 157: void (*BeginRegistration) (char *map); 158: struct model_s *(*RegisterModel) (char *name); 159: struct image_s *(*RegisterSkin) (char *name); 160: struct image_s *(*RegisterPic) (char *name); 161: void (*SetSky) (char *name, float rotate, vec3_t axis); 162: void (*EndRegistration) (void); 1.1.1.2 root 163: 1.1 root 164: void (*RenderFrame) (refdef_t *fd); 1.1.1.2 root 165: 1.1 root 166: void (*DrawGetPicSize) (int *w, int *h, char *name); // will return 0 0 if not found 167: void (*DrawPic) (int x, int y, char *name); 168: void (*DrawStretchPic) (int x, int y, int w, int h, char *name); 169: void (*DrawChar) (int x, int y, int c); 170: void (*DrawTileClear) (int x, int y, int w, int h, char *name); 171: void (*DrawFill) (int x, int y, int w, int h, int c); 172: void (*DrawFadeScreen) (void); 1.1.1.2 root 173: 1.1 root 174: // Draw images for cinematic rendering (which can have a different palette). Note that calls 175: void (*DrawStretchRaw) (int x, int y, int w, int h, int cols, int rows, byte *data); 1.1.1.2 root 176: 1.1 root 177: /* 178: ** video mode and refresh state management entry points 179: */ 180: void (*CinematicSetPalette)( const unsigned char *palette); // NULL = game palette 181: void (*BeginFrame)( float camera_separation ); 182: void (*EndFrame) (void); 1.1.1.2 root 183: 1.1 root 184: void (*AppActivate)( qboolean activate ); 1.1.1.2 root 185: 1.1 root 186: } refexport_t; 1.1.1.2 root 187: 1.1 root 188: // 189: // these are the functions imported by the refresh module 190: // 191: typedef struct 192: { 193: void (*Sys_Error) (int err_level, char *str, ...); 1.1.1.2 root 194: 1.1 root 195: void (*Cmd_AddCommand) (char *name, void(*cmd)(void)); 196: void (*Cmd_RemoveCommand) (char *name); 197: int (*Cmd_Argc) (void); 198: char *(*Cmd_Argv) (int i); 199: void (*Cmd_ExecuteText) (int exec_when, char *text); 1.1.1.2 root 200: 1.1 root 201: void (*Con_Printf) (int print_level, char *str, ...); 1.1.1.2 root 202: 1.1 root 203: // files will be memory mapped read only 204: // the returned buffer may be part of a larger pak file, 205: // or a discrete file from anywhere in the quake search path 206: // a -1 return means the file does not exist 207: // NULL can be passed for buf to just determine existance 208: int (*FS_LoadFile) (char *name, void **buf); 209: void (*FS_FreeFile) (void *buf); 1.1.1.2 root 210: 1.1 root 211: // gamedir will be the current directory that generated 212: // files should be stored to, ie: "f:\quake\id1" 213: char *(*FS_Gamedir) (void); 1.1.1.2 root 214: 1.1 root 215: cvar_t *(*Cvar_Get) (char *name, char *value, int flags); 216: cvar_t *(*Cvar_Set)( char *name, char *value ); 217: void (*Cvar_SetValue)( char *name, float value ); 1.1.1.2 root 218: 1.1 root 219: qboolean (*Vid_GetModeInfo)( int *width, int *height, int mode ); 220: void (*Vid_MenuInit)( void ); 221: void (*Vid_NewWindow)( int width, int height ); 222: } refimport_t; 1.1.1.2 root 223: 224: 1.1 root 225: // this is the only function actually exported at the linker level 226: typedef refexport_t (*GetRefAPI_t) (refimport_t); 1.1.1.4 ! root 227: ! 228: #endif // __REF_H
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.