[renderer] Avoid gl/glsl segfault when resizing qwaq

qwaq doesn't supply a backtile pic, so Draw_TileClear in the gl and glsl
renderers would segfault when qwaq's window width changed due to some
back-tile being drawn.
This commit is contained in:
Bill Currie 2022-09-22 10:33:32 +09:00
parent a1813868fc
commit d1f6945747
2 changed files with 6 additions and 0 deletions

View file

@ -885,6 +885,9 @@ gl_Draw_ConsoleBackground (int lines, byte alpha)
void
gl_Draw_TileClear (int x, int y, int w, int h)
{
if (!draw_backtile) {
return;
}
glpic_t *gl;
qfglColor3ubv (color_0_8);
gl = (glpic_t *) draw_backtile->data;

View file

@ -440,6 +440,9 @@ glsl_Draw_Init (void)
white_pic = pic_data ("white_block", 8, 8, white_block);
backtile_pic = glsl_Draw_PicFromWad ("backtile");
if (!backtile_pic) {
backtile_pic = white_pic;
}
//FIXME gl = (glpic_t *) backtile_pic->data;
//FIXME qfeglBindTexture (GL_TEXTURE_2D, gl->texnum);
//FIXME qfeglTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);