]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cvar.h
common: Wrap ContainerOf around parentheses to allow direct struct access
[xonotic/darkplaces.git] / cvar.h
diff --git a/cvar.h b/cvar.h
index e7234b1713b1e6da34a7dce12e2989ddb7eaf8e8..186d1677dd94a6b5a75d8ed0ebb7c6b03b43c96c 100644 (file)
--- a/cvar.h
+++ b/cvar.h
@@ -80,41 +80,6 @@ interface from being ambiguous.
 #define CVAR_DEFAULTSET (1<<30)
 #define CVAR_ALLOCATED (1<<31)
 
-/*
-// type of a cvar for menu purposes
-#define CVARMENUTYPE_FLOAT 1
-#define CVARMENUTYPE_INTEGER 2
-#define CVARMENUTYPE_SLIDER 3
-#define CVARMENUTYPE_BOOL 4
-#define CVARMENUTYPE_STRING 5
-#define CVARMENUTYPE_OPTION 6
-
-// which menu to put a cvar in
-#define CVARMENU_GRAPHICS 1
-#define CVARMENU_SOUND 2
-#define CVARMENU_INPUT 3
-#define CVARMENU_NETWORK 4
-#define CVARMENU_SERVER 5
-
-#define MAX_CVAROPTIONS 16
-
-typedef struct cvaroption_s
-{
-       int value;
-       const char *name;
-}
-cvaroption_t;
-
-typedef struct menucvar_s
-{
-       int type;
-       float valuemin, valuemax, valuestep;
-       int numoptions;
-       cvaroption_t optionlist[MAX_CVAROPTIONS];
-}
-menucvar_t;
-*/
-
 typedef struct cvar_s
 {
        int flags;
@@ -129,7 +94,7 @@ typedef struct cvar_s
 
        const char *defstring;
 
-       void (*callback)(char *value);
+       void (*callback)(struct cvar_s *var);
        qboolean ignore_callback;
 
        char **aliases;
@@ -148,7 +113,6 @@ typedef struct cvar_s
        int globaldefindex[3];
        int globaldefindex_stringno[3];
 
-       //menucvar_t menuinfo;
        struct cvar_s *next;
 } cvar_t;
 
@@ -168,19 +132,9 @@ cvar_state_t;
 extern cvar_state_t cvars_all;
 extern cvar_state_t cvars_null; // used by cmd_serverfromclient which intentionally has no cvars available
 
-/*
-void Cvar_MenuSlider(cvar_t *variable, int menu, float slider_min, float slider_max, float slider_step);
-void Cvar_MenuBool(cvar_t *variable, int menu, const char *name_false, const char *name_true);
-void Cvar_MenuFloat(cvar_t *variable, int menu, float range_min, float range_max);
-void Cvar_MenuInteger(cvar_t *variable, int menu, int range_min, int range_max);
-void Cvar_MenuString(cvar_t *variable, int menu);
-void Cvar_MenuOption(cvar_t *variable, int menu, int value[16], const char *name[16]);
-*/
-
-
 void Cvar_RegisterAlias(cvar_t *variable, const char *alias );
 
-void Cvar_RegisterCallback(cvar_t *variable, void (*callback)(char *));
+void Cvar_RegisterCallback(cvar_t *variable, void (*callback)(cvar_t *));
 
 /// registers a cvar that already has the name, string, and optionally the
 /// archive elements set.