mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-31 05:00:35 +00:00
Remove viddef in favor of vid in the renderers.
This fixes the status bar refresh issues in sw. The problem was that with two viddef's hanging around, things got a little confused and recalc_refdef wasn't getting into the renderer.
This commit is contained in:
parent
cdbb2ad030
commit
3cb0f3e183
16 changed files with 11 additions and 23 deletions
|
@ -172,7 +172,8 @@ extern struct texture_s *r_notexture_mip;
|
|||
extern entity_t r_worldentity;
|
||||
|
||||
void R_Init (void);
|
||||
void R_LoadModule (void);
|
||||
void R_LoadModule (void (*load_gl)(void),
|
||||
void (*set_palette) (const byte *palette));
|
||||
struct progs_s;
|
||||
void R_Progs_Init (struct progs_s *pr);
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ typedef struct {
|
|||
void (*end_rendering)(void);
|
||||
} viddef_t;
|
||||
|
||||
extern viddef_t viddef;
|
||||
#define viddef (*r_data->vid)
|
||||
|
||||
extern unsigned int d_8to24table[256]; //FIXME nq/qw uses
|
||||
|
||||
|
|
|
@ -138,7 +138,6 @@ gl_R_LoadSky_f (void)
|
|||
void
|
||||
gl_R_Init (void)
|
||||
{
|
||||
vid = *vr_data.vid;
|
||||
R_Init_Cvars ();
|
||||
gl_R_Particles_Init_Cvars ();
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ static U void (*const r_progs_init)(struct progs_s *) = R_Progs_Init;
|
|||
#undef U
|
||||
|
||||
VISIBLE void
|
||||
R_LoadModule (void)
|
||||
R_LoadModule (void (*load_gl)(void), void (*set_palette) (const byte *palette))
|
||||
{
|
||||
PI_RegisterPlugins (vidrend_plugin_list);
|
||||
vidrend_plugin = Cvar_Get ("vid_render", VID_RENDER_DEFAULT, CVAR_ROM, 0,
|
||||
|
@ -76,7 +76,8 @@ R_LoadModule (void)
|
|||
r_funcs = vidrendmodule->functions->vid_render;
|
||||
mod_funcs = r_funcs->model_funcs;
|
||||
r_data = vidrendmodule->data->vid_render;
|
||||
r_data->vid = &viddef;
|
||||
r_data->vid->load_gl = load_gl;
|
||||
r_data->vid->set_palette = set_palette;
|
||||
|
||||
vidrendmodule->functions->general->p_Init ();
|
||||
}
|
||||
|
|
|
@ -98,7 +98,6 @@ D_ClearCacheGuard (void)
|
|||
void
|
||||
D_InitCaches (void *buffer, int size)
|
||||
{
|
||||
vid = *vr_data.vid; // recache
|
||||
Sys_MaskPrintf (SYS_DEV, "D_InitCaches: %ik surface cache\n", size/1024);
|
||||
|
||||
sc_size = size - GUARDSIZE;
|
||||
|
|
|
@ -107,7 +107,6 @@ D_ClearCacheGuard (void)
|
|||
void
|
||||
sw32_D_InitCaches (void *buffer, int size)
|
||||
{
|
||||
vid = *vr_data.vid; // recache
|
||||
Sys_MaskPrintf (SYS_DEV, "D_InitCaches: %ik surface cache\n", size/1024);
|
||||
|
||||
sc_size = size - GUARDSIZE;
|
||||
|
|
|
@ -131,7 +131,6 @@ gl_vid_render_init (void)
|
|||
vr_data.vid->load_gl ();
|
||||
vr_funcs = &gl_vid_render_funcs;
|
||||
m_funcs = &model_funcs;
|
||||
vid = *vr_data.vid;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -131,7 +131,6 @@ glsl_vid_render_init (void)
|
|||
vr_data.vid->load_gl ();
|
||||
vr_funcs = &glsl_vid_render_funcs;
|
||||
m_funcs = &model_funcs;
|
||||
vid = *vr_data.vid;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -121,7 +121,6 @@ sw_vid_render_init (void)
|
|||
{
|
||||
vr_funcs = &sw_vid_render_funcs;
|
||||
m_funcs = &model_funcs;
|
||||
vid = *vr_data.vid;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -126,7 +126,6 @@ sw32_vid_render_init (void)
|
|||
{
|
||||
vr_funcs = &sw32_vid_render_funcs;
|
||||
m_funcs = &model_funcs;
|
||||
vid = *vr_data.vid;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -65,7 +65,7 @@ VID_Shutdown (void)
|
|||
static void
|
||||
VID_UpdateFullscreen (cvar_t *vid_fullscreen)
|
||||
{
|
||||
if (!viddef.initialized)
|
||||
if (!r_data || !viddef.initialized)
|
||||
return;
|
||||
if ((vid_fullscreen->int_val && !(screen->flags & SDL_FULLSCREEN))
|
||||
|| (!vid_fullscreen->int_val && screen->flags & SDL_FULLSCREEN))
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include "vid_internal.h"
|
||||
|
||||
/* Software and hardware gamma support */
|
||||
viddef_t viddef;
|
||||
#define viddef (*r_data->vid)
|
||||
byte *vid_colormap;
|
||||
cvar_t *vid_gamma;
|
||||
cvar_t *vid_system_gamma;
|
||||
|
|
|
@ -406,7 +406,7 @@ VID_Init (byte *palette, byte *colormap)
|
|||
if (fbdev_inited)
|
||||
return;
|
||||
|
||||
viddef.set_palette = VID_SetPalette;
|
||||
R_LoadModule (0, VID_SetPalette);
|
||||
|
||||
if (COM_CheckParm ("-novideo")) {
|
||||
viddef.width = 320;
|
||||
|
@ -426,8 +426,6 @@ VID_Init (byte *palette, byte *colormap)
|
|||
return;
|
||||
}
|
||||
|
||||
R_LoadModule ();
|
||||
|
||||
fbname = getenv("FRAMEBUFFER");
|
||||
if (!fbname)
|
||||
fbname = "/dev/fb0";
|
||||
|
|
|
@ -235,15 +235,13 @@ VID_Init (byte *palette, byte *colormap)
|
|||
{
|
||||
Uint32 flags;
|
||||
|
||||
viddef.load_gl = sdl_load_gl;
|
||||
viddef.set_palette = VID_SetPalette;
|
||||
set_vid_mode = sdl_set_vid_mode;
|
||||
|
||||
// Load the SDL library
|
||||
if (SDL_Init (SDL_INIT_VIDEO) < 0)
|
||||
Sys_Error ("VID: Couldn't load SDL: %s", SDL_GetError ());
|
||||
|
||||
R_LoadModule ();
|
||||
R_LoadModule (sdl_load_gl, VID_SetPalette);
|
||||
|
||||
viddef.numpages = 1;
|
||||
viddef.colormap8 = colormap;
|
||||
|
|
|
@ -670,10 +670,8 @@ VID_Init (byte *palette, byte *colormap)
|
|||
{
|
||||
choose_visual = x11_choose_visual;
|
||||
create_context = x11_create_context;
|
||||
viddef.load_gl = glx_load_gl;
|
||||
viddef.set_palette = VID_SetPalette;
|
||||
|
||||
R_LoadModule ();
|
||||
R_LoadModule (glx_load_gl, VID_SetPalette);
|
||||
|
||||
viddef.numpages = 2;
|
||||
viddef.colormap8 = colormap;
|
||||
|
|
|
@ -51,7 +51,6 @@ cvar_t *chase_active;
|
|||
int fps_count;
|
||||
int viewentity;
|
||||
|
||||
viddef_t viddef;
|
||||
vid_render_data_t *r_data;
|
||||
vid_render_funcs_t *r_funcs;
|
||||
|
||||
|
|
Loading…
Reference in a new issue