More conversion
This commit is contained in:
+64
-64
@@ -78,30 +78,30 @@ float scr_con_current;
|
||||
float scr_conlines; // lines of console to display
|
||||
|
||||
//johnfitz -- new cvars
|
||||
cvar_t scr_menuscale = {"scr_menuscale", "1", CVAR_ARCHIVE};
|
||||
cvar_t scr_sbarscale = {"scr_sbarscale", "1", CVAR_ARCHIVE};
|
||||
cvar_t scr_sbaralpha = {"scr_sbaralpha", "0.75", CVAR_ARCHIVE};
|
||||
cvar_t scr_conwidth = {"scr_conwidth", "0", CVAR_ARCHIVE};
|
||||
cvar_t scr_conscale = {"scr_conscale", "1", CVAR_ARCHIVE};
|
||||
cvar_t scr_crosshairscale = {"scr_crosshairscale", "1", CVAR_ARCHIVE};
|
||||
cvar_t scr_showfps = {"scr_showfps", "0", CVAR_NONE};
|
||||
cvar_t scr_clock = {"scr_clock", "0", CVAR_NONE};
|
||||
convar scr_menuscale = {"scr_menuscale", "1", {.archive = true}};
|
||||
convar scr_sbarscale = {"scr_sbarscale", "1", {.archive = true}};
|
||||
convar scr_sbaralpha = {"scr_sbaralpha", "0.75", {.archive = true}};
|
||||
convar scr_conwidth = {"scr_conwidth", "0", {.archive = true}};
|
||||
convar scr_conscale = {"scr_conscale", "1", {.archive = true}};
|
||||
convar scr_crosshairscale = {"scr_crosshairscale", "1", {.archive = true}};
|
||||
convar scr_showfps = {"scr_showfps", "0"};
|
||||
convar scr_clock = {"scr_clock", "0"};
|
||||
//johnfitz
|
||||
cvar_t scr_usekfont = {"scr_usekfont", "0", CVAR_NONE}; // 2021 re-release
|
||||
convar scr_usekfont = {"scr_usekfont", "0"}; // 2021 re-release
|
||||
|
||||
cvar_t scr_viewsize = {"viewsize","100", CVAR_ARCHIVE};
|
||||
cvar_t scr_fov = {"fov","90",CVAR_NONE}; // 10 - 170
|
||||
cvar_t scr_fov_adapt = {"fov_adapt","1",CVAR_ARCHIVE};
|
||||
cvar_t scr_conspeed = {"scr_conspeed","500",CVAR_ARCHIVE};
|
||||
cvar_t scr_centertime = {"scr_centertime","2",CVAR_NONE};
|
||||
cvar_t scr_showturtle = {"showturtle","0",CVAR_NONE};
|
||||
cvar_t scr_showpause = {"showpause","1",CVAR_NONE};
|
||||
cvar_t scr_printspeed = {"scr_printspeed","8",CVAR_NONE};
|
||||
cvar_t gl_triplebuffer = {"gl_triplebuffer", "1", CVAR_ARCHIVE};
|
||||
convar scr_viewsize = {"viewsize","100", {.archive = true}};
|
||||
convar scr_fov = {"fov","90"}; // 10 - 170
|
||||
convar scr_fov_adapt = {"fov_adapt","1",{.archive = true}};
|
||||
convar scr_conspeed = {"scr_conspeed","500",{.archive = true}};
|
||||
convar scr_centertime = {"scr_centertime","2"};
|
||||
convar scr_showturtle = {"showturtle","0"};
|
||||
convar scr_showpause = {"showpause","1"};
|
||||
convar scr_printspeed = {"scr_printspeed","8"};
|
||||
convar gl_triplebuffer = {"gl_triplebuffer", "1", {.archive = true}};
|
||||
|
||||
cvar_t cl_gun_fovscale = {"cl_gun_fovscale","1",CVAR_ARCHIVE}; // Qrack
|
||||
convar cl_gun_fovscale = {"cl_gun_fovscale","1",{.archive = true}}; // Qrack
|
||||
|
||||
extern cvar_t crosshair;
|
||||
extern convar crosshair;
|
||||
|
||||
qboolean scr_initialized; // ready to draw
|
||||
|
||||
@@ -291,15 +291,15 @@ static void SCR_CalcRefdef (void)
|
||||
|
||||
// bound viewsize
|
||||
if (scr_viewsize.value < 30)
|
||||
Cvar_SetQuick (&scr_viewsize, "30");
|
||||
scr_viewsize.set("30");
|
||||
if (scr_viewsize.value > 120)
|
||||
Cvar_SetQuick (&scr_viewsize, "120");
|
||||
scr_viewsize.set("120");
|
||||
|
||||
// bound fov
|
||||
if (scr_fov.value < 10)
|
||||
Cvar_SetQuick (&scr_fov, "10");
|
||||
scr_fov.set("10");
|
||||
if (scr_fov.value > 170)
|
||||
Cvar_SetQuick (&scr_fov, "170");
|
||||
scr_fov.set("170");
|
||||
|
||||
vid.recalc_refdef = 0;
|
||||
|
||||
@@ -314,12 +314,12 @@ static void SCR_CalcRefdef (void)
|
||||
else
|
||||
sb_lines = 48 * scale;
|
||||
|
||||
size = q_min(scr_viewsize.value, 100.f) / 100;
|
||||
size = std::min(scr_viewsize.value, 100.f) / 100;
|
||||
//johnfitz
|
||||
|
||||
//johnfitz -- rewrote this section
|
||||
r_refdef.vrect.width = q_max(glwidth * size, 96.0f); //no smaller than 96, for icons
|
||||
r_refdef.vrect.height = q_min((int)(glheight * size), glheight - sb_lines); //make room for sbar
|
||||
r_refdef.vrect.width = std::max(glwidth * size, 96.0f); //no smaller than 96, for icons
|
||||
r_refdef.vrect.height = std::min((int)(glheight * size), glheight - sb_lines); //make room for sbar
|
||||
r_refdef.vrect.x = (glwidth - r_refdef.vrect.width)/2;
|
||||
r_refdef.vrect.y = (glheight - sb_lines - r_refdef.vrect.height)/2;
|
||||
//johnfitz
|
||||
@@ -340,7 +340,7 @@ Keybinding command
|
||||
*/
|
||||
void SCR_SizeUp_f (void)
|
||||
{
|
||||
Cvar_SetValueQuick (&scr_viewsize, scr_viewsize.value+10);
|
||||
scr_viewsize.set_value(scr_viewsize.value+10);
|
||||
}
|
||||
|
||||
|
||||
@@ -353,10 +353,10 @@ Keybinding command
|
||||
*/
|
||||
void SCR_SizeDown_f (void)
|
||||
{
|
||||
Cvar_SetValueQuick (&scr_viewsize, scr_viewsize.value-10);
|
||||
scr_viewsize.set_value(scr_viewsize.value-10);
|
||||
}
|
||||
|
||||
static void SCR_Callback_refdef (cvar_t *var)
|
||||
static void SCR_Callback_refdef (convar *var)
|
||||
{
|
||||
vid.recalc_refdef = 1;
|
||||
}
|
||||
@@ -366,7 +366,7 @@ static void SCR_Callback_refdef (cvar_t *var)
|
||||
SCR_Conwidth_f -- johnfitz -- called when scr_conwidth or scr_conscale changes
|
||||
==================
|
||||
*/
|
||||
void SCR_Conwidth_f (cvar_t *var)
|
||||
void SCR_Conwidth_f (convar *var)
|
||||
{
|
||||
vid.recalc_refdef = 1;
|
||||
vid.conwidth = (scr_conwidth.value > 0) ? (int)scr_conwidth.value : (scr_conscale.value > 0) ? (int)(vid.width/scr_conscale.value) : vid.width;
|
||||
@@ -396,36 +396,36 @@ SCR_Init
|
||||
void SCR_Init (void)
|
||||
{
|
||||
//johnfitz -- new cvars
|
||||
Cvar_RegisterVariable (&scr_menuscale);
|
||||
Cvar_RegisterVariable (&scr_sbarscale);
|
||||
Cvar_SetCallback (&scr_sbaralpha, SCR_Callback_refdef);
|
||||
Cvar_RegisterVariable (&scr_sbaralpha);
|
||||
Cvar_SetCallback (&scr_conwidth, &SCR_Conwidth_f);
|
||||
Cvar_SetCallback (&scr_conscale, &SCR_Conwidth_f);
|
||||
Cvar_RegisterVariable (&scr_conwidth);
|
||||
Cvar_RegisterVariable (&scr_conscale);
|
||||
Cvar_RegisterVariable (&scr_crosshairscale);
|
||||
Cvar_RegisterVariable (&scr_showfps);
|
||||
Cvar_RegisterVariable (&scr_clock);
|
||||
scr_menuscale.inscribe();
|
||||
scr_sbarscale.inscribe();
|
||||
scr_sbaralpha.set_callback(SCR_Callback_refdef);
|
||||
scr_sbaralpha.inscribe();
|
||||
scr_conwidth.set_callback(&SCR_Conwidth_f);
|
||||
scr_conscale.set_callback(&SCR_Conwidth_f);
|
||||
scr_conwidth.inscribe();
|
||||
scr_conscale.inscribe();
|
||||
scr_crosshairscale.inscribe();
|
||||
scr_showfps.inscribe();
|
||||
scr_clock.inscribe();
|
||||
//johnfitz
|
||||
Cvar_RegisterVariable (&scr_usekfont); // 2021 re-release
|
||||
Cvar_SetCallback (&scr_fov, SCR_Callback_refdef);
|
||||
Cvar_SetCallback (&scr_fov_adapt, SCR_Callback_refdef);
|
||||
Cvar_SetCallback (&scr_viewsize, SCR_Callback_refdef);
|
||||
Cvar_RegisterVariable (&scr_fov);
|
||||
Cvar_RegisterVariable (&scr_fov_adapt);
|
||||
Cvar_RegisterVariable (&scr_viewsize);
|
||||
Cvar_RegisterVariable (&scr_conspeed);
|
||||
Cvar_RegisterVariable (&scr_showturtle);
|
||||
Cvar_RegisterVariable (&scr_showpause);
|
||||
Cvar_RegisterVariable (&scr_centertime);
|
||||
Cvar_RegisterVariable (&scr_printspeed);
|
||||
Cvar_RegisterVariable (&gl_triplebuffer);
|
||||
Cvar_RegisterVariable (&cl_gun_fovscale);
|
||||
scr_usekfont.inscribe(); // 2021 re-release
|
||||
scr_fov.set_callback(SCR_Callback_refdef);
|
||||
scr_fov_adapt.set_callback(SCR_Callback_refdef);
|
||||
scr_viewsize.set_callback(SCR_Callback_refdef);
|
||||
scr_fov.inscribe();
|
||||
scr_fov_adapt.inscribe();
|
||||
scr_viewsize.inscribe();
|
||||
scr_conspeed.inscribe();
|
||||
scr_showturtle.inscribe();
|
||||
scr_showpause.inscribe();
|
||||
scr_centertime.inscribe();
|
||||
scr_printspeed.inscribe();
|
||||
gl_triplebuffer.inscribe();
|
||||
cl_gun_fovscale.inscribe();
|
||||
|
||||
Cmd_AddCommand ("screenshot",SCR_ScreenShot_f);
|
||||
Cmd_AddCommand ("sizeup",SCR_SizeUp_f);
|
||||
Cmd_AddCommand ("sizedown",SCR_SizeDown_f);
|
||||
command::add ("screenshot",SCR_ScreenShot_f);
|
||||
command::add ("sizeup",SCR_SizeUp_f);
|
||||
command::add ("sizedown",SCR_SizeDown_f);
|
||||
|
||||
SCR_LoadPics (); //johnfitz
|
||||
|
||||
@@ -666,7 +666,7 @@ SCR_SetUpToDrawConsole
|
||||
void SCR_SetUpToDrawConsole (void)
|
||||
{
|
||||
//johnfitz -- let's hack away the problem of slow console when host_timescale is <0
|
||||
extern cvar_t host_timescale;
|
||||
extern convar host_timescale;
|
||||
float timescale, conspeed;
|
||||
//johnfitz
|
||||
|
||||
@@ -765,9 +765,9 @@ void SCR_ScreenShot_f (void)
|
||||
|
||||
Q_strncpy (ext, "png", sizeof(ext));
|
||||
|
||||
if (Cmd_Argc () >= 2)
|
||||
if (command::argc () >= 2)
|
||||
{
|
||||
const char *requested_ext = Cmd_Argv (1);
|
||||
const char *requested_ext = command::argv (1)->c_str();
|
||||
|
||||
if (!q_strcasecmp ("png", requested_ext)
|
||||
|| !q_strcasecmp ("tga", requested_ext)
|
||||
@@ -782,8 +782,8 @@ void SCR_ScreenShot_f (void)
|
||||
|
||||
// read quality as the 3rd param (only used for JPG)
|
||||
quality = 90;
|
||||
if (Cmd_Argc () >= 3)
|
||||
quality = Q_atoi (Cmd_Argv(2));
|
||||
if (command::argc () >= 3)
|
||||
quality = Q_atoi (command::argv(2)->c_str());
|
||||
if (quality < 1 || quality > 100)
|
||||
{
|
||||
SCR_ScreenShot_Usage ();
|
||||
|
||||
Reference in New Issue
Block a user