[win] Get the software renderer hobbling

16 and 32 bit rendering are disabled at the moment because there's a
weird segfault I need to fix, but the 8-bit dynamic lights are doing
weird things (for x11, too) when updating the light maps.
This commit is contained in:
Bill Currie 2022-03-09 20:00:59 +09:00
parent dce1a4d292
commit 19348f678f
2 changed files with 21 additions and 0 deletions

View file

@ -152,6 +152,7 @@ VID_Init_Cvars (void)
Win_Vulkan_Init_Cvars ();
#endif
Win_GL_Init_Cvars ();
Win_SW_Init_Cvars ();
}
void

View file

@ -50,6 +50,8 @@ static win_palette_t st2d_8to32table[256];
static byte current_palette[768];
static int palette_changed;
static cvar_t *vid_bitdepth;
static LPDIRECTDRAW dd_Object;
static HINSTANCE hInstDDraw;
static LPDIRECTDRAWSURFACE dd_frontbuffer;
@ -469,14 +471,32 @@ sw_ctx_t *
Win_SW_Context (void)
{
sw_ctx_t *ctx = calloc (1, sizeof (sw_ctx_t));
ctx->pixbytes = 1;
ctx->set_palette = win_set_palette;
ctx->choose_visual = win_choose_visual;
ctx->create_context = win_create_context;
ctx->update = win_sw_update;
#if 0 //FIXME need to figure out 16 and 32 bit buffers
switch (vid_bitdepth->int_val) {
case 8:
ctx->pixbytes = 1;
break;
case 16:
ctx->pixbytes = 2;
break;
case 32:
ctx->pixbytes = 4;
break;
default:
Sys_Error ("X11_SW32_Context: unsupported bit depth");
}
#endif
return ctx;
}
void
Win_SW_Init_Cvars (void)
{
vid_bitdepth = Cvar_Get ("vid_bitdepth", "8", CVAR_ROM, NULL, "Sets "
"display bitdepth (supported modes: 8 16 32)");
}