2012-02-14 08:28:09 +00:00
|
|
|
#ifndef __r_internal_h
|
|
|
|
#define __r_internal_h
|
|
|
|
|
|
|
|
#include "QF/vid.h"
|
|
|
|
#include "QF/plugin/vid_render.h"
|
|
|
|
#include "r_cvar.h"
|
|
|
|
#include "r_dynamic.h"
|
|
|
|
#include "r_local.h"
|
|
|
|
#include "r_shared.h"
|
|
|
|
|
|
|
|
extern viddef_t vid; // global video state
|
|
|
|
|
2012-02-15 00:04:22 +00:00
|
|
|
extern vid_render_data_t vid_render_data;
|
2012-02-22 12:53:17 +00:00
|
|
|
extern vid_render_funcs_t gl_vid_render_funcs;
|
|
|
|
extern vid_render_funcs_t glsl_vid_render_funcs;
|
|
|
|
extern vid_render_funcs_t sw_vid_render_funcs;
|
2021-01-18 03:46:06 +00:00
|
|
|
extern vid_render_funcs_t vulkan_vid_render_funcs;
|
2012-04-11 13:45:23 +00:00
|
|
|
extern vid_render_funcs_t *vid_render_funcs;
|
2012-02-22 12:53:17 +00:00
|
|
|
|
2012-02-15 00:04:22 +00:00
|
|
|
#define vr_data vid_render_data
|
2012-04-11 13:45:23 +00:00
|
|
|
#define vr_funcs vid_render_funcs
|
2012-02-14 08:28:09 +00:00
|
|
|
|
|
|
|
extern refdef_t r_refdef;
|
2022-12-13 13:58:44 +00:00
|
|
|
#define SW_COMP(comp, id) ((void *)((byte *)r_refdef.registry->comp_pools[comp].data + (id) * r_refdef.registry->components.a[comp].size))
|
2012-02-14 08:28:09 +00:00
|
|
|
extern int r_viewsize;
|
|
|
|
|
2021-07-11 01:59:27 +00:00
|
|
|
void R_LineGraph (int x, int y, int *h_vals, int count, int height);
|
2012-02-14 08:28:09 +00:00
|
|
|
|
|
|
|
|
2012-02-23 12:17:32 +00:00
|
|
|
void gl_R_Init (void);
|
|
|
|
void glsl_R_Init (void);
|
2023-03-05 07:56:09 +00:00
|
|
|
void glsl_R_Shutdown (void);
|
2012-02-22 13:12:29 +00:00
|
|
|
void sw_R_Init (void);
|
2021-12-02 09:30:57 +00:00
|
|
|
void R_RenderFrame (SCR_Func *scr_funcs);
|
2012-02-14 08:28:09 +00:00
|
|
|
void R_Init_Cvars (void);
|
|
|
|
void R_InitEfrags (void);
|
|
|
|
void R_ClearState (void);
|
|
|
|
void R_InitSky (struct texture_s *mt); // called at level load
|
|
|
|
void R_Textures_Init (void);
|
|
|
|
void R_RenderView (void); // must set r_refdef first
|
2021-04-01 10:17:19 +00:00
|
|
|
void R_ViewChanged (void); // must set r_refdef first
|
2012-02-14 08:28:09 +00:00
|
|
|
// called whenever r_refdef or vid change
|
|
|
|
|
2021-12-19 05:47:25 +00:00
|
|
|
extern struct psystem_s r_psystem;
|
|
|
|
struct psystem_s *gl_ParticleSystem (void);
|
|
|
|
struct psystem_s *glsl_ParticleSystem (void);
|
|
|
|
struct psystem_s *sw_ParticleSystem (void);
|
|
|
|
void R_RunParticles (float dT);
|
|
|
|
|
2022-05-05 05:41:46 +00:00
|
|
|
struct scene_s;
|
|
|
|
void R_NewScene (struct scene_s *scene);
|
2012-02-14 08:28:09 +00:00
|
|
|
|
2023-06-28 14:44:38 +00:00
|
|
|
typedef struct visstate_s {
|
|
|
|
const struct mleaf_s *viewleaf;
|
|
|
|
int *node_visframes;
|
|
|
|
int *leaf_visframes;
|
|
|
|
int *face_visframes;
|
|
|
|
int visframecount;
|
2023-07-27 06:43:47 +00:00
|
|
|
const struct mod_brush_s *brush;
|
2023-06-28 14:44:38 +00:00
|
|
|
} visstate_t;
|
|
|
|
|
|
|
|
extern visstate_t r_visstate;//FIXME
|
|
|
|
|
2012-02-14 08:28:09 +00:00
|
|
|
// LordHavoc: relative bmodel lighting
|
2023-06-28 14:44:38 +00:00
|
|
|
void R_PushDlights (const vec3_t entorigin, const visstate_t *visstate);
|
2012-02-14 08:28:09 +00:00
|
|
|
void R_DrawWaterSurfaces (void);
|
|
|
|
|
2018-10-09 03:35:01 +00:00
|
|
|
void *D_SurfaceCacheAddress (void) __attribute__((pure));
|
2022-03-21 02:12:58 +00:00
|
|
|
int D_SurfaceCacheForRes (int width, int height);
|
2021-07-10 15:09:41 +00:00
|
|
|
void D_FlushCaches (void *data);
|
2012-02-14 08:28:09 +00:00
|
|
|
void D_DeleteSurfaceCache (void);
|
2022-03-21 02:12:58 +00:00
|
|
|
void D_InitCaches (void *buffer, int size);
|
2013-01-30 12:20:25 +00:00
|
|
|
void R_SetVrect (const vrect_t *pvrect, vrect_t *pvrectin, int lineadj);
|
2012-02-14 08:28:09 +00:00
|
|
|
|
|
|
|
void R_LoadSkys (const char *);
|
|
|
|
|
|
|
|
void R_ClearEfrags (void);
|
|
|
|
|
2023-08-01 14:28:24 +00:00
|
|
|
int R_FindNearLights (vec4f_t pos, int count, dlight_t **lights);
|
2012-02-14 08:28:09 +00:00
|
|
|
dlight_t *R_AllocDlight (int key);
|
|
|
|
void R_DecayLights (double frametime);
|
|
|
|
void R_ClearDlights (void);
|
|
|
|
|
|
|
|
int R_InitGraphTextures (int base);
|
|
|
|
|
2022-03-29 05:40:48 +00:00
|
|
|
struct entity_s;
|
|
|
|
struct animation_s;
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
struct transform_s;
|
2022-03-29 05:40:48 +00:00
|
|
|
void R_DrawAliasModel (struct entity_s *e);
|
2012-02-14 08:28:09 +00:00
|
|
|
|
2023-07-27 06:43:47 +00:00
|
|
|
struct set_s;
|
|
|
|
void R_MarkLeavesPVS (visstate_t *state, const struct set_s *pvs);
|
2023-06-28 14:44:38 +00:00
|
|
|
void R_MarkLeaves (visstate_t *state, const struct mleaf_s *viewleaf);
|
2012-02-14 08:28:09 +00:00
|
|
|
|
2021-07-10 15:09:41 +00:00
|
|
|
void GL_SetPalette (void *data, const byte *palette);
|
|
|
|
void GLSL_SetPalette (void *data, const byte *palette);
|
2012-04-12 04:57:05 +00:00
|
|
|
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
int R_BillboardFrame (struct transform_s transform, int orientation,
|
2022-03-30 14:50:12 +00:00
|
|
|
vec4f_t cameravec,
|
|
|
|
vec4f_t *bbup, vec4f_t *bbright, vec4f_t *bbfwd);
|
2021-12-14 16:18:02 +00:00
|
|
|
mspriteframe_t *R_GetSpriteFrame (const msprite_t *sprite,
|
2022-03-29 05:40:48 +00:00
|
|
|
const struct animation_s *animation);
|
2021-12-10 05:34:04 +00:00
|
|
|
|
2022-03-25 03:22:16 +00:00
|
|
|
// These correspond to the standard box sides for OpenGL cube maps but with
|
|
|
|
// TOP and BOTTOM swapped due to lelt/right handed systems (quake/gl are right,
|
|
|
|
// cube maps are left)
|
2022-03-24 06:45:01 +00:00
|
|
|
#define BOX_FRONT 4
|
|
|
|
#define BOX_RIGHT 0
|
|
|
|
#define BOX_BEHIND 5
|
|
|
|
#define BOX_LEFT 1
|
2022-03-25 03:22:16 +00:00
|
|
|
#define BOX_TOP 3
|
|
|
|
#define BOX_BOTTOM 2
|
2022-03-24 06:45:01 +00:00
|
|
|
void R_RenderFisheye (framebuffer_t *cube);
|
|
|
|
|
2012-02-14 08:28:09 +00:00
|
|
|
#endif//__r_internal_h
|