Browse Source

Fixed division by zero caused by uninitialized vid struct

console
Nico de Poel 5 years ago
parent
commit
a2e16eaf89
  1. 3
      engine/UniQuake/gl_uniquake.c
  2. 11
      engine/UniQuake/stub/stub_vidgl.c

3
engine/UniQuake/gl_uniquake.c

@ -3,9 +3,6 @@
#include "../Quake/quakedef.h"
#include "../Quake/gl_model.h"
viddef_t vid; // global video state
modestate_t modestate = MS_UNINIT;
typedef struct unity_glcalls_s
{
void *target;

11
engine/UniQuake/stub/stub_vidgl.c

@ -2,6 +2,9 @@
#include "quakedef.h"
viddef_t vid; // global video state
modestate_t modestate = MS_UNINIT;
int gl_stencilbits = 0;
qboolean gl_texture_NPOT = false;
qboolean gl_glsl_gamma_able = false;
@ -17,6 +20,14 @@ void VID_Init(void)
{
Cvar_RegisterVariable(&vid_gamma);
Cvar_RegisterVariable(&vid_contrast);
memset(&vid, 0, sizeof(viddef_t));
vid.width = 1;
vid.height = 1;
vid.conwidth = 1;
vid.conheight = 1;
vid.maxwarpwidth = 320;
vid.maxwarpheight = 200;
}
void VID_Shutdown(void)

Loading…
Cancel
Save