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 char skyname[];
25 extern void R_SetSkyBox(char* sky);
26 extern void LoadSky_f(void);
27 extern rtexture_t *solidskytexture;
28 extern rtexture_t *alphaskytexture;
29 extern float speedscale; // for top sky and bottom sky
31 // far clip distance for scene
32 extern cvar_t r_farclip;
35 extern void FOG_clear(void);
36 extern float fog_density, fog_red, fog_green, fog_blue;
38 // SHOWLMP stuff (Nehahra)
39 extern void SHOWLMP_decodehide(void);
40 extern void SHOWLMP_decodeshow(void);
41 extern void SHOWLMP_drawall(void);
42 extern void SHOWLMP_clear(void);
44 // render profiling stuff
45 extern qboolean intimerefresh;
46 extern cvar_t r_speeds2;
47 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];
50 extern vec3_t lightspot;
51 extern cvar_t r_ambient;
53 // model rendering stuff
54 extern float *aliasvert;
55 extern float *aliasvertnorm;
56 extern byte *aliasvertcolor;
57 extern float modelalpha;
60 extern cvar_t r_novis;
62 // model transform stuff
63 extern cvar_t gl_transform;
65 #define TOP_RANGE 16 // soldier uniform colors
66 #define BOTTOM_RANGE 96
68 //=============================================================================
70 typedef struct entity_render_s
75 int visframe; // last frame this entity was found in an active leaf
77 model_t *model; // NULL = no model
78 int frame; // current desired frame (usually identical to frame2, but frame2 is not always used)
79 int colormap; // entity shirt and pants colors
80 int effects; // light, particles, etc
81 int skinnum; // for Alias models
82 int flags; // render flags
84 float alpha; // opacity (alpha) of the model
85 float scale; // size the model is shown
86 float trail_time; // last time for trail rendering
87 float colormod[3]; // color tint for model
89 model_t *lerp_model; // lerp resets when model changes
90 int frame1; // frame that the model is interpolating from
91 int frame2; // frame that the model is interpolating to
92 double lerp_starttime; // start of this transition
93 double framelerp; // interpolation factor, usually computed from lerp_starttime
94 double frame1start; // time frame1 began playing (for framegroup animations)
95 double frame2start; // time frame2 began playing (for framegroup animations)
99 typedef struct entity_s
101 entity_state_t state_baseline; // baseline for entity
102 entity_state_t state_previous; // previous state (interpolating from this)
103 entity_state_t state_current; // current state (interpolating to this)
105 entity_render_t render;
110 vrect_t vrect; // subwindow in video for refresh
124 extern refdef_t r_refdef;
125 extern vec3_t r_origin, vpn, vright, vup;
126 extern qboolean hlbsp;
129 void R_RenderView (void); // must set r_refdef first
130 void R_ViewChanged (vrect_t *pvrect, int lineadj, float aspect); // called whenever r_refdef or vid change
132 // LordHavoc: changed this for sake of GLQuake
133 void R_InitSky (byte *src, int bytesperpixel); // called at level load
135 int R_VisibleCullBox (vec3_t mins, vec3_t maxs);
137 void R_NewMap (void);
139 #include "r_decals.h"
141 void R_ParseParticleEffect (void);
142 void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count);
143 void R_RocketTrail (vec3_t start, vec3_t end, int type, entity_t *ent);
144 void R_RocketTrail2 (vec3_t start, vec3_t end, int type, entity_t *ent);
145 void R_SparkShower (vec3_t org, vec3_t dir, int count);
146 void R_BloodPuff (vec3_t org, vec3_t vel, int count);
147 void R_FlameCube (vec3_t mins, vec3_t maxs, int count);
148 void R_Flames (vec3_t org, vec3_t vel, int count);
150 void R_EntityParticles (entity_t *ent);
151 void R_BlobExplosion (vec3_t org);
152 void R_ParticleExplosion (vec3_t org, int smoke);
153 void R_ParticleExplosion2 (vec3_t org, int colorStart, int colorLength);
154 void R_LavaSplash (vec3_t org);
155 void R_TeleportSplash (vec3_t org);
157 void R_NewExplosion(vec3_t org);
159 void R_PushDlights (void);
160 void R_DrawWorld (void);
161 //void R_RenderDlights (void);
162 void R_DrawParticles (void);
163 void R_MoveParticles (void);
164 void R_DrawExplosions (void);
165 void R_MoveExplosions (void);