@@ -67,8 +67,8 @@ Cvar::Cvar<float> cl_mumbleScale("cl_mumbleScale", "multiplier of world coordina
6767Cvar::Cvar<bool > cl_nodelta (" cl_nodelta" , " disable network snapshot delta compression" , Cvar::NONE , false );
6868
6969Cvar::Cvar<float > cl_timeout (" cl_timeout" , " disconnect after this many seconds without server packets" , Cvar::NONE , 200 );
70- cvar_t * cl_maxpackets;
71- cvar_t * cl_packetdup;
70+ Cvar::Range<Cvar::Cvar< int >> cl_maxpackets ( " cl_maxpackets " , " client->server max packets per second " , Cvar:: NONE , 125 , 15 , 125 ) ;
71+ Cvar::Range<Cvar::Cvar< int >> cl_packetdup ( " cl_packetdup " , " send N extra copies of each usercmd_t " , Cvar:: NONE , 1 , 0 , 5 ) ;
7272Cvar::Range<Cvar::Cvar<int >> cl_timeNudge (" cl_timeNudge" , " ms to extrapolate/interpolate ahead/behind latest snapshots (negative means extrapolate ahead)" , Cvar::NONE , 0 , -30 , 30 );
7373cvar_t *cl_showTimeDelta;
7474
@@ -89,7 +89,7 @@ Cvar::Cvar<std::string> cvar_demo_status_filename(
8989 " "
9090);
9191
92- cvar_t * cl_aviFrameRate;
92+ Cvar::Cvar< int > cl_aviFrameRate ( " cl_aviFrameRate " , " demo video framerate " , Cvar:: NONE , 25 ) ;
9393
9494Cvar::Cvar<bool > cl_freelook (" cl_freelook" , " vertical mouse movement always controls pitch" , Cvar::NONE , true );
9595
@@ -121,9 +121,9 @@ Cvar::Cvar<bool> cl_autorecord("cl_autorecord", "record a demo of every game", C
121121Cvar::Cvar<bool > cl_allowDownload (" cl_allowDownload" , " auto-download paks required by the server" , Cvar::NONE , true );
122122
123123Cvar::Cvar<std::string> cl_consoleFont (" cl_consoleFont" , " path (in homepath) for console typeface" , Cvar::NONE , " " );
124- cvar_t *cl_consoleFontSize ;
125- cvar_t *cl_consoleFontScaling ;
126- cvar_t *cl_consoleFontKerning ;
124+ Cvar::Cvar< int > cl_consoleFontSize ( " cl_consoleFontSize " , " console font point size " , Cvar:: NONE , 16 ) ;
125+ Cvar::Cvar< bool > cl_consoleFontScaling ( " cl_consoleFontScaling " , " rescale console font size by ratio of display size to 1080p " , Cvar:: NONE , true ) ;
126+ Cvar::Cvar< float > cl_consoleFontKerning ( " cl_consoleFontKerning " , " px of horizontal padding on console glyphs " , Cvar:: NONE , 0 ) ;
127127// see also com_consoleCommand for terminal consoles
128128Cvar::Cvar<std::string> cl_consoleCommand (" cl_consoleCommand" , " command prepended to console lines, when in game" , Cvar::NONE , " say" );
129129
@@ -2098,20 +2098,20 @@ bool CL_InitRenderer()
20982098 }
20992099
21002100 Cvar::Latch (cl_consoleFont);
2101- cl_consoleFontSize = Cvar_Get ( " cl_consoleFontSize" , " 16 " , CVAR_LATCH );
2102- cl_consoleFontScaling = Cvar_Get ( " cl_consoleFontScaling" , " 1 " , CVAR_LATCH );
2101+ Cvar::Latch ( cl_consoleFontSize);
2102+ Cvar::Latch ( cl_consoleFontScaling);
21032103
21042104 // Register console font specified by cl_consoleFont. Empty string means use the embbed Unifont
21052105
2106- int fontSize = cl_consoleFontSize-> integer ;
2106+ int fontSize = cl_consoleFontSize. Get () ;
21072107
2108- if ( cl_consoleFontScaling-> integer )
2108+ if ( cl_consoleFontScaling. Get () )
21092109 {
21102110 // This gets 12px on 1920×1080 screen, which is libRocket default for 1em
21112111 int fontScale = std::min (cls.windowConfig .vidWidth , cls.windowConfig .vidHeight ) / 90 ;
21122112
21132113 // fontScale / 12px gets 1px on 1920×1080 screen
2114- fontSize = cl_consoleFontSize-> integer * fontScale / 12 ;
2114+ fontSize = cl_consoleFontSize. Get () * fontScale / 12 ;
21152115 }
21162116
21172117 if ( !cl_consoleFont.Get ().empty () )
@@ -2301,13 +2301,6 @@ void CL_Init()
23012301 cl_showSend = Cvar_Get ( " cl_showSend" , " 0" , CVAR_TEMP );
23022302 cl_showTimeDelta = Cvar_Get ( " cl_showTimeDelta" , " 0" , CVAR_TEMP );
23032303
2304- cl_aviFrameRate = Cvar_Get ( " cl_aviFrameRate" , " 25" , 0 );
2305-
2306- cl_maxpackets = Cvar_Get ( " cl_maxpackets" , " 125" , 0 );
2307- cl_packetdup = Cvar_Get ( " cl_packetdup" , " 1" , 0 );
2308-
2309- cl_consoleFontKerning = Cvar_Get ( " cl_consoleFontKerning" , " 0" , 0 );
2310-
23112304 // userinfo
23122305 cl_rate = Cvar_Get ( " rate" , XSTRING (NETWORK_DEFAULT_RATE ), CVAR_USERINFO | CVAR_ARCHIVE );
23132306
0 commit comments