VM_gecko_resize, // #492 void gecko_resize( string name, float w, float h )
VM_gecko_get_texture_extent, // #493 vector gecko_get_texture_extent( string name )
VM_crc16, // #494 float(float caseinsensitive, string s, ...) crc16 = #494 (DP_QC_CRC16)
-NULL, // #495
+VM_cvar_type, // #495 float(string name) cvar_type = #495; (DP_QC_CVAR_TYPE)
NULL, // #496
NULL, // #497
NULL, // #498
memcpy(cvar->defstring, value, alloclen);
cvar->value = atof (cvar->string);
cvar->integer = (int) cvar->value;
- cvar->description = "custom cvar";
+ cvar->description = "custom cvar"; // actually checked by VM_cvar_type
// link the variable in
// alphanumerical order
"DP_QC_STRINGBUFFERS "
"DP_QC_CRC16 "
"FTE_STRINGS "
+"DP_QC_CVAR_TYPE "
;
/*
VM_gecko_resize, // #492 void gecko_resize( string name, float w, float h )
VM_gecko_get_texture_extent, // #493 vector gecko_get_texture_extent( string name )
VM_crc16, // #494 float(float caseinsensitive, string s, ...) crc16 = #494 (DP_QC_CRC16)
-NULL, // #495
+VM_cvar_type, // #495 float(string name) cvar_type = #495; (DP_QC_CVAR_TYPE)
NULL, // #496
NULL, // #497
NULL, // #498
PRVM_G_FLOAT(OFS_RETURN) = Cvar_VariableValue(string);
}
+/*
+=================
+VM_cvar
+
+float cvar_type (string)
+float CVAR_TYPEFLAG_EXISTS = 1;
+float CVAR_TYPEFLAG_SAVED = 2;
+float CVAR_TYPEFLAG_PRIVATE = 4;
+float CVAR_TYPEFLAG_ENGINE = 8;
+float CVAR_TYPEFLAG_HASDESCRIPTION = 16;
+=================
+*/
+void VM_cvar_type (void)
+{
+ char string[VM_STRINGTEMP_LENGTH];
+ cvar_t *cvar;
+ int ret;
+
+ VM_SAFEPARMCOUNTRANGE(1,8,VM_cvar);
+ VM_VarString(0, string, sizeof(string));
+ VM_CheckEmptyString(string);
+ cvar = Cvar_FindVar(string);
+
+
+ if(!cvar)
+ {
+ PRVM_G_FLOAT(OFS_RETURN) = 0;
+ return; // CVAR_TYPE_NONE
+ }
+
+ ret = 1; // CVAR_EXISTS
+ if(cvar->flags & CVAR_SAVE)
+ ret |= 2; // CVAR_TYPE_SAVED
+ if(cvar->flags & CVAR_PRIVATE)
+ ret |= 4; // CVAR_TYPE_PRIVATE
+ if(!(cvar->flags & CVAR_ALLOCATED))
+ ret |= 8; // CVAR_TYPE_ENGINE
+ if(strcmp(cvar->description, "custom cvar")) // has to match Cvar_Get's placeholder string
+ ret |= 16; // CVAR_TYPE_HASDESCRIPTION
+
+ PRVM_G_FLOAT(OFS_RETURN) = ret;
+}
+
/*
=================
VM_cvar_string
parseentitydata(entity ent, string data)
float mod(float val, float m)
const string cvar_string (string)
+float cvar_type (string)
crash()
stackdump()
void VM_localcmd (void);
void VM_cvar (void);
void VM_cvar_string(void);
+void VM_cvar_type (void);
void VM_cvar_defstring (void);
void VM_cvar_set (void);
void VM_dprint (void);
"DP_QC_CHANGEPITCH "
"DP_QC_COPYENTITY "
"DP_QC_CVAR_DEFSTRING "
+"DP_QC_CVAR_TYPE "
"DP_QC_CVAR_STRING "
"DP_QC_ETOS "
"DP_QC_FINDCHAIN "
NULL, // #492
NULL, // #493
VM_crc16, // #494 float(float caseinsensitive, string s, ...) crc16 = #494 (DP_QC_CRC16)
-NULL, // #495
+VM_cvar_type, // #495 float(string name) cvar_type = #495; (DP_QC_CVAR_TYPE)
NULL, // #496
NULL, // #497
NULL, // #498
qboolean vid_supportrefreshrate = false;
cvar_t joy_detected = {CVAR_READONLY, "joy_detected", "0", "number of joysticks detected by engine"};
-cvar_t joy_enable = {0, "joy_enable", "1", "enables joystick support"};
+cvar_t joy_enable = {CVAR_SAVE, "joy_enable", "0", "enables joystick support"};
cvar_t joy_index = {0, "joy_index", "0", "selects which joystick to use if you have multiple"};
cvar_t joy_axisforward = {0, "joy_axisforward", "1", "which joystick axis to query for forward/backward movement"};
cvar_t joy_axisside = {0, "joy_axisside", "0", "which joystick axis to query for right/left movement"};