2004-08-23 00:15:46 +00:00
|
|
|
//These are defined later in the source tree. This file should probably be moved to a later spot.
|
|
|
|
struct progfuncs_s;
|
|
|
|
struct globalvars_s;
|
|
|
|
struct texture_s;
|
|
|
|
|
2008-12-23 02:55:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef HALFLIFEMODELS
|
|
|
|
#define MAX_BONE_CONTROLLERS 5
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define FST_BASE 0 //base frames
|
|
|
|
#define FS_REG 1 //regular frames
|
|
|
|
#define FS_COUNT 2 //regular frames
|
|
|
|
typedef struct {
|
|
|
|
struct {
|
|
|
|
int frame[2];
|
|
|
|
float frametime[2];
|
|
|
|
float lerpfrac;
|
|
|
|
|
|
|
|
#ifdef HALFLIFEMODELS
|
|
|
|
float subblendfrac; //hl models are weird
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int endbone;
|
|
|
|
} g[2];
|
|
|
|
|
|
|
|
float *bonestate;
|
|
|
|
int bonecount;
|
|
|
|
|
|
|
|
#ifdef HALFLIFEMODELS
|
|
|
|
float bonecontrols[MAX_BONE_CONTROLLERS]; //hl special bone controllers
|
|
|
|
#endif
|
|
|
|
} framestate_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
//function prototypes
|
|
|
|
|
|
|
|
#if defined(SERVERONLY)
|
|
|
|
#define qrenderer QR_NONE
|
2005-07-16 00:53:08 +00:00
|
|
|
#define FNC(n) (n) //FNC is defined as 'pointer if client build, direct if dedicated server'
|
2004-08-23 00:15:46 +00:00
|
|
|
#else
|
|
|
|
#define FNC(n) (*n)
|
|
|
|
extern r_qrenderer_t qrenderer;
|
|
|
|
extern char *q_renderername;
|
|
|
|
|
2004-12-24 08:45:56 +00:00
|
|
|
extern mpic_t *(*Draw_SafePicFromWad) (char *name);
|
|
|
|
extern mpic_t *(*Draw_CachePic) (char *path);
|
|
|
|
extern mpic_t *(*Draw_SafeCachePic) (char *path);
|
2004-08-23 00:15:46 +00:00
|
|
|
extern void (*Draw_Init) (void);
|
|
|
|
extern void (*Draw_ReInit) (void);
|
|
|
|
extern void (*Draw_Character) (int x, int y, unsigned int num);
|
2008-06-01 22:06:22 +00:00
|
|
|
extern void (*Draw_TinyCharacter) (int x, int y, unsigned int num);
|
2004-08-23 00:15:46 +00:00
|
|
|
extern void (*Draw_ColouredCharacter) (int x, int y, unsigned int num);
|
|
|
|
extern void (*Draw_String) (int x, int y, const qbyte *str);
|
|
|
|
extern void (*Draw_Alt_String) (int x, int y, const qbyte *str);
|
|
|
|
extern void (*Draw_Crosshair) (void);
|
|
|
|
extern void (*Draw_DebugChar) (qbyte num);
|
2004-12-24 08:45:56 +00:00
|
|
|
extern void (*Draw_Pic) (int x, int y, mpic_t *pic);
|
|
|
|
extern void (*Draw_ScalePic) (int x, int y, int width, int height, mpic_t *pic);
|
|
|
|
extern void (*Draw_SubPic) (int x, int y, mpic_t *pic, int srcx, int srcy, int width, int height);
|
|
|
|
extern void (*Draw_TransPic) (int x, int y, mpic_t *pic);
|
2005-02-12 18:56:04 +00:00
|
|
|
extern void (*Draw_TransPicTranslate) (int x, int y, int width, int height, qbyte *image, qbyte *translation);
|
2009-04-06 00:34:32 +00:00
|
|
|
extern void (*Draw_ConsoleBackground) (int firstline, int lastline, qboolean forceopaque);
|
2004-08-23 00:15:46 +00:00
|
|
|
extern void (*Draw_EditorBackground) (int lines);
|
|
|
|
extern void (*Draw_TileClear) (int x, int y, int w, int h);
|
2008-06-01 22:06:22 +00:00
|
|
|
extern void (*Draw_Fill) (int x, int y, int w, int h, unsigned int c);
|
2006-03-11 03:12:10 +00:00
|
|
|
extern void (*Draw_FillRGB) (int x, int y, int w, int h, float r, float g, float b);
|
2004-08-23 00:15:46 +00:00
|
|
|
extern void (*Draw_FadeScreen) (void);
|
|
|
|
extern void (*Draw_BeginDisc) (void);
|
|
|
|
extern void (*Draw_EndDisc) (void);
|
2004-11-23 01:10:10 +00:00
|
|
|
extern qboolean (*Draw_IsCached) (char *picname); //can be null
|
|
|
|
|
2005-07-03 15:16:20 +00:00
|
|
|
extern void (*Draw_Image) (float x, float y, float w, float h, float s1, float t1, float s2, float t2, mpic_t *pic); //gl-style scaled/coloured/subpic
|
2004-11-23 01:10:10 +00:00
|
|
|
extern void (*Draw_ImageColours) (float r, float g, float b, float a);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
extern void (*R_Init) (void);
|
|
|
|
extern void (*R_DeInit) (void);
|
|
|
|
extern void (*R_ReInit) (void);
|
|
|
|
extern void (*R_RenderView) (void); // must set r_refdef first
|
|
|
|
|
|
|
|
extern qboolean (*R_CheckSky) (void);
|
|
|
|
extern void (*R_SetSky) (char *name, float rotate, vec3_t axis);
|
|
|
|
|
|
|
|
extern void (*R_NewMap) (void);
|
|
|
|
extern void (*R_PreNewMap) (void);
|
|
|
|
extern int (*R_LightPoint) (vec3_t point);
|
|
|
|
|
|
|
|
extern void (*R_PushDlights) (void);
|
|
|
|
extern void (*R_AddStain) (vec3_t org, float red, float green, float blue, float radius);
|
|
|
|
extern void (*R_LessenStains) (void);
|
|
|
|
extern void (*R_DrawWaterSurfaces) (void);
|
|
|
|
|
2004-09-20 23:25:38 +00:00
|
|
|
extern void (*Media_ShowFrameBGR_24_Flip) (qbyte *framedata, int inwidth, int inheight); //input is bottom up...
|
|
|
|
extern void (*Media_ShowFrameRGBA_32) (qbyte *framedata, int inwidth, int inheight); //top down
|
|
|
|
extern void (*Media_ShowFrame8bit) (qbyte *framedata, int inwidth, int inheight, qbyte *palette); //paletted topdown (framedata is 8bit indexes into palette)
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
extern qboolean (*VID_Init) (rendererstate_t *info, unsigned char *palette);
|
|
|
|
extern void (*VID_DeInit) (void);
|
|
|
|
extern void (*VID_LockBuffer) (void);
|
|
|
|
extern void (*VID_UnlockBuffer) (void);
|
|
|
|
extern void (*D_BeginDirectRect) (int x, int y, qbyte *pbitmap, int width, int height);
|
|
|
|
extern void (*D_EndDirectRect) (int x, int y, int width, int height);
|
|
|
|
extern void (*VID_ForceLockState) (int lk);
|
|
|
|
extern int (*VID_ForceUnlockedAndReturnState) (void);
|
|
|
|
extern void (*VID_SetPalette) (unsigned char *palette);
|
|
|
|
extern void (*VID_ShiftPalette) (unsigned char *palette);
|
2004-11-23 01:10:10 +00:00
|
|
|
extern char *(*VID_GetRGBInfo) (int prepad, int *truevidwidth, int *truevidheight);
|
|
|
|
extern void (*VID_SetWindowCaption) (char *msg);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
extern void SCR_Init (void);
|
|
|
|
extern void SCR_DeInit (void);
|
|
|
|
extern void (*SCR_UpdateScreen) (void);
|
|
|
|
extern void SCR_BeginLoadingPlaque (void);
|
|
|
|
extern void SCR_EndLoadingPlaque (void);
|
|
|
|
extern void SCR_DrawConsole (qboolean noback);
|
|
|
|
extern void SCR_SetUpToDrawConsole (void);
|
|
|
|
extern void SCR_EraseCenterString (void);
|
2008-11-09 22:29:28 +00:00
|
|
|
extern void SCR_CenterPrint (int pnum, char *str, qboolean fromgamecode);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern void FNC(Mod_Init) (void);
|
|
|
|
extern void FNC(Mod_ClearAll) (void);
|
|
|
|
extern struct model_s *FNC(Mod_ForName) (char *name, qboolean crash);
|
|
|
|
extern struct model_s *FNC(Mod_FindName) (char *name);
|
|
|
|
extern void *FNC(Mod_Extradata) (struct model_s *mod); // handles caching
|
|
|
|
extern void FNC(Mod_TouchModel) (char *name);
|
|
|
|
|
|
|
|
extern void FNC(Mod_NowLoadExternal) (void);
|
|
|
|
|
|
|
|
extern void FNC(Mod_Think) (void);
|
2005-08-03 23:14:59 +00:00
|
|
|
extern int FNC(Mod_SkinForName) (struct model_s *model, char *name);
|
2009-04-01 22:03:56 +00:00
|
|
|
extern int FNC(Mod_FrameForName) (struct model_s *model, char *name);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
#undef FNC
|
|
|
|
|
2008-12-23 02:55:20 +00:00
|
|
|
extern qboolean Mod_GetTag (struct model_s *model, int tagnum, framestate_t *framestate, float *transforms);
|
2007-05-25 23:03:49 +00:00
|
|
|
extern int Mod_TagNumForName (struct model_s *model, char *name);
|
|
|
|
|
2008-12-23 02:55:20 +00:00
|
|
|
int Mod_GetNumBones(struct model_s *model, qboolean allowtags);
|
|
|
|
int Mod_GetBoneRelations(struct model_s *model, int numbones, framestate_t *fstate, float *result);
|
|
|
|
int Mod_GetBoneParent(struct model_s *model, int bonenum);
|
|
|
|
char *Mod_GetBoneName(struct model_s *model, int bonenum);
|
|
|
|
|
2005-03-28 00:11:59 +00:00
|
|
|
void Draw_FunString(int x, int y, unsigned char *str);
|
2006-02-28 00:46:04 +00:00
|
|
|
void Draw_FunStringLen(int x, int y, unsigned char *str, int len);
|
2005-01-24 23:47:32 +00:00
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
#ifdef SERVERONLY
|
|
|
|
#define Mod_Q1LeafPVS Mod_LeafPVS
|
2005-09-08 01:47:48 +00:00
|
|
|
// qbyte *Mod_LeafPVS (struct mleaf_s *leaf, struct model_s *model, qbyte *buffer);
|
2004-08-23 00:15:46 +00:00
|
|
|
#endif
|
2005-06-22 17:10:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char *description;
|
|
|
|
char *name[4];
|
|
|
|
r_qrenderer_t rtype;
|
|
|
|
|
|
|
|
mpic_t *(*Draw_SafePicFromWad) (char *name);
|
|
|
|
mpic_t *(*Draw_CachePic) (char *path);
|
|
|
|
mpic_t *(*Draw_SafeCachePic) (char *path);
|
|
|
|
void (*Draw_Init) (void);
|
|
|
|
void (*Draw_ReInit) (void);
|
|
|
|
void (*Draw_Character) (int x, int y, unsigned int num);
|
|
|
|
void (*Draw_ColouredCharacter) (int x, int y, unsigned int num);
|
2008-06-01 22:06:22 +00:00
|
|
|
void (*Draw_TinyCharacter) (int x, int y, unsigned int num);
|
2005-06-22 17:10:13 +00:00
|
|
|
void (*Draw_String) (int x, int y, const qbyte *str);
|
|
|
|
void (*Draw_Alt_String) (int x, int y, const qbyte *str);
|
|
|
|
void (*Draw_Crosshair) (void);
|
|
|
|
void (*Draw_DebugChar) (qbyte num);
|
|
|
|
void (*Draw_Pic) (int x, int y, mpic_t *pic);
|
|
|
|
void (*Draw_ScalePic) (int x, int y, int width, int height, mpic_t *pic);
|
|
|
|
void (*Draw_SubPic) (int x, int y, mpic_t *pic, int srcx, int srcy, int width, int height);
|
|
|
|
void (*Draw_TransPic) (int x, int y, mpic_t *pic);
|
|
|
|
void (*Draw_TransPicTranslate) (int x, int y, int w, int h, qbyte *pic, qbyte *translation);
|
2009-04-06 00:34:32 +00:00
|
|
|
void (*Draw_ConsoleBackground) (int firstline, int lastline, qboolean forceopaque);
|
2005-06-22 17:10:13 +00:00
|
|
|
void (*Draw_EditorBackground) (int lines);
|
|
|
|
void (*Draw_TileClear) (int x, int y, int w, int h);
|
2008-06-01 22:06:22 +00:00
|
|
|
void (*Draw_Fill) (int x, int y, int w, int h, unsigned int c);
|
2006-03-11 00:51:00 +00:00
|
|
|
void (*Draw_FillRGB) (int x, int y, int w, int h, float r, float g, float b);
|
2005-06-22 17:10:13 +00:00
|
|
|
void (*Draw_FadeScreen) (void);
|
|
|
|
void (*Draw_BeginDisc) (void);
|
|
|
|
void (*Draw_EndDisc) (void);
|
|
|
|
|
|
|
|
void (*Draw_Image) (float x, float y, float w, float h, float s1, float t1, float s2, float t2, mpic_t *pic); //gl-style scaled/coloured/subpic
|
|
|
|
void (*Draw_ImageColours) (float r, float g, float b, float a);
|
|
|
|
|
|
|
|
void (*R_Init) (void);
|
|
|
|
void (*R_DeInit) (void);
|
|
|
|
void (*R_ReInit) (void);
|
|
|
|
void (*R_RenderView) (void); // must set r_refdef first
|
|
|
|
|
|
|
|
qboolean (*R_CheckSky) (void);
|
|
|
|
void (*R_SetSky) (char *name, float rotate, vec3_t axis);
|
|
|
|
|
|
|
|
void (*R_NewMap) (void);
|
|
|
|
void (*R_PreNewMap) (void);
|
|
|
|
int (*R_LightPoint) (vec3_t point);
|
|
|
|
|
|
|
|
void (*R_PushDlights) (void);
|
|
|
|
void (*R_AddStain) (vec3_t org, float red, float green, float blue, float radius);
|
|
|
|
void (*R_LessenStains) (void);
|
|
|
|
|
|
|
|
void (*Media_ShowFrameBGR_24_Flip) (qbyte *framedata, int inwidth, int inheight); //input is bottom up...
|
|
|
|
void (*Media_ShowFrameRGBA_32) (qbyte *framedata, int inwidth, int inheight); //top down
|
|
|
|
void (*Media_ShowFrame8bit) (qbyte *framedata, int inwidth, int inheight, qbyte *palette); //paletted topdown (framedata is 8bit indexes into palette)
|
|
|
|
|
|
|
|
void (*Mod_Init) (void);
|
|
|
|
void (*Mod_ClearAll) (void);
|
|
|
|
struct model_s *(*Mod_ForName) (char *name, qboolean crash);
|
|
|
|
struct model_s *(*Mod_FindName) (char *name);
|
|
|
|
void *(*Mod_Extradata) (struct model_s *mod); // handles caching
|
|
|
|
void (*Mod_TouchModel) (char *name);
|
|
|
|
|
|
|
|
void (*Mod_NowLoadExternal) (void);
|
|
|
|
void (*Mod_Think) (void);
|
2008-12-23 02:55:20 +00:00
|
|
|
qboolean (*Mod_GetTag) (struct model_s *model, int tagnum, framestate_t *fstate, float *result);
|
2005-06-22 17:10:13 +00:00
|
|
|
int (*Mod_TagNumForName) (struct model_s *model, char *name);
|
2005-08-03 23:14:59 +00:00
|
|
|
int (*Mod_SkinForName) (struct model_s *model, char *name);
|
2009-04-01 22:03:56 +00:00
|
|
|
int (*Mod_FrameForName) (struct model_s *model, char *name);
|
2005-06-22 17:10:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
qboolean (*VID_Init) (rendererstate_t *info, unsigned char *palette);
|
|
|
|
void (*VID_DeInit) (void);
|
|
|
|
void (*VID_LockBuffer) (void);
|
|
|
|
void (*VID_UnlockBuffer) (void);
|
|
|
|
void (*D_BeginDirectRect) (int x, int y, qbyte *pbitmap, int width, int height);
|
|
|
|
void (*D_EndDirectRect) (int x, int y, int width, int height);
|
|
|
|
void (*VID_ForceLockState) (int lk);
|
|
|
|
int (*VID_ForceUnlockedAndReturnState) (void);
|
|
|
|
void (*VID_SetPalette) (unsigned char *palette);
|
|
|
|
void (*VID_ShiftPalette) (unsigned char *palette);
|
|
|
|
char *(*VID_GetRGBInfo) (int prepad, int *truevidwidth, int *truevidheight);
|
|
|
|
void (*VID_SetWindowCaption) (char *msg);
|
|
|
|
|
|
|
|
void (*SCR_UpdateScreen) (void);
|
|
|
|
|
|
|
|
char *alignment;
|
|
|
|
} rendererinfo_t;
|