[renderer] Merge the fog support code

GL still has its own functions for enabling and disabling fog while
rendering, but GLSL doesn't need such (thanks to the shaders), nor will
vulkan (and the software renderers don't support fog).
This commit is contained in:
Bill Currie 2022-03-08 02:10:47 +09:00
parent af0c66dff9
commit 48c225da89
27 changed files with 60 additions and 384 deletions

View file

@ -98,10 +98,6 @@ typedef struct vid_render_funcs_s {
struct tex_s *(*SCR_CaptureBGR) (void);
void (*Fog_Update) (float density, float red, float green, float blue,
float time);
void (*Fog_ParseWorldspawn) (struct plitem_s *worldspawn);
struct psystem_s *(*ParticleSystem) (void);
void (*R_Init) (void);
void (*R_ClearState) (void);

View file

@ -244,5 +244,16 @@ void R_RemoveEfrags (entity_t *ent);
dlight_t *R_AllocDlight (int key);
void R_MaxDlightsCheck (struct cvar_s *var);
void R_DecayLights (double frametime);
void Fog_Update (float density, float red, float green, float blue,
float time);
struct plitem_s;
void Fog_ParseWorldspawn (struct plitem_s *worldspawn);
void Fog_GetColor (quat_t fogcolor);
float Fog_GetDensity (void) __attribute__((pure));
void Fog_SetupFrame (void);
void Fog_StartAdditive (void);
void Fog_StopAdditive (void);
void Fog_Init (void);
#endif//__QF_render_h

View file

@ -27,19 +27,6 @@ extern int r_viewsize;
void R_LineGraph (int x, int y, int *h_vals, int count, int height);
void Fog_Update (float density, float red, float green, float blue,
float time);
struct plitem_s;
void Fog_ParseWorldspawn (struct plitem_s *worldspawn);
void Fog_GetColor (quat_t fogcolor);
float Fog_GetDensity (void) __attribute__((pure));
void Fog_SetupFrame (void);
void Fog_EnableGFog (void);
void Fog_DisableGFog (void);
void Fog_StartAdditive (void);
void Fog_StopAdditive (void);
void Fog_Init (void);
void gl_R_Init (void);
void glsl_R_Init (void);

View file

@ -25,4 +25,10 @@ extern gl_ctx_t *glsl_ctx;
struct tex_s *gl_SCR_CaptureBGR (void);
struct tex_s *glsl_SCR_CaptureBGR (void);
void gl_Fog_SetupFrame (void);
void gl_Fog_EnableGFog (void);
void gl_Fog_DisableGFog (void);
void gl_Fog_StartAdditive (void);
void gl_Fog_StopAdditive (void);
#endif//__vid_gl_h

View file

@ -216,8 +216,7 @@ CL_World_NewMap (const char *mapname, const char *skyname)
if (cl_world.edicts) {
cl_world.worldspawn = PL_ObjectAtIndex (cl_world.edicts, 0);
CL_LoadSky (skyname);
if (r_funcs->Fog_ParseWorldspawn)
r_funcs->Fog_ParseWorldspawn (cl_world.worldspawn);
Fog_ParseWorldspawn (cl_world.worldspawn);
}
}
map_cfg (mapname, 1);

View file

@ -49,6 +49,7 @@ libs_video_renderer_libQFrenderer_la_DEPENDENCIES= $(renderer_libs)
libs_video_renderer_libQFrenderer_la_SOURCES=\
libs/video/renderer/r_cvar.c \
libs/video/renderer/r_efrag.c \
libs/video/renderer/r_fog.c \
libs/video/renderer/r_init.c \
libs/video/renderer/r_light.c \
libs/video/renderer/r_main.c \
@ -112,7 +113,6 @@ libs_video_renderer_librender_glsl_la_SOURCES = \
libs/video/renderer/glsl/glsl_alias.c \
libs/video/renderer/glsl/glsl_bsp.c \
libs/video/renderer/glsl/glsl_draw.c \
libs/video/renderer/glsl/glsl_fog.c \
libs/video/renderer/glsl/glsl_iqm.c \
libs/video/renderer/glsl/glsl_lightmap.c \
libs/video/renderer/glsl/glsl_main.c \

View file

@ -23,214 +23,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# include "config.h"
#endif
#define NH_DEFINE
#include "namehack.h"
#ifdef HAVE_STRING_H
# include <string.h>
#endif
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
#include "QF/cmd.h"
#include "QF/plist.h"
#include "QF/render.h"
#include "QF/sys.h"
#include "QF/GL/defines.h"
#include "QF/GL/funcs.h"
#include "compat.h"
#include "r_internal.h"
//==============================================================================
//
// GLOBAL FOG
//
//==============================================================================
static float fog_density;
static float fog_red;
static float fog_green;
static float fog_blue;
static float old_density;
static float old_red;
static float old_green;
static float old_blue;
static float fade_time; //duration of fade
static float fade_done; //time when fade will be done
/*
Fog_Update
update internal variables
*/
void
gl_Fog_Update (float density, float red, float green, float blue, float time)
{
//save previous settings for fade
if (time > 0) {
//check for a fade in progress
if (fade_done > vr_data.realtime) {
float f;
f = (fade_done - vr_data.realtime) / fade_time;
old_density = f * old_density + (1.0 - f) * fog_density;
old_red = f * old_red + (1.0 - f) * fog_red;
old_green = f * old_green + (1.0 - f) * fog_green;
old_blue = f * old_blue + (1.0 - f) * fog_blue;
} else {
old_density = fog_density;
old_red = fog_red;
old_green = fog_green;
old_blue = fog_blue;
}
}
fog_density = density;
fog_red = red;
fog_green = green;
fog_blue = blue;
fade_time = time;
fade_done = vr_data.realtime + time;
}
/*
Fog_FogCommand_f
handle the 'fog' console command
*/
static void
Fog_FogCommand_f (void)
{
float density = fog_density;
float red = fog_red;
float green = fog_green;
float blue = fog_blue;
float time = 0.0;
switch (Cmd_Argc ()) {
default:
case 1:
Sys_Printf ("usage:\n");
Sys_Printf (" fog <density>\n");
Sys_Printf (" fog <red> <green> <blue>\n");
Sys_Printf (" fog <density> <red> <green> <blue>\n");
Sys_Printf ("current values:\n");
Sys_Printf (" \"density\" is \"%f\"\n", fog_density);
Sys_Printf (" \"red\" is \"%f\"\n", fog_red);
Sys_Printf (" \"green\" is \"%f\"\n", fog_green);
Sys_Printf (" \"blue\" is \"%f\"\n", fog_blue);
return;
case 2:
density = atof (Cmd_Argv(1));
break;
case 3: //TEST
density = atof (Cmd_Argv(1));
time = atof (Cmd_Argv(2));
break;
case 4:
red = atof (Cmd_Argv(1));
green = atof (Cmd_Argv(2));
blue = atof (Cmd_Argv(3));
break;
case 5:
density = atof (Cmd_Argv(1));
red = atof (Cmd_Argv(2));
green = atof (Cmd_Argv(3));
blue = atof (Cmd_Argv(4));
break;
case 6: //TEST
density = atof (Cmd_Argv(1));
red = atof (Cmd_Argv(2));
green = atof (Cmd_Argv(3));
blue = atof (Cmd_Argv(4));
time = atof (Cmd_Argv(5));
break;
}
density = max (0.0, density);
red = bound (0.0, red, 1.0);
green = bound (0.0, green, 1.0);
blue = bound (0.0, blue, 1.0);
gl_Fog_Update (density, red, green, blue, time);
}
/*
Fog_ParseWorldspawn
called at map load
*/
void
gl_Fog_ParseWorldspawn (plitem_t *worldspawn)
{
plitem_t *fog;
const char *value;
//initially no fog
fog_density = 0.0;
old_density = 0.0;
fade_time = 0.0;
fade_done = 0.0;
if (!worldspawn)
return; // error
if ((fog = PL_ObjectForKey (worldspawn, "fog"))
&& (value = PL_String (fog))) {
sscanf (value, "%f %f %f %f", &fog_density,
&fog_red, &fog_green, &fog_blue);
}
}
/*
Fog_GetColor
calculates fog color for this frame, taking into account fade times
*/
void
gl_Fog_GetColor (quat_t fogcolor)
{
float f;
int i;
if (fade_done > vr_data.realtime) {
f = (fade_done - vr_data.realtime) / fade_time;
fogcolor[0] = f * old_red + (1.0 - f) * fog_red;
fogcolor[1] = f * old_green + (1.0 - f) * fog_green;
fogcolor[2] = f * old_blue + (1.0 - f) * fog_blue;
fogcolor[3] = 1.0;
} else {
fogcolor[0] = fog_red;
fogcolor[1] = fog_green;
fogcolor[2] = fog_blue;
fogcolor[3] = 1.0;
}
//find closest 24-bit RGB value, so solid-colored sky can match the fog
//perfectly
for (i = 0; i < 3; i++)
fogcolor[i] = (float) (rint (fogcolor[i] * 255)) / 255.0f;
}
/*
Fog_GetDensity
returns current density of fog
*/
float
gl_Fog_GetDensity (void)
{
float f;
if (fade_done > vr_data.realtime) {
f = (fade_done - vr_data.realtime) / fade_time;
return f * old_density + (1.0 - f) * fog_density;
} else {
return fog_density;
}
}
#include "vid_gl.h"
/*
Fog_SetupFrame
@ -242,11 +40,13 @@ gl_Fog_SetupFrame (void)
{
quat_t fogcolor;
gl_Fog_GetColor (fogcolor);
Fog_GetColor (fogcolor);
qfglFogfv (GL_FOG_COLOR, fogcolor);
qfglFogf (GL_FOG_DENSITY, gl_Fog_GetDensity () / 64.0);
qfglFogf (GL_FOG_DENSITY, Fog_GetDensity () / 64.0);
qfglFogi (GL_FOG_MODE, GL_EXP2);
}
/*
Fog_EnableGFog
@ -255,7 +55,7 @@ gl_Fog_SetupFrame (void)
void
gl_Fog_EnableGFog (void)
{
if (gl_Fog_GetDensity () > 0)
if (Fog_GetDensity () > 0)
qfglEnable (GL_FOG);
}
@ -267,7 +67,7 @@ gl_Fog_EnableGFog (void)
void
gl_Fog_DisableGFog (void)
{
if (gl_Fog_GetDensity () > 0)
if (Fog_GetDensity () > 0)
qfglDisable (GL_FOG);
}
@ -282,7 +82,8 @@ gl_Fog_StartAdditive (void)
{
vec3_t color = {0, 0, 0};
if (gl_Fog_GetDensity () > 0)
qfglFogi (GL_FOG_MODE, GL_EXP2);
if (Fog_GetDensity () > 0)
qfglFogfv (GL_FOG_COLOR, color);
}
@ -294,61 +95,9 @@ gl_Fog_StartAdditive (void)
void
gl_Fog_StopAdditive (void)
{
if (gl_Fog_GetDensity () > 0) {
if (Fog_GetDensity () > 0) {
quat_t fogcolor;
gl_Fog_GetColor (fogcolor);
Fog_GetColor (fogcolor);
qfglFogfv (GL_FOG_COLOR, fogcolor);
}
}
//==============================================================================
//
// VOLUMETRIC FOG
//
//==============================================================================
//cvar_t r_vfog = {"r_vfog", "1"};
//void Fog_DrawVFog (void) {}
//void Fog_MarkModels (void) {}
//==============================================================================
//
// INIT
//
//==============================================================================
/*
Fog_NewMap
called whenever a map is loaded
*/
#if 0
void
gl_Fog_NewMap (void)
{
Fog_ParseWorldspawn (); //for global fog
Fog_MarkModels (); //for volumetric fog
}
#endif
/*
Fog_Init
called when quake initializes
*/
void
gl_Fog_Init (void)
{
Cmd_AddCommand ("fog", Fog_FogCommand_f, "");
//Cvar_RegisterVariable (&r_vfog, NULL);
//set up global fog
fog_density = 0.0;
fog_red = 0.3;
fog_green = 0.3;
fog_blue = 0.3;
qfglFogi (GL_FOG_MODE, GL_EXP2);
}

View file

@ -66,6 +66,7 @@
#include "compat.h"
#include "r_internal.h"
#include "varrays.h"
#include "vid_gl.h"
qboolean gl_envmap; // true during envmap command capture
@ -330,8 +331,6 @@ gl_R_SetupFrame (void)
EntQueue_Clear (r_ent_queue);
r_framecount++;
gl_Fog_SetupFrame ();
// build the transformation matrix for the given view angles
VectorCopy (r_refdef.viewposition, r_origin);

View file

@ -164,7 +164,6 @@ gl_R_Init (void)
r_init = 1;
gl_R_InitParticles ();
gl_R_InitSprites ();
gl_Fog_Init ();
Skin_Init ();
}

View file

@ -752,7 +752,7 @@ gl_R_DrawWorld (void)
}
}
if (!gl_Fog_GetDensity ()
if (!Fog_GetDensity ()
|| (gl_fb_bmodels->int_val && gl_mtex_fullbright)
|| gl_mtex_active_tmus > 1) {
// we have enough active TMUs to render everything in one go

View file

@ -21,16 +21,6 @@
#define Draw_Pic gl_Draw_Pic
#define Draw_Picf gl_Draw_Picf
#define Draw_SubPic gl_Draw_SubPic
#define Fog_DisableGFog gl_Fog_DisableGFog
#define Fog_EnableGFog gl_Fog_EnableGFog
#define Fog_GetColor gl_Fog_GetColor
#define Fog_GetDensity gl_Fog_GetDensity
#define Fog_Init gl_Fog_Init
#define Fog_ParseWorldspawn gl_Fog_ParseWorldspawn
#define Fog_SetupFrame gl_Fog_SetupFrame
#define Fog_StartAdditive gl_Fog_StartAdditive
#define Fog_StopAdditive gl_Fog_StopAdditive
#define Fog_Update gl_Fog_Update
#define R_AddTexture gl_R_AddTexture
#define R_BlendLightmaps gl_R_BlendLightmaps
#define R_CalcLightmaps gl_R_CalcLightmaps
@ -74,16 +64,6 @@
#define r_particles_style_f gl_r_particles_style_f
#define r_world_matrix gl_r_world_matrix
#else
#undef Fog_DisableGFog
#undef Fog_EnableGFog
#undef Fog_GetColor
#undef Fog_GetDensity
#undef Fog_Init
#undef Fog_ParseWorldspawn
#undef Fog_SetupFrame
#undef Fog_StartAdditive
#undef Fog_StopAdditive
#undef Fog_Update
#undef R_AddTexture
#undef R_BlendLightmaps
#undef R_CalcLightmaps

View file

@ -342,8 +342,8 @@ glsl_R_AliasBegin (void)
qfeglDisableVertexAttribArray (quake_mdl.colora.location);
qfeglDisableVertexAttribArray (quake_mdl.colorb.location);
glsl_Fog_GetColor (fog);
fog[3] = glsl_Fog_GetDensity () / 64.0;
Fog_GetColor (fog);
fog[3] = Fog_GetDensity () / 64.0;
qfeglUniform4fv (quake_mdl.fog.location, 1, fog);
qfeglUniform1i (quake_mdl.colormap.location, 1);

View file

@ -896,8 +896,8 @@ bsp_begin (void)
qfeglVertexAttrib4fv (quake_bsp.color.location, default_color);
glsl_Fog_GetColor (fog);
fog[3] = glsl_Fog_GetDensity () / 64.0;
Fog_GetColor (fog);
fog[3] = Fog_GetDensity () / 64.0;
qfeglUniform4fv (quake_bsp.fog.location, 1, fog);
qfeglUniform1i (quake_bsp.colormap.location, 2);
@ -951,8 +951,8 @@ turb_begin (void)
qfeglVertexAttrib4fv (quake_turb.color.location, default_color);
glsl_Fog_GetColor (fog);
fog[3] = glsl_Fog_GetDensity () / 64.0;
Fog_GetColor (fog);
fog[3] = Fog_GetDensity () / 64.0;
qfeglUniform4fv (quake_turb.fog.location, 1, fog);
qfeglUniform1i (quake_turb.palette.location, 1);
@ -1055,8 +1055,8 @@ sky_begin (void)
qfeglEnable (GL_TEXTURE_2D);
}
glsl_Fog_GetColor (fog);
fog[3] = glsl_Fog_GetDensity () / 64.0;
Fog_GetColor (fog);
fog[3] = Fog_GetDensity () / 64.0;
qfeglUniform4fv (sky_params.fog->location, 1, fog);
spin (mat);

View file

@ -285,8 +285,8 @@ glsl_R_IQMBegin (void)
qfeglUseProgram (iqm_shader.program);
glsl_Fog_GetColor (fog);
fog[3] = glsl_Fog_GetDensity () / 64.0;
Fog_GetColor (fog);
fog[3] = Fog_GetDensity () / 64.0;
qfeglUniform4fv (iqm_shader.fog.location, 1, fog);
qfeglUniform1i (iqm_shader.texture.location, 0);

View file

@ -252,7 +252,6 @@ glsl_R_Init (void)
glsl_R_InitIQM ();
glsl_R_InitSprites ();
glsl_R_InitParticles ();
glsl_Fog_Init ();
Skin_Init ();
}

View file

@ -236,8 +236,8 @@ draw_qf_particles (void)
qfeglEnableVertexAttribArray (quake_part.color.location);
qfeglEnableVertexAttribArray (quake_part.st.location);
glsl_Fog_GetColor (fog);
fog[3] = glsl_Fog_GetDensity () / 64.0;
Fog_GetColor (fog);
fog[3] = Fog_GetDensity () / 64.0;
qfeglUniform4fv (quake_part.fog.location, 1, fog);
qfeglUniformMatrix4fv (quake_part.mvp_matrix.location, 1, false,
@ -361,8 +361,8 @@ draw_id_particles (void)
qfeglUniformMatrix4fv (quake_point.mvp_matrix.location, 1, false,
&vp_mat[0][0]);
glsl_Fog_GetColor (fog);
fog[3] = glsl_Fog_GetDensity () / 64.0;
Fog_GetColor (fog);
fog[3] = Fog_GetDensity () / 64.0;
qfeglUniform4fv (quake_point.fog.location, 1, fog);
qfeglUniform1i (quake_point.palette.location, 0);

View file

@ -277,8 +277,8 @@ R_SpriteBegin (void)
qfeglDisableVertexAttribArray (quake_sprite.colorb.location);
qfeglDisableVertexAttribArray (quake_sprite.blend.location);
glsl_Fog_GetColor (fog);
fog[3] = glsl_Fog_GetDensity () / 64.0;
Fog_GetColor (fog);
fog[3] = Fog_GetDensity () / 64.0;
qfeglUniform4fv (quake_sprite.fog.location, 1, fog);
qfeglUniform1i (quake_sprite.spritea.location, 0);

View file

@ -21,16 +21,6 @@
#define Draw_Pic glsl_Draw_Pic
#define Draw_Picf glsl_Draw_Picf
#define Draw_SubPic glsl_Draw_SubPic
#define Fog_DisableGFog glsl_Fog_DisableGFog
#define Fog_EnableGFog glsl_Fog_EnableGFog
#define Fog_GetColor glsl_Fog_GetColor
#define Fog_GetDensity glsl_Fog_GetDensity
#define Fog_Init glsl_Fog_Init
#define Fog_ParseWorldspawn glsl_Fog_ParseWorldspawn
#define Fog_SetupFrame glsl_Fog_SetupFrame
#define Fog_StartAdditive glsl_Fog_StartAdditive
#define Fog_StopAdditive glsl_Fog_StopAdditive
#define Fog_Update glsl_Fog_Update
#define R_AddTexture glsl_R_AddTexture
#define R_BlendLightmaps glsl_R_BlendLightmaps
#define R_BuildLightMap glsl_R_BuildLightMap
@ -76,16 +66,6 @@
#define r_particles_style_f glsl_r_particles_style_f
#define r_world_matrix glsl_r_world_matrix
#else
#undef Fog_DisableGFog
#undef Fog_EnableGFog
#undef Fog_GetColor
#undef Fog_GetDensity
#undef Fog_Init
#undef Fog_ParseWorldspawn
#undef Fog_SetupFrame
#undef Fog_StartAdditive
#undef Fog_StopAdditive
#undef Fog_Update
#undef R_AddTexture
#undef R_BlendLightmaps
#undef R_BuildLightMap

View file

@ -17,15 +17,12 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
//gl_fog.c -- global and volumetric fog
//r_fog.c -- global and volumetric fog
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#define NH_DEFINE
#include "namehack.h"
#ifdef HAVE_STRING_H
# include <string.h>
#endif
@ -38,9 +35,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "QF/render.h"
#include "QF/sys.h"
#include "QF/GLSL/defines.h"
#include "QF/GLSL/funcs.h"
#include "compat.h"
#include "r_internal.h"
@ -69,7 +63,7 @@ static float fade_done; //time when fade will be done
update internal variables
*/
void
glsl_Fog_Update (float density, float red, float green, float blue, float time)
Fog_Update (float density, float red, float green, float blue, float time)
{
//save previous settings for fade
if (time > 0) {
@ -155,7 +149,7 @@ Fog_FogCommand_f (void)
red = bound (0.0, red, 1.0);
green = bound (0.0, green, 1.0);
blue = bound (0.0, blue, 1.0);
glsl_Fog_Update (density, red, green, blue, time);
Fog_Update (density, red, green, blue, time);
}
/*
@ -164,7 +158,7 @@ Fog_FogCommand_f (void)
called at map load
*/
void
glsl_Fog_ParseWorldspawn (plitem_t *worldspawn)
Fog_ParseWorldspawn (plitem_t *worldspawn)
{
plitem_t *fog;
const char *value;
@ -190,7 +184,7 @@ glsl_Fog_ParseWorldspawn (plitem_t *worldspawn)
calculates fog color for this frame, taking into account fade times
*/
void
glsl_Fog_GetColor (quat_t fogcolor)
Fog_GetColor (quat_t fogcolor)
{
float f;
int i;
@ -220,7 +214,7 @@ glsl_Fog_GetColor (quat_t fogcolor)
returns current density of fog
*/
float
glsl_Fog_GetDensity (void)
Fog_GetDensity (void)
{
float f;
@ -238,7 +232,7 @@ glsl_Fog_GetDensity (void)
called when quake initializes
*/
void
glsl_Fog_Init (void)
Fog_Init (void)
{
Cmd_AddCommand ("fog", Fog_FogCommand_f, "");

View file

@ -98,4 +98,5 @@ R_Init (void)
{
r_funcs->R_Init ();
R_ClearEfrags (); //FIXME force link of r_efrag.o for qwaq
Fog_Init ();
}

View file

@ -163,6 +163,8 @@ gl_begin_frame (void)
vid.height - vr_data.lineadj -
(r_refdef.vrect.height + r_refdef.vrect.y));
}
gl_Fog_SetupFrame ();
}
static void
@ -225,9 +227,6 @@ vid_render_funcs_t gl_vid_render_funcs = {
gl_SCR_CaptureBGR,
gl_Fog_Update,
gl_Fog_ParseWorldspawn,
gl_ParticleSystem,
gl_R_Init,
gl_R_ClearState,

View file

@ -263,9 +263,6 @@ vid_render_funcs_t glsl_vid_render_funcs = {
glsl_SCR_CaptureBGR,
glsl_Fog_Update,
glsl_Fog_ParseWorldspawn,
glsl_ParticleSystem,
glsl_R_Init,
glsl_R_ClearState,

View file

@ -179,9 +179,6 @@ vid_render_funcs_t sw_vid_render_funcs = {
sw_SCR_CaptureBGR,
0,
0,
sw_ParticleSystem,
sw_R_Init,
R_ClearState,

View file

@ -183,9 +183,6 @@ vid_render_funcs_t sw32_vid_render_funcs = {
sw32_SCR_CaptureBGR,
0,
0,
sw32_ParticleSystem,
sw32_R_Init,
sw32_R_ClearState,

View file

@ -70,17 +70,6 @@
static vulkan_ctx_t *vulkan_ctx;
static void
vulkan_Fog_Update (float density, float red, float green, float blue,
float time)
{
}
static void
vulkan_Fog_ParseWorldspawn (struct plitem_s *worldspawn)
{
}
static struct psystem_s *
vulkan_ParticleSystem (void)
{
@ -669,9 +658,6 @@ vid_render_funcs_t vulkan_vid_render_funcs = {
vulkan_SCR_CaptureBGR,
vulkan_Fog_Update,
vulkan_Fog_ParseWorldspawn,
vulkan_ParticleSystem,
vulkan_R_Init,
vulkan_R_ClearState,

View file

@ -1066,8 +1066,7 @@ CL_ParseServerMessage (void)
blue = MSG_ReadByte (net_message) / 255.0;
time = (short) MSG_ReadShort (net_message) / 100.0;
time = max (0.0, time);
if (r_funcs->Fog_Update)
r_funcs->Fog_Update (density, red, green, blue, time);
Fog_Update (density, red, green, blue, time);
}
break;
case svc_spawnbaseline2:

View file

@ -497,6 +497,7 @@ draw_sigils (view_t *view)
static void
draw_inventory_sbar (view_t *view)
{
printf ("sbar: %d\n", sbar_view->visible);
draw_pic (view, 0, 0, sb_ibar);
view_draw (view);
}