Commit 39380aa9 authored by Rudolf Polzer's avatar Rudolf Polzer

gmqcc has vector bit operations now. Switch to using them.

This also gets rid of the ugly WEPSET macros.

New design limit of weapon count: 72 weapons (currently set to 24 to use
less bandwidth, though).
parent 35f8f68f
......@@ -5,36 +5,17 @@ QCC ?= gmqcc
QCCVERSIONFILE := qccversion.$(shell $(QCC) --version > qccversion.txt && git hash-object qccversion.txt)
QCCFLAGS ?= \
-std=fteqcc \
-Werror -Wall \
-Wcpp \
# We eventually need to get rid of these.
QCCFLAGS_WTFS ?= \
-Wno-field-redeclared \
-Wno-double-declaration \
-Wno-uninitialized-global \
-Wno-parenthesis \
-O3 \
-fadjust-vector-fields \
-fftepp \
-fftepp-predefs \
-frelaxed-switch \
-fshort-logic \
-fno-perl-logic \
-ftranslatable-strings \
-fno-initialized-nonconstants \
-fno-assign-function-types \
-flno \
-fcorrect-ternary \
-fno-single-vector-defs \
-fcorrect-logic \
-ftrue-empty-strings \
-fno-false-empty-strings \
-futf8 \
-fno-bail-on-werror \
-floop-labels \
-funtyped-nil \
-fno-permissive \
-fvariadic-args \
QCCFLAGS ?= \
-std=gmqcc \
-O3 -flno \
-Werror -fno-bail-on-werror -Wall \
-fftepp -fftepp-predefs -Wcpp -futf8 \
$(QCCFLAGS_WTFS) \
$(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
# xonotic build system overrides this by command line argument to turn off the update-cvarcount step
......
......@@ -720,7 +720,7 @@ void Ent_ReadSpawnEvent(float is_new)
}
if(autocvar_cl_spawn_event_sound)
{
sound(self, CH_TRIGGER, "misc/spawn.wav", VOL_BASE, ATTN_NORM);
sound(self, CH_TRIGGER, "misc/spawn.wav", VOL_BASE, ATTEN_NORM);
}
}
}
......
entity porto;
vector polyline[16];
float Q3SURFACEFLAG_SLICK = 2; // low friction surface
float DPCONTENTS_SOLID = 1; // blocks player movement
float DPCONTENTS_BODY = 32; // blocks player movement
float DPCONTENTS_CORPSE = 64; // blocks player movement
float DPCONTENTS_PLAYERCLIP = 256; // blocks player movement
void Porto_Draw()
{
vector p, dir, ang, q, nextdir;
......@@ -350,8 +345,8 @@ void PostInit(void);
void CSQC_Demo_Camera();
float HUD_WouldDrawScoreboard();
float camera_mode;
float CAMERA_FREE = 1;
float CAMERA_CHASE = 2;
const float CAMERA_FREE = 1;
const float CAMERA_CHASE = 2;
float reticle_type;
string NextFrameCommand;
void CSQC_SPIDER_HUD();
......@@ -480,7 +475,7 @@ void CSQC_UpdateView(float w, float h)
// event chase camera
if(autocvar_chase_active <= 0) // greater than 0 means it's enabled manually, and this code is skipped
{
if(spectatee_status >= 0 && (autocvar_cl_eventchase_death && is_dead) || intermission)
if((spectatee_status >= 0 && (autocvar_cl_eventchase_death && is_dead)) || intermission)
{
// make special vector since we can't use view_origin (It is one frame old as of this code, it gets set later with the results this code makes.)
vector current_view_origin = (csqcplayer ? csqcplayer.origin : pmove_org);
......@@ -805,11 +800,11 @@ void CSQC_UpdateView(float w, float h)
// the view to go back to normal, so reticle_type would become 0 as we fade out)
if(spectatee_status || is_dead || hud != HUD_NORMAL)
reticle_type = 0; // prevent reticle from showing during the respawn zoom effect or for spectators
else if(activeweapon == WEP_NEX && (button_zoom || zoomscript_caught) || activeweapon == WEP_RIFLE && (button_zoom || zoomscript_caught) || activeweapon == WEP_MINSTANEX && (button_zoom || zoomscript_caught))
else if((activeweapon == WEP_NEX || activeweapon == WEP_RIFLE || activeweapon == WEP_MINSTANEX) && (button_zoom || zoomscript_caught))
reticle_type = 2; // nex zoom
else if(button_zoom || zoomscript_caught)
reticle_type = 1; // normal zoom
else if(activeweapon == WEP_NEX && button_attack2 || activeweapon == WEP_RIFLE && button_attack2)
else if((activeweapon == WEP_NEX) && button_attack2)
reticle_type = 2; // nex zoom
if(reticle_type && autocvar_cl_reticle)
......@@ -1072,7 +1067,7 @@ void CSQC_UpdateView(float w, float h)
if(hit_time > nextsound_hit_time && autocvar_cl_hitsound)
{
if(time - hit_time < MAX_TIME_DIFF) // don't play the sound if it's too old.
sound(world, CH_INFO, "misc/hit.wav", VOL_BASE, ATTN_NONE);
sound(world, CH_INFO, "misc/hit.wav", VOL_BASE, ATTEN_NONE);
nextsound_hit_time = time + autocvar_cl_hitsound_antispam_time;
}
......@@ -1080,7 +1075,7 @@ void CSQC_UpdateView(float w, float h)
if(typehit_time > nextsound_typehit_time)
{
if(time - typehit_time < MAX_TIME_DIFF) // don't play the sound if it's too old.
sound(world, CH_INFO, "misc/typehit.wav", VOL_BASE, ATTN_NONE);
sound(world, CH_INFO, "misc/typehit.wav", VOL_BASE, ATTEN_NONE);
nextsound_typehit_time = time + autocvar_cl_hitsound_antispam_time;
}
......
......@@ -2,7 +2,7 @@ void Announcer_Play(string announcement)
{
/*if((announcement != previous_announcement) || (time >= (previous_announcement_time + autocvar_cl_announcer_antispam)))
{
sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/", announcement, ".wav"), VOL_BASEVOICE, ATTN_NONE);
sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/", announcement, ".wav"), VOL_BASEVOICE, ATTEN_NONE);
if(previous_announcement) { strunzone(previous_announcement); }
......
......@@ -11,7 +11,7 @@ void Casing_Draw()
{
self.move_angles_x = 0;
self.move_angles_z = 0;
self.flags &~= FL_ONGROUND;
self.flags &= ~FL_ONGROUND;
}
Movetype_Physics_MatchTicrate(autocvar_cl_casings_ticrate, autocvar_cl_casings_sloppy);
......@@ -57,7 +57,7 @@ void Casing_Touch()
break;
}
sound (self, CH_SHOTS, s, VOL_BASE, ATTN_LARGE);
sound (self, CH_SHOTS, s, VOL_BASE, ATTEN_LARGE);
}
}
}
......@@ -70,7 +70,7 @@ void Casing_Damage(float thisdmg, float hittype, vector org, vector thisforce)
if(thisforce_z < 0)
thisforce_z = 0;
self.move_velocity = self.move_velocity + thisforce + '0 0 100';
self.move_flags &~= FL_ONGROUND;
self.move_flags &= ~FL_ONGROUND;
}
void Ent_Casing(float isNew)
......
......@@ -159,13 +159,13 @@ const float BUTTON_16 = 262144;
#define SOLID_BSP 4 // bsp clip, touch on edge, block
#define SOLID_CORPSE 5 // same as SOLID_BBOX, except it behaves as SOLID_NOT against SOLID_SLIDEBOX objects (players/monsters)
float MOVE_NORMAL = 0; // same as FALSE
float MOVE_NOMONSTERS = 1; // same as TRUE
float MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
float MOVE_HITMODEL = 4;
float MOVE_WORLDONLY = 3;
const float MOVE_NORMAL = 0; // same as FALSE
const float MOVE_NOMONSTERS = 1; // same as TRUE
const float MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
const float MOVE_HITMODEL = 4;
const float MOVE_WORLDONLY = 3;
float CAMERA_FREE = 1;
float CAMERA_CHASE = 2;
const float CAMERA_FREE = 1;
const float CAMERA_CHASE = 2;
float EF_NOMODELFLAGS = 8388608;
const float EF_NOMODELFLAGS = 8388608;
......@@ -452,22 +452,22 @@ void CSQCModel_AutoTagIndex_Apply(void)
}
// FEATURE: EF_NODRAW workalike
float EF_BRIGHTFIELD = 1;
float EF_BRIGHTLIGHT = 4;
float EF_DIMLIGHT = 8;
float EF_DOUBLESIDED = 32768;
float EF_NOSELFSHADOW = 65536;
float EF_DYNAMICMODELLIGHT = 131072;
float EF_RESTARTANIM_BIT = 1048576;
float EF_TELEPORT_BIT = 2097152;
float MF_ROCKET = 1; // leave a trail
float MF_GRENADE = 2; // leave a trail
float MF_GIB = 4; // leave a trail
float MF_ROTATE = 8; // rotate (bonus items)
float MF_TRACER = 16; // green split trail
float MF_ZOMGIB = 32; // small blood trail
float MF_TRACER2 = 64; // orange split trail
float MF_TRACER3 = 128; // purple trail
const float EF_BRIGHTFIELD = 1;
const float EF_BRIGHTLIGHT = 4;
const float EF_DIMLIGHT = 8;
const float EF_DOUBLESIDED = 32768;
const float EF_NOSELFSHADOW = 65536;
const float EF_DYNAMICMODELLIGHT = 131072;
const float EF_RESTARTANIM_BIT = 1048576;
const float EF_TELEPORT_BIT = 2097152;
const float MF_ROCKET = 1; // leave a trail
const float MF_GRENADE = 2; // leave a trail
const float MF_GIB = 4; // leave a trail
const float MF_ROTATE = 8; // rotate (bonus items)
const float MF_TRACER = 16; // green split trail
const float MF_ZOMGIB = 32; // small blood trail
const float MF_TRACER2 = 64; // orange split trail
const float MF_TRACER3 = 128; // purple trail
.float csqcmodel_effects;
.float csqcmodel_modelflags;
void CSQCModel_Effects_PreUpdate(void)
......@@ -488,9 +488,9 @@ void CSQCModel_Effects_PostUpdate(void)
void CSQCModel_Effects_Apply(void)
{
float eff = self.csqcmodel_effects;
eff &~= CSQCMODEL_EF_RESPAWNGHOST;
eff &= ~CSQCMODEL_EF_RESPAWNGHOST;
self.renderflags &~= (RF_DEPTHHACK | RF_ADDITIVE | RF_FULLBRIGHT | EF_NOSHADOW | RF_USEAXIS);
self.renderflags &= ~(RF_DEPTHHACK | RF_ADDITIVE | RF_FULLBRIGHT | EF_NOSHADOW | RF_USEAXIS);
self.effects = 0;
self.traileffect = 0;
......
......@@ -182,7 +182,7 @@ void Ent_DamageInfo(float isNew)
if(vlen(thisforce))
{
self.move_velocity = self.move_velocity + damage_explosion_calcpush(self.damageforcescale * thisforce, self.move_velocity, autocvar_g_balance_damagepush_speedfactor);
self.move_flags &~= FL_ONGROUND;
self.move_flags &= ~FL_ONGROUND;
}
if(w_issilent)
......@@ -218,33 +218,33 @@ void Ent_DamageInfo(float isNew)
case DEATH_VH_SPID_MINIGUN:
string _snd;
_snd = strcat("weapons/ric", ftos(1 + rint(random() * 2)), ".waw");
sound(self, CH_SHOTS, _snd, VOL_BASE, ATTN_NORM);
sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("spiderbot_minigun_impact"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_SPID_ROCKET:
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("spiderbot_rocket_explode"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_SPID_DEATH:
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_MIN);
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_WAKI_GUN:
sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("wakizashi_gun_impact"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_WAKI_ROCKET:
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("wakizashi_rocket_explode"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_WAKI_DEATH:
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_MIN);
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_RAPT_CANNON:
sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("raptor_cannon_impact"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_RAPT_FRAGMENT:
......@@ -256,19 +256,19 @@ void Ent_DamageInfo(float isNew)
ang = vectoangles(vel);
RaptorCBShellfragToss(w_org, vel, ang + '0 0 1' * (120 * i));
}
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("raptor_bomb_spread"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_RAPT_BOMB:
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("raptor_bomb_impact"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_RAPT_DEATH:
sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_MIN);
sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_BUMB_GUN:
sound(self, CH_SHOTS, "weapons/fireball_impact2.wav", VOL_BASE, ATTN_NORM);
sound(self, CH_SHOTS, "weapons/fireball_impact2.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("bigplasma_impact"), self.origin, w_backoff * 1000, 1);
break;
}
......@@ -289,38 +289,38 @@ void Ent_DamageInfo(float isNew)
switch(w_deathtype)
{
case DEATH_TURRET_EWHEEL:
sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_MIN);
sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("laser_impact"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_TURRET_FLAC:
pointparticles(particleeffectnum("hagar_explode"), w_org, '0 0 0', 1);
_snd = strcat("weapons/hagexp", ftos(1 + rint(random() * 2)), ".waw");
sound(self, CH_SHOTS, _snd, VOL_BASE, ATTN_NORM);
sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM);
break;
case DEATH_TURRET_MLRS:
case DEATH_TURRET_HK:
case DEATH_TURRET_WALK_ROCKET:
case DEATH_TURRET_HELLION:
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_MIN);
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("rocket_explode"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_TURRET_MACHINEGUN:
case DEATH_TURRET_WALK_GUN:
_snd = strcat("weapons/ric", ftos(1 + rint(random() * 2)), ".waw");
sound(self, CH_SHOTS, _snd, VOL_BASE, ATTN_NORM);
sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("machinegun_impact"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_TURRET_PLASMA:
sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTN_MIN);
sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("electro_impact"), self.origin, w_backoff * 1000, 1);
break;
case DEATH_TURRET_WALK_MEELE:
sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTN_MIN);
sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTEN_MIN);
pointparticles(particleeffectnum("TE_SPARK"), self.origin, w_backoff * 1000, 1);
break;
......
......@@ -73,7 +73,7 @@ void Gib_Touch()
}
if(!self.silent)
sound(self, CH_PAIN, strcat("misc/gib_splat0", ftos(floor(prandom() * 4 + 1)), ".wav"), VOL_BASE, ATTN_NORM);
sound(self, CH_PAIN, strcat("misc/gib_splat0", ftos(floor(prandom() * 4 + 1)), ".wav"), VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum(strcat(species_prefix(self.cnt), "blood")), self.origin + '0 0 1', '0 0 30', 10);
Gib_Delete();
......@@ -205,7 +205,7 @@ void Ent_GibSplash(float isNew)
{
case 0x01:
if(!issilent)
sound (self, CH_PAIN, "misc/gib.wav", VOL_BASE, ATTN_NORM);
sound (self, CH_PAIN, "misc/gib.wav", VOL_BASE, ATTEN_NORM);
if(prandom() < amount)
TossGib ("models/gibs/eye.md3", org, org, vel, prandomvec() * 150, specnum, 0, issilent);
......
......@@ -59,7 +59,7 @@ void Draw_GrapplingHook()
if(self.teleport_time)
if(time > self.teleport_time)
{
sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTN_NORM); // safeguard
sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM); // safeguard
self.teleport_time = 0;
}
......@@ -215,7 +215,7 @@ void Draw_GrapplingHook()
void Remove_GrapplingHook()
{
sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTN_NORM);
sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM);
}
void Ent_ReadHook(float bIsNew, float type)
......@@ -275,10 +275,10 @@ void Ent_ReadHook(float bIsNew, float type)
self.drawmask = MASK_NORMAL;
break;
case ENT_CLIENT_LGBEAM:
sound (self, CH_SHOTS_SINGLE, "weapons/lgbeam_fly.wav", VOL_BASE, ATTN_NORM);
sound (self, CH_SHOTS_SINGLE, "weapons/lgbeam_fly.wav", VOL_BASE, ATTEN_NORM);
break;
case ENT_CLIENT_GAUNTLET:
sound (self, CH_SHOTS_SINGLE, "weapons/gauntletbeam_fly.wav", VOL_BASE, ATTN_NORM);
sound (self, CH_SHOTS_SINGLE, "weapons/gauntletbeam_fly.wav", VOL_BASE, ATTEN_NORM);
break;
}
}
......
......@@ -447,8 +447,7 @@ float GetAmmoTypeForWep(float i)
void HUD_Weapons(void)
{
// declarations
WEPSET_DECLARE_A(weapons_stat);
WEPSET_COPY_AS(weapons_stat);
WepSet weapons_stat = WepSet_GetFromStat();
float i, f, a;
float screen_ar, center_x = 0, center_y;
float weapon_count, weapon_id;
......@@ -532,9 +531,9 @@ void HUD_Weapons(void)
{
if(autocvar__hud_configure)
{
if (WEPSET_EMPTY_A(weapons_stat))
if (!weapons_stat)
for(i = WEP_FIRST; i <= WEP_LAST; i += floor((WEP_LAST-WEP_FIRST)/5))
WEPSET_OR_AW(weapons_stat, i);
weapons_stat |= WepSet_FromWeapon(i);
if(menu_enabled != 2)
HUD_Panel_DrawBg(1); // also draw the bg of the entire panel
......@@ -543,7 +542,7 @@ void HUD_Weapons(void)
// do we own this weapon?
weapon_count = 0;
for(i = 0; i <= WEP_LAST-WEP_FIRST; ++i)
if(WEPSET_CONTAINS_AW(weapons_stat, weaponorder[i].weapon))
if(weapons_stat & WepSet_FromWeapon(weaponorder[i].weapon))
++weapon_count;
// add it anyway if weaponcomplain is shown
......@@ -735,7 +734,7 @@ void HUD_Weapons(void)
// skip this weapon if we don't own it (and onlyowned is enabled)-- or if weapons_complainbubble is showing for this weapon
if(autocvar_hud_panel_weapons_onlyowned)
if not(WEPSET_CONTAINS_AW(weapons_stat, self.weapon) || (self.weapon == complain_weapon))
if not((weapons_stat & WepSet_FromWeapon(self.weapon)) || (self.weapon == complain_weapon))
continue;
// figure out the drawing position of weapon
......@@ -759,7 +758,7 @@ void HUD_Weapons(void)
}
// drawing all the weapon items
if(WEPSET_CONTAINS_AW(weapons_stat, self.weapon))
if(weapons_stat & WepSet_FromWeapon(self.weapon))
{
// draw the weapon image
drawpic_aspect_skin(weapon_pos, strcat("weapon", self.netname), weapon_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
......@@ -3140,7 +3139,7 @@ void HUD_Mod_Race(vector pos, vector mySize)
if(autocvar_cl_autodemo_delete_keeprecords)
{
f = autocvar_cl_autodemo_delete;
f &~= 1;
f &= ~1;
cvar_set("cl_autodemo_delete", ftos(f)); // don't delete demo with new record!
}
}
......
......@@ -10,11 +10,6 @@
.float scale; // scaling factor of the thickness
.float modelscale; // scaling factor of the dlight
// TODO move these into a heade file
float trace_dphitq3surfaceflags;
float Q3SURFACEFLAG_SKY = 4; // sky surface (also has NOIMPACT and NOMARKS set)
float Q3SURFACEFLAG_NOIMPACT = 16; // projectiles should remove themselves on impact (this is set on sky)
void Draw_Laser()
{
if(!self.state)
......
......@@ -464,9 +464,9 @@ void MapVote_UpdateMask()
else
mv_maps_mask = ReadShort();
if(oldmask & mv_maps_mask != oldmask)
if(oldmask & mv_maps_mask == mv_maps_mask)
sound(world, CH_INFO, "misc_invshot.wav", VOL_BASE, ATTN_NONE);
if((oldmask & mv_maps_mask) != oldmask)
if((oldmask & mv_maps_mask) == mv_maps_mask)
sound(world, CH_INFO, "misc_invshot.wav", VOL_BASE, ATTEN_NONE);
// remove votes that no longer apply
for(i = 0, power = 1; i < mv_num_maps; ++i, power *= 2)
......
float STAT_MOVEFLAGS = 225;
float MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE = 4;
const float STAT_MOVEFLAGS = 225;
const float MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE = 4;
#define GRAVITY_UNAFFECTED_BY_TICRATE (getstati(STAT_MOVEFLAGS) & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE)
.entity move_groundentity; // FIXME add move_groundnetworkentity?
......@@ -220,7 +220,7 @@ void _Movetype_Physics_Toss(float dt) // SV_Physics_Toss
if(self.move_flags & FL_ONGROUND)
{
if(self.move_velocity_z >= 1/32)
self.move_flags &~= FL_ONGROUND;
self.move_flags &= ~FL_ONGROUND;
else if(!self.move_groundentity)
return;
else if(self.move_suspendedinair && wasfreed(self.move_groundentity))
......@@ -281,7 +281,7 @@ void _Movetype_Physics_Toss(float dt) // SV_Physics_Toss
if(self.move_movetype == MOVETYPE_BOUNCEMISSILE)
{
self.move_velocity = _Movetype_ClipVelocity(self.move_velocity, trace_plane_normal, 2.0);
self.move_flags &~= FL_ONGROUND;
self.move_flags &= ~FL_ONGROUND;
}
else if(self.move_movetype == MOVETYPE_BOUNCE)
{
......@@ -305,7 +305,7 @@ void _Movetype_Physics_Toss(float dt) // SV_Physics_Toss
self.move_avelocity = '0 0 0';
}
else
self.move_flags &~= FL_ONGROUND;
self.move_flags &= ~FL_ONGROUND;
}
else
{
......@@ -320,7 +320,7 @@ void _Movetype_Physics_Toss(float dt) // SV_Physics_Toss
self.move_avelocity = '0 0 0';
}
else
self.move_flags &~= FL_ONGROUND;
self.move_flags &= ~FL_ONGROUND;
}
// DP revision 8905 (just, WHY...)
......
......@@ -14,21 +14,21 @@ void Movetype_Physics_MatchTicrate(float tr, float sloppy);
void Movetype_Physics_MatchServer(float sloppy);
void Movetype_Physics_NoMatchServer();
float MOVETYPE_NONE = 0;
float MOVETYPE_ANGLENOCLIP = 1;
float MOVETYPE_ANGLECLIP = 2;
float MOVETYPE_WALK = 3;
float MOVETYPE_STEP = 4;
float MOVETYPE_FLY = 5;
float MOVETYPE_TOSS = 6;
float MOVETYPE_PUSH = 7;
float MOVETYPE_NOCLIP = 8;
float MOVETYPE_FLYMISSILE = 9;
float MOVETYPE_BOUNCE = 10;
float MOVETYPE_BOUNCEMISSILE = 11; // Like bounce but doesn't lose speed on bouncing
float MOVETYPE_FOLLOW = 12;
float MOVETYPE_FAKEPUSH = 13;
float MOVETYPE_FLY_WORLDONLY = 33;
const float MOVETYPE_NONE = 0;
const float MOVETYPE_ANGLENOCLIP = 1;
const float MOVETYPE_ANGLECLIP = 2;
const float MOVETYPE_WALK = 3;
const float MOVETYPE_STEP = 4;
const float MOVETYPE_FLY = 5;
const float MOVETYPE_TOSS = 6;
const float MOVETYPE_PUSH = 7;
const float MOVETYPE_NOCLIP = 8;
const float MOVETYPE_FLYMISSILE = 9;
const float MOVETYPE_BOUNCE = 10;
const float MOVETYPE_BOUNCEMISSILE = 11; // Like bounce but doesn't lose speed on bouncing
const float MOVETYPE_FOLLOW = 12;
const float MOVETYPE_FAKEPUSH = 13;
const float MOVETYPE_FLY_WORLDONLY = 33;
float FL_ITEM = 256;
float FL_ONGROUND = 512;
const float FL_ITEM = 256;
const float FL_ONGROUND = 512;
......@@ -58,7 +58,7 @@ void Projectile_Draw()
if(self.count & 0x80)
{
//self.move_flags &~= FL_ONGROUND;
//self.move_flags &= ~FL_ONGROUND;
if(self.move_movetype == MOVETYPE_NONE || self.move_movetype == MOVETYPE_FLY)
Movetype_Physics_NoMatchServer();
// the trivial movetypes do not have to match the
......@@ -226,7 +226,7 @@ void Ent_Projectile()
if(f & 0x40)
self.move_flags |= FL_ONGROUND;
else
self.move_flags &~= FL_ONGROUND;
self.move_flags &= ~FL_ONGROUND;
if(!self.move_time)
{
......@@ -352,7 +352,7 @@ void Ent_Projectile()
{
case PROJECTILE_ELECTRO:
// only new engines support sound moving with object
loopsound(self, CH_SHOTS_SINGLE, "weapons/electro_fly.wav", VOL_BASE, ATTN_NORM);
loopsound(self, CH_SHOTS_SINGLE, "weapons/electro_fly.wav", VOL_BASE, ATTEN_NORM);
self.mins = '0 0 -4';
self.maxs = '0 0 -4';
self.move_movetype = MOVETYPE_BOUNCE;
......@@ -361,7 +361,7 @@ void Ent_Projectile()
self.move_bounce_stopspeed = g_balance_electro_secondary_bouncestop;
break;
case PROJECTILE_ROCKET:
loopsound(self, CH_SHOTS_SINGLE, "weapons/rocket_fly.wav", VOL_BASE, ATTN_NORM);
loopsound(self, CH_SHOTS_SINGLE, "weapons/rocket_fly.wav", VOL_BASE, ATTEN_NORM);
self.mins = '-3 -3 -3';
self.maxs = '3 3 3';
break;
......@@ -430,12 +430,12 @@ void Ent_Projectile()
self.move_touch = func_null;
break;
case PROJECTILE_FIREBALL:
loopsound(self, CH_SHOTS_SINGLE, "weapons/fireball_fly2.wav", VOL_BASE, ATTN_NORM);
loopsound(self, CH_SHOTS_SINGLE, "weapons/fireball_fly2.wav", VOL_BASE, ATTEN_NORM);
self.mins = '-16 -16 -16';
self.maxs = '16 16 16';
break;
case PROJECTILE_FIREMINE:
loopsound(self, CH_SHOTS_SINGLE, "weapons/fireball_fly.wav", VOL_BASE, ATTN_NORM);
loopsound(self, CH_SHOTS_SINGLE, "weapons/fireball_fly.wav", VOL_BASE, ATTEN_NORM);
self.move_movetype = MOVETYPE_BOUNCE;
self.move_touch = func_null;
self.mins = '-4 -4 -4';
......@@ -450,7 +450,7 @@ void Ent_Projectile()
self.maxs = '2 2 2';
break;
case PROJECTILE_SEEKER:
loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTN_NORM);
loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTEN_NORM);
self.mins = '-4 -4 -4';
self.maxs = '4 4 4';
break;
......@@ -463,17 +463,17 @@ void Ent_Projectile()
case PROJECTILE_RAPTORCANNON:
break;
case PROJECTILE_SPIDERROCKET:
loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTN_NORM);
loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTEN_NORM);
break;
case PROJECTILE_WAKIROCKET:
loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTN_NORM);
loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTEN_NORM);
break;
/*
case PROJECTILE_WAKICANNON:
break;
case PROJECTILE_BUMBLE_GUN:
// only new engines support sound moving with object
loopsound(self, CH_SHOTS_SINGLE, "weapons/electro_fly.wav", VOL_BASE, ATTN_NORM);
loopsound(self, CH_SHOTS_SINGLE, "weapons/electro_fly.wav", VOL_BASE, ATTEN_NORM);
self.mins = '0 0 -4';
self.maxs = '0 0 -4';
self.move_movetype = MOVETYPE_BOUNCE;
......
......@@ -9,7 +9,7 @@ float scoreboard_alpha_name_self;
void drawstringright(vector, string, vector, vector, float, float);
void drawstringcenter(vector, string, vector, vector, float, float);
float SCOREBOARD_OFFSET = 50;
const float SCOREBOARD_OFFSET = 50;
// wrapper to put all possible scores titles through gettext
string TranslateScoresLabel(string l)
......
#pragma noref 0
#undef ATTN_NORM
#undef ATTEN_NORM
#ifdef COMPAT_050_ENGINE
// WORKAROUND for 0.5.0 engine
......
......@@ -4,7 +4,7 @@
#define CSQC
#define ATTN_NORM builtin_ATTN_NORM
#define ATTEN_NORM builtin_ATTEN_NORM
#ifdef COMPAT_050_ENGINE
// WORKAROUND for 0.5.0 engine
......
......@@ -44,9 +44,9 @@ void TargetMusic_Advance()
if(vol != vol0)
{
if(vol0 < 0)
sound(e, CH_BGM_SINGLE, e.noise, vol, ATTN_NONE); // restart
sound(e, CH_BGM_SINGLE, e.noise, vol, ATTEN_NONE); // restart
else
sound(e, CH_BGM_SINGLE, "", vol, ATTN_NONE);
sound(e, CH_BGM_SINGLE, "", vol, ATTEN_NONE);
e.lastvol = vol;
}
}
......@@ -88,7 +88,7 @@ void Net_TargetMusic()
strunzone(e.noise);
e.noise = strzone(noi);
precache_sound(e.noise);
sound(e, CH_BGM_SINGLE, e.noise, 0, ATTN_NONE);
sound(e, CH_BGM_SINGLE, e.noise, 0, ATTEN_NONE);
if(getsoundtime(e, CH_BGM_SINGLE) < 0)
{
print(sprintf(_("Cannot initialize sound %s\n"), e.noise));
......@@ -177,7 +177,7 @@ void Ent_ReadTriggerMusic()
if(self.noise != s)
{
precache_sound(self.noise);
sound(self, CH_BGM_SINGLE, self.noise, 0, ATTN_NONE);
sound(self, CH_BGM_SINGLE, self.noise, 0, ATTEN_NONE);
if(getsoundtime(self, CH_BGM_SINGLE) < 0)
{
print(sprintf(_("Cannot initialize sound %s\n"), self.noise));
......
......@@ -509,7 +509,7 @@ void turret_gibboom()
{
float i;
sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
for (i = 1; i < 5; i = i + 1)
......@@ -556,7 +556,7 @@ entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, flo
void turret_die()
{
sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
turret_tid2info(self.turret_type);
if (!autocvar_cl_nogibs)
......