]> icculus.org git repositories - divverent/darkplaces.git/blob - render.h
ignore ChangeLog
[divverent/darkplaces.git] / render.h
1 /*
2 Copyright (C) 1996-1997 Id Software, Inc.
3
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.
8
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.  
12
13 See the GNU General Public License for more details.
14
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.
18
19 */
20
21 // refresh.h -- public interface to refresh functions
22
23 // far clip distance for scene
24 extern cvar_t r_farclip;
25
26 // fog stuff
27 extern void FOG_clear(void);
28 extern float fog_density, fog_red, fog_green, fog_blue;
29
30 // SHOWLMP stuff (Nehahra)
31 extern void SHOWLMP_decodehide(void);
32 extern void SHOWLMP_decodeshow(void);
33 extern void SHOWLMP_drawall(void);
34 extern void SHOWLMP_clear(void);
35
36 // render profiling stuff
37 extern qboolean intimerefresh;
38 extern cvar_t r_speeds2;
39 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];
40
41 // lighting stuff
42 extern vec3_t lightspot;
43 extern cvar_t r_ambient;
44
45 // model rendering stuff
46 extern float *aliasvert;
47 extern float *aliasvertnorm;
48 extern byte *aliasvertcolor;
49 extern float modelalpha;
50
51 // vis stuff
52 extern cvar_t r_novis;
53
54 // model transform stuff
55 extern cvar_t gl_transform;
56
57 #define TOP_RANGE               16                      // soldier uniform colors
58 #define BOTTOM_RANGE    96
59
60 //=============================================================================
61
62 typedef struct entity_render_s
63 {
64         vec3_t  origin;
65         vec3_t  angles;
66
67         int             visframe;               // last frame this entity was found in an active leaf
68
69         model_t *model;                 // NULL = no model
70         int             frame;                  // current desired frame (usually identical to frame2, but frame2 is not always used)
71         int             colormap;               // entity shirt and pants colors
72         int             effects;                // light, particles, etc
73         int             skinnum;                // for Alias models
74         int             flags;                  // render flags
75
76         float   alpha;                  // opacity (alpha) of the model
77         float   scale;                  // size the model is shown
78         float   trail_time;             // last time for trail rendering
79         float   colormod[3];    // color tint for model
80
81         model_t *lerp_model;    // lerp resets when model changes
82         int             frame1;                 // frame that the model is interpolating from
83         int             frame2;                 // frame that the model is interpolating to
84         double  lerp_starttime; // start of this transition
85         double  framelerp;              // interpolation factor, usually computed from lerp_starttime
86         double  frame1start;    // time frame1 began playing (for framegroup animations)
87         double  frame2start;    // time frame2 began playing (for framegroup animations)
88 }
89 entity_render_t;
90
91 typedef struct entity_s
92 {
93         entity_state_t state_baseline;  // baseline for entity
94         entity_state_t state_previous;  // previous state (interpolating from this)
95         entity_state_t state_current;   // current state (interpolating to this)
96
97         entity_render_t render;
98 } entity_t;
99
100 typedef struct
101 {
102         vrect_t         vrect;                          // subwindow in video for refresh
103
104         vec3_t          vieworg;
105         vec3_t          viewangles;
106
107         float           fov_x, fov_y;
108 } refdef_t;
109
110
111 //
112 // refresh
113 //
114
115
116 extern  refdef_t        r_refdef;
117 extern vec3_t   r_origin, vpn, vright, vup;
118 extern qboolean hlbsp;
119
120 void R_Init (void);
121 void R_RenderView (void); // must set r_refdef first
122 void R_ViewChanged (vrect_t *pvrect, int lineadj, float aspect); // called whenever r_refdef or vid change
123
124 // LordHavoc: changed this for sake of GLQuake
125 void R_InitSky (byte *src, int bytesperpixel); // called at level load
126
127 int R_VisibleCullBox (vec3_t mins, vec3_t maxs);
128
129 void R_NewMap (void);
130
131 #include "r_decals.h"
132
133 void R_ParseParticleEffect (void);
134 void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count);
135 void R_RocketTrail (vec3_t start, vec3_t end, int type, entity_t *ent);
136 void R_RocketTrail2 (vec3_t start, vec3_t end, int type, entity_t *ent);
137 void R_SparkShower (vec3_t org, vec3_t dir, int count);
138 void R_BloodPuff (vec3_t org, vec3_t vel, int count);
139 void R_FlameCube (vec3_t mins, vec3_t maxs, int count);
140 void R_Flames (vec3_t org, vec3_t vel, int count);
141
142 void R_EntityParticles (entity_t *ent);
143 void R_BlobExplosion (vec3_t org);
144 void R_ParticleExplosion (vec3_t org, int smoke);
145 void R_ParticleExplosion2 (vec3_t org, int colorStart, int colorLength);
146 void R_LavaSplash (vec3_t org);
147 void R_TeleportSplash (vec3_t org);
148
149 void R_NewExplosion(vec3_t org);
150
151 void R_PushDlights (void);
152 void R_DrawWorld (void);
153 //void R_RenderDlights (void);
154 void R_DrawParticles (void);
155 void R_MoveParticles (void);
156 void R_DrawExplosions (void);
157 void R_MoveExplosions (void);