diff --git a/nq/include/render.h b/nq/include/render.h index 34d7a14fd..d25632098 100644 --- a/nq/include/render.h +++ b/nq/include/render.h @@ -31,12 +31,11 @@ #include "QF/cvar.h" #include "QF/mathlib.h" +#include "QF/model.h" #include "QF/vid.h" #include "protocol.h" -#define MAXCLIPPLANES 11 - #define TOP_RANGE 16 // soldier uniform colors #define BOTTOM_RANGE 96 @@ -51,33 +50,41 @@ typedef struct entity_s entity_state_t baseline; // to fill in defaults in updates double msgtime; // time of last update - vec3_t msg_origins[2]; // last two updates (0 is newest) vec3_t origin; vec3_t old_origin; - vec3_t msg_angles[2]; // last two updates (0 is newest) vec3_t angles; + vec3_t msg_origins[2]; // last two updates (0 is newest) + vec3_t msg_angles[2]; // last two updates (0 is newest) struct model_s *model; // NULL = no model - struct efrag_s *efrag; // linked list of efrags int frame; - float syncbase; // for client-side animations byte *colormap; - int effects; // light, particals, etc int skinnum; // for Alias models + + float syncbase; // for client-side animations + + struct efrag_s *efrag; // linked list of efrags int visframe; // last frame this entity was // found in an active leaf + int effects; // light, particals, etc int dlightframe; // dynamic lighting int dlightbits; - + + float colormod[3]; // color tint for model + float alpha; // opacity (alpha) of the model + float scale; // size scaler of the model + float glow_size; // how big the glow is (can be negative) + byte glow_color; // color of glow (paletted) + // FIXME: could turn these into a union int trivial_accept; - struct mnode_s *topnode; // for bmodels, first world node that - // splits bmodel, or NULL if not split + struct mnode_s *topnode; // for bmodels, first world node that + // splits bmodel, or NULL if not split // Animation interpolation float frame_start_time; float frame_interval; - int pose1; - int pose2; + int pose1; + int pose2; } entity_t; // !!! if this is changed, it must be changed in asm_draw.h too !!! @@ -105,7 +112,7 @@ typedef struct vec3_t vieworg; vec3_t viewangles; - + float fov_x, fov_y; int ambientlight; @@ -126,6 +133,7 @@ extern struct texture_s *r_notexture_mip; extern entity_t r_worldentity; void R_Init (void); +void R_Init_Cvars (void); void R_InitEfrags (void); void R_InitSky (struct texture_s *mt); // called at level load void R_Textures_Init (void); @@ -139,22 +147,6 @@ void R_RemoveEfrags (entity_t *ent); void R_NewMap (void); -struct entity_s; -void R_RocketTrail (int type, struct entity_s *ent); -void R_RunParticleEffect (vec3_t org, int color, int count); -void R_RunPuffEffect (vec3_t org, byte type, byte count); -void R_RunSpikeEffect (vec3_t org, byte type); - -#ifdef QUAKE2 -void R_DarkFieldParticles (entity_t *ent); -#endif -void R_EntityParticles (entity_t *ent); -void R_BlobExplosion (vec3_t org); -void R_ParticleExplosion (vec3_t org); -void R_ParticleExplosion2 (vec3_t org, int colorStart, int colorLength); -void R_LavaSplash (vec3_t org); -void R_TeleportSplash (vec3_t org); - // LordHavoc: relative bmodel lighting void R_PushDlights (vec3_t entorigin); void R_DrawWaterSurfaces (void); @@ -172,14 +164,6 @@ void D_DeleteSurfaceCache (void); void D_InitCaches (void *buffer, int size); void R_SetVrect (vrect_t *pvrect, vrect_t *pvrectin, int lineadj); -void R_DrawBrushModel (entity_t *e); -void R_DrawWorld (void); -void R_RenderDlights (void); - -struct msurface_s; -void R_RenderBrushPoly (struct msurface_s *fa); - -void R_TranslatePlayerSkin (int playernum); -void R_AddFire (vec3_t, vec3_t, entity_t *ent); +void R_LoadSkys (const char *); #endif // __render_h diff --git a/nq/source/cl_main.c b/nq/source/cl_main.c index 301a623b8..bf6b45df9 100644 --- a/nq/source/cl_main.c +++ b/nq/source/cl_main.c @@ -45,6 +45,7 @@ #include "chase.h" #include "host.h" #include "host.h" +#include "r_dynamic.h" #include "render.h" #include "server.h" diff --git a/nq/source/gl_rmain.c b/nq/source/gl_rmain.c index 8b38483e9..ee5ec123d 100644 --- a/nq/source/gl_rmain.c +++ b/nq/source/gl_rmain.c @@ -1079,6 +1079,7 @@ R_RenderScene (void) R_RenderDlights (); } +void R_RenderBrushPoly (msurface_t *fa); void R_Mirror (void) { diff --git a/qw/include/render.h b/qw/include/render.h index bc058f29d..180219151 100644 --- a/qw/include/render.h +++ b/qw/include/render.h @@ -26,12 +26,12 @@ $Id$ */ -#ifndef _RENDER_H -#define _RENDER_H +#ifndef __render_h +#define __render_h +#include "QF/cvar.h" #include "QF/mathlib.h" #include "QF/model.h" -#include "QF/cvar.h" #include "QF/vid.h" // now we know why (struct model_s *) is used here instead of model_t @@ -47,39 +47,38 @@ typedef struct entity_s int keynum; // for matching entities in different frames vec3_t origin; vec3_t old_origin; - vec3_t angles; - struct model_s *model; // NULL = no model + vec3_t angles; + struct model_s *model; // NULL = no model int frame; byte *colormap; - int skinnum; // for Alias models + int skinnum; // for Alias models - struct player_info_s *scoreboard; // identify player + struct player_info_s *scoreboard; // identify player - float syncbase; + float syncbase; // for client-side animations - struct efrag_s *efrag; // linked list of efrags (FIXME) - int visframe; // last frame this entity was found in an - // active leaf, only used for static objects + struct efrag_s *efrag; // linked list of efrags + int visframe; // last frame this entity was + // found in an active leaf - float colormod[3]; // color tint for model - float alpha; // opacity (alpha) of the model - float scale; // size scaler of the model - float glow_size; // how big the glow is (can be negative) - byte glow_color; // color of glow (paletted) + float colormod[3]; // color tint for model + float alpha; // opacity (alpha) of the model + float scale; // size scaler of the model + float glow_size; // how big the glow is (can be negative) + byte glow_color; // color of glow (paletted) - // FIXME: could turn these into a union +// FIXME: could turn these into a union int trivial_accept; struct mnode_s *topnode; // for bmodels, first world node that // splits bmodel, or NULL if not split // Animation interpolation - float frame_start_time; - float frame_interval; - int pose1; - int pose2; + float frame_start_time; + float frame_interval; + int pose1; + int pose2; } entity_t; - // !!! if this is changed, it must be changed in asm_draw.h too !!! typedef struct { @@ -107,7 +106,7 @@ typedef struct vec3_t viewangles; float fov_x, fov_y; - + int ambientlight; } refdef_t; @@ -123,8 +122,7 @@ extern vec3_t r_origin, vpn, vright, vup; extern struct texture_s *r_notexture_mip; -extern entity_t r_worldentity; - +extern entity_t r_worldentity; void R_Init (void); void R_Init_Cvars (void); @@ -152,7 +150,7 @@ extern int reinit_surfcache; // if 1, surface cache is currently empty extern qboolean r_cache_thrash; // set if thrashing the surface cache void *D_SurfaceCacheAddress (void); -int D_SurfaceCacheForRes (int width, int height); +int D_SurfaceCacheForRes (int width, int height); void D_FlushCaches (void); void D_DeleteSurfaceCache (void); void D_InitCaches (void *buffer, int size); @@ -160,4 +158,4 @@ void R_SetVrect (vrect_t *pvrect, vrect_t *pvrectin, int lineadj); void R_LoadSkys (const char *); -#endif // _RENDER_H +#endif // __render_h