]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use the BIT macro
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 6 May 2015 10:55:32 +0000 (20:55 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 25 Oct 2015 22:55:49 +0000 (09:55 +1100)
22 files changed:
qcsrc/client/csqc_constants.qh
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/main.qc
qcsrc/common/animdecide.qh
qcsrc/common/constants.qh
qcsrc/common/csqcmodel_settings.qh
qcsrc/common/weapons/weapon/arc.qc
qcsrc/lib/csqcmodel/common.qh
qcsrc/lib/csqcmodel/interpolate.qh
qcsrc/server/bot/bot.qh
qcsrc/server/bot/scripting.qc
qcsrc/server/bot/waypoints.qh
qcsrc/server/command/vote.qc
qcsrc/server/constants.qh
qcsrc/server/defs.qh
qcsrc/server/g_hook.qh
qcsrc/server/g_models.qc
qcsrc/server/item_key.qc
qcsrc/server/miscfunctions.qh
qcsrc/server/mutators/mutator/mutator_superspec.qc
qcsrc/server/pathlib/pathlib.qh
qcsrc/server/t_items.qh

index 584f001f88ad0b9763658c1fce02d4eaed3006e3..d70de9cb3ff3c2720d9a0c26dab47293bde2d8e0 100644 (file)
@@ -2,16 +2,16 @@
 #define CLIENT_CSQC_CONSTANTS
 
 // Mask Constants (set .drawmask on entities; use R_AddEntities to add all entities based on mask)
-const int              MASK_ENGINE                                             = 1;
-const int              MASK_ENGINEVIEWMODELS                   = 2;
-const int              MASK_NORMAL                                             = 4;
+const int              MASK_ENGINE                                             = BIT(0);
+const int              MASK_ENGINEVIEWMODELS                   = BIT(1);
+const int              MASK_NORMAL                                             = BIT(2);
 
 // Renderflag Constants (used for CSQC entities)
-const int              RF_VIEWMODEL                                    = 1;
-const int              RF_EXTERNALMODEL                                = 2;
-const int              RF_DEPTHHACK                                    = 4;
-const int              RF_ADDITIVE                                             = 8;
-const int              RF_USEAXIS                                              = 16;
+const int              RF_VIEWMODEL                                    = BIT(0);
+const int              RF_EXTERNALMODEL                                = BIT(1);
+const int              RF_DEPTHHACK                                    = BIT(2);
+const int              RF_ADDITIVE                                             = BIT(3);
+const int              RF_USEAXIS                                              = BIT(4);
 
 // Viewflag Constants (use with R_SetView)
 const int              VF_MIN                                                  = 1;    //(vector)
@@ -59,21 +59,21 @@ const vector        VEC_HULL_MIN                                    = '-16 -16 -24';
 const vector   VEC_HULL_MAX                                    = '16 16 32';
 
 // Effect Constants
-const int      EF_NODRAW                                               = 16;
-const int      EF_ADDITIVE                                             = 32;
-const int      EF_BLUE                                                 = 64;
-const int      EF_RED                                                  = 128;
-const int      EF_FULLBRIGHT                                   = 512;
-const int      EF_FLAME                                                = 1024;
-const int      EF_STARDUST                                             = 2048;
-const int      EF_NOSHADOW                                             = 4096;
-const int      EF_NODEPTHTEST                                  = 8192;
+const int      EF_NODRAW                                               = BIT(4);
+const int      EF_ADDITIVE                                             = BIT(5);
+const int      EF_BLUE                                                 = BIT(6);
+const int      EF_RED                                                  = BIT(7);
+const int      EF_FULLBRIGHT                                   = BIT(9);
+const int      EF_FLAME                                                = BIT(10);
+const int      EF_STARDUST                                             = BIT(11);
+const int      EF_NOSHADOW                                             = BIT(12);
+const int      EF_NODEPTHTEST                                  = BIT(13);
 
 // Quake Player Flag Constants
-const int      PFL_ONGROUND                                    = 1;
-const int      PFL_CROUCH                                              = 2;
-const int      PFL_DEAD                                                = 4;
-const int      PFL_GIBBED                                              = 8;
+const int      PFL_ONGROUND                                    = BIT(0);
+const int      PFL_CROUCH                                              = BIT(1);
+const int      PFL_DEAD                                                = BIT(2);
+const int      PFL_GIBBED                                              = BIT(3);
 
 // Quake Temporary Entity Constants
 const int              TE_SPIKE                                                = 0;
@@ -104,25 +104,25 @@ const int         FILE_APPEND                                             = 1;
 const int              FILE_WRITE                                              = 2;
 
 // Button values used by input_buttons
-const int BUTTON_ATTACK = 1;
-const int BUTTON_JUMP = 2;
-const int BUTTON_3 = 4;
-const int BUTTON_4 = 8;
-const int BUTTON_5 = 16;
-const int BUTTON_6 = 32;
-const int BUTTON7 = 64;
-const int BUTTON8 = 128;
-const int BUTTON_USE = 256;
-const int BUTTON_CHAT = 512;
-const int BUTTON_PRYDONCURSOR = 1024;
-const int BUTTON_9 = 2048;
-const int BUTTON_10 = 4096;
-const int BUTTON_11 = 8192;
-const int BUTTON_12 = 16384;
-const int BUTTON_13 = 32768;
-const int BUTTON_14 = 65536;
-const int BUTTON_15 = 131072;
-const int BUTTON_16 = 262144;
+const int BUTTON_ATTACK = BIT(0);
+const int BUTTON_JUMP = BIT(1);
+const int BUTTON_3 = BIT(2);
+const int BUTTON_4 = BIT(3);
+const int BUTTON_5 = BIT(4);
+const int BUTTON_6 = BIT(5);
+const int BUTTON7 = BIT(6);
+const int BUTTON8 = BIT(7);
+const int BUTTON_USE = BIT(8);
+const int BUTTON_CHAT = BIT(9);
+const int BUTTON_PRYDONCURSOR = BIT(10);
+const int BUTTON_9 = BIT(11);
+const int BUTTON_10 = BIT(12);
+const int BUTTON_11 = BIT(13);
+const int BUTTON_12 = BIT(14);
+const int BUTTON_13 = BIT(15);
+const int BUTTON_14 = BIT(16);
+const int BUTTON_15 = BIT(17);
+const int BUTTON_16 = BIT(18);
 
 const int SOLID_NOT            = 0; // no interaction with other objects
 const int SOLID_TRIGGER        = 1; // touch on edge, but not blocking
@@ -140,6 +140,6 @@ const int MOVE_WORLDONLY = 3;
 const int CAMERA_FREE = 1;
 const int CAMERA_CHASE = 2;
 
-const int EF_NOMODELFLAGS = 8388608;
+const int EF_NOMODELFLAGS = BIT(23);
 
 #endif
index 6e7e5a8de77444946bec59756357d218a838975c..e2e0e9341ac4a0e5741a085cd69d821e7f7111a9 100644 (file)
@@ -462,22 +462,22 @@ void CSQCModel_AutoTagIndex_Apply(void)
 }
 
 // FEATURE: EF_NODRAW workalike
-const int EF_BRIGHTFIELD       = 1;
-const int EF_BRIGHTLIGHT       = 4;
-const int EF_DIMLIGHT          = 8;
-const int EF_DOUBLESIDED       = 32768;
-const int EF_NOSELFSHADOW      = 65536;
-const int EF_DYNAMICMODELLIGHT = 131072;
-const int EF_RESTARTANIM_BIT = 1048576;
-const int EF_TELEPORT_BIT = 2097152;
-const int MF_ROCKET  =   1; // leave a trail
-const int MF_GRENADE =   2; // leave a trail
-const int MF_GIB     =   4; // leave a trail
-const int MF_ROTATE  =   8; // rotate (bonus items)
-const int MF_TRACER  =  16; // green split trail
-const int MF_ZOMGIB  =  32; // small blood trail
-const int MF_TRACER2 =  64; // orange split trail
-const int MF_TRACER3 = 128; // purple trail
+const int EF_BRIGHTFIELD       = BIT(0);
+const int EF_BRIGHTLIGHT       = BIT(2);
+const int EF_DIMLIGHT          = BIT(3);
+const int EF_DOUBLESIDED       = BIT(15);
+const int EF_NOSELFSHADOW      = BIT(16);
+const int EF_DYNAMICMODELLIGHT = BIT(17);
+const int EF_RESTARTANIM_BIT = BIT(20);
+const int EF_TELEPORT_BIT = BIT(21);
+const int MF_ROCKET  =  BIT(0); // leave a trail
+const int MF_GRENADE =  BIT(1); // leave a trail
+const int MF_GIB     =  BIT(2); // leave a trail
+const int MF_ROTATE  =  BIT(3); // rotate (bonus items)
+const int MF_TRACER  =  BIT(4); // green split trail
+const int MF_ZOMGIB  =  BIT(5); // small blood trail
+const int MF_TRACER2 =  BIT(6); // orange split trail
+const int MF_TRACER3 = BIT(7); // purple trail
 .int csqcmodel_effects;
 .int csqcmodel_modelflags;
 .int csqcmodel_traileffect;
index bcbe32bb9e6b189a90db26599f47aa1343a8ccdf..d43c0bbbef658585503674777cefd73204bcfc8f 100644 (file)
@@ -558,7 +558,7 @@ void Ent_Nagger()
 
     int nags = ReadByte(); // NAGS NAGS NAGS NAGS NAGS NAGS NADZ NAGS NAGS NAGS
 
-       if(!(nags & 4))
+       if(!(nags & BIT(2)))
        {
                if(vote_called_vote)
                        strunzone(vote_called_vote);
@@ -570,7 +570,7 @@ void Ent_Nagger()
                vote_active = 1;
        }
 
-       if(nags & 64)
+       if(nags & BIT(6))
        {
                vote_yescount = ReadByte();
                vote_nocount = ReadByte();
@@ -578,7 +578,7 @@ void Ent_Nagger()
                vote_highlighted = ReadChar();
        }
 
-       if(nags & 128)
+       if(nags & BIT(7))
        {
                if(vote_called_vote)
                        strunzone(vote_called_vote);
@@ -600,11 +600,11 @@ void Ent_Nagger()
                }
        }
 
-       ready_waiting = (nags & 1);
-       ready_waiting_for_me = (nags & 2);
-       vote_waiting = (nags & 4);
-       vote_waiting_for_me = (nags & 8);
-       warmup_stage = (nags & 16);
+       ready_waiting = (nags & BIT(0));
+       ready_waiting_for_me = (nags & BIT(1));
+       vote_waiting = (nags & BIT(2));
+       vote_waiting_for_me = (nags & BIT(3));
+       warmup_stage = (nags & BIT(4));
 }
 
 void Ent_EliminatedPlayers()
index d122b6a36288c9b2d43eb083e980881af537dcd1..521c6ab989b906649bf774b55ca840cb8416de1b 100644 (file)
@@ -62,19 +62,19 @@ void animdecide_setframes(entity e, bool support_blending, .int fld_frame, .int
 
 // explicit anim states (networked)
 void animdecide_setstate(entity e, int newstate, float restart);
-const int ANIMSTATE_DEAD1 = 1; // base frames: die1
-const int ANIMSTATE_DEAD2 = 2; // base frames: die2
-const int ANIMSTATE_DUCK = 4; // turns walk into duckwalk, jump into duckjump, etc.
-const int ANIMSTATE_FROZEN = 8; // force idle
-const int ANIMSTATE_FOLLOW = 16; // also force idle
+const int ANIMSTATE_DEAD1 = BIT(0); // base frames: die1
+const int ANIMSTATE_DEAD2 = BIT(1); // base frames: die2
+const int ANIMSTATE_DUCK = BIT(2); // turns walk into duckwalk, jump into duckjump, etc.
+const int ANIMSTATE_FROZEN = BIT(3); // force idle
+const int ANIMSTATE_FOLLOW = BIT(4); // also force idle
 
 // implicit anim states (inferred from velocity, etc.)
-const int ANIMIMPLICITSTATE_INAIR = 1;
-const int ANIMIMPLICITSTATE_FORWARD = 2;
-const int ANIMIMPLICITSTATE_BACKWARDS = 4;
-const int ANIMIMPLICITSTATE_LEFT = 8;
-const int ANIMIMPLICITSTATE_RIGHT = 16;
-const int ANIMIMPLICITSTATE_JUMPRELEASED = 32;
+const int ANIMIMPLICITSTATE_INAIR = BIT(0);
+const int ANIMIMPLICITSTATE_FORWARD = BIT(1);
+const int ANIMIMPLICITSTATE_BACKWARDS = BIT(2);
+const int ANIMIMPLICITSTATE_LEFT = BIT(3);
+const int ANIMIMPLICITSTATE_RIGHT = BIT(4);
+const int ANIMIMPLICITSTATE_JUMPRELEASED = BIT(5);
 
 // explicit actions (networked); negative values are for lower body
 void animdecide_setaction(entity e, float action, float restart);
index a4329ad44553606563046f207ec3666ab1471d81..254246bdff54a896477a214d96686f5dd4ffb9ce 100644 (file)
@@ -136,14 +136,14 @@ const int SPRITERULE_SPECTATOR = 2;
 
 ///////////////////////////
 // keys pressed
-const int KEY_FORWARD = 1;
-const int KEY_BACKWARD = 2;
-const int KEY_LEFT = 4;
-const int KEY_RIGHT = 8;
-const int KEY_JUMP = 16;
-const int KEY_CROUCH = 32;
-const int KEY_ATCK = 64;
-const int KEY_ATCK2 = 128;
+const int KEY_FORWARD = BIT(0);
+const int KEY_BACKWARD = BIT(1);
+const int KEY_LEFT = BIT(2);
+const int KEY_RIGHT = BIT(3);
+const int KEY_JUMP = BIT(4);
+const int KEY_CROUCH = BIT(5);
+const int KEY_ATCK = BIT(6);
+const int KEY_ATCK2 = BIT(7);
 
 ///////////////////////////
 // cvar constants
@@ -169,27 +169,27 @@ const int MAPVOTE_COUNT = 30;
 /**
  * Lower scores are better (e.g. suicides)
  */
-const int SFL_LOWER_IS_BETTER = 1;
+const int SFL_LOWER_IS_BETTER = BIT(0);
 
 /**
  * Don't show zero values as scores
  */
-const int SFL_HIDE_ZERO = 2;
+const int SFL_HIDE_ZERO = BIT(1);
 
 /**
  * Allow a column to be hidden (do not automatically add it even if it is a sorting key)
  */
-const int SFL_ALLOW_HIDE = 16;
+const int SFL_ALLOW_HIDE = BIT(4);
 
 /**
  * Display as a rank (with st, nd, rd, th suffix)
  */
-const int SFL_RANK = 32;
+const int SFL_RANK = BIT(5);
 
 /**
  * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)
  */
-const int SFL_TIME = 64;
+const int SFL_TIME = BIT(6);
 
 // not an extra constant yet
 #define SFL_ZERO_IS_WORST SFL_TIME
index 256142759d622b44fd4baa21ddb0d5537120fb49..eacc1947e1be0e9a29edbd48b30717db47701594 100644 (file)
 
 // add properties you want networked to CSQC here
 #define CSQCMODEL_EXTRAPROPERTIES \
-       CSQCMODEL_PROPERTY(1, int, ReadShort, WriteShort, colormap) \
-       CSQCMODEL_PROPERTY(2, int, ReadInt24_t, WriteInt24_t, effects) \
-       CSQCMODEL_PROPERTY(4, int, ReadByte, WriteByte, modelflags) \
-       CSQCMODEL_PROPERTY_SCALED(8, float, ReadByte, WriteByte, alpha, 254, -1, 254) \
-       CSQCMODEL_PROPERTY(16, int, ReadByte, WriteByte, skin) \
-       CSQCMODEL_PROPERTY(32, float, ReadApproxPastTime, WriteApproxPastTime, death_time) \
-       CSQCMODEL_PROPERTY(64, float, ReadByte, WriteByte, solid) \
+       CSQCMODEL_PROPERTY(BIT(0), int, ReadShort, WriteShort, colormap) \
+       CSQCMODEL_PROPERTY(BIT(1), int, ReadInt24_t, WriteInt24_t, effects) \
+       CSQCMODEL_PROPERTY(BIT(2), int, ReadByte, WriteByte, modelflags) \
+       CSQCMODEL_PROPERTY_SCALED(BIT(3), float, ReadByte, WriteByte, alpha, 254, -1, 254) \
+       CSQCMODEL_PROPERTY(BIT(4), int, ReadByte, WriteByte, skin) \
+       CSQCMODEL_PROPERTY(BIT(5), float, ReadApproxPastTime, WriteApproxPastTime, death_time) \
+       CSQCMODEL_PROPERTY(BIT(6), float, ReadByte, WriteByte, solid) \
        CSQCMODEL_IF(!isplayer) \
-               CSQCMODEL_PROPERTY(128, TAG_ENTITY_TYPE, ReadShort, WriteEntity, TAG_ENTITY_NAME) \
-               CSQCMODEL_PROPERTY_SCALED(256, float, ReadByte, WriteByte, glowmod_x, 254, -1, 254) \
-               CSQCMODEL_PROPERTY_SCALED(256, float, ReadByte, WriteByte, glowmod_y, 254, -1, 254) \
-               CSQCMODEL_PROPERTY_SCALED(256, float, ReadByte, WriteByte, glowmod_z, 254, -1, 254) \
-               CSQCMODEL_PROPERTY_SCALED(256, float, ReadByte, WriteByte, colormod_x, 254, -1, 254) \
-               CSQCMODEL_PROPERTY_SCALED(256, float, ReadByte, WriteByte, colormod_y, 254, -1, 254) \
-               CSQCMODEL_PROPERTY_SCALED(256, float, ReadByte, WriteByte, colormod_z, 254, -1, 254) \
+               CSQCMODEL_PROPERTY(BIT(7), TAG_ENTITY_TYPE, ReadShort, WriteEntity, TAG_ENTITY_NAME) \
+               CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, glowmod_x, 254, -1, 254) \
+               CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, glowmod_y, 254, -1, 254) \
+               CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, glowmod_z, 254, -1, 254) \
+               CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, colormod_x, 254, -1, 254) \
+               CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, colormod_y, 254, -1, 254) \
+               CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, colormod_z, 254, -1, 254) \
        CSQCMODEL_ENDIF \
        CSQCMODEL_IF(isplayer) \
-               CSQCMODEL_PROPERTY(128, int, ReadByte, WriteByte, anim_state) \
-               CSQCMODEL_PROPERTY(128, float, ReadApproxPastTime, WriteApproxPastTime, anim_time) \
+               CSQCMODEL_PROPERTY(BIT(7), int, ReadByte, WriteByte, anim_state) \
+               CSQCMODEL_PROPERTY(BIT(7), float, ReadApproxPastTime, WriteApproxPastTime, anim_time) \
                CSQCMODEL_IF(!islocalplayer) \
-                       CSQCMODEL_PROPERTY(256, float, ReadChar, WriteChar, anim_lower_action) \
-                       CSQCMODEL_PROPERTY(256, float, ReadApproxPastTime, WriteApproxPastTime, anim_lower_time) \
+                       CSQCMODEL_PROPERTY(BIT(8), float, ReadChar, WriteChar, anim_lower_action) \
+                       CSQCMODEL_PROPERTY(BIT(8), float, ReadApproxPastTime, WriteApproxPastTime, anim_lower_time) \
                CSQCMODEL_ENDIF \
-               CSQCMODEL_PROPERTY(512, float, ReadChar, WriteChar, anim_upper_action) \
-               CSQCMODEL_PROPERTY(512, float, ReadApproxPastTime, WriteApproxPastTime, anim_upper_time) \
+               CSQCMODEL_PROPERTY(BIT(9), float, ReadChar, WriteChar, anim_upper_action) \
+               CSQCMODEL_PROPERTY(BIT(9), float, ReadApproxPastTime, WriteApproxPastTime, anim_upper_time) \
        CSQCMODEL_ENDIF \
-       CSQCMODEL_PROPERTY(1024, float, ReadAngle, WriteAngle, v_angle_x) \
-       CSQCMODEL_PROPERTY(2048, int, ReadByte, WriteByte, traileffect) \
-       CSQCMODEL_PROPERTY_SCALED(4096, float, ReadByte, WriteByte, scale, 16, 0, 255) \
-       CSQCMODEL_PROPERTY(8192, int, ReadInt24_t, WriteInt24_t, dphitcontentsmask) \
-       CSQCMODEL_PROPERTY(16384, TAG_VIEWLOC_TYPE, ReadShort, WriteEntity, TAG_VIEWLOC_NAME)
+       CSQCMODEL_PROPERTY(BIT(10), float, ReadAngle, WriteAngle, v_angle_x) \
+       CSQCMODEL_PROPERTY(BIT(11), int, ReadByte, WriteByte, traileffect) \
+       CSQCMODEL_PROPERTY_SCALED(BIT(12), float, ReadByte, WriteByte, scale, 16, 0, 255) \
+       CSQCMODEL_PROPERTY(BIT(13), int, ReadInt24_t, WriteInt24_t, dphitcontentsmask) \
+       CSQCMODEL_PROPERTY(BIT(14), TAG_VIEWLOC_TYPE, ReadShort, WriteEntity, TAG_VIEWLOC_NAME)
 // TODO get rid of colormod/glowmod here, find good solution for vortex charge glowmod hack; also get rid of some useless properties on non-players that only exist for CopyBody
 
 // add hook function calls here
index 8d8f4c43b47737354e23fe19c897d6916c75cedb..b05132cb1648bfb76efdf2f94a7fdbd1ad0d6bf3 100644 (file)
@@ -74,12 +74,12 @@ const int ARC_BT_BURST_HEAL =  0x12;
 const int ARC_BT_BURST_HIT =   0x13;
 const int ARC_BT_BURSTMASK =   0x10;
 
-const int ARC_SF_SETTINGS =    1;
-const int ARC_SF_START =       2;
-const int ARC_SF_WANTDIR =     4;
-const int ARC_SF_BEAMDIR =     8;
-const int ARC_SF_BEAMTYPE =    16;
-const int ARC_SF_LOCALMASK =   14;
+const int ARC_SF_SETTINGS =    BIT(0);
+const int ARC_SF_START =       BIT(1);
+const int ARC_SF_WANTDIR =     BIT(2);
+const int ARC_SF_BEAMDIR =     BIT(3);
+const int ARC_SF_BEAMTYPE =    BIT(4);
+const int ARC_SF_LOCALMASK =   ARC_SF_START | ARC_SF_WANTDIR | ARC_SF_BEAMDIR;
 #endif
 #ifdef SVQC
 ARC_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
index 884977f9040758a49fecd718411d7cd09aad4168..e922453afec8e6a0458462ffd886e36d61ff8865 100644 (file)
@@ -54,15 +54,15 @@ IN THE SOFTWARE.\
 .float frame2time;
 .float lerpfrac;
 
-const int CSQCMODEL_PROPERTY_FRAME = 8388608;
-const int CSQCMODEL_PROPERTY_TELEPORTED = 4194304; // the "teleport bit" cancelling interpolation
-const int CSQCMODEL_PROPERTY_MODELINDEX = 2097152;
-const int CSQCMODEL_PROPERTY_ORIGIN = 1048576;
-const int CSQCMODEL_PROPERTY_YAW = 524288;
-const int CSQCMODEL_PROPERTY_PITCHROLL = 262144;
-const int CSQCMODEL_PROPERTY_FRAME2 = 131072;
-const int CSQCMODEL_PROPERTY_LERPFRAC = 65536;
-const int CSQCMODEL_PROPERTY_SIZE = 32768;
+const int CSQCMODEL_PROPERTY_FRAME = BIT(23);
+const int CSQCMODEL_PROPERTY_TELEPORTED = BIT(22); // the "teleport bit" cancelling interpolation
+const int CSQCMODEL_PROPERTY_MODELINDEX = BIT(21);
+const int CSQCMODEL_PROPERTY_ORIGIN = BIT(20);
+const int CSQCMODEL_PROPERTY_YAW = BIT(19);
+const int CSQCMODEL_PROPERTY_PITCHROLL = BIT(18);
+const int CSQCMODEL_PROPERTY_FRAME2 = BIT(17);
+const int CSQCMODEL_PROPERTY_LERPFRAC = BIT(BIT(4));
+const int CSQCMODEL_PROPERTY_SIZE = BIT(15);
 
 #define ALLPROPERTIES_COMMON \
        CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_FRAME, int, ReadByte, WriteByte, frame) \
index e07ad4ade809b39cbeadd5740abc046cb7591554..92ec58f0b4ff7048445a0ef2fbb1ffff8dc8815f 100644 (file)
 #define LIB_CSQCMODEL_INTERPOLATE_H
 
 .int iflags;
-const int IFLAG_VELOCITY = 1;
-const int IFLAG_ANGLES = 2;
-const int IFLAG_AUTOANGLES = 4;
-const int IFLAG_VALID = 8;
-const int IFLAG_PREVALID = 16;
-const int IFLAG_TELEPORTED = 32;
-const int IFLAG_AUTOVELOCITY = 64;
-const int IFLAG_V_ANGLE = 128;
-const int IFLAG_V_ANGLE_X = 256;
-const int IFLAG_ORIGIN = 512;
-#define IFLAG_INTERNALMASK (IFLAG_VALID | IFLAG_PREVALID)
+const int IFLAG_VELOCITY = BIT(0);
+const int IFLAG_ANGLES = BIT(1);
+const int IFLAG_AUTOANGLES = BIT(2);
+const int IFLAG_VALID = BIT(3);
+const int IFLAG_PREVALID = BIT(4);
+const int IFLAG_TELEPORTED = BIT(5);
+const int IFLAG_AUTOVELOCITY = BIT(6);
+const int IFLAG_V_ANGLE = BIT(7);
+const int IFLAG_V_ANGLE_X = BIT(8);
+const int IFLAG_ORIGIN = BIT(9);
+const int IFLAG_INTERNALMASK = IFLAG_VALID | IFLAG_PREVALID;
 
 // call this BEFORE reading an entity update
 void InterpolateOrigin_Undo();
index d5a2794008019675759858141e47bdf83ef9e03c..2ae70728a0a78f1c47cb052cec9acb0994abdb76 100644 (file)
@@ -4,18 +4,18 @@
  * Globals and Fields
  */
 
-const int AI_STATUS_ROAMING                                            = 1;    // Bot is just crawling the map. No enemies at sight
-const int AI_STATUS_ATTACKING                                  = 2;    // There are enemies at sight
-const int AI_STATUS_RUNNING                                            = 4;    // Bot is bunny hopping
-const int AI_STATUS_DANGER_AHEAD                               = 8;    // There is lava/slime/trigger_hurt ahead
-const int AI_STATUS_OUT_JUMPPAD                                        = 16;   // Trying to get out of a "vertical" jump pad
-const int AI_STATUS_OUT_WATER                                  = 32;   // Trying to get out of water
-const int AI_STATUS_WAYPOINT_PERSONAL_LINKING  = 64;   // Waiting for the personal waypoint to be linked
-const int AI_STATUS_WAYPOINT_PERSONAL_GOING            = 128;  // Going to a personal waypoint
-const int AI_STATUS_WAYPOINT_PERSONAL_REACHED  = 256;  // Personal waypoint reached
-const int AI_STATUS_JETPACK_FLYING                             = 512;
-const int AI_STATUS_JETPACK_LANDING                            = 1024;
-const int AI_STATUS_STUCK                                              = 2048; // Cannot reach any goal
+const int AI_STATUS_ROAMING                                            = BIT(0);       // Bot is just crawling the map. No enemies at sight
+const int AI_STATUS_ATTACKING                                  = BIT(1);       // There are enemies at sight
+const int AI_STATUS_RUNNING                                            = BIT(2);       // Bot is bunny hopping
+const int AI_STATUS_DANGER_AHEAD                               = BIT(3);       // There is lava/slime/trigger_hurt ahead
+const int AI_STATUS_OUT_JUMPPAD                                        = BIT(4);       // Trying to get out of a "vertical" jump pad
+const int AI_STATUS_OUT_WATER                                  = BIT(5);       // Trying to get out of water
+const int AI_STATUS_WAYPOINT_PERSONAL_LINKING  = BIT(6);       // Waiting for the personal waypoint to be linked
+const int AI_STATUS_WAYPOINT_PERSONAL_GOING            = BIT(7);       // Going to a personal waypoint
+const int AI_STATUS_WAYPOINT_PERSONAL_REACHED  = BIT(8);       // Personal waypoint reached
+const int AI_STATUS_JETPACK_FLYING                             = BIT(9);
+const int AI_STATUS_JETPACK_LANDING                            = BIT(10);
+const int AI_STATUS_STUCK                                              = BIT(11);  // Cannot reach any goal
 
 .float isbot; // true if this client is actually a bot
 .int aistatus;
index c3484e1d4c47e9c4bc1dc7753630dada4104b309..76cda90d90f48dd98b796f31965f46ad4c017bdc 100644 (file)
@@ -815,17 +815,17 @@ float bot_cmd_aimtarget()
 .int bot_cmd_keys;
 
 const int BOT_CMD_KEY_NONE             = 0;
-const int BOT_CMD_KEY_FORWARD  = 1;
-const int BOT_CMD_KEY_BACKWARD         = 2;
-const int BOT_CMD_KEY_RIGHT    = 4;
-const int BOT_CMD_KEY_LEFT             = 8;
-const int BOT_CMD_KEY_JUMP             = 16;
-const int BOT_CMD_KEY_ATTACK1  = 32;
-const int BOT_CMD_KEY_ATTACK2  = 64;
-const int BOT_CMD_KEY_USE              = 128;
-const int BOT_CMD_KEY_HOOK             = 256;
-const int BOT_CMD_KEY_CROUCH   = 512;
-const int BOT_CMD_KEY_CHAT             = 1024;
+const int BOT_CMD_KEY_FORWARD  = BIT(0);
+const int BOT_CMD_KEY_BACKWARD         = BIT(1);
+const int BOT_CMD_KEY_RIGHT    = BIT(2);
+const int BOT_CMD_KEY_LEFT             = BIT(3);
+const int BOT_CMD_KEY_JUMP             = BIT(4);
+const int BOT_CMD_KEY_ATTACK1  = BIT(5);
+const int BOT_CMD_KEY_ATTACK2  = BIT(6);
+const int BOT_CMD_KEY_USE              = BIT(7);
+const int BOT_CMD_KEY_HOOK             = BIT(8);
+const int BOT_CMD_KEY_CROUCH   = BIT(9);
+const int BOT_CMD_KEY_CHAT             = BIT(10);
 
 float bot_presskeys()
 {SELFPARAM();
index fde524bb94821ae89bd4ced22ecebed7e3d47e66..8e0dd0fe627e07c1ecfc689da28454cf8280e8c9 100644 (file)
@@ -4,14 +4,14 @@
  * Globals and Fields
  */
 
-const int WAYPOINTFLAG_GENERATED = 8388608;
-const int WAYPOINTFLAG_ITEM = 4194304;
-const int WAYPOINTFLAG_TELEPORT = 2097152;
-const int WAYPOINTFLAG_NORELINK = 1048576;
-const int WAYPOINTFLAG_PERSONAL = 524288;
-const int WAYPOINTFLAG_PROTECTED = 262144;  // Useless WP detection never kills these.
-const int WAYPOINTFLAG_USEFUL = 131072;  // Useless WP detection temporary flag.
-const int WAYPOINTFLAG_DEAD_END = 65536;  // Useless WP detection temporary flag.
+const int WAYPOINTFLAG_GENERATED = BIT(23);
+const int WAYPOINTFLAG_ITEM = BIT(22);
+const int WAYPOINTFLAG_TELEPORT = BIT(21);
+const int WAYPOINTFLAG_NORELINK = BIT(20);
+const int WAYPOINTFLAG_PERSONAL = BIT(19);
+const int WAYPOINTFLAG_PROTECTED = BIT(18);  // Useless WP detection never kills these.
+const int WAYPOINTFLAG_USEFUL = BIT(17);  // Useless WP detection temporary flag.
+const int WAYPOINTFLAG_DEAD_END = BIT(16);  // Useless WP detection temporary flag.
 
 // fields you can query using prvm_global server to get some statistics about waypoint linking culling
 float relink_total, relink_walkculled, relink_pvsculled, relink_lengthculled;
index 77c0a35600dd12cee1428f7ae7ec8f53e3f3767b..da9be11ff69c9ed53f4abc0505393532b4e6f028 100644 (file)
@@ -42,31 +42,31 @@ bool Nagger_SendEntity(entity this, entity to, float sendflags)
        nags = 0;
        if(readycount)
        {
-               nags |= 1;
+               nags |= BIT(0);
                if(to.ready == 0)
-                       nags |= 2;
+                       nags |= BIT(1);
        }
        if(vote_called)
        {
-               nags |= 4;
+               nags |= BIT(2);
                if(to.vote_selection == 0)
-                       nags |= 8;
+                       nags |= BIT(3);
        }
        if(warmup_stage)
-               nags |= 16;
+               nags |= BIT(4);
 
-       if(sendflags & 64)
-               nags |= 64;
+       if(sendflags & BIT(6))
+               nags |= BIT(6);
 
-       if(sendflags & 128)
-               nags |= 128;
+       if(sendflags & BIT(7))
+               nags |= BIT(7);
 
        if(!(nags & 4)) // no vote called? send no string
-               nags &= ~(64 | 128);
+               nags &= ~(BIT(6) | BIT(7));
 
        WriteByte(MSG_ENTITY, nags);
 
-       if(nags & 64)
+       if(nags & BIT(6))
        {
                WriteByte(MSG_ENTITY, vote_accept_count);
                WriteByte(MSG_ENTITY, vote_reject_count);
@@ -74,7 +74,7 @@ bool Nagger_SendEntity(entity this, entity to, float sendflags)
                WriteChar(MSG_ENTITY, to.vote_selection);
        }
 
-       if(nags & 128)
+       if(nags & BIT(7))
                WriteString(MSG_ENTITY, vote_called_display);
 
        if(nags & 1)
@@ -99,19 +99,19 @@ void Nagger_Init()
 void Nagger_VoteChanged()
 {
        if(nagger)
-               nagger.SendFlags |= 128;
+               nagger.SendFlags |= BIT(7);
 }
 
 void Nagger_VoteCountChanged()
 {
        if(nagger)
-               nagger.SendFlags |= 64;
+               nagger.SendFlags |= BIT(6);
 }
 
 void Nagger_ReadyCounted()
 {
        if(nagger)
-               nagger.SendFlags |= 1;
+               nagger.SendFlags |= BIT(0);
 }
 
 // If the vote_caller is still here, return their name, otherwise vote_caller_name
index ac6be94dd22b99b375d3906a3303d9e17c78579a..6de55189f1408c220cbba92b0368e61f6bf8890c 100644 (file)
@@ -1,13 +1,13 @@
 #ifndef SERVER_CONSTANTS_H
 #define SERVER_CONSTANTS_H
 
-const int FL_WEAPON = 8192;
-const int FL_POWERUP = 16384;
-const int FL_PROJECTILE = 32768;
-const int FL_TOSSED = 65536;
-const int FL_NO_WEAPON_STAY = 131072;
-const int FL_SPAWNING = 262144;
-const int FL_PICKUPITEMS = 524288;
+const int FL_WEAPON = BIT(13);
+const int FL_POWERUP = BIT(14);
+const int FL_PROJECTILE = BIT(15);
+const int FL_TOSSED = BIT(BIT(4));
+const int FL_NO_WEAPON_STAY = BIT(17);
+const int FL_SPAWNING = BIT(18);
+const int FL_PICKUPITEMS = BIT(19);
 
 const int SVC_SOUND = 6;
 const int SVC_STOPSOUND = 16;
index 463d0bc8f316defbad7d50a356a7107332118a77..4f790014934e7f6186e2810b43171b929623b69e 100644 (file)
@@ -532,17 +532,17 @@ typedef vector(entity player, entity spot, vector current) spawn_evalfunc_t;
 string modname;
 
 .float missile_flags;
-const int MIF_SPLASH = 2;
-const int MIF_ARC = 4;
-const int MIF_PROXY = 8;
-const int MIF_GUIDED_MANUAL = 16;
-const int MIF_GUIDED_HEAT = 32;
-const int MIF_GUIDED_LASER = 64;
-const int MIF_GUIDED_AI = 128;
-const int MIF_GUIDED_TAG = 128;
-#define MIF_GUIDED_ALL (MIF_GUIDED_MANUAL | MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG)
-#define MIF_GUIDED_TRACKING (MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG)
-#define MIF_GUIDED_CONFUSABLE (MIF_GUIDED_HEAT | MIF_GUIDED_AI)
+const int MIF_SPLASH = BIT(1);
+const int MIF_ARC = BIT(2);
+const int MIF_PROXY = BIT(3);
+const int MIF_GUIDED_MANUAL = BIT(4);
+const int MIF_GUIDED_HEAT = BIT(5);
+const int MIF_GUIDED_LASER = BIT(6);
+const int MIF_GUIDED_AI = BIT(7);
+const int MIF_GUIDED_TAG = BIT(7);
+const int MIF_GUIDED_ALL = MIF_GUIDED_MANUAL | MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG;
+const int MIF_GUIDED_TRACKING = MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG;
+const int MIF_GUIDED_CONFUSABLE = MIF_GUIDED_HEAT | MIF_GUIDED_AI;
 
 #define MISSILE_IS_CONFUSABLE(m) ((m.missile_flags & MIF_GUIDED_CONFUSABLE) ? true : false)
 #define MISSILE_IS_GUIDED(m) ((m.missile_flags & MIF_GUIDED_ALL) ? true : false)
index 140a93cfdf02bafe87d983aba29479ee16a94a7c..2a2d566b35670b97a9ace13a126349e2f7e0d80a 100644 (file)
@@ -8,11 +8,11 @@ void SetGrappleHookBindings();
 // (note: you can change the hook impulse #'s to whatever you please)
 .float hook_time;
 
-const float HOOK_FIRING = 1;
-const float HOOK_REMOVING = 2;
-const float HOOK_PULLING = 4;
-const float HOOK_RELEASING = 8;
-const float HOOK_WAITING_FOR_RELEASE = 16;
+const float HOOK_FIRING = BIT(0);
+const float HOOK_REMOVING = BIT(1);
+const float HOOK_PULLING = BIT(2);
+const float HOOK_RELEASING = BIT(3);
+const float HOOK_WAITING_FOR_RELEASE = BIT(4);
 .float hook_state;
 
 void GrappleHookInit();
index 8bc5387367542162947a07b205be9b51b3db38a9..f9f4083e3475786fc617e77e08941bef1bf5055d 100644 (file)
@@ -26,13 +26,13 @@ void g_model_setcolormaptoactivator (void)
        }
        else
                self.colormap = floor(random() * 256);
-       self.colormap |= 1024; // RENDER_COLORMAPPED
+       self.colormap |= BIT(10); // RENDER_COLORMAPPED
 }
 
 void g_clientmodel_setcolormaptoactivator (void)
 {SELFPARAM();
        g_model_setcolormaptoactivator();
-       self.SendFlags |= (8 | 1);
+       self.SendFlags |= (BIT(3) | BIT(0));
 }
 
 void g_clientmodel_use(void)
index 8c5a06b320725657b56f0f54d4d3801c43a68adf..5ab3c8df22626eceb373246a94621684bb2e3ea7 100644 (file)
@@ -167,32 +167,32 @@ spawnfunc(item_key)
 
        // find default netname and colormod
        switch(self.itemkeys) {
-       case 1:
+       case BIT(0):
                _netname = "GOLD key";
                _colormod = '1 .9 0';
                break;
 
-       case 2:
+       case BIT(1):
                _netname = "SILVER key";
                _colormod = '.9 .9 .9';
                break;
 
-       case 4:
+       case BIT(2):
                _netname = "BRONZE key";
                _colormod = '.6 .25 0';
                break;
 
-       case 8:
+       case BIT(3):
                _netname = "RED keycard";
                _colormod = '.9 0 0';
                break;
 
-       case 16:
+       case BIT(4):
                _netname = "BLUE keycard";
                _colormod = '0 0 .9';
                break;
 
-       case 32:
+       case BIT(5):
                _netname = "GREEN keycard";
                _colormod = '0 .9 0';
                break;
index 8d23f511139ea7d6fb956f68ca0c7e4194379a43..3ca3ea67306edc931bfa1206ea2a586cfaa24235 100644 (file)
@@ -425,10 +425,10 @@ void readlevelcvars(void)
 // hack
 float precache_sound_index (string s) = #19;
 
-const float SND_VOLUME = 1;
-const float SND_ATTENUATION = 2;
-const float SND_LARGEENTITY = 8;
-const float SND_LARGESOUND = 16;
+const float SND_VOLUME = BIT(0);
+const float SND_ATTENUATION = BIT(1);
+const float SND_LARGEENTITY = BIT(3);
+const float SND_LARGESOUND = BIT(4);
 
 const float INITPRIO_FIRST                             = 0;
 const float INITPRIO_GAMETYPE                  = 0;
index 00ebbafe08e1f784624b5275d809b636c135c9f2..416df75b4ffe51c8a68a5490d196b6c84506caf8 100644 (file)
@@ -4,15 +4,15 @@ REGISTER_MUTATOR(superspec, cvar("g_superspectate"));
 #define _SSMAGIX "SUPERSPEC_OPTIONSFILE_V1"
 #define _ISLOCAL ((edict_num(1) == self) ? true : false)
 
-const float ASF_STRENGTH               = 1;
-const float ASF_SHIELD                         = 2;
-const float ASF_MEGA_AR                = 4;
-const float ASF_MEGA_HP                = 8;
-const float ASF_FLAG_GRAB              = 16;
-const float ASF_OBSERVER_ONLY  = 32;
-const float ASF_SHOWWHAT               = 64;
-const float ASF_SSIM                   = 128;
-const float ASF_FOLLOWKILLER   = 256;
+const float ASF_STRENGTH               = BIT(0);
+const float ASF_SHIELD                         = BIT(1);
+const float ASF_MEGA_AR                = BIT(2);
+const float ASF_MEGA_HP                = BIT(3);
+const float ASF_FLAG_GRAB              = BIT(4);
+const float ASF_OBSERVER_ONLY  = BIT(5);
+const float ASF_SHOWWHAT               = BIT(6);
+const float ASF_SSIM                   = BIT(7);
+const float ASF_FOLLOWKILLER   = BIT(8);
 const float ASF_ALL                    = 0xFFFFFF;
 .float autospec_flags;
 
index d88a43ed8e14fc2f6ad8bfad91214a7805e5e132..765fe2a7f201b6bfa6b1e1da7e70c0cac3284d31 100644 (file)
@@ -31,15 +31,15 @@ entity start_node;
 .float pathlib_node_c;
 
 const float pathlib_node_edgeflag_unknown              = 0;
-const float pathlib_node_edgeflag_left                         = 2;
-const float pathlib_node_edgeflag_right                = 4;
-const float pathlib_node_edgeflag_forward              = 8;
-const float pathlib_node_edgeflag_back                         = 16;
-const float pathlib_node_edgeflag_backleft             = 32;
-const float pathlib_node_edgeflag_backright    = 64;
-const float pathlib_node_edgeflag_forwardleft  = 128;
-const float pathlib_node_edgeflag_forwardright         = 256;
-const float pathlib_node_edgeflag_none                         = 512;
+const float pathlib_node_edgeflag_left                         = BIT(1);
+const float pathlib_node_edgeflag_right                = BIT(2);
+const float pathlib_node_edgeflag_forward              = BIT(3);
+const float pathlib_node_edgeflag_back                         = BIT(4);
+const float pathlib_node_edgeflag_backleft             = BIT(5);
+const float pathlib_node_edgeflag_backright    = BIT(6);
+const float pathlib_node_edgeflag_forwardleft  = BIT(7);
+const float pathlib_node_edgeflag_forwardright         = BIT(8);
+const float pathlib_node_edgeflag_none                         = BIT(9);
 .float pathlib_node_edgeflags;
 
 float pathlib_open_cnt;
index 8195d250d023b4e528cb40bfd67d272fde8392c0..45b5f9e9c32f9df0352b661a5bf1fea92ee2b03e 100644 (file)
@@ -4,20 +4,20 @@
 const int AMMO_COUNT = 4; // amount of ammo types to show in the inventory panel
 
 // item networking
-const int ISF_LOCATION                         = 2;
-const int ISF_MODEL                            = 4;
-const int ISF_STATUS                   = 8;
-    const int ITS_STAYWEP              = 1;
-    const int ITS_ANIMATE1             = 2;
-    const int ITS_ANIMATE2             = 4;
-    const int ITS_AVAILABLE    = 8;
-    const int ITS_ALLOWFB              = 16;
-    const int ITS_ALLOWSI              = 32;
-    const int ITS_POWERUP              = 64;
-const int ISF_COLORMAP                         = 16;
-const int ISF_DROP                             = 32;
-const int ISF_ANGLES                   = 64;
-const int ISF_SIZE                             = 128;
+const int ISF_LOCATION                         = BIT(1);
+const int ISF_MODEL                            = BIT(2);
+const int ISF_STATUS                   = BIT(3);
+    const int ITS_STAYWEP                  = BIT(0);
+    const int ITS_ANIMATE1                 = BIT(1);
+    const int ITS_ANIMATE2                 = BIT(2);
+    const int ITS_AVAILABLE        = BIT(3);
+    const int ITS_ALLOWFB                  = BIT(4);
+    const int ITS_ALLOWSI                  = BIT(5);
+    const int ITS_POWERUP                  = BIT(6);
+const int ISF_COLORMAP                         = BIT(4);
+const int ISF_DROP                             = BIT(5);
+const int ISF_ANGLES                   = BIT(6);
+const int ISF_SIZE                             = BIT(7);
 
 .int ItemStatus;