2 Copyright (C) 1996-1997 Id Software, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 // refresh.h -- public interface to refresh functions
24 extern void R_SetSkyBox(char* sky);
26 // far clip distance for scene
27 extern cvar_t r_farclip;
30 extern void FOG_clear(void);
31 extern float fog_density, fog_red, fog_green, fog_blue;
33 // SHOWLMP stuff (Nehahra)
34 extern void SHOWLMP_decodehide(void);
35 extern void SHOWLMP_decodeshow(void);
36 extern void SHOWLMP_drawall(void);
37 extern void SHOWLMP_clear(void);
39 // render profiling stuff
40 extern qboolean intimerefresh;
41 extern cvar_t r_speeds2;
42 extern char r_speeds2_string1[81], r_speeds2_string2[81], r_speeds2_string3[81], r_speeds2_string4[81], r_speeds2_string5[81], r_speeds2_string6[81], r_speeds2_string7[81];
45 extern vec3_t lightspot;
46 extern cvar_t r_ambient;
48 // model rendering stuff
49 extern float *aliasvert;
50 extern float *aliasvertnorm;
51 extern byte *aliasvertcolor;
52 extern float modelalpha;
55 extern cvar_t r_novis;
57 // model transform stuff
58 extern cvar_t gl_transform;
60 #define TOP_RANGE 16 // soldier uniform colors
61 #define BOTTOM_RANGE 96
63 //=============================================================================
65 typedef struct entity_render_s
70 int visframe; // last frame this entity was found in an active leaf
72 model_t *model; // NULL = no model
73 int frame; // current desired frame (usually identical to frame2, but frame2 is not always used)
74 int colormap; // entity shirt and pants colors
75 int effects; // light, particles, etc
76 int skinnum; // for Alias models
77 int flags; // render flags
79 float alpha; // opacity (alpha) of the model
80 float scale; // size the model is shown
81 float trail_time; // last time for trail rendering
82 float colormod[3]; // color tint for model
84 model_t *lerp_model; // lerp resets when model changes
85 int frame1; // frame that the model is interpolating from
86 int frame2; // frame that the model is interpolating to
87 double lerp_starttime; // start of this transition
88 double framelerp; // interpolation factor, usually computed from lerp_starttime
89 double frame1start; // time frame1 began playing (for framegroup animations)
90 double frame2start; // time frame2 began playing (for framegroup animations)
94 typedef struct entity_s
96 entity_state_t state_baseline; // baseline for entity
97 entity_state_t state_previous; // previous state (interpolating from this)
98 entity_state_t state_current; // current state (interpolating to this)
100 entity_render_t render;
105 vrect_t vrect; // subwindow in video for refresh
119 extern refdef_t r_refdef;
120 extern vec3_t r_origin, vpn, vright, vup;
121 extern qboolean hlbsp;
124 void R_RenderView (void); // must set r_refdef first
125 void R_ViewChanged (vrect_t *pvrect, int lineadj, float aspect); // called whenever r_refdef or vid change
127 // LordHavoc: changed this for sake of GLQuake
128 void R_InitSky (byte *src, int bytesperpixel); // called at level load
130 int R_VisibleCullBox (vec3_t mins, vec3_t maxs);
132 void R_NewMap (void);
134 #include "r_decals.h"
136 void R_ParseParticleEffect (void);
137 void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count);
138 void R_RocketTrail (vec3_t start, vec3_t end, int type, entity_t *ent);
139 void R_RocketTrail2 (vec3_t start, vec3_t end, int type, entity_t *ent);
140 void R_SparkShower (vec3_t org, vec3_t dir, int count);
141 void R_BloodPuff (vec3_t org, vec3_t vel, int count);
142 void R_FlameCube (vec3_t mins, vec3_t maxs, int count);
143 void R_Flames (vec3_t org, vec3_t vel, int count);
145 void R_EntityParticles (entity_t *ent);
146 void R_BlobExplosion (vec3_t org);
147 void R_ParticleExplosion (vec3_t org, int smoke);
148 void R_ParticleExplosion2 (vec3_t org, int colorStart, int colorLength);
149 void R_LavaSplash (vec3_t org);
150 void R_TeleportSplash (vec3_t org);
152 void R_NewExplosion(vec3_t org);
154 void R_PushDlights (void);
155 void R_DrawWorld (void);
156 //void R_RenderDlights (void);
157 void R_DrawParticles (void);
158 void R_MoveParticles (void);
159 void R_DrawExplosions (void);
160 void R_MoveExplosions (void);