]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Declare more ints as ints
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 24 Jan 2015 11:01:58 +0000 (22:01 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 24 Jan 2015 11:01:58 +0000 (22:01 +1100)
qcsrc/client/hud.qc
qcsrc/client/hud.qh
qcsrc/client/teamradar.qc
qcsrc/client/teamradar.qh
qcsrc/client/waypointsprites.qc
qcsrc/common/mapinfo.qh
qcsrc/common/monsters/monsters.qc

index 9e240048f01b7d4d9afe7d802a47af7b555390cd..308665dc43191a6d4dc95c3162ada1964fa0660b 100644 (file)
@@ -4476,7 +4476,7 @@ void HUD_Reset (void)
 
 void HUD_Main (void)
 {
-       float i;
+       int i;
        // global hud theAlpha fade
        if(menu_enabled == 1)
                hud_fade_alpha = 1;
index eb960a29cedf08c947e8f6cd4a0074cac10b87c1..23eed8f1e6bd4afa6847ee1e2e50780df42ecfa0 100644 (file)
@@ -1,10 +1,10 @@
-const float HUD_PANEL_MAX = 24;
+const int HUD_PANEL_MAX = 24;
 entity hud_panel[HUD_PANEL_MAX];
-const float HUD_PANEL_FIRST = 0;
-float HUD_PANEL_NUM;
-float HUD_PANEL_LAST;
+const int HUD_PANEL_FIRST = 0;
+int HUD_PANEL_NUM;
+int HUD_PANEL_LAST;
 
-float panel_order[HUD_PANEL_MAX];
+int panel_order[HUD_PANEL_MAX];
 string hud_panelorder_prev;
 
 float hud_draw_maximized;
@@ -21,15 +21,15 @@ float highlightedAction; // 0 = nothing, 1 = move, 2 = resize
 
 const float BORDER_MULTIPLIER = 0.25;
 float scoreboard_bottom;
-float weapon_accuracy[WEP_MAXCOUNT];
+int weapon_accuracy[WEP_MAXCOUNT];
 
 float complain_weapon;
 string complain_weapon_name;
 float complain_weapon_type;
 float complain_weapon_time;
 
-float ps_primary, ps_secondary;
-float ts_primary, ts_secondary;
+int ps_primary, ps_secondary;
+int ts_primary, ts_secondary;
 
 float last_switchweapon;
 float last_activeweapon;
@@ -43,10 +43,10 @@ float hud_configure_prev;
 vector hud_configure_gridSize;
 vector hud_configure_realGridSize;
 
-float hudShiftState;
-const float S_SHIFT = 1;
-const float S_CTRL = 2;
-const float S_ALT = 4;
+int hudShiftState;
+const int S_SHIFT = 1;
+const int S_CTRL = 2;
+const int S_ALT = 4;
 
 float menu_enabled; // 1 showing the entire HUD, 2 showing only the clicked panel
 
@@ -65,7 +65,7 @@ var vector panel_size_copied;
 
 entity panel;
 .string panel_name;
-.float panel_id;
+.int panel_id;
 .vector current_panel_pos;
 .vector current_panel_size;
 .string current_panel_bg;
@@ -118,7 +118,7 @@ float current_player;
        HUD_PANEL(BUFFS        , HUD_Buffs        , buffs) 
 
 #define HUD_PANEL(NAME,draw_func,name) \
-       float HUD_PANEL_##NAME; \
+       int HUD_PANEL_##NAME; \
        void draw_func(void); \
        void RegisterHUD_Panel_##NAME() \
        { \
@@ -341,8 +341,8 @@ HUD_Panel_GetBorder() \
 const float NOTIFY_MAX_ENTRIES = 10;
 const float NOTIFY_ICON_MARGIN = 0.02;
 
-float notify_index;
-float notify_count;
+int notify_index;
+int notify_count;
 float notify_times[NOTIFY_MAX_ENTRIES];
 string notify_attackers[NOTIFY_MAX_ENTRIES];
 string notify_victims[NOTIFY_MAX_ENTRIES];
index c4078a6af455572a44b4bc7a0ca6d111305e9c10..5bb3f45a5f7fc725bae06ef0cb64c0937a353ce9 100644 (file)
@@ -144,7 +144,7 @@ void draw_teamradar_icon(vector coord, float icon, entity pingdata, vector rgb,
        }
 }
 
-void draw_teamradar_link(vector start, vector end, float colors)
+void draw_teamradar_link(vector start, vector end, int colors)
 {
        vector c0, c1, norm;
 
@@ -202,8 +202,7 @@ void teamradar_loadcvars()
 
 void Ent_RadarLink()
 {
-       float sendflags;
-       sendflags = ReadByte();
+       int sendflags = ReadByte();
 
        InterpolateOrigin_Undo();
 
index 35ae44385b2fecdbb35b1cd0be4352026ba1a025..dfa92ef1c8bd8a689d514838946e19b6ce27d3b3 100644 (file)
@@ -3,5 +3,5 @@ const float MAX_TEAMRADAR_TIMES = 32;
 // to make entities have dots on the team radar
 .float teamradar_icon;
 .float teamradar_times[MAX_TEAMRADAR_TIMES];
-.float teamradar_time_index;
+.int teamradar_time_index;
 .vector teamradar_color;
index 2df3dd411bc6d9f4da76ef4124a81fa51658c8fc..ae6fcffcc954ec49077f17f1bee709aa7fb0c970 100644 (file)
@@ -31,7 +31,7 @@ float waypointsprite_alpha;
 .float lifetime;
 .float fadetime;
 .float maxdistance;
-.float hideflags;
+.int hideflags;
 .float spawntime;
 .float health;
 .float build_started;
@@ -614,7 +614,7 @@ void Ent_RemoveWaypointSprite()
 
 void Ent_WaypointSprite()
 {
-       float sendflags, f, t;
+       int sendflags, f, t;
        sendflags = ReadByte();
 
        if(!self.spawntime)
index bbcc267b2bdbf5d05005155768419c357516e84c..8bd0871e247208a720d2431a74eb6f36e8c7fd5f 100644 (file)
@@ -12,8 +12,8 @@ entity MapInfo_Type_last;
 .string gametype_description; // game type description
 
 #define REGISTER_GAMETYPE(hname,sname,g_name,NAME,gteamplay,defaults,gdescription) \
-       var float MAPINFO_TYPE_##NAME; \
-       var entity MapInfo_Type##g_name; \
+       int MAPINFO_TYPE_##NAME; \
+       entity MapInfo_Type##g_name; \
        void RegisterGametypes_##g_name() \
        { \
                MAPINFO_TYPE_##NAME = MAPINFO_TYPE_ALL + 1; \
@@ -82,15 +82,15 @@ REGISTER_GAMETYPE(_("Keepaway"),ka,g_keepaway,KEEPAWAY,TRUE,"timelimit=20 pointl
 REGISTER_GAMETYPE(_("Invasion"),inv,g_invasion,INVASION,FALSE,"pointlimit=50 teams=0",_("Survive against waves of monsters"));
 #define g_invasion IS_GAMETYPE(INVASION)
 
-const float MAPINFO_FEATURE_WEAPONS       = 1; // not defined for instagib-only maps
-const float MAPINFO_FEATURE_VEHICLES      = 2;
-const float MAPINFO_FEATURE_TURRETS       = 4;
-const float MAPINFO_FEATURE_MONSTERS      = 8;
+const int MAPINFO_FEATURE_WEAPONS       = 1; // not defined for instagib-only maps
+const int MAPINFO_FEATURE_VEHICLES      = 2;
+const int MAPINFO_FEATURE_TURRETS       = 4;
+const int MAPINFO_FEATURE_MONSTERS      = 8;
 
-const float MAPINFO_FLAG_HIDDEN           = 1; // not in lsmaps/menu/vcall/etc., can just be changed to manually
-const float MAPINFO_FLAG_FORBIDDEN        = 2; // don't even allow the map by a cvar setting that allows hidden maps
-const float MAPINFO_FLAG_FRUSTRATING      = 4; // this map is near impossible to play, enable at your own risk
-const float MAPINFO_FLAG_NOAUTOMAPLIST    = 8; // do not include when automatically building maplist (counts as hidden for maplist building purposes)
+const int MAPINFO_FLAG_HIDDEN           = 1; // not in lsmaps/menu/vcall/etc., can just be changed to manually
+const int MAPINFO_FLAG_FORBIDDEN        = 2; // don't even allow the map by a cvar setting that allows hidden maps
+const int MAPINFO_FLAG_FRUSTRATING      = 4; // this map is near impossible to play, enable at your own risk
+const int MAPINFO_FLAG_NOAUTOMAPLIST    = 8; // do not include when automatically building maplist (counts as hidden for maplist building purposes)
 
 float MapInfo_count;
 
@@ -102,9 +102,9 @@ string MapInfo_Map_description;
 string MapInfo_Map_author;
 string MapInfo_Map_clientstuff; // not in cache, only for map load
 string MapInfo_Map_fog; // not in cache, only for map load
-float MapInfo_Map_supportedGametypes;
-float MapInfo_Map_supportedFeatures;
-float MapInfo_Map_flags;
+int MapInfo_Map_supportedGametypes;
+int MapInfo_Map_supportedFeatures;
+int MapInfo_Map_flags;
 vector MapInfo_Map_mins; // these are '0 0 0' if not supported!
 vector MapInfo_Map_maxs; // these are '0 0 0' if not specified!
 
@@ -115,8 +115,8 @@ void MapInfo_Enumerate();
 // filter the info by game type mask (updates MapInfo_count)
 float MapInfo_progress;
 float MapInfo_FilterGametype(float gametype, float features, float pFlagsRequired, float pFlagsForbidden, float pAbortOnGenerate); // 1 on success, 0 on temporary failure (call it again next frame then; use MapInfo_progress as progress indicator)
-float MapInfo_CurrentFeatures(); // retrieves currently required features from cvars
-float MapInfo_CurrentGametype(); // retrieves current gametype from cvars
+int MapInfo_CurrentFeatures(); // retrieves currently required features from cvars
+int MapInfo_CurrentGametype(); // retrieves current gametype from cvars
 float MapInfo_ForbiddenFlags(); // retrieves current flags from cvars
 float MapInfo_RequiredFlags(); // retrieves current flags from cvars
 
index 67e176cf26395b6001ca42c7090fbade0bf5040d..1b1036f2b450c9a24bc463fbe383b2b03205e24a 100644 (file)
@@ -4,7 +4,7 @@
 entity monster_info[MON_MAXCOUNT];
 entity dummy_monster_info;
 
-void register_monster(float id, float(float) func, float monsterflags, vector min_s, vector max_s, string modelname, string shortname, string mname)
+void register_monster(int id, float(float) func, float monsterflags, vector min_s, vector max_s, string modelname, string shortname, string mname)
 {
        entity e;
        monster_info[id - 1] = e = spawn();
@@ -33,7 +33,7 @@ void register_monsters_done()
        dummy_monster_info.maxs = '0 0 0';
        dummy_monster_info.model = "";
 }
-entity get_monsterinfo(float id)
+entity get_monsterinfo(int id)
 {
        entity m;
        if(id < MON_FIRST || id > MON_LAST)