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.
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
struct pubprogfuncs_s;
|
2004-08-23 00:15:46 +00:00
|
|
|
struct globalvars_s;
|
|
|
|
struct texture_s;
|
2011-01-23 03:51:27 +00:00
|
|
|
struct texnums_s;
|
|
|
|
struct vbo_s;
|
|
|
|
struct mesh_s;
|
|
|
|
struct batch_s;
|
|
|
|
struct entity_s;
|
2011-10-27 16:42:53 +00:00
|
|
|
struct dlight_s;
|
2011-12-05 15:23:40 +00:00
|
|
|
struct galiasbone_s;
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2014-03-30 08:55:06 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
SKEL_RELATIVE, //relative to parent.
|
|
|
|
SKEL_ABSOLUTE, //relative to model. doesn't blend very well.
|
|
|
|
SKEL_INVERSE_RELATIVE, //pre-inverted. faster than regular relative but has weirdness with skeletal objects. blends okay.
|
|
|
|
SKEL_INVERSE_ABSOLUTE //final renderable type.
|
|
|
|
} skeltype_t;
|
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;
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
} g[FS_COUNT];
|
2008-12-23 02:55:20 +00:00
|
|
|
|
2014-03-30 08:55:06 +00:00
|
|
|
#ifdef SKELETALOBJECTS
|
2008-12-23 02:55:20 +00:00
|
|
|
float *bonestate;
|
|
|
|
int bonecount;
|
2014-03-30 08:55:06 +00:00
|
|
|
skeltype_t skeltype;
|
|
|
|
#endif
|
2008-12-23 02:55:20 +00:00
|
|
|
|
|
|
|
#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'
|
2009-07-06 07:45:46 +00:00
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
#else
|
|
|
|
#define FNC(n) (*n)
|
|
|
|
extern r_qrenderer_t qrenderer;
|
|
|
|
extern char *q_renderername;
|
|
|
|
|
2014-03-30 08:55:06 +00:00
|
|
|
mpic_t *R2D_SafeCachePic (const char *path);
|
|
|
|
mpic_t *R2D_SafePicFromWad (const char *name);
|
2011-03-31 19:46:26 +00:00
|
|
|
void R2D_DrawCrosshair (void);
|
2013-08-21 07:14:39 +00:00
|
|
|
void R2D_ScalePic (float x, float y, float width, float height, mpic_t *pic);
|
|
|
|
void R2D_SubPic(float x, float y, float width, float height, mpic_t *pic, float srcx, float srcy, float srcwidth, float srcheight);
|
2014-03-30 08:55:06 +00:00
|
|
|
void R2D_TransPicTranslate (float x, float y, int width, int height, qbyte *pic, unsigned int *palette);
|
2013-08-21 07:14:39 +00:00
|
|
|
void R2D_TileClear (float x, float y, float w, float h);
|
2011-03-31 01:14:01 +00:00
|
|
|
void R2D_FadeScreen (void);
|
|
|
|
|
2013-12-29 22:48:28 +00:00
|
|
|
void R2D_Font_Changed(void);
|
2011-03-31 01:14:01 +00:00
|
|
|
void R2D_ConsoleBackground (int firstline, int lastline, qboolean forceopaque);
|
|
|
|
void R2D_EditorBackground (void);
|
|
|
|
|
|
|
|
void R2D_Image(float x, float y, float w, float h, float s1, float t1, float s2, float t2, mpic_t *pic);
|
|
|
|
|
|
|
|
void R2D_ImageColours(float r, float g, float b, float a);
|
|
|
|
void R2D_ImagePaletteColour(unsigned int i, float a);
|
2013-08-21 07:14:39 +00:00
|
|
|
void R2D_FillBlock(float x, float y, float w, float h);
|
2011-03-31 01:14:01 +00:00
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
extern void (*Draw_Init) (void);
|
2004-11-23 01:10:10 +00:00
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
extern void (*R_Init) (void);
|
|
|
|
extern void (*R_DeInit) (void);
|
|
|
|
extern void (*R_RenderView) (void); // must set r_refdef first
|
|
|
|
|
|
|
|
extern void (*R_NewMap) (void);
|
|
|
|
extern void (*R_PreNewMap) (void);
|
|
|
|
|
|
|
|
extern qboolean (*VID_Init) (rendererstate_t *info, unsigned char *palette);
|
|
|
|
extern void (*VID_DeInit) (void);
|
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);
|
2009-04-19 00:50:42 +00:00
|
|
|
extern void SCR_CenterPrint (int pnum, char *str, qboolean skipgamecode);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2014-03-30 08:55:06 +00:00
|
|
|
void R_DrawTextField(int x, int y, int w, int h, const char *text, unsigned int defaultmask, unsigned int fieldflags);
|
2010-07-11 02:22:39 +00:00
|
|
|
#define CPRINT_BALIGN (1<<0) //B
|
|
|
|
#define CPRINT_TALIGN (1<<1) //T
|
|
|
|
#define CPRINT_LALIGN (1<<2) //L
|
|
|
|
#define CPRINT_RALIGN (1<<3) //R
|
|
|
|
#define CPRINT_BACKGROUND (1<<4) //P
|
|
|
|
|
|
|
|
#define CPRINT_OBITUARTY (1<<16) //O (show at 2/3rds from top)
|
|
|
|
#define CPRINT_PERSIST (1<<17) //P (doesn't time out)
|
|
|
|
#define CPRINT_TYPEWRITER (1<<18) // (char at a time)
|
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
#endif
|
|
|
|
|
2013-10-29 17:38:22 +00:00
|
|
|
//mod_purge flags
|
|
|
|
enum mod_purge_e
|
|
|
|
{
|
|
|
|
MP_MAPCHANGED, //new map. old stuff no longer needed
|
|
|
|
MP_FLUSH, //user flush command. anything flushable goes.
|
|
|
|
MP_RESET //*everything* is destroyed. renderer is going down.
|
|
|
|
};
|
2014-03-30 08:55:06 +00:00
|
|
|
enum mlverbosity_e
|
|
|
|
{
|
|
|
|
MLV_SILENT,
|
|
|
|
MLV_WARN,
|
|
|
|
MLV_ERROR
|
|
|
|
};
|
2013-10-29 17:38:22 +00:00
|
|
|
|
2013-07-14 12:22:51 +00:00
|
|
|
extern void Mod_ClearAll (void);
|
2013-10-29 17:38:22 +00:00
|
|
|
extern void Mod_Purge (enum mod_purge_e type);
|
2014-03-30 08:55:06 +00:00
|
|
|
extern struct model_s *Mod_FindName (const char *name); //find without loading. needload should be set.
|
|
|
|
extern struct model_s *Mod_ForName (const char *name, enum mlverbosity_e verbosity); //finds+loads
|
|
|
|
extern struct model_s *Mod_LoadModel (struct model_s *mod, enum mlverbosity_e verbose); //makes sure a model is loaded
|
2013-07-14 12:22:51 +00:00
|
|
|
extern void *Mod_Extradata (struct model_s *mod); // handles caching
|
2014-03-30 08:55:06 +00:00
|
|
|
extern void Mod_TouchModel (const char *name);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2013-07-14 12:22:51 +00:00
|
|
|
extern void Mod_NowLoadExternal (void);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2013-07-14 12:22:51 +00:00
|
|
|
extern void Mod_Think (void);
|
2014-03-30 08:55:06 +00:00
|
|
|
extern int Mod_SkinNumForName (struct model_s *model, const char *name);
|
|
|
|
extern int Mod_FrameNumForName (struct model_s *model, const char *name);
|
2013-07-14 12:22:51 +00:00
|
|
|
extern float Mod_GetFrameDuration (struct model_s *model, int framenum);
|
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);
|
2014-03-30 08:55:06 +00:00
|
|
|
extern int Mod_TagNumForName (struct model_s *model, const char *name);
|
2007-05-25 23:03:49 +00:00
|
|
|
|
2008-12-23 02:55:20 +00:00
|
|
|
int Mod_GetNumBones(struct model_s *model, qboolean allowtags);
|
2009-04-19 00:50:42 +00:00
|
|
|
int Mod_GetBoneRelations(struct model_s *model, int firstbone, int lastbone, framestate_t *fstate, float *result);
|
2008-12-23 02:55:20 +00:00
|
|
|
int Mod_GetBoneParent(struct model_s *model, int bonenum);
|
2013-05-03 04:28:08 +00:00
|
|
|
struct galiasbone_s *Mod_GetBoneInfo(struct model_s *model, int *numbones);
|
2008-12-23 02:55:20 +00:00
|
|
|
char *Mod_GetBoneName(struct model_s *model, int bonenum);
|
|
|
|
|
2013-08-27 13:18:09 +00:00
|
|
|
void Draw_FunString(float x, float y, const void *str);
|
|
|
|
void Draw_AltFunString(float x, float y, const void *str);
|
2013-10-29 17:38:22 +00:00
|
|
|
void Draw_FunStringWidth(float x, float y, const void *str, int width, qboolean rightalign, qboolean highlight);
|
2005-01-24 23:47:32 +00:00
|
|
|
|
2013-03-12 23:09:25 +00:00
|
|
|
extern int r_regsequence;
|
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
|
|
|
|
2011-10-27 15:46:36 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int regsequence;
|
2013-05-11 14:02:55 +00:00
|
|
|
int width;
|
|
|
|
int height;
|
2011-10-27 15:46:36 +00:00
|
|
|
} texcom_t;
|
|
|
|
struct texid_s
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
unsigned int num;
|
2012-05-09 15:30:53 +00:00
|
|
|
#if defined(D3DQUAKE) || defined(SWQUAKE)
|
2011-10-27 15:46:36 +00:00
|
|
|
void *ptr;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
texcom_t *ref;
|
|
|
|
};
|
|
|
|
#if 1
|
|
|
|
typedef struct texid_s texid_t;
|
|
|
|
#define texid_tf texid_t
|
|
|
|
#define TEXASSIGN(d,s) d=s
|
|
|
|
#define TEXASSIGNF(d,s) d=s
|
|
|
|
#define TEXVALID(t) ((t).ref!=NULL)
|
|
|
|
#else
|
|
|
|
typedef struct texid_s texid_t[1];
|
|
|
|
typedef struct texid_s texid_tf;
|
|
|
|
#define TEXASSIGN(d,s) memcpy(&d,&s,sizeof(d))
|
|
|
|
#define TEXASSIGNF(d,s) memcpy(&d,&s,sizeof(d))
|
|
|
|
#define TEXVALID(t) 1
|
2010-10-02 02:25:39 +00:00
|
|
|
#endif
|
2013-04-06 03:36:00 +00:00
|
|
|
|
|
|
|
//small context for easy vbo creation.
|
|
|
|
typedef struct
|
|
|
|
{
|
2013-05-11 05:03:07 +00:00
|
|
|
size_t maxsize;
|
|
|
|
size_t pos;
|
2013-04-06 03:36:00 +00:00
|
|
|
int vboid[2];
|
2013-05-11 05:03:07 +00:00
|
|
|
void *fallback;
|
2013-04-06 03:36:00 +00:00
|
|
|
} vbobctx_t;
|
|
|
|
|
|
|
|
typedef struct vboarray_s
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
void *dummy;
|
|
|
|
#ifdef GLQUAKE
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int vbo;
|
|
|
|
void *addr;
|
|
|
|
} gl;
|
|
|
|
#endif
|
|
|
|
#if defined(D3D9QUAKE) || defined(D3D11QUAKE)
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
void *buff;
|
|
|
|
unsigned int offs;
|
|
|
|
} d3d;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
} vboarray_t;
|
|
|
|
|
2013-06-23 02:17:02 +00:00
|
|
|
//scissor rects
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
float x;
|
|
|
|
float y;
|
|
|
|
float width;
|
|
|
|
float height;
|
|
|
|
double dmin;
|
|
|
|
double dmax;
|
|
|
|
} srect_t;
|
|
|
|
|
2013-03-12 22:56:10 +00:00
|
|
|
typedef struct texnums_s {
|
|
|
|
texid_t base;
|
|
|
|
texid_t bump;
|
2013-09-06 22:57:44 +00:00
|
|
|
texid_t specular;
|
2013-03-12 22:56:10 +00:00
|
|
|
texid_t upperoverlay;
|
|
|
|
texid_t loweroverlay;
|
|
|
|
texid_t fullbright;
|
|
|
|
} texnums_t;
|
2011-10-29 19:01:33 +00:00
|
|
|
typedef enum uploadfmt
|
|
|
|
{
|
|
|
|
TF_INVALID,
|
|
|
|
TF_RGBA32, /*rgba byte order*/
|
|
|
|
TF_BGRA32, /*bgra byte order*/
|
|
|
|
TF_RGBX32, /*rgb byte order, with extra wasted byte after blue*/
|
2012-04-24 07:59:11 +00:00
|
|
|
TF_BGRX32, /*rgb byte order, with extra wasted byte after blue*/
|
2013-03-12 22:40:16 +00:00
|
|
|
TF_RGB24, /*rgb byte order, no alpha channel nor pad, and regular top down*/
|
|
|
|
TF_BGR24, /*bgr byte order, no alpha channel nor pad, and regular top down*/
|
2011-10-29 19:01:33 +00:00
|
|
|
TF_BGR24_FLIP, /*bgr byte order, no alpha channel nor pad, and bottom up*/
|
2013-03-12 22:40:16 +00:00
|
|
|
TF_LUM8, /*8bit greyscale image*/
|
2011-10-29 19:01:33 +00:00
|
|
|
TF_SOLID8, /*8bit quake-palette image*/
|
|
|
|
TF_TRANS8, /*8bit quake-palette image, index 255=transparent*/
|
|
|
|
TF_TRANS8_FULLBRIGHT, /*fullbright 8 - fullbright texels have alpha 255, everything else 0*/
|
|
|
|
TF_HEIGHT8, /*image data is greyscale, convert to a normalmap and load that, uploaded alpha contains the original heights*/
|
|
|
|
TF_HEIGHT8PAL, /*source data is palette values rather than actual heights, generate a fallback heightmap*/
|
|
|
|
TF_H2_T7G1, /*8bit data, odd indexes give greyscale transparence*/
|
|
|
|
TF_H2_TRANS8_0, /*8bit data, 0 is transparent, not 255*/
|
|
|
|
TF_H2_T4A4, /*8bit data, weird packing*/
|
|
|
|
|
2014-02-07 08:38:40 +00:00
|
|
|
/*this block requires a palette*/
|
2011-10-29 19:01:33 +00:00
|
|
|
TF_PALETTES,
|
|
|
|
TF_8PAL24,
|
2014-02-07 08:38:40 +00:00
|
|
|
TF_8PAL32,
|
|
|
|
|
|
|
|
/*for render targets*/
|
|
|
|
TF_DEPTH16,
|
|
|
|
TF_DEPTH24,
|
|
|
|
TF_DEPTH32,
|
|
|
|
TF_RGBA16F,
|
|
|
|
TF_RGBA32F
|
2011-10-29 19:01:33 +00:00
|
|
|
} uploadfmt_t;
|
|
|
|
|
2011-01-29 19:53:38 +00:00
|
|
|
//not all modes accept meshes - STENCIL(intentional) and DEPTHONLY(not implemented)
|
|
|
|
typedef enum backendmode_e
|
|
|
|
{
|
2012-08-04 01:35:52 +00:00
|
|
|
BEM_STANDARD, //regular mode to draw surfaces akin to q3 (aka: legacy mode). lightmaps+delux+ambient
|
|
|
|
BEM_DEPTHONLY, //just a quick depth pass. textures used only for alpha test (shadowmaps).
|
|
|
|
BEM_WIREFRAME, //for debugging or something
|
|
|
|
BEM_STENCIL, //used for drawing shadow volumes to the stencil buffer.
|
|
|
|
BEM_DEPTHDARK, //a quick depth pass. textures used only for alpha test. additive textures still shown as normal.
|
2011-12-05 15:23:40 +00:00
|
|
|
BEM_CREPUSCULAR, //sky is special, everything else completely black
|
2011-09-03 03:49:43 +00:00
|
|
|
BEM_DEPTHNORM, //all opaque stuff drawn using 'depthnorm' shader
|
2012-09-30 05:52:03 +00:00
|
|
|
BEM_FOG, //drawing a fog volume
|
2012-08-04 01:35:52 +00:00
|
|
|
BEM_LIGHT, //we have a valid light
|
2011-01-29 19:53:38 +00:00
|
|
|
} backendmode_t;
|
2005-06-22 17:10:13 +00:00
|
|
|
|
2010-02-06 01:25:04 +00:00
|
|
|
typedef struct rendererinfo_s {
|
2005-06-22 17:10:13 +00:00
|
|
|
char *description;
|
|
|
|
char *name[4];
|
|
|
|
r_qrenderer_t rtype;
|
|
|
|
|
|
|
|
void (*Draw_Init) (void);
|
2009-11-04 21:16:50 +00:00
|
|
|
void (*Draw_Shutdown) (void);
|
2005-06-22 17:10:13 +00:00
|
|
|
|
2014-03-30 08:55:06 +00:00
|
|
|
texid_tf (*IMG_LoadTexture) (const char *identifier, int width, int height, uploadfmt_t fmt, void *data, unsigned int flags);
|
|
|
|
texid_tf (*IMG_LoadTexture8Pal24) (const char *identifier, int width, int height, qbyte *data, qbyte *palette24, unsigned int flags);
|
|
|
|
texid_tf (*IMG_LoadTexture8Pal32) (const char *identifier, int width, int height, qbyte *data, qbyte *palette32, unsigned int flags);
|
|
|
|
texid_tf (*IMG_LoadCompressed) (const char *name);
|
|
|
|
texid_tf (*IMG_FindTexture) (const char *identifier, unsigned int flags);
|
|
|
|
texid_tf (*IMG_AllocNewTexture) (const char *identifier, int w, int h, unsigned int flags);
|
2014-08-03 14:47:47 +00:00
|
|
|
void (*IMG_Upload) (texid_t tex, const char *name, uploadfmt_t fmt, void *data, void *palette, int width, int height, unsigned int flags);
|
2010-10-02 02:25:39 +00:00
|
|
|
void (*IMG_DestroyTexture) (texid_t tex);
|
|
|
|
|
2013-07-14 12:22:51 +00:00
|
|
|
void (*R_Init) (void); //FIXME - merge implementations
|
|
|
|
void (*R_DeInit) (void); //FIXME - merge implementations
|
|
|
|
void (*R_RenderView) (void); // must set r_refdef first
|
2005-06-22 17:10:13 +00:00
|
|
|
|
2013-07-14 12:22:51 +00:00
|
|
|
void (*R_NewMap) (void); //FIXME - merge implementations
|
|
|
|
void (*R_PreNewMap) (void); //FIXME - merge implementations
|
2005-06-22 17:10:13 +00:00
|
|
|
|
|
|
|
qboolean (*VID_Init) (rendererstate_t *info, unsigned char *palette);
|
|
|
|
void (*VID_DeInit) (void);
|
2014-03-30 00:39:37 +00:00
|
|
|
void (*VID_SwapBuffers) (void); //force a buffer swap, regardless of what's displayed.
|
2013-05-11 14:02:55 +00:00
|
|
|
qboolean (*VID_ApplyGammaRamps) (unsigned short *ramps);
|
2005-06-22 17:10:13 +00:00
|
|
|
void (*VID_SetWindowCaption) (char *msg);
|
2014-03-30 00:39:37 +00:00
|
|
|
char *(*VID_GetRGBInfo) (int prepad, int *truevidwidth, int *truevidheight);
|
2005-06-22 17:10:13 +00:00
|
|
|
|
|
|
|
void (*SCR_UpdateScreen) (void);
|
|
|
|
|
2011-01-04 02:56:16 +00:00
|
|
|
|
|
|
|
//Select the current render mode and modifier flags
|
2011-04-20 23:34:13 +00:00
|
|
|
void (*BE_SelectMode)(backendmode_t mode);
|
2011-01-04 02:56:16 +00:00
|
|
|
/*Draws an entire mesh list from a VBO. vbo can be null, in which case the chain may be drawn without batching.
|
|
|
|
Rules for using a list: Every mesh must be part of the same VBO, shader, lightmap, and must have the same pointers set*/
|
2011-04-20 23:34:13 +00:00
|
|
|
void (*BE_DrawMesh_List)(shader_t *shader, int nummeshes, struct mesh_s **mesh, struct vbo_s *vbo, struct texnums_s *texnums, unsigned int be_flags);
|
|
|
|
void (*BE_DrawMesh_Single)(shader_t *shader, struct mesh_s *meshchain, struct vbo_s *vbo, struct texnums_s *texnums, unsigned int be_flags);
|
2011-01-04 02:56:16 +00:00
|
|
|
void (*BE_SubmitBatch)(struct batch_s *batch);
|
|
|
|
struct batch_s *(*BE_GetTempBatch)(void);
|
|
|
|
//Asks the backend to invoke DrawMeshChain for each surface, and to upload lightmaps as required
|
2012-07-07 05:17:43 +00:00
|
|
|
void (*BE_DrawWorld) (qboolean drawworld, qbyte *vis);
|
2011-01-04 02:56:16 +00:00
|
|
|
//called at init, force the display to the right defaults etc
|
|
|
|
void (*BE_Init)(void);
|
|
|
|
//Generates an optimised VBO, one for each texture on the map
|
|
|
|
void (*BE_GenBrushModelVBO)(struct model_s *mod);
|
|
|
|
//Destroys the given vbo
|
|
|
|
void (*BE_ClearVBO)(struct vbo_s *vbo);
|
|
|
|
//Uploads all modified lightmaps
|
|
|
|
void (*BE_UploadAllLightmaps)(void);
|
|
|
|
void (*BE_SelectEntity)(struct entity_s *ent);
|
2013-10-08 14:28:11 +00:00
|
|
|
qboolean (*BE_SelectDLight)(struct dlight_s *dl, vec3_t colour, unsigned int lmode);
|
2013-06-23 02:17:02 +00:00
|
|
|
void (*BE_Scissor)(srect_t *rect);
|
2011-01-04 02:56:16 +00:00
|
|
|
/*check to see if an ent should be drawn for the selected light*/
|
|
|
|
qboolean (*BE_LightCullModel)(vec3_t org, struct model_s *model);
|
2013-04-06 03:36:00 +00:00
|
|
|
void (*BE_VBO_Begin)(vbobctx_t *ctx, unsigned int maxsize);
|
|
|
|
void (*BE_VBO_Data)(vbobctx_t *ctx, void *data, unsigned int size, vboarray_t *varray);
|
|
|
|
void (*BE_VBO_Finish)(vbobctx_t *ctx, void *edata, unsigned int esize, vboarray_t *earray);
|
|
|
|
void (*BE_VBO_Destroy)(vboarray_t *vearray);
|
2014-02-07 14:57:07 +00:00
|
|
|
void (*BE_RenderToTextureUpdate2d)(qboolean destchanged);
|
2005-06-22 17:10:13 +00:00
|
|
|
char *alignment;
|
|
|
|
} rendererinfo_t;
|
2010-10-02 02:25:39 +00:00
|
|
|
|
|
|
|
#define rf currentrendererstate.renderer
|
|
|
|
|
2014-03-30 00:39:37 +00:00
|
|
|
#define VID_SwapBuffers rf->VID_SwapBuffers
|
|
|
|
|
2010-10-02 02:25:39 +00:00
|
|
|
#define R_LoadTexture rf->IMG_LoadTexture
|
|
|
|
#define R_LoadTexture8Pal24 rf->IMG_LoadTexture8Pal24
|
|
|
|
#define R_LoadTexture8Pal32 rf->IMG_LoadTexture8Pal32
|
|
|
|
#define R_LoadCompressed rf->IMG_LoadCompressed
|
|
|
|
#define R_FindTexture rf->IMG_FindTexture
|
|
|
|
#define R_AllocNewTexture rf->IMG_AllocNewTexture
|
|
|
|
#define R_Upload rf->IMG_Upload
|
|
|
|
#define R_DestroyTexture rf->IMG_DestroyTexture
|
2011-01-04 02:56:16 +00:00
|
|
|
|
|
|
|
#define BE_Init rf->BE_Init
|
|
|
|
#define BE_SelectMode rf->BE_SelectMode
|
|
|
|
#define BE_GenBrushModelVBO rf->BE_GenBrushModelVBO
|
|
|
|
#define BE_ClearVBO rf->BE_ClearVBO
|
|
|
|
#define BE_UploadAllLightmaps rf->BE_UploadAllLightmaps
|
|
|
|
#define BE_LightCullModel rf->BE_LightCullModel
|
|
|
|
#define BE_SelectEntity rf->BE_SelectEntity
|
2011-10-27 15:46:36 +00:00
|
|
|
#define BE_SelectDLight rf->BE_SelectDLight
|
2011-01-04 02:56:16 +00:00
|
|
|
#define BE_GetTempBatch rf->BE_GetTempBatch
|
|
|
|
#define BE_SubmitBatch rf->BE_SubmitBatch
|
|
|
|
#define BE_DrawMesh_List rf->BE_DrawMesh_List
|
|
|
|
#define BE_DrawMesh_Single rf->BE_DrawMesh_Single
|
2011-12-05 15:23:40 +00:00
|
|
|
#define BE_SubmitMeshes rf->BE_SubmitMeshes
|
2011-01-29 19:53:38 +00:00
|
|
|
#define BE_DrawWorld rf->BE_DrawWorld
|
2013-04-06 03:36:00 +00:00
|
|
|
#define BE_VBO_Begin rf->BE_VBO_Begin
|
|
|
|
#define BE_VBO_Data rf->BE_VBO_Data
|
|
|
|
#define BE_VBO_Finish rf->BE_VBO_Finish
|
|
|
|
#define BE_VBO_Destroy rf->BE_VBO_Destroy
|
2013-06-23 02:17:02 +00:00
|
|
|
#define BE_Scissor rf->BE_Scissor
|
2014-02-07 08:38:40 +00:00
|
|
|
|
2014-02-07 14:57:07 +00:00
|
|
|
#define BE_RenderToTextureUpdate2d rf->BE_RenderToTextureUpdate2d
|
|
|
|
|
2014-08-03 14:47:47 +00:00
|
|
|
texid_t R2D_RT_Configure(const char *id, int width, int height, uploadfmt_t rtfmt);
|
|
|
|
texid_t R2D_RT_GetTexture(const char *id, unsigned int *width, unsigned int *height);
|
|
|
|
|
2014-02-07 08:38:40 +00:00
|
|
|
|