From 26866fb782cb868e2a0541b5495257e3de0b31c2 Mon Sep 17 00:00:00 2001 From: slipher Date: Tue, 7 Jan 2025 17:39:21 -0300 Subject: [PATCH] Remove legacy command interface from renderer interface --- src/engine/client/cl_main.cpp | 6 ------ src/engine/renderer/tr_public.h | 8 -------- src/engine/sys/sdl_glimp.cpp | 9 +++------ 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/engine/client/cl_main.cpp b/src/engine/client/cl_main.cpp index 13aab8ef7c..c98bc13f66 100644 --- a/src/engine/client/cl_main.cpp +++ b/src/engine/client/cl_main.cpp @@ -2219,12 +2219,6 @@ static bool CL_InitRef() refimport_t ri; refexport_t *ret; - ri.Cmd_AddCommand = Cmd_AddCommand; - ri.Cmd_RemoveCommand = Cmd_RemoveCommand; - ri.Cmd_Argc = Cmd_Argc; - ri.Cmd_Argv = Cmd_Argv; - ri.Cmd_QuoteString = Cmd_QuoteString; - ri.Milliseconds = Sys::Milliseconds; ri.RealTime = Com_RealTime; diff --git a/src/engine/renderer/tr_public.h b/src/engine/renderer/tr_public.h index d1d2b9b0df..038c069489 100644 --- a/src/engine/renderer/tr_public.h +++ b/src/engine/renderer/tr_public.h @@ -293,14 +293,6 @@ struct refimport_t void *( *Hunk_AllocateTempMemory )( int size ); void ( *Hunk_FreeTempMemory )( void *block ); - void ( *Cmd_AddCommand )( const char *name, void ( *cmd )() ); - void ( *Cmd_RemoveCommand )( const char *name ); - - int ( *Cmd_Argc )(); - const char *( *Cmd_Argv )( int i ); - - const char *( *Cmd_QuoteString )( const char *text ); - // a -1 return means the file does not exist // nullptr can be passed for buf to just determine existence int ( *FS_ReadFile )( const char *name, void **buf ); diff --git a/src/engine/sys/sdl_glimp.cpp b/src/engine/sys/sdl_glimp.cpp index 500a94362d..d484be43f8 100644 --- a/src/engine/sys/sdl_glimp.cpp +++ b/src/engine/sys/sdl_glimp.cpp @@ -500,10 +500,9 @@ void GLimp_Shutdown() ResetStruct( glState ); } -static void GLimp_Minimize() -{ - SDL_MinimizeWindow( window ); -} +static Cmd::LambdaCmd minimizeCmd( + "minimize", "minimize the window", + []( const Cmd::Args & ) { SDL_MinimizeWindow( window ); }); static void SetSwapInterval( int swapInterval ) { @@ -2655,8 +2654,6 @@ bool GLimp_Init() Cvar::Latch( workaround_glExtension_missingArbFbo_useExtFbo ); Cvar::Latch( workaround_glHardware_intel_useFirstProvokinVertex ); - ri.Cmd_AddCommand( "minimize", GLimp_Minimize ); - /* Enable S3TC on Mesa even if libtxc-dxtn is not available The environment variables is currently always set, it should do nothing with other systems and drivers.