Annotation of quake2/client/ref.h, revision 1.1.1.3

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.