Fixed potential game crash at shutdown

Only happens in Windows. A cvar was being queried just after
all cvars were freed, in Qcommon_Shutdown().
GL_GENERATE_MIPMAP definition relocated.
scrap_uploads counter deleted, it wasn't being read anywhere.
This commit is contained in:
Jaime Moreira 2024-05-11 18:16:38 -04:00
parent b401846ce6
commit a8824972db
4 changed files with 4 additions and 9 deletions

View file

@ -85,6 +85,7 @@ Sys_Error(const char *error, ...)
void
Sys_Quit(void)
{
const qboolean free_console = (dedicated && dedicated->value);
timeEndPeriod(1);
#ifndef DEDICATED_ONLY
@ -93,7 +94,7 @@ Sys_Quit(void)
Qcommon_Shutdown();
if (dedicated && dedicated->value)
if (free_console)
{
FreeConsole();
}

View file

@ -638,11 +638,6 @@ R_BuildPalettedTexture(unsigned char *paletted_texture, unsigned char *scaled,
}
}
// Windows headers don't define this constant.
#ifndef GL_GENERATE_MIPMAP
#define GL_GENERATE_MIPMAP 0x8191
#endif
qboolean
R_Upload32Native(unsigned *data, int width, int height, qboolean mipmap)
{

View file

@ -19,7 +19,7 @@
*
* =======================================================================
*
* Allocate all the little status bar obejcts into a single texture
* Allocate all the little status bar objects into a single texture
* to crutch up inefficient hardware / drivers.
*
* =======================================================================
@ -30,7 +30,6 @@
int scrap_allocated[MAX_SCRAPS][BLOCK_WIDTH];
byte scrap_texels[MAX_SCRAPS][BLOCK_WIDTH * BLOCK_HEIGHT];
qboolean scrap_dirty;
int scrap_uploads;
qboolean R_Upload8(byte *data,
int width,
@ -93,7 +92,6 @@ Scrap_AllocBlock(int w, int h, int *x, int *y)
void
Scrap_Upload(void)
{
scrap_uploads++;
R_Bind(TEXNUM_SCRAPS);
R_Upload8(scrap_texels[0], BLOCK_WIDTH, BLOCK_HEIGHT, false, false);
scrap_dirty = false;

View file

@ -49,6 +49,7 @@
#define GL_POINT_SIZE_MIN 0x8126
#define GL_POINT_SIZE_MAX 0x8127
#define GL_POINT_DISTANCE_ATTENUATION 0x8129
#define GL_GENERATE_MIPMAP 0x8191
#endif
#ifndef GL_VERSION_1_3