mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 15:01:41 +00:00
Pass vid_internal to R_LoadModule
This fixes the segfault and pushes things very much in the desired direction of proper system independence for rendering and presentation separation (though things were headed in the right direction before).
This commit is contained in:
parent
6ee2df8445
commit
cb10175824
4 changed files with 10 additions and 9 deletions
|
@ -172,8 +172,8 @@ extern struct texture_s *r_notexture_mip;
|
|||
extern entity_t r_worldentity;
|
||||
|
||||
void R_Init (void);
|
||||
void R_LoadModule (void (*load_gl)(void),
|
||||
void (*set_palette) (const byte *palette));
|
||||
struct vid_internal_s;
|
||||
void R_LoadModule (struct vid_internal_s *vid_internal);
|
||||
struct progs_s;
|
||||
void R_Progs_Init (struct progs_s *pr);
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ static U void (*const r_progs_init)(struct progs_s *) = R_Progs_Init;
|
|||
#undef U
|
||||
|
||||
VISIBLE void
|
||||
R_LoadModule (void (*load_gl)(void), void (*set_palette) (const byte *palette))
|
||||
R_LoadModule (vid_internal_t *vid_internal)
|
||||
{
|
||||
PI_RegisterPlugins (vidrend_plugin_list);
|
||||
vidrend_plugin = Cvar_Get ("vid_render", VID_RENDER_DEFAULT, CVAR_ROM, 0,
|
||||
|
@ -77,8 +77,7 @@ R_LoadModule (void (*load_gl)(void), void (*set_palette) (const byte *palette))
|
|||
r_funcs = vidrendmodule->functions->vid_render;
|
||||
mod_funcs = r_funcs->model_funcs;
|
||||
r_data = vidrendmodule->data->vid_render;
|
||||
r_data->vid->vid_internal->load_gl = load_gl;
|
||||
r_data->vid->vid_internal->set_palette = set_palette;
|
||||
r_data->vid->vid_internal = vid_internal;
|
||||
|
||||
vidrendmodule->functions->general->p_Init ();
|
||||
}
|
||||
|
|
|
@ -237,7 +237,8 @@ VID_Init (byte *palette, byte *colormap)
|
|||
{
|
||||
Uint32 flags;
|
||||
|
||||
viddef.vid_internal = &vid_internal;
|
||||
vid_internal.set_palette = VID_SetPalette;
|
||||
vid_internal.load_gl = sdl_load_gl;
|
||||
|
||||
set_vid_mode = sdl_set_vid_mode;
|
||||
|
||||
|
@ -245,7 +246,7 @@ VID_Init (byte *palette, byte *colormap)
|
|||
if (SDL_Init (SDL_INIT_VIDEO) < 0)
|
||||
Sys_Error ("VID: Couldn't load SDL: %s", SDL_GetError ());
|
||||
|
||||
R_LoadModule (sdl_load_gl, VID_SetPalette);
|
||||
R_LoadModule (&vid_internal);
|
||||
|
||||
viddef.numpages = 1;
|
||||
viddef.colormap8 = colormap;
|
||||
|
|
|
@ -667,12 +667,13 @@ VID_SetPalette (const byte *palette)
|
|||
void
|
||||
VID_Init (byte *palette, byte *colormap)
|
||||
{
|
||||
viddef.vid_internal = &vid_internal;
|
||||
vid_internal.load_gl = glx_load_gl;
|
||||
vid_internal.set_palette = VID_SetPalette;
|
||||
|
||||
choose_visual = x11_choose_visual;
|
||||
create_context = x11_create_context;
|
||||
|
||||
R_LoadModule (glx_load_gl, VID_SetPalette);
|
||||
R_LoadModule (&vid_internal);
|
||||
|
||||
viddef.numpages = 2;
|
||||
viddef.colormap8 = colormap;
|
||||
|
|
Loading…
Reference in a new issue