engine: initialize default video mode in refState global, as we don't support reloading engine without reinitializing globals anyway

This commit is contained in:
Alibek Omarov
2025-11-23 11:54:33 +05:00
parent c956c65e33
commit 6aadb4ceea
5 changed files with 7 additions and 23 deletions
+7 -1
View File
@@ -6,7 +6,13 @@
#include "vid_common.h"
struct ref_state_s ref;
ref_globals_t refState;
ref_globals_t refState =
{
// just have something valid until video subsystem is finished initializing
.width = 640,
.height = 480,
};
static const char* r_skyBoxSuffix[SKYBOX_MAX_SIDES] = { "rt", "bk", "lf", "ft", "up", "dn" };
-13
View File
@@ -34,19 +34,6 @@ CVAR_DEFINE( window_ypos, "_window_ypos", "-1", FCVAR_RENDERINFO, "window positi
glwstate_t glw_state;
/*
=================
VID_InitDefaultResolution
=================
*/
void VID_InitDefaultResolution( void )
{
// we need to have something valid here
// until video subsystem initialized
refState.width = 640;
refState.height = 480;
}
/*
=================
R_SaveVideoMode
-1
View File
@@ -824,7 +824,6 @@ uint LZSS_GetActualSize( const byte *source, size_t input_len );
byte *LZSS_Compress( byte *pInput, int inputLength, uint *pOutputSize );
uint LZSS_Decompress( const byte *pInput, byte *pOutput, size_t input_len, size_t output_len );
void GL_FreeImage( const char *name );
void VID_InitDefaultResolution( void );
void VID_Init( void );
void UI_SetActiveMenu( qboolean fActive );
void UI_ShowConnectionWarning( void );
-5
View File
@@ -88,11 +88,6 @@ void Host_InputFrame( void )
{
}
void VID_InitDefaultResolution( void )
{
}
void Con_Init( void )
{
-3
View File
@@ -1074,9 +1074,6 @@ static void Host_InitCommon( int argc, char **argv, const char *progname, qboole
// NOTE: this message couldn't be passed into game console but it doesn't matter
// Con_Reportf( "Sys_LoadLibrary: Loading xash.dll - ok\n" );
// get default screen res
VID_InitDefaultResolution();
// init host state machine
COM_InitHostState();