From eb5a5182fdfd7e7610a187f19ffc885b0a671650 Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Sat, 23 Nov 2024 16:58:51 +0200 Subject: [PATCH] effects: use vec3_t as scale --- src/client/vid/header/ref.h | 4 +- src/common/header/shared.h | 1 + src/game/effects/client_effects.h | 1 + src/game/effects/client_entities.c | 14 +- src/game/effects/fx_ammo_pickup.c | 8 +- src/game/effects/fx_animate.c | 2 +- src/game/effects/fx_blood.c | 5 +- src/game/effects/fx_blue_ring.c | 3 +- src/game/effects/fx_bubbler.c | 11 +- src/game/effects/fx_crosshair.c | 9 +- src/game/effects/fx_cwatcher.c | 45 ++- src/game/effects/fx_debris.c | 25 +- src/game/effects/fx_defense_pickup.c | 8 +- src/game/effects/fx_dripper.c | 8 +- src/game/effects/fx_fire.c | 68 ++-- src/game/effects/fx_flyingfist.c | 43 ++- src/game/effects/fx_health_pickup.c | 4 +- src/game/effects/fx_hell_staff.c | 29 +- src/game/effects/fx_hitpuff.c | 9 +- src/game/effects/fx_hpproj.c | 174 ++++++--- src/game/effects/fx_insectstaff.c | 91 +++-- src/game/effects/fx_lightning.c | 28 +- src/game/effects/fx_maceball.c | 29 +- src/game/effects/fx_magicmissile.c | 51 ++- src/game/effects/fx_mist.c | 9 +- src/game/effects/fx_mork.c | 374 ++++++++++++------- src/game/effects/fx_morph.c | 26 +- src/game/effects/fx_objects.c | 6 +- src/game/effects/fx_pespell.c | 39 +- src/game/effects/fx_phoenix.c | 56 +-- src/game/effects/fx_pickup.c | 2 +- src/game/effects/fx_pickuppuzzle.c | 7 +- src/game/effects/fx_portal.c | 7 +- src/game/effects/fx_redrain.c | 24 +- src/game/effects/fx_ripples.c | 7 +- src/game/effects/fx_rope.c | 20 +- src/game/effects/fx_scorchmark.c | 10 +- src/game/effects/fx_shadow.c | 19 +- src/game/effects/fx_shrine.c | 56 +-- src/game/effects/fx_smoke.c | 18 +- src/game/effects/fx_sparks.c | 11 +- src/game/effects/fx_sphereofannihlation.c | 87 +++-- src/game/effects/fx_spoo.c | 7 +- src/game/effects/fx_ssarrow.c | 2 +- src/game/effects/fx_ssithra.c | 34 +- src/game/effects/fx_staff.c | 83 ++-- src/game/effects/fx_tbeast.c | 8 +- src/game/effects/fx_teleport.c | 4 +- src/game/effects/fx_tome.c | 4 +- src/game/effects/fx_tornado.c | 4 +- src/game/effects/fx_wall.c | 87 +++-- src/game/effects/fx_waterentrysplash.c | 26 +- src/game/effects/fx_waterwake.c | 2 +- src/game/effects/fx_weaponpickup.c | 14 +- src/game/effects/generic_character_effects.c | 31 +- src/game/effects/generic_weapon_effects.c | 5 +- src/game/effects/main.c | 2 +- 57 files changed, 1127 insertions(+), 634 deletions(-) diff --git a/src/client/vid/header/ref.h b/src/client/vid/header/ref.h index 144d86780..084f44f74 100644 --- a/src/client/vid/header/ref.h +++ b/src/client/vid/header/ref.h @@ -68,6 +68,7 @@ typedef struct entity_s { /* misc */ float backlerp; /* 0.0 = current, 1.0 = old */ int skinnum; /* also used as RF_BEAM's palette index */ + vec3_t scale; /* model scale before render */ int lightstyle; /* for flashing entities */ float alpha; /* ignore if RF_TRANSLUCENT isn't set */ @@ -76,9 +77,6 @@ typedef struct entity_s { int flags; /* Heretic 2 */ - - float scale; // model scale - float cl_scale; // scale of model - but only for client entity models - not server side models // required for scaling mins and maxs that are used to cull models - mins and maxs // are scaled on the server side, but not on the client side when the models are loaded in diff --git a/src/common/header/shared.h b/src/common/header/shared.h index 104214d9f..941774872 100644 --- a/src/common/header/shared.h +++ b/src/common/header/shared.h @@ -1436,6 +1436,7 @@ typedef struct entity_state_s int event; /* impulse events -- muzzle flashes, footsteps, etc */ /* events only go out for a single frame, they */ /* are automatically cleared each frame */ + /* New protocol fields */ vec3_t scale; short clientnum; // In Quake 2, the client num was passed in skinnum. We need this value, however. diff --git a/src/game/effects/client_effects.h b/src/game/effects/client_effects.h index 7aa9fcc38..9007b3e6c 100644 --- a/src/game/effects/client_effects.h +++ b/src/game/effects/client_effects.h @@ -16,6 +16,7 @@ #define DETAIL_HIGH 2 #define DETAIL_UBERHIGH 3 #define DETAIL_DEFAULT "2.0" +#define AVG_VEC3T(scale) (((scale)[0] + (scale)[1] + (scale)[2]) / 3) extern client_fx_import_t fxi; diff --git a/src/game/effects/client_entities.c b/src/game/effects/client_entities.c index 9d2035b70..03db2aef7 100644 --- a/src/game/effects/client_entities.c +++ b/src/game/effects/client_entities.c @@ -105,7 +105,7 @@ client_entity_t *ClientEntity_new(int type, int flags, vec3_t origin, vec3_t dir AnglesFromDirI(newEnt->direction, newEnt->r.angles); // AnglesFromDirAndUp(newEnt->direction, newEnt->up, newEnt->r.angles); - newEnt->r.scale = 1.0F; + VectorSet(newEnt->r.scale, 1.0F, 1.0F, 1.0F); newEnt->r.color.c = 0xffffffff; newEnt->alpha = 1.0F; newEnt->radius = 1.0F; @@ -355,7 +355,7 @@ int AddEffectsToView(client_entity_t **root, centity_t *owner) current->r.color.a = Q_ftol(current->alpha * 255.0); - if(current->r.color.a && (current->r.scale > 0.0)) + if(current->r.color.a && (AVG_VEC3T(current->r.scale) > 0.0)) { if(!AddEntityToView(¤t->r)) { @@ -388,7 +388,7 @@ void AddEffect(centity_t* owner, client_entity_t* fx) } // copy up the scale on a model so it can be culled properly - fx->r.cl_scale = fx->r.scale; + fx->r.cl_scale = AVG_VEC3T(fx->r.scale); } #define NUM_TRACES 100 // I really, really hope we don't ever see more than _this @@ -469,9 +469,11 @@ int UpdateEffects(client_entity_t **root, centity_t *owner) d_size = d_time * current->d_scale; - current->radius *= (1 + d_size/r->scale); + current->radius *= (1 + d_size / AVG_VEC3T(r->scale)); - r->scale += d_size; + r->scale[0] += d_size; + r->scale[1] += d_size; + r->scale[2] += d_size; // Apply scale to spritelines as appropriate. if (current->r.spriteType == SPRITE_LINE) @@ -484,7 +486,7 @@ int UpdateEffects(client_entity_t **root, centity_t *owner) } else { // Otherwise the second scale is copied from the first. - r->scale2 = r->scale; + r->scale2 = AVG_VEC3T(r->scale); } } diff --git a/src/game/effects/fx_ammo_pickup.c b/src/game/effects/fx_ammo_pickup.c index 670a0ae64..26e381596 100644 --- a/src/game/effects/fx_ammo_pickup.c +++ b/src/game/effects/fx_ammo_pickup.c @@ -121,9 +121,13 @@ void FXAmmoPickup(centity_t *owner, int type, int flags, vec3_t origin) if ((tag == ITEM_AMMO_MANA_COMBO_HALF) || (tag == ITEM_AMMO_MANA_DEFENSIVE_FULL) || (tag == ITEM_AMMO_MANA_OFFENSIVE_FULL)) - ce->r.scale = 1.25; + { + VectorSet(ce->r.scale, 1.25, 1.25, 1.25); + } else - ce->r.scale = 1.0; + { + VectorSet(ce->r.scale, 1.0, 1.0, 1.0); + } ce->radius = 10.0; ce->alpha = 0.8; ce->Update = FXAmmoPickupThink; diff --git a/src/game/effects/fx_animate.c b/src/game/effects/fx_animate.c index eff4b463d..809797b2a 100644 --- a/src/game/effects/fx_animate.c +++ b/src/game/effects/fx_animate.c @@ -95,7 +95,7 @@ void FXAnimate(centity_t *owner, int type, int flags, vec3_t origin) atype = anim & 0x7f; self->r.model = FXAnimModel[atype].model; - self->r.scale = scale * 0.02; + VectorSet(self->r.scale, scale * 0.02, scale * 0.02, scale * 0.02); self->r.skinnum = skinnum; self->alpha = FXAnimModel[atype].alpha; diff --git a/src/game/effects/fx_blood.c b/src/game/effects/fx_blood.c index 0ecf95322..609487266 100644 --- a/src/game/effects/fx_blood.c +++ b/src/game/effects/fx_blood.c @@ -392,6 +392,8 @@ void ThrowBlood(vec3_t origin, vec3_t tnormal, qboolean dark, qboolean yellow, q if(trueplane || GetTruePlane(origin, normal)) { + float scale; + bloodmark = ClientEntity_new(FX_BLOOD, CEF_NOMOVE, origin, tnormal, 1000); bloodmark->r.angles[ROLL] = flrand(0, ANGLE_360); @@ -422,7 +424,8 @@ void ThrowBlood(vec3_t origin, vec3_t tnormal, qboolean dark, qboolean yellow, q bloodmark->alpha = 1.0; bloodmark->radius = 10.0; - bloodmark->r.scale = flrand(0.2, 0.45); + scale = flrand(0.2, 0.45); + VectorSet(bloodmark->r.scale, scale, scale, scale); if(tnormal[2] <= -0.7 && !irand(0, 2) && bloodmark->r.frame != 2 && bloodmark->r.frame != 4) { diff --git a/src/game/effects/fx_blue_ring.c b/src/game/effects/fx_blue_ring.c index 79cd9c025..135c39372 100644 --- a/src/game/effects/fx_blue_ring.c +++ b/src/game/effects/fx_blue_ring.c @@ -45,7 +45,8 @@ void FXBlueRing(centity_t *Owner, int Type, int Flags, vec3_t Origin) flameitem->r.model = blue_models[0]; flameitem->r.flags = RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; flameitem->r.frame = 0; - flameitem->r.scale = FLAME_INIT_SCALE; + VectorSet(flameitem->r.scale, + FLAME_INIT_SCALE, FLAME_INIT_SCALE, FLAME_INIT_SCALE); flameitem->d_scale = FLAME_DELTA_SCALE; VectorSet(flameitem->velocity, FLAME_ABSVEL * cos(curAng), FLAME_ABSVEL * sin(curAng), 0); diff --git a/src/game/effects/fx_bubbler.c b/src/game/effects/fx_bubbler.c index 089d54684..d23082e7f 100644 --- a/src/game/effects/fx_bubbler.c +++ b/src/game/effects/fx_bubbler.c @@ -58,8 +58,9 @@ qboolean FXBubbleThink(client_entity_t *bubble, centity_t *owner) static qboolean FXBubblerParticleSpawner(client_entity_t *spawner, centity_t *owner) { - client_entity_t *bubble; + client_entity_t *bubble; vec3_t origin; + float scale; VectorCopy(spawner->r.origin, origin); @@ -72,7 +73,8 @@ static qboolean FXBubblerParticleSpawner(client_entity_t *spawner, centity_t *ow bubble = ClientEntity_new(-1, 0, origin, NULL, spawner->SpawnData); bubble->r.model = bubbler_models[0]; - bubble->r.scale = flrand(0.10, 0.20); + scale = flrand(0.10, 0.20); + VectorSet(bubble->r.scale, scale, scale, scale); bubble->r.flags = RF_TRANSLUCENT; bubble->radius = flrand(0.5, 1.5); @@ -122,7 +124,7 @@ void FXBubble(centity_t *Owner, int Type, int Flags, vec3_t Origin) { int time; client_entity_t *bubble; - float up, down; + float up, down, scale; vec3_t dest; GetSolidDist(Origin, 1.0, 1000, &up); @@ -137,7 +139,8 @@ void FXBubble(centity_t *Owner, int Type, int Flags, vec3_t Origin) bubble = ClientEntity_new(FX_BUBBLE, Flags, Origin, NULL, time); bubble->r.model = bubbler_models[0]; - bubble->r.scale = flrand(0.025, 0.10); + scale = flrand(0.025, 0.10); + VectorSet(bubble->r.scale, scale, scale, scale); bubble->r.flags = RF_TRANSLUCENT; bubble->radius = BUBBLE_RADIUS*2; bubble->acceleration[2] = BUBBLE_ACCELERATION; diff --git a/src/game/effects/fx_crosshair.c b/src/game/effects/fx_crosshair.c index 558db5ad2..41207b27d 100644 --- a/src/game/effects/fx_crosshair.c +++ b/src/game/effects/fx_crosshair.c @@ -34,10 +34,16 @@ static qboolean FXDrawCrosshair(struct client_entity_s *cross_hair, centity_t *o // Get new destination if (fxi.Get_Crosshair(cross_hair->r.origin, &type)) { + float scale; + if (type > 2) + { cross_hair->r.frame = 0; + } else + { cross_hair->r.frame = type; + } cross_hair->r.flags = RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_NODEPTHTEST; @@ -50,7 +56,8 @@ static qboolean FXDrawCrosshair(struct client_entity_s *cross_hair, centity_t *o alpha = 0.0f; cross_hair->alpha = 0.25 + alpha * 0.5; - cross_hair->r.scale = alpha * 0.5; + scale = alpha * 0.5; + VectorSet(cross_hair->r.scale, scale, scale, scale); cross_hair->flags &= ~(CEF_CULLED | CEF_DISAPPEARED | CEF_NO_DRAW); } diff --git a/src/game/effects/fx_cwatcher.c b/src/game/effects/fx_cwatcher.c index aab463919..78bdba3fc 100644 --- a/src/game/effects/fx_cwatcher.c +++ b/src/game/effects/fx_cwatcher.c @@ -67,6 +67,8 @@ static qboolean FXCWBeamUpdate(struct client_entity_s *self, centity_t *owner) while (i--) { + float scale; + spawner = ClientEntity_new(FX_CWATCHER, CEF_DONT_LINK, self->r.origin, NULL, 1000); spawner->r.model = cwmodels[CWM_BEAM_LINE]; spawner->radius = 400; @@ -76,7 +78,9 @@ static qboolean FXCWBeamUpdate(struct client_entity_s *self, centity_t *owner) spawner->r.spriteType = SPRITE_LINE; - spawner->r.scale=flrand(1.5, 2.5); + scale = flrand(1.5, 2.5); + VectorSet(spawner->r.scale, scale, scale, scale); + spawner->alpha=0.75; spawner->d_alpha=-2.5; spawner->d_scale=-2.5; @@ -105,27 +109,40 @@ static qboolean FXCWBeamUpdate(struct client_entity_s *self, centity_t *owner) static qboolean FXCWBeamThink(struct client_entity_s *self, centity_t *owner) { + float scale; + if (self->LifeTime < fxi.cl->time) + { return false; + } - self->r.scale = flrand(14.0, 16.0); + scale = flrand(14.0, 16.0); + VectorSet(self->r.scale, scale, scale, scale); return true; } static qboolean FXCWBeamThink2(struct client_entity_s *self, centity_t *owner) { + float scale; + if (self->LifeTime < fxi.cl->time) + { return false; + } - self->r.scale = flrand(1.5, 2.0); + scale = flrand(1.5, 2.0); + VectorSet(self->r.scale, scale, scale, scale); return true; } static qboolean FXCWStarThink(struct client_entity_s *self, centity_t *owner) { - self->r.scale = flrand(0.3, 0.5); + float scale; + + scale = flrand(0.3, 0.5); + VectorSet(self->r.scale, scale, scale, scale); return true; } @@ -153,7 +170,7 @@ void FXCWatcherEffects(centity_t *owner, int type, int flags, vec3_t origin) spawner->r.frame = 0; spawner->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - spawner->r.scale=0.8; + VectorSet(spawner->r.scale, 0.8, 0.8, 0.8); spawner->alpha=0.5; spawner->d_alpha=0.0; @@ -169,7 +186,7 @@ void FXCWatcherEffects(centity_t *owner, int type, int flags, vec3_t origin) spawner->r.frame = 1; spawner->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD; - spawner->r.scale=0.5; + VectorSet(spawner->r.scale, 0.5, 0.5, 0.5); spawner->alpha=0.75; spawner->d_alpha=0.0; @@ -192,13 +209,16 @@ void FXCWatcherEffects(centity_t *owner, int type, int flags, vec3_t origin) while (i--) { + float scale; + spawner = ClientEntity_new(type, flags | CEF_DONT_LINK, origin, NULL, 500); spawner->r.model = cwmodels[CWM_STAR_HALO]; spawner->radius = 400; spawner->r.frame = 1; spawner->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - spawner->r.scale=flrand(0.5, 0.25); + scale = flrand(0.5, 0.25); + VectorSet(spawner->r.scale, scale, scale, scale); spawner->alpha=0.75; spawner->d_alpha=-2.0; spawner->d_scale=-0.5; @@ -214,6 +234,8 @@ void FXCWatcherEffects(centity_t *owner, int type, int flags, vec3_t origin) while (i--) { + float scale; + spawner = ClientEntity_new(type, flags | CEF_DONT_LINK, origin, NULL, 1000); spawner->r.model = cwmodels[CWM_STAR_TRAIL]; spawner->radius = 400; @@ -223,7 +245,8 @@ void FXCWatcherEffects(centity_t *owner, int type, int flags, vec3_t origin) spawner->r.spriteType = SPRITE_LINE; - spawner->r.scale=flrand(2.0, 1.5); + scale = flrand(2.0, 1.5); + VectorSet(spawner->r.scale, scale, scale, scale); spawner->alpha=0.75; spawner->d_alpha=-2.5; spawner->d_scale=-4.0; @@ -249,7 +272,7 @@ void FXCWatcherEffects(centity_t *owner, int type, int flags, vec3_t origin) spawner->radius = 400; spawner->r.flags = RF_TRANS_ADD | RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD_ALPHA; - spawner->r.scale = 16; + VectorSet(spawner->r.scale, 16, 16, 16); spawner->r.color.c = 0xA0FFFFFF; spawner->r.spriteType = SPRITE_LINE; VectorCopy(vel, spawner->r.startpos); @@ -268,7 +291,7 @@ void FXCWatcherEffects(centity_t *owner, int type, int flags, vec3_t origin) spawner->radius = 400; spawner->r.flags = RF_TRANS_ADD | RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD_ALPHA | RF_NODEPTHTEST; - spawner->r.scale = 2.5; + VectorSet(spawner->r.scale, 2.5, 2.5, 2.5); spawner->r.color.c = 0xFFFFFFFF; spawner->LifeTime = fxi.cl->time + 3100; @@ -292,7 +315,7 @@ void FXCWatcherEffects(centity_t *owner, int type, int flags, vec3_t origin) spawner->radius = 400; spawner->r.flags = RF_TRANS_ADD | RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD_ALPHA | RF_NODEPTHTEST; - spawner->r.scale = 2.5; + VectorSet(spawner->r.scale, 2.5, 2.5, 2.5); spawner->r.color.c = 0xFFFFFFFF; spawner->dlight=CE_DLight_new(white_light,200.0f,0.0f); diff --git a/src/game/effects/fx_debris.c b/src/game/effects/fx_debris.c index 4483e2141..e4bec4ab1 100644 --- a/src/game/effects/fx_debris.c +++ b/src/game/effects/fx_debris.c @@ -224,9 +224,13 @@ void DoFireTrail (client_entity_t *spawner) material = spawner->SpawnInfo & SIF_FLAG_MASK; if(material == MAT_FLESH || material == MAT_INSECT || spawner->effectID == FX_BODYPART) - master_scale = spawner->r.scale * 3.33; + { + master_scale = AVG_VEC3T(spawner->r.scale) * 3.33; + } else - master_scale = spawner->r.scale; + { + master_scale = AVG_VEC3T(spawner->r.scale); + } if (r_detail->value < DETAIL_NORMAL) flame_duration = 700.0; @@ -238,13 +242,16 @@ void DoFireTrail (client_entity_t *spawner) { flame = ClientParticle_new(irand(PART_16x16_FIRE1, PART_16x16_FIRE3), color, flame_duration); - radius = spawner->r.scale * 2.0; - VectorSet(flame->origin, flrand(-radius, radius), flrand(-radius, radius), flrand(-4.0F, -2.0F) * spawner->r.scale); + radius = AVG_VEC3T(spawner->r.scale) * 2.0; + VectorSet(flame->origin, + flrand(-radius, radius), + flrand(-radius, radius), + flrand(-4.0F, -2.0F) * AVG_VEC3T(spawner->r.scale)); VectorAdd(flame->origin, spawner->r.origin, flame->origin); flame->scale = master_scale; VectorSet(flame->velocity, flrand(-1.0, 1.0), flrand(-1, 1.0), flrand(17.0, 20.0)); - flame->acceleration[2] = 32.0 * spawner->r.scale; + flame->acceleration[2] = 32.0 * AVG_VEC3T(spawner->r.scale); flame->d_scale = flrand(-5.0, -2.5); flame->d_alpha = flrand(-200.0, -160.0); @@ -505,7 +512,7 @@ client_entity_t *FXDebris_Throw(vec3_t origin, int material, vec3_t dir, float k debris->r.model = debrisChunks[index].model; - debris->r.scale = scale; + VectorSet(debris->r.scale, scale, scale, scale); debris->r.angles[0] = flrand(-ANGLE_180, ANGLE_180); debris->r.angles[1] = flrand(-ANGLE_90, ANGLE_90); @@ -894,12 +901,12 @@ qboolean FXDebris_Vanish(struct client_entity_s *self, centity_t *owner) if(self->SpawnInfo&SIF_INLAVA) FXDarkSmoke(self->r.origin, flrand(0.2, 0.5), flrand(30, 50)); - if ((self->alpha < 0.1f)||(self->r.scale < 0.1f)) + if ((self->alpha < 0.1f)||(AVG_VEC3T(self->r.scale) < 0.1f)) { if(self->flags&CEF_FLAG6) {//let the smoke die out self->alpha = 0.0f; - self->r.scale = 0.0f; + VectorClear(self->r.scale); self->Update = FXDebris_Remove; self->updateTime = 1000; return true; @@ -916,7 +923,7 @@ qboolean FXDebris_Vanish(struct client_entity_s *self, centity_t *owner) self->flags &= ~CEF_FLAG6; self->d_alpha = -0.01; } - else if(flrand(0.0, 0.3)>self->r.scale) + else if(flrand(0.0, 0.3) > AVG_VEC3T(self->r.scale)) { self->dlight = NULL; self->flags &= ~CEF_FLAG6; diff --git a/src/game/effects/fx_defense_pickup.c b/src/game/effects/fx_defense_pickup.c index f8022a507..86d5202e8 100644 --- a/src/game/effects/fx_defense_pickup.c +++ b/src/game/effects/fx_defense_pickup.c @@ -94,10 +94,10 @@ void FXDefensePickup(centity_t *owner, int type, int flags, vec3_t origin) VectorCopy(ce->r.origin, ce->origin); ce->r.flags = RF_TRANSLUCENT | RF_GLOW; ce->r.model = defense_models[tag]; - ce->r.scale = 1.0; + VectorSet(ce->r.scale, 1.0, 1.0, 1.0); if (tag == ITEM_DEFENSE_TELEPORT) - ce->r.scale = 1.25; + VectorSet(ce->r.scale, 1.25, 1.25, 1.25); ce->radius = 10.0; ce->alpha = 0.8; @@ -126,11 +126,11 @@ void FXDefensePickup(centity_t *owner, int type, int flags, vec3_t origin) shield->d_alpha = 0.5; if (tag == 1) { - shield->r.scale = 0.2; + VectorSet(shield->r.scale, 0.2, 0.2, 0.2); } else { - shield->r.scale = 0.8; + VectorSet(shield->r.scale, 0.8, 0.8, 0.8); } shield->SpawnData = tag; diff --git a/src/game/effects/fx_dripper.c b/src/game/effects/fx_dripper.c index bec6557d6..6b500bf4b 100644 --- a/src/game/effects/fx_dripper.c +++ b/src/game/effects/fx_dripper.c @@ -41,7 +41,7 @@ qboolean FXDripThinkSolid(client_entity_t *drip, centity_t *owner) mist = ClientEntity_new(-1, 0, origin, NULL, 500); mist->r.model = drip_models[0]; - mist->r.scale = 0.5F; + VectorSet(mist->r.scale, 0.5, 0.5, 0.5); mist->r.flags = RF_TRANSLUCENT; mist->alpha = 0.4F; @@ -72,7 +72,7 @@ qboolean FXDripThinkWater(client_entity_t *drip, centity_t *owner) mist = ClientEntity_new(-1, 0, origin, NULL, 500); mist->r.model = drip_models[0]; - mist->r.scale = 0.5F; + VectorSet(mist->r.scale, 0.5, 0.5, 0.5); mist->r.flags = RF_TRANSLUCENT; mist->d_scale = -2.0; @@ -105,7 +105,7 @@ qboolean FXDripThinkLava(client_entity_t *drip, centity_t *owner) mist = ClientEntity_new(-1, 0, origin, NULL, 500); mist->r.model = drip_models[1]; - mist->r.scale = 0.5F; + VectorSet(mist->r.scale, 0.5, 0.5, 0.5); mist->r.flags = RF_TRANSLUCENT; mist->alpha = 0.4F; @@ -134,7 +134,7 @@ static qboolean FXDripperParticleSpawner(client_entity_t *spawner, centity_t *ow drip = ClientEntity_new(-1, 0, spawner->r.origin, NULL, spawner->SpawnDelay); drip->r.model = drip_models[2]; - drip->r.scale = 0.1F; + VectorSet(drip->r.scale, 0.1, 0.1, 0.1); drip->r.flags = RF_TRANSLUCENT | RF_ALPHA_TEXTURE; drip->r.frame = spawner->r.frame; diff --git a/src/game/effects/fx_fire.c b/src/game/effects/fx_fire.c index 6b8a882e4..7ac417119 100644 --- a/src/game/effects/fx_fire.c +++ b/src/game/effects/fx_fire.c @@ -50,7 +50,7 @@ void FXFlareup(centity_t *owner, int type, int flags, vec3_t origin) spawner->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; spawner->radius = 128.0; - spawner->r.scale = 1.0; + VectorSet(spawner->r.scale, 1.0, 1.0, 1.0); spawner->d_scale = -2.0; spawner->alpha = 0.95; spawner->d_alpha = -2.0; @@ -63,15 +63,15 @@ void FXFlareup(centity_t *owner, int type, int flags, vec3_t origin) { flame = ClientParticle_new(irand(PART_32x32_FIRE0, PART_32x32_FIRE2) | PFL_NEARCULL, spawner->color, 1000); - radius = spawner->r.scale * FLARE_SPAWN_RADIUS; + radius = AVG_VEC3T(spawner->r.scale) * FLARE_SPAWN_RADIUS; VectorSet(flame->origin, flrand(-radius, radius), flrand(-radius, radius), flrand(-radius, -radius)); - flame->scale = FLARE_SCALE * spawner->r.scale; + flame->scale = FLARE_SCALE * AVG_VEC3T(spawner->r.scale); VectorSet(flame->velocity, flrand(-FLARE_SPEED, FLARE_SPEED), flrand(-FLARE_SPEED, FLARE_SPEED), flrand(-FLARE_SPEED, FLARE_SPEED)); - flame->acceleration[2] = FLARE_ACCEL * spawner->r.scale; + flame->acceleration[2] = FLARE_ACCEL * AVG_VEC3T(spawner->r.scale); flame->d_scale = flrand(-20.0, -10.0); flame->d_alpha = flrand(-320.0, -256.0); @@ -104,12 +104,12 @@ qboolean FXFireThink(client_entity_t *spawner, centity_t *owner) flame = ClientParticle_new(PART_32x32_STEAM | PFL_NEARCULL, color, 2000); - radius = spawner->r.scale * FIRE_SPAWN_RADIUS; - VectorSet(flame->origin, flrand(-radius, radius), flrand(-radius, radius), 8 * spawner->r.scale); + radius = AVG_VEC3T(spawner->r.scale) * FIRE_SPAWN_RADIUS; + VectorSet(flame->origin, flrand(-radius, radius), flrand(-radius, radius), 8 * AVG_VEC3T(spawner->r.scale)); - flame->scale = (FIRE_SCALE * spawner->r.scale) / 2; + flame->scale = (FIRE_SCALE * AVG_VEC3T(spawner->r.scale)) / 2; VectorSet(flame->velocity, flrand(-5.0, 5.0), flrand(-5, 5.0), flrand(15.0, 22.0)); - flame->acceleration[2] = FIRE_ACCEL * spawner->r.scale; + flame->acceleration[2] = FIRE_ACCEL * AVG_VEC3T(spawner->r.scale); flame->d_scale = flrand(15.0, 20.0); flame->d_alpha = flrand(-100.0, -50.0); flame->duration = (color.a * 1000.0) / -flame->d_alpha; // time taken to reach zero alpha @@ -120,12 +120,12 @@ qboolean FXFireThink(client_entity_t *spawner, centity_t *owner) { flame = ClientParticle_new(irand(PART_32x32_FIRE0, PART_32x32_FIRE2) | PFL_NEARCULL, spawner->color, 2000); - radius = spawner->r.scale * FIRE_SPAWN_RADIUS; - VectorSet(flame->origin, flrand(-radius, radius), flrand(-radius, radius), flrand(-16.0F, -8.0F) * spawner->r.scale); + radius = AVG_VEC3T(spawner->r.scale) * FIRE_SPAWN_RADIUS; + VectorSet(flame->origin, flrand(-radius, radius), flrand(-radius, radius), flrand(-16.0F, -8.0F) * AVG_VEC3T(spawner->r.scale)); - flame->scale = FIRE_SCALE * spawner->r.scale; + flame->scale = FIRE_SCALE * AVG_VEC3T(spawner->r.scale); VectorSet(flame->velocity, flrand(-5.0, 5.0), flrand(-5, 5.0), flrand(15.0, 22.0)); - flame->acceleration[2] = FIRE_ACCEL * spawner->r.scale; + flame->acceleration[2] = FIRE_ACCEL * AVG_VEC3T(spawner->r.scale); flame->d_scale = flrand(-10.0, -5.0); flame->d_alpha = flrand(-200.0, -160.0); flame->duration = (255.0 * 1000.0) / -flame->d_alpha; // time taken to reach zero alpha @@ -143,13 +143,14 @@ qboolean FXFireThink(client_entity_t *spawner, centity_t *owner) void FXFire(centity_t *owner, int type, int flags, vec3_t origin) { - client_entity_t *spawner; - byte scale; + client_entity_t *spawner; + byte scale; spawner = ClientEntity_new(type, flags, origin, NULL, 17); fxi.GetEffect(owner, flags, clientEffectSpawners[FX_FIRE].formatString, &scale); - spawner->r.scale = scale / 32.0; + VectorSet(spawner->r.scale, + scale / 32.0, scale / 32.0, scale / 32.0); spawner->r.flags |= RF_FULLBRIGHT|RF_TRANSLUCENT|RF_TRANS_ADD|RF_TRANS_ADD_ALPHA; spawner->flags |= CEF_NO_DRAW | CEF_NOMOVE | CEF_CULLED | CEF_CHECK_OWNER | CEF_VIEWSTATUSCHANGED; @@ -196,13 +197,13 @@ qboolean FXFireOnEntityThink(client_entity_t *spawner, centity_t *owner) flame = ClientParticle_new(PART_32x32_STEAM | PFL_NEARCULL, color, 2000); - radius = spawner->r.scale; - VectorSet(flame->origin, flrand(-radius, radius), flrand(-radius, radius), flrand(-0.25, 0.75) * spawner->r.scale); + radius = AVG_VEC3T(spawner->r.scale); + VectorSet(flame->origin, flrand(-radius, radius), flrand(-radius, radius), flrand(-0.25, 0.75) * AVG_VEC3T(spawner->r.scale)); VectorAdd(flame->origin, spawner->origin, flame->origin); - flame->scale = spawner->r.scale*2.0; + flame->scale = AVG_VEC3T(spawner->r.scale) * 2.0; VectorSet(flame->velocity, flrand(-5.0, 5.0), flrand(-5, 5.0), flrand(15.0, 22.0)); - flame->acceleration[2] = FIRE_ACCEL * spawner->r.scale; + flame->acceleration[2] = FIRE_ACCEL * AVG_VEC3T(spawner->r.scale); flame->d_scale = flrand(15.0, 20.0); flame->d_alpha = flrand(-100.0, -50.0); flame->duration = (255.0 * 1000.0) / -flame->d_alpha; // time taken to reach zero alpha @@ -213,7 +214,7 @@ qboolean FXFireOnEntityThink(client_entity_t *spawner, centity_t *owner) { flame = ClientParticle_new(irand(PART_32x32_FIRE0, PART_32x32_FIRE2) | PFL_NEARCULL, spawner->color, 1000); - radius = spawner->r.scale ; + radius = AVG_VEC3T(spawner->r.scale); VectorSet(flame->origin, flrand(-radius, radius), flrand(-radius, radius), flrand(-0.25, 0.75)*radius); // If dead, then move the flame down a tad. if(owner->current.effects&EF_DISABLE_EXTRA_FX) @@ -222,9 +223,9 @@ qboolean FXFireOnEntityThink(client_entity_t *spawner, centity_t *owner) } VectorAdd(flame->origin, spawner->origin, flame->origin); - flame->scale = spawner->r.scale*2.0; + flame->scale = AVG_VEC3T(spawner->r.scale) *2.0; VectorSet(flame->velocity, flrand(-5.0, 5.0), flrand(-5, 5.0), flrand(32.0, 48.0)); - flame->acceleration[2] = 2.0 * spawner->r.scale; + flame->acceleration[2] = 2.0 * AVG_VEC3T(spawner->r.scale); flame->d_scale = flrand(-20.0, -10.0); flame->d_alpha = flrand(-400.0, -320.0); flame->duration = (255.0 * 1000.0) / -flame->d_alpha; // time taken to reach zero alpha @@ -277,8 +278,11 @@ qboolean FXFireOnEntity2Think(client_entity_t *spawner, centity_t *owner) { flame = ClientParticle_new(irand(PART_32x32_FIRE0, PART_32x32_FIRE2) | PFL_NEARCULL, spawner->color, 1000); - radius = spawner->r.scale * FIRE_SPAWN_RADIUS; - VectorSet(flame->origin, flrand(-radius, radius), flrand(-radius, radius), flrand(-8.0F, 0.0F) * spawner->r.scale); + radius = AVG_VEC3T(spawner->r.scale) * FIRE_SPAWN_RADIUS; + VectorSet(flame->origin, + flrand(-radius, radius), + flrand(-radius, radius), + flrand(-8.0F, 0.0F) * AVG_VEC3T(spawner->r.scale)); // If dead, then move the flame down a tad. if(owner->current.effects&EF_DISABLE_EXTRA_FX) { @@ -286,9 +290,9 @@ qboolean FXFireOnEntity2Think(client_entity_t *spawner, centity_t *owner) } VectorAdd(flame->origin, spawner->origin, flame->origin); - flame->scale = FIRE_ENT_SCALE * spawner->r.scale; + flame->scale = FIRE_ENT_SCALE * AVG_VEC3T(spawner->r.scale); VectorSet(flame->velocity, flrand(-5.0, 5.0), flrand(-5, 5.0), flrand(15.0, 22.0)); - flame->acceleration[2] = FIRE_ACCEL * spawner->r.scale; + flame->acceleration[2] = FIRE_ACCEL * AVG_VEC3T(spawner->r.scale); flame->d_scale = flrand(-10.0, -5.0); flame->d_alpha = flrand(-200.0, -160.0); flame->duration = (255.0 * 1000.0) / -flame->d_alpha; // time taken to reach zero alpha @@ -303,16 +307,18 @@ qboolean FXFireOnEntity2Think(client_entity_t *spawner, centity_t *owner) //FIXME: have it constantly check a flag so it can go out if under water! void FXFireOnEntity(centity_t *owner, int type, int flags, vec3_t origin) { - client_entity_t *spawner; - byte scale; - byte lifetime; - byte style; + client_entity_t *spawner; + byte scale; + float scalef; + byte lifetime; + byte style; fxi.GetEffect(owner, flags, clientEffectSpawners[FX_FIRE_ON_ENTITY].formatString, &scale, &lifetime, &style); spawner = ClientEntity_new(type, flags, origin, NULL, 17); - spawner->r.scale = sqrt((float)scale)*0.5; + scalef = sqrt((float)scale) * 0.5; + VectorSet(spawner->r.scale, scalef, scalef, scalef); spawner->nextEventTime = fxi.cl->time + (100*(int)lifetime); // How long to last. Lifetime was in 10th secs. spawner->r.flags |= RF_FULLBRIGHT|RF_TRANSLUCENT|RF_TRANS_ADD|RF_TRANS_ADD_ALPHA; diff --git a/src/game/effects/fx_flyingfist.c b/src/game/effects/fx_flyingfist.c index 26277395e..1f88d4e1a 100644 --- a/src/game/effects/fx_flyingfist.c +++ b/src/game/effects/fx_flyingfist.c @@ -40,7 +40,8 @@ void PreCacheFist() // FXFlyingFistTrailThink // ************************************************************************************************ -static qboolean FXFlyingFistTrailThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXFlyingFistTrailThink(struct client_entity_s *self, centity_t *owner) { client_entity_t *TrailEnt; vec3_t accel_dir; @@ -71,15 +72,21 @@ static qboolean FXFlyingFistTrailThink(struct client_entity_s *self, centity_t * if (self->flags & CEF_FLAG7) { + float scale; + TrailEnt->r.model = fist_models[1]; - TrailEnt->r.scale = 3.0 * (trailscale + flrand(0.0, 0.05)); + scale = 3.0 * (trailscale + flrand(0.0, 0.05)); + VectorSet(TrailEnt->r.scale, scale, scale, scale); VectorRandomCopy(self->r.origin, TrailEnt->r.origin, flrand(-8.0, 8.0)); VectorScale(accel_dir, flrand(-100.0, -400.0), TrailEnt->velocity); } else { + float scale; + TrailEnt->r.model = fist_models[0]; - TrailEnt->r.scale = trailscale + flrand(0.0, 0.05); + scale = trailscale + flrand(0.0, 0.05); + VectorSet(TrailEnt->r.scale, scale, scale, scale); VectorRandomCopy(self->r.origin, TrailEnt->r.origin, flrand(-5.0, 5.0)); VectorScale(accel_dir, flrand(-50.0, -400.0), TrailEnt->velocity); } @@ -127,9 +134,9 @@ void FXFlyingFist(centity_t *owner, int type, int flags, vec3_t origin) missile->r.model = fist_models[2]; missile->r.skinnum = 1; if (flags & CEF_FLAG8) // Wimpy shot, because didn't have mana. - missile->r.scale = 1.0; + VectorSet(missile->r.scale, 1.0, 1.0, 1.0); else - missile->r.scale = 1.5; + VectorSet(missile->r.scale, 1.5, 1.5, 1.5); LightColor.c = 0xff0000ff; // Red light lightsize = 160.0; @@ -228,12 +235,18 @@ void FXFlyingFistExplode(centity_t *owner,int type,int flags,vec3_t origin) blastvel = FIST_POWER_BLAST_VEL; if (wimpy) { - blastvel*=0.3; - SmokePuff->r.scale=flrand(0.8,1.4); + float scale; + + blastvel *= 0.3; + scale = flrand(0.8, 1.4); + VectorSet(SmokePuff->r.scale, scale, scale, scale); } else { - SmokePuff->r.scale=flrand(1.2,2.0); + float scale; + + scale = flrand(1.2, 2.0); + VectorSet(SmokePuff->r.scale, scale, scale, scale); } VectorRandomCopy(dir, SmokePuff->velocity, blastvel); @@ -242,16 +255,22 @@ void FXFlyingFistExplode(centity_t *owner,int type,int flags,vec3_t origin) } else { // Non-powered up. - SmokePuff->d_scale=-2.0; + SmokePuff->d_scale = -2.0; blastvel = FIST_BLAST_VEL; if (wimpy) { - blastvel*=0.5; - SmokePuff->r.scale=flrand(0.5,1.0); + float scale; + + blastvel *= 0.5; + scale = flrand(0.5, 1.0); + VectorSet(SmokePuff->r.scale, scale, scale, scale); } else { - SmokePuff->r.scale=flrand(0.8,1.6); + float scale; + + scale = flrand(0.8, 1.6); + VectorSet(SmokePuff->r.scale, scale, scale, scale); } VectorRandomCopy(dir, SmokePuff->velocity, blastvel); diff --git a/src/game/effects/fx_health_pickup.c b/src/game/effects/fx_health_pickup.c index 9cdfcbae3..6b3077028 100644 --- a/src/game/effects/fx_health_pickup.c +++ b/src/game/effects/fx_health_pickup.c @@ -82,9 +82,9 @@ void FXHealthPickup(centity_t *owner, int type, int flags, vec3_t origin) ce->r.flags = RF_GLOW | RF_TRANSLUCENT | RF_TRANS_ADD; if ((flags & CEF_FLAG6) >> 5) // Full health - ce->r.scale = 1; + VectorSet(ce->r.scale, 1.0, 1.0, 1.0); else - ce->r.scale = 1.5; + VectorSet(ce->r.scale, 1.5, 1.5, 1.5); ce->radius = 10.0; ce->alpha = 0.8; ce->Update = FXHealthPickupThink; diff --git a/src/game/effects/fx_hell_staff.c b/src/game/effects/fx_hell_staff.c index 8917122d6..32c46d52f 100644 --- a/src/game/effects/fx_hell_staff.c +++ b/src/game/effects/fx_hell_staff.c @@ -55,7 +55,7 @@ void FXHellbolt(centity_t *owner, int type, int flags, vec3_t origin) VectoAngles(vel, hellbolt->r.angles); VectorCopy(vel, hellbolt->velocity); - hellbolt->r.scale = 0.5; + VectorSet(hellbolt->r.scale, 0.5, 0.5, 0.5); hellbolt->r.color = lightcolor; hellbolt->d_alpha = 0.0; hellbolt->radius = 10.0F; @@ -171,17 +171,18 @@ void FXHellstaffPowerBurn(centity_t *owner, int type, int flags, vec3_t origin) // CreateEffect FX_WEAPON_HELLSTAFF_POWER -void FXHellstaffPower(centity_t *owner,int type,int flags, vec3_t origin) +void +FXHellstaffPower(centity_t *owner,int type,int flags, vec3_t origin) { - vec3_t endpos, curpos, dpos, angles; - vec3_t fwd, right, up, dir; - client_entity_t *beam, *beam2; - paletteRGBA_t lightcolor = {{{255, 255, 255, 255}}}; - int i; - client_particle_t *spark; - float len; - int count; - byte blen; + vec3_t endpos, curpos, dpos, angles; + vec3_t fwd, right, up, dir; + client_entity_t *beam, *beam2; + paletteRGBA_t lightcolor = {{{255, 255, 255, 255}}}; + int i; + client_particle_t *spark; + float len, scale; + int count; + byte blen; VectorClear(angles); fxi.GetEffect(owner,flags,clientEffectSpawners[FX_WEAPON_HELLSTAFF_POWER].formatString, &dir, &blen); @@ -196,7 +197,8 @@ void FXHellstaffPower(centity_t *owner,int type,int flags, vec3_t origin) beam = ClientEntity_new(-1, CEF_DONT_LINK | CEF_ABSOLUTE_PARTS | CEF_ADDITIVE_PARTS, origin, NULL, 333); beam->r.model = hell_models[1]; beam->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - beam->r.scale = flrand(6.0, 10.0); + scale = flrand(6.0, 10.0); + VectorSet(beam->r.scale, scale, scale, scale); beam->r.tile = len/flrand(40.0, 48.0); beam->r.tileoffset = flrand(0.0, 1.0); beam->radius = 40.0; @@ -212,7 +214,8 @@ void FXHellstaffPower(centity_t *owner,int type,int flags, vec3_t origin) beam2->r.model = hell_models[1]; beam2->r.frame = 1; beam2->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - beam2->r.scale = beam->r.scale * 1.4; + scale *= 1.4; + VectorSet(beam2->r.scale, scale, scale, scale); beam2->r.tile = beam->r.tile; beam2->r.tileoffset = beam->r.tileoffset; beam2->radius = 40.0; diff --git a/src/game/effects/fx_hitpuff.c b/src/game/effects/fx_hitpuff.c index 9f84224f9..b098a7f4c 100644 --- a/src/game/effects/fx_hitpuff.c +++ b/src/game/effects/fx_hitpuff.c @@ -67,10 +67,11 @@ void FXLightningHit(centity_t *owner, int type, int flags, vec3_t origin) blast->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT; // | blast->r.frame = 1; blast->radius = 64.0; - blast->r.scale=1.0; - blast->d_alpha=-4.0; - blast->d_scale=-2.0; - fxi.S_StartSound(blast->r.origin, -1, CHAN_WEAPON, fxi.S_RegisterSound("weapons/HellHit.wav"), 1, ATTN_NORM, 0); + VectorSet(blast->r.scale, 1.0, 1.0, 1.0); + blast->d_alpha = -4.0; + blast->d_scale = -2.0; + fxi.S_StartSound(blast->r.origin, -1, CHAN_WEAPON, + fxi.S_RegisterSound("weapons/HellHit.wav"), 1, ATTN_NORM, 0); blast->dlight = CE_DLight_new(color, 75.0f, 0.0f); VectorClear(blast->velocity); AddEffect(NULL, blast); diff --git a/src/game/effects/fx_hpproj.c b/src/game/effects/fx_hpproj.c index 09f69e34c..89bfbe05d 100644 --- a/src/game/effects/fx_hpproj.c +++ b/src/game/effects/fx_hpproj.c @@ -90,7 +90,8 @@ void PreCacheHPMissile() #define PRIESTESS_TELEPORT_LINEHEIGHT 764 -static qboolean FXHPTeleportLineThink(struct client_entity_s *self, centity_t *Owner) +static qboolean +FXHPTeleportLineThink(struct client_entity_s *self, centity_t *Owner) { client_entity_t *effect; client_particle_t *p; @@ -109,11 +110,15 @@ static qboolean FXHPTeleportLineThink(struct client_entity_s *self, centity_t *O self->SpawnInfo = 1; self->d_alpha = -1.0; - self->r.scale += 16; + self->r.scale[0] += 16; + self->r.scale[1] += 16; + self->r.scale[2] += 16; } else { - self->r.scale += 1.5; + self->r.scale[0] += 1.5; + self->r.scale[1] += 1.5; + self->r.scale[2] += 1.5; //Spawn some particles and some rock chunks @@ -157,6 +162,8 @@ static qboolean FXHPTeleportLineThink(struct client_entity_s *self, centity_t *O while(i--) { + float scale; + effect=ClientEntity_new( FX_HP_MISSILE, CEF_DONT_LINK, self->origin, @@ -165,7 +172,8 @@ static qboolean FXHPTeleportLineThink(struct client_entity_s *self, centity_t *O effect->r.model = hpproj_models[irand(8,9)]; - effect->r.scale = flrand(0.1, 0.5); + scale = flrand(0.1, 0.5); + VectorSet(effect->r.scale, scale, scale, scale); VectorCopy(self->r.origin, effect->r.origin); effect->r.origin[0] += irand(-32,32); @@ -176,7 +184,7 @@ static qboolean FXHPTeleportLineThink(struct client_entity_s *self, centity_t *O effect->acceleration[0] = irand(-150, 150); effect->acceleration[1] = irand(-150, 150); - effect->acceleration[2] = irand( 300, 600 - ( self->r.scale * 100) ); + effect->acceleration[2] = irand( 300, 600 - (AVG_VEC3T(self->r.scale) * 100) ); effect->d_alpha = -0.25; @@ -189,15 +197,18 @@ static qboolean FXHPTeleportLineThink(struct client_entity_s *self, centity_t *O return true; } -static qboolean FXHPTeleportLineThink2(struct client_entity_s *self, centity_t *Owner) +static qboolean +FXHPTeleportLineThink2(struct client_entity_s *self, centity_t *Owner) { if (self->alpha <= 0.0f) return false; - if (self->r.scale <= 0.0f) + if (AVG_VEC3T(self->r.scale) <= 0.0f) return false; - self->r.scale -= 4; + self->r.scale[0] -= 4; + self->r.scale[1] -= 4; + self->r.scale[2] -= 4; return true; } @@ -206,7 +217,8 @@ static qboolean FXHPTeleportLineThink2(struct client_entity_s *self, centity_t * FXHPMissileSpawnerThink -----------------------------------------------*/ -static qboolean FXHPMissileSpawnerThink(struct client_entity_s *self, centity_t *Owner) +static qboolean +FXHPMissileSpawnerThink(struct client_entity_s *self, centity_t *Owner) { client_entity_t *TrailEnt; @@ -226,7 +238,7 @@ static qboolean FXHPMissileSpawnerThink(struct client_entity_s *self, centity_t TrailEnt->r.color.c = 0xFFFFFFFF; TrailEnt->alpha = 1.0; - TrailEnt->r.scale = 0.1; + VectorSet(TrailEnt->r.scale, 0.1, 0.1, 0.1); TrailEnt->d_alpha = -2.5; TrailEnt->d_scale = 4.0; @@ -246,7 +258,8 @@ static qboolean FXHPMissileSpawnerThink(struct client_entity_s *self, centity_t FXHPMissileSpawnerThink2 -----------------------------------------------*/ -static qboolean FXHPMissileSpawnerThink2(struct client_entity_s *self, centity_t *Owner) +static qboolean +FXHPMissileSpawnerThink2(struct client_entity_s *self, centity_t *Owner) { client_entity_t *TrailEnt; @@ -270,7 +283,7 @@ static qboolean FXHPMissileSpawnerThink2(struct client_entity_s *self, centity_t TrailEnt->r.color.a = 255; TrailEnt->alpha = 0.5; - TrailEnt->r.scale = 0.25; + VectorSet(TrailEnt->r.scale, 0.25, 0.25, 0.25); TrailEnt->d_alpha = -2.5; TrailEnt->d_scale = 2.0; @@ -290,9 +303,10 @@ static qboolean FXHPMissileSpawnerThink2(struct client_entity_s *self, centity_t FXHPHaloDie -----------------------------------------------*/ -static qboolean FXHPHaloDie(struct client_entity_s *self, centity_t *Owner) +static qboolean +FXHPHaloDie(struct client_entity_s *self, centity_t *Owner) { - if (self->r.scale <= 0.0f) + if (AVG_VEC3T(self->r.scale) <= 0.0f) return false; if (self->alpha <= 0.0f) @@ -304,7 +318,8 @@ static qboolean FXHPHaloDie(struct client_entity_s *self, centity_t *Owner) FXHPMissileSpawnerThink3 -----------------------------------------------*/ -static qboolean FXHPMissileSpawnerThink3(struct client_entity_s *self, centity_t *Owner) +static qboolean +FXHPMissileSpawnerThink3(struct client_entity_s *self, centity_t *Owner) { if (self->LifeTime < fxi.cl->time) { @@ -316,11 +331,13 @@ static qboolean FXHPMissileSpawnerThink3(struct client_entity_s *self, centity_t if (self->d_scale == 0.0) { - self->r.scale = flrand(1.75, 2.25); + float scale = flrand(1.75, 2.25); + + VectorSet(self->r.scale, scale, scale, scale); return true; } - if (self->r.scale >= 2) + if (AVG_VEC3T(self->r.scale) >= 2) self->d_scale = 0.0; if (self->alpha > 0.5) @@ -336,12 +353,17 @@ static qboolean FXHPMissileSpawnerThink3(struct client_entity_s *self, centity_t FXHPTrailThink -----------------------------------------------*/ -static qboolean FXHPTrailThink(struct client_entity_s *self, centity_t *Owner) +static qboolean +FXHPTrailThink(struct client_entity_s *self, centity_t *Owner) { - if (self->alpha <= 0.1 || self->r.scale <= 0.0) + if (self->alpha <= 0.1 || AVG_VEC3T(self->r.scale) <= 0.0) + { return false; + } - self->r.scale -= 0.1; + self->r.scale[0] -= 0.1; + self->r.scale[1] -= 0.1; + self->r.scale[2] -= 0.1; return true; } @@ -350,12 +372,17 @@ static qboolean FXHPTrailThink(struct client_entity_s *self, centity_t *Owner) FXHPTrailThink2 -----------------------------------------------*/ -static qboolean FXHPTrailThink2(struct client_entity_s *self, centity_t *Owner) +static qboolean +FXHPTrailThink2(struct client_entity_s *self, centity_t *Owner) { - if (self->alpha <= 0.1 || self->r.scale <= 0.0) + if (self->alpha <= 0.1 || AVG_VEC3T(self->r.scale) <= 0.0) + { return false; + } - self->r.scale -= 0.15; + self->r.scale[0] -= 0.15; + self->r.scale[1] -= 0.15; + self->r.scale[2] -= 0.15; return true; } @@ -364,12 +391,17 @@ static qboolean FXHPTrailThink2(struct client_entity_s *self, centity_t *Owner) FXHPTrailThink3 -----------------------------------------------*/ -static qboolean FXHPTrailThink3(struct client_entity_s *self, centity_t *Owner) +static qboolean +FXHPTrailThink3(struct client_entity_s *self, centity_t *Owner) { - if (self->alpha <= 0.1 || self->r.scale <= 0.0) + if (self->alpha <= 0.1 || AVG_VEC3T(self->r.scale) <= 0.0) + { return false; + } - self->r.scale -= 0.25; + self->r.scale[0] -= 0.25; + self->r.scale[1] -= 0.25; + self->r.scale[2] -= 0.25; return true; } @@ -378,9 +410,13 @@ static qboolean FXHPTrailThink3(struct client_entity_s *self, centity_t *Owner) FXHPBugThink -----------------------------------------------*/ -static qboolean FXHPBugThink(struct client_entity_s *self, centity_t *Owner) +static qboolean +FXHPBugThink(struct client_entity_s *self, centity_t *Owner) { - self->r.scale = flrand(0.2, 0.4); + float scale; + + scale = flrand(0.2, 0.4); + VectorSet(self->r.scale, scale, scale, scale); self->alpha = flrand(0.3, 0.5); return true; @@ -390,11 +426,14 @@ static qboolean FXHPBugThink(struct client_entity_s *self, centity_t *Owner) FXHPMissileTrailThink -----------------------------------------------*/ -static qboolean FXHPMissileTrailThink(struct client_entity_s *self, centity_t *Owner) +static qboolean +FXHPMissileTrailThink(struct client_entity_s *self, centity_t *Owner) { client_entity_t *TrailEnt; + float scale; - self->r.scale = flrand(0.35, 0.65); + scale = flrand(0.35, 0.65); + VectorSet(self->r.scale, scale, scale, scale); TrailEnt=ClientEntity_new(FX_HP_MISSILE, CEF_DONT_LINK, @@ -411,9 +450,9 @@ static qboolean FXHPMissileTrailThink(struct client_entity_s *self, centity_t *O TrailEnt->r.spriteType = SPRITE_LINE; TrailEnt->r.tile = 1; - TrailEnt->r.scale = 2.5; + VectorSet(TrailEnt->r.scale, 2.5, 2.5, 2.5); TrailEnt->alpha = 1.0; - TrailEnt->r.scale = 1.0; + VectorSet(TrailEnt->r.scale, 1.0, 1.0, 1.0); VectorCopy( self->startpos, TrailEnt->r.startpos ); VectorCopy( Owner->origin , TrailEnt->r.endpos ); @@ -433,11 +472,15 @@ static qboolean FXHPMissileTrailThink(struct client_entity_s *self, centity_t *O FXHPMissileTrailThink2 -----------------------------------------------*/ -static qboolean FXHPMissileTrailThink2(struct client_entity_s *self, centity_t *Owner) +static qboolean +FXHPMissileTrailThink2(struct client_entity_s *self, centity_t *Owner) { client_entity_t *TrailEnt; + float scale; + + scale = flrand(0.35, 0.55); + VectorSet(self->r.scale, scale, scale, scale); - self->r.scale = flrand(0.35, 0.55); TrailEnt=ClientEntity_new(FX_HP_MISSILE, CEF_DONT_LINK, @@ -454,9 +497,9 @@ static qboolean FXHPMissileTrailThink2(struct client_entity_s *self, centity_t * TrailEnt->r.spriteType = SPRITE_LINE; TrailEnt->r.tile = 1; - TrailEnt->r.scale = 2; + VectorSet(TrailEnt->r.scale, 2.0, 2.0, 2.0); TrailEnt->alpha = 1.0; - TrailEnt->r.scale = 1.0; + VectorSet(TrailEnt->r.scale, 1.0, 1.0, 1.0); VectorCopy( self->startpos, TrailEnt->r.startpos ); VectorCopy( Owner->origin , TrailEnt->r.endpos ); @@ -476,7 +519,8 @@ static qboolean FXHPMissileTrailThink2(struct client_entity_s *self, centity_t * FXHPMissileTrailThink3 -----------------------------------------------*/ -static qboolean FXHPMissileTrailThink3(struct client_entity_s *self, centity_t *Owner) +static qboolean +FXHPMissileTrailThink3(struct client_entity_s *self, centity_t *Owner) { client_entity_t *TrailEnt; @@ -495,9 +539,9 @@ static qboolean FXHPMissileTrailThink3(struct client_entity_s *self, centity_t * TrailEnt->r.spriteType = SPRITE_LINE; TrailEnt->r.tile = 1; - TrailEnt->r.scale = 2.0; + VectorSet(TrailEnt->r.scale, 2.0, 2.0, 2.0); TrailEnt->alpha = 1.0; - TrailEnt->r.scale = 1.0; + VectorSet(TrailEnt->r.scale, 1.0, 1.0, 1.0); VectorCopy( self->startpos, TrailEnt->r.startpos ); VectorCopy( Owner->origin , TrailEnt->r.endpos ); @@ -529,13 +573,16 @@ void FXHPMissileExplode(struct client_entity_s *self, centity_t *Owner) while(i--) { + float scale; + if (!i) SmokePuff=ClientEntity_new(FX_HP_MISSILE,0,Owner->origin,NULL,500); else SmokePuff=ClientEntity_new(FX_HP_MISSILE,0,Owner->origin,NULL,1500); SmokePuff->r.model = hpproj_models[3]; - SmokePuff->r.scale=flrand(0.5,1.0); + scale = flrand(0.5, 1.0); + VectorSet(SmokePuff->r.scale, scale, scale, scale); SmokePuff->d_scale = flrand(-1.0, -1.5); SmokePuff->r.flags |=RF_FULLBRIGHT|RF_TRANSLUCENT|RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; @@ -571,13 +618,16 @@ void FXHPBugExplode(struct client_entity_s *self, centity_t *Owner) while(i--) { + float scale; + if (!i) SmokePuff=ClientEntity_new(FX_HP_MISSILE,0,Owner->origin,NULL,500); else SmokePuff=ClientEntity_new(FX_HP_MISSILE,0,Owner->origin,NULL,1500); SmokePuff->r.model = hpproj_models[0]; - SmokePuff->r.scale=flrand(0.5,1.0); + scale = flrand(0.5,1.0); + VectorSet(SmokePuff->r.scale, scale, scale, scale); SmokePuff->d_scale=-2.0; SmokePuff->r.flags |=RF_FULLBRIGHT|RF_TRANSLUCENT|RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; @@ -611,14 +661,15 @@ void FXHPMissileCreateWarp(centity_t *Owner,int Type,int Flags,vec3_t Origin) Trail->r.model = hpproj_models[3]; Trail->r.color.c = 0xffff5555; Trail->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - Trail->r.scale = 0.1; + VectorSet(Trail->r.scale, 0.1, 0.1, 0.1); Trail->d_scale = 2.0; Trail->d_alpha = -2.0; AddEffect(NULL,Trail); } -static qboolean PriestessLinkedEntityUpdatePlacement(struct client_entity_s *self, centity_t *owner) +static qboolean +PriestessLinkedEntityUpdatePlacement(struct client_entity_s *self, centity_t *owner) { LinkedEntityUpdatePlacement(self, owner); VectorCopy(self->r.origin, self->r.startpos); @@ -637,7 +688,7 @@ void FXHPMissile(centity_t *Owner,int Type,int Flags,vec3_t Origin) paletteRGBA_t BugColor = {{{229, 250, 88, 255}}}; paletteRGBA_t BrightColor = {{{255, 255, 255, 255}}}; vec3_t vel, boltDir, boltAng, oldPos, ang, huntdir; - float boltStep, width, alpha; + float boltStep, width, alpha, scale; byte effectType; int bends, i, bolts, j; @@ -661,7 +712,7 @@ void FXHPMissile(centity_t *Owner,int Type,int Flags,vec3_t Origin) Trail->r.model = hpproj_models[3]; Trail->r.color.c = 0x00999999; Trail->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - Trail->r.scale = 0.5; + VectorSet(Trail->r.scale, 0.5, 0.5, 0.5); Trail->AddToView = PriestessLinkedEntityUpdatePlacement; VectorCopy(Origin, Trail->startpos); @@ -686,7 +737,7 @@ void FXHPMissile(centity_t *Owner,int Type,int Flags,vec3_t Origin) Trail->r.model = hpproj_models[3]; Trail->r.color.c = 0x00999999; Trail->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - Trail->r.scale = 0.45; + VectorSet(Trail->r.scale, 0.45, 0.45, 0.45); Trail->AddToView = PriestessLinkedEntityUpdatePlacement; VectorCopy(Owner->origin, Trail->startpos); @@ -714,7 +765,8 @@ void FXHPMissile(centity_t *Owner,int Type,int Flags,vec3_t Origin) Trail->r.angles[PITCH] -= ANGLE_90; Trail->r.color.c = 0xFF999999; - Trail->r.scale = flrand(0.3, 0.4); + scale = flrand(0.3, 0.4); + VectorSet(Trail->r.scale, scale, scale, scale); Trail->AddToView = LinkedEntityUpdatePlacement; VectorCopy(Owner->origin, Trail->startpos); @@ -740,7 +792,8 @@ void FXHPMissile(centity_t *Owner,int Type,int Flags,vec3_t Origin) Trail->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - Trail->r.scale = flrand(0.3, 0.4); + scale = flrand(0.3, 0.4); + VectorSet(Trail->r.scale, scale, scale, scale); Trail->AddToView = LinkedEntityUpdatePlacement; @@ -759,6 +812,8 @@ void FXHPMissile(centity_t *Owner,int Type,int Flags,vec3_t Origin) while (i--) { + float scale; + Trail = ClientEntity_new( Type, CEF_DONT_LINK, Origin, NULL, 2000); Trail->radius = 500; @@ -767,9 +822,10 @@ void FXHPMissile(centity_t *Owner,int Type,int Flags,vec3_t Origin) Trail->r.spriteType = SPRITE_LINE; Trail->r.tile = 1; - Trail->r.scale = irand(1.0, 2.0); + scale = irand(1.0, 2.0); + VectorSet(Trail->r.scale, scale, scale, scale); Trail->alpha = 1.0; - Trail->r.scale = 1.0; + VectorSet(Trail->r.scale, 1.0, 1.0, 1.0); ang[PITCH] = irand( 0, 720 ); ang[YAW] = irand( 0, 720 ); @@ -830,9 +886,9 @@ void FXHPMissile(centity_t *Owner,int Type,int Flags,vec3_t Origin) Trail->r.model = hpproj_models[10]; Trail->r.spriteType = SPRITE_LINE; - Trail->r.scale = width; + VectorSet(Trail->r.scale, width, width, width); Trail->alpha = 1.0; - Trail->r.scale = 1.0; + VectorSet(Trail->r.scale, 1.0, 1.0, 1.0); VectorCopy(vel, Trail->r.origin); @@ -934,7 +990,7 @@ void FXHPMissile(centity_t *Owner,int Type,int Flags,vec3_t Origin) Trail->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; Trail->r.model = hpproj_models[4]; - Trail->r.scale = 0.1; + VectorSet(Trail->r.scale, 0.1, 0.1, 0.1); Trail->alpha = 1.0; Trail->d_alpha = -1.0; Trail->d_scale = 4.0; @@ -952,7 +1008,7 @@ void FXHPMissile(centity_t *Owner,int Type,int Flags,vec3_t Origin) Trail->Update=FXHPMissileSpawnerThink3; Trail->r.model = hpproj_models[4]; - Trail->r.scale = 0.1; + VectorSet(Trail->r.scale, 0.1, 0.1, 0.1); Trail->alpha = 0.1; Trail->d_alpha = 0.5; Trail->d_scale = 2.0; @@ -985,9 +1041,9 @@ void FXHPMissile(centity_t *Owner,int Type,int Flags,vec3_t Origin) Trail->r.model = hpproj_models[7]; Trail->r.spriteType = SPRITE_LINE; Trail->r.tile = 1.0; - Trail->r.scale = 2; + VectorSet(Trail->r.scale, 2.0, 2.0, 2.0); Trail->alpha = 1.0; - Trail->r.scale = 1.0; + VectorSet(Trail->r.scale, 1.0, 1.0, 1.0); VectorCopy( Origin, Trail->r.startpos ); Trail->r.startpos[2] -= 128; @@ -1016,9 +1072,9 @@ void FXHPMissile(centity_t *Owner,int Type,int Flags,vec3_t Origin) Trail->r.model = hpproj_models[7]; Trail->r.spriteType = SPRITE_LINE; Trail->r.tile = 1.0; - Trail->r.scale = 64; + VectorSet(Trail->r.scale, 64, 64, 64); Trail->alpha = 1.0; - Trail->r.scale = 1.0; + VectorSet(Trail->r.scale, 1.0, 1.0, 1.0); VectorCopy( Origin, Trail->r.startpos ); Trail->r.startpos[2] -= 128; @@ -1085,7 +1141,7 @@ qboolean HPStaffTrailThink(struct client_entity_s *self, centity_t *owner) Trail->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; Trail->r.model = hpstaff_models[0]; - Trail->r.scale = 0.75; + VectorSet(Trail->r.scale, 0.75, 0.75, 0.75); Trail->alpha = 0.5; Trail->d_alpha = -2.0; Trail->d_scale = -2.0; diff --git a/src/game/effects/fx_insectstaff.c b/src/game/effects/fx_insectstaff.c index 62ffeb8fc..8818f8942 100644 --- a/src/game/effects/fx_insectstaff.c +++ b/src/game/effects/fx_insectstaff.c @@ -82,19 +82,21 @@ static qboolean FXGlobeOfOuchinessGlowballSpawnerThink(struct client_entity_s *s // FXInsectStaffTrailThink // ************************************************************************************************ -static qboolean FXInsectStaffTrailThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXInsectStaffTrailThink(struct client_entity_s *self, centity_t *owner) { vec3_t TrailStart,Trail; float TrailLength,DeltaTrailLength; vec3_t Right,Up; int NoOfIntervals; - float Theta,DeltaTheta; + float Theta, DeltaTheta, scale; client_entity_t *TrailEnt; VectorCopy(owner->origin,TrailStart); VectorSubtract(owner->origin, self->origin, Trail); - self->r.scale = flrand(0.8, 1.3); + scale = flrand(0.8, 1.3); + VectorSet(self->r.scale, scale, scale, scale); if((TrailLength=VectorNormalize(Trail))>0.05) { PerpendicularVector(Right,Trail); @@ -113,6 +115,7 @@ static qboolean FXInsectStaffTrailThink(struct client_entity_s *self, centity_t while(TrailLength>0.0) { + float scale; TrailEnt=ClientEntity_new(FX_I_EFFECTS, self->flags&~(CEF_OWNERS_ORIGIN|CEF_NO_DRAW), @@ -128,7 +131,8 @@ static qboolean FXInsectStaffTrailThink(struct client_entity_s *self, centity_t VectorRandomCopy(self->velocity, TrailEnt->velocity, flrand(0, 4)); - TrailEnt->r.scale = FIST_SCALE+flrand(0.0, 0.05); + scale = FIST_SCALE + flrand(0.0, 0.05); + VectorSet(TrailEnt->r.scale, scale, scale, scale); TrailEnt->d_alpha = flrand(-1.75, -2); TrailEnt->d_scale = flrand(-0.75, -1.0); TrailEnt->radius=20.0; @@ -156,12 +160,14 @@ void FXInsectStaff(centity_t *owner,int type,int flags,vec3_t origin) { client_entity_t *Trail; paletteRGBA_t LightColor = {{{255, 64, 32, 255}}}; + float scale; Trail=ClientEntity_new(type, flags, origin, NULL, 17); Trail->r.model = ins_models[0]; Trail->r.flags = RF_TRANSLUCENT | RF_TRANS_ADD; - Trail->r.scale = flrand(0.8, 1.3); + scale = flrand(0.8, 1.3); + VectorSet(Trail->r.scale, scale, scale, scale); Trail->d_alpha = 0.0f; Trail->d_scale = 0.0f; Trail->r.color.c = 0xffffffff; @@ -229,9 +235,13 @@ void FXInsectStaffExplode(centity_t *owner,int type,int flags,vec3_t origin, vec // FXGlobeOfOuchinessGlobeThink - // **************************************************************************** -static qboolean FXGlobeOfOuchinessGlobeThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXGlobeOfOuchinessGlobeThink(struct client_entity_s *self, centity_t *owner) { - self->r.scale = flrand(0.35, 0.50); + float scale; + + scale = flrand(0.35, 0.50); + VectorSet(self->r.scale, scale, scale, scale); return true; } @@ -240,7 +250,8 @@ static qboolean FXGlobeOfOuchinessGlobeThink(struct client_entity_s *self, centi // FXGlobeOfOuchinessAuraThink - // **************************************************************************** -static qboolean FXGlobeOfOuchinessAuraThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXGlobeOfOuchinessAuraThink(struct client_entity_s *self, centity_t *owner) { vec3_t TrailStart,Trail; float TrailLength,DeltaTrailLength; @@ -313,10 +324,10 @@ static qboolean FXGlobeOfOuchinessAuraThink(struct client_entity_s *self, centit void FXInsectGlobe(centity_t *owner,int type,int flags,vec3_t origin, short CasterEntnum) { - client_entity_t *GlobeThinker, - *AuraThinker; - paletteRGBA_t LightColor = {{{0, 0, 255, 255}}}; - int caster_update; + client_entity_t *GlobeThinker, *AuraThinker; + paletteRGBA_t LightColor = {{{0, 0, 255, 255}}}; + int caster_update; + float scale; // Create a fiery blue aura around the globe. @@ -342,7 +353,8 @@ void FXInsectGlobe(centity_t *owner,int type,int flags,vec3_t origin, short Cast GlobeThinker->r.model = globe_models[1]; GlobeThinker->r.flags |= RF_TRANSLUCENT|RF_TRANS_ADD; - GlobeThinker->r.scale = flrand(0.15, 0.20); + scale = flrand(0.15, 0.20); + VectorSet(GlobeThinker->r.scale, scale, scale, scale); GlobeThinker->r.color.r=irand(128, 180); GlobeThinker->r.color.g=irand(128, 180); @@ -359,7 +371,8 @@ void FXInsectGlobe(centity_t *owner,int type,int flags,vec3_t origin, short Cast // FXGlobeOfOuchinessGlowballThink - // **************************************************************************** -static qboolean FXGlobeOfOuchinessGlowballThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXGlobeOfOuchinessGlowballThink(struct client_entity_s *self, centity_t *owner) { client_entity_t *Spark; @@ -369,6 +382,7 @@ static qboolean FXGlobeOfOuchinessGlowballThink(struct client_entity_s *self, ce if(self->color.r>3) { // Create a trailing spark. + float scale; Spark=ClientEntity_new(FX_I_EFFECTS, self->flags&~(CEF_OWNERS_ORIGIN), @@ -378,7 +392,8 @@ static qboolean FXGlobeOfOuchinessGlowballThink(struct client_entity_s *self, ce Spark->r.model = globe_models[2]; Spark->r.flags|=RF_FULLBRIGHT|RF_TRANSLUCENT|RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - Spark->r.scale = FIST_SCALE+flrand(0.0, 0.05); + scale = FIST_SCALE + flrand(0.0, 0.05); + VectorSet(Spark->r.scale, scale, scale, scale); Spark->d_alpha = flrand(-1.75, -2); Spark->d_scale = flrand(-0.75, -1.0); Spark->radius=20.0; @@ -414,7 +429,8 @@ static qboolean FXGlobeOfOuchinessGlowballThink(struct client_entity_s *self, ce // FXGlobeOfOuchinessGlowballSpawnerThink - // **************************************************************************** -static qboolean FXGlobeOfOuchinessGlowballSpawnerThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXGlobeOfOuchinessGlowballSpawnerThink(struct client_entity_s *self, centity_t *owner) { client_entity_t *Glowball; vec3_t Forward,Right, @@ -573,7 +589,7 @@ void FXISpear(centity_t *owner, int type, int flags, vec3_t origin, vec3_t vel) hellbolt->r.model = spear_models[0]; hellbolt->r.flags = RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - hellbolt->r.scale = 1.0; + VectorSet(hellbolt->r.scale, 1.0, 1.0, 1.0); hellbolt->r.color = LightColor; hellbolt->d_alpha = 0.0; hellbolt->radius = 10.0F; @@ -590,11 +606,12 @@ qboolean FXISpear2Update(struct client_entity_s *self, centity_t *owner) { client_particle_t *spark; int i; - float dist; + float dist, scale; vec3_t dir; self->r.color.a = irand(128, 136); - self->r.scale = flrand(0.1, 0.5); + scale = flrand(0.1, 0.5); + VectorSet(self->r.scale, scale, scale, scale); if(!VectorCompare(owner->lerp_origin, self->startpos2)) VectorCopy(owner->lerp_origin, self->startpos2); @@ -635,6 +652,7 @@ void FXISpear2(centity_t *owner, int type, int flags, vec3_t origin) { client_entity_t *hellbolt; paletteRGBA_t LightColor = {{{255, 128, 255, 255}}}; + float scale; hellbolt = ClientEntity_new(type, CEF_OWNERS_ORIGIN | CEF_ABSOLUTE_PARTS, origin, NULL, 20); @@ -642,7 +660,8 @@ void FXISpear2(centity_t *owner, int type, int flags, vec3_t origin) hellbolt->r.flags = RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; hellbolt->r.color.c = 0xffffffff; - hellbolt->r.scale = flrand(0.2, 0.4); + scale = flrand(0.2, 0.4); + VectorSet(hellbolt->r.scale, scale, scale, scale); hellbolt->d_alpha = 0.0; hellbolt->radius = 10.0F; hellbolt->AddToView = LinkedEntityUpdatePlacement; @@ -662,7 +681,8 @@ void FXISpear2(centity_t *owner, int type, int flags, vec3_t origin) hellbolt->r.flags = RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; hellbolt->r.color.c = 0x33ffffff; - hellbolt->r.scale = flrand(1, 2); + scale = flrand(1, 2); + VectorSet(hellbolt->r.scale, scale, scale, scale); hellbolt->d_alpha = 0.0; hellbolt->radius = 10.0F; hellbolt->AddToView = LinkedEntityUpdatePlacement; @@ -689,11 +709,14 @@ void FXISpMslHit(centity_t *owner, int type, int flags, vec3_t origin, vec3_t Di for(i = 0; i < NUM_SPEAR_EXPLODES; i++) { + float scale; + smokepuff = ClientEntity_new(type, flags, origin, NULL, 500); smokepuff->r.model = spear_models[1]; smokepuff->r.flags = RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - smokepuff->r.scale = flrand(0.2, 0.3); + scale = flrand(0.2, 0.3); + VectorSet(smokepuff->r.scale, scale, scale, scale); smokepuff->r.color = lightcolor; VectorRandomCopy(Dir, smokepuff->velocity, 64); @@ -715,18 +738,22 @@ void FXISpMslHit(centity_t *owner, int type, int flags, vec3_t origin, vec3_t Di void FXISpMslHit2(centity_t *owner, int type, int flags, vec3_t origin, vec3_t Dir) { - client_entity_t *smokepuff; - int i; + client_entity_t *smokepuff; + float scale; + int i; Vec3ScaleAssign(32.0, Dir); for(i = 0; i < NUM_SPEAR_EXPLODES; i++) { + float scale; + smokepuff = ClientEntity_new(type, flags, origin, NULL, 500); smokepuff->r.model = spear_models[2]; smokepuff->r.flags = RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - smokepuff->r.scale = flrand(0.7, 1); + scale = flrand(0.7, 1); + VectorSet(smokepuff->r.scale, scale, scale, scale); VectorRandomCopy(Dir, smokepuff->velocity, 64); VectorSet(smokepuff->acceleration, 0.0, 0.0, GetGravity() * 0.3); @@ -750,7 +777,8 @@ void FXISpMslHit2(centity_t *owner, int type, int flags, vec3_t origin, vec3_t D smokepuff->r.flags = RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; smokepuff->r.color.c = 0x77ffffff; - smokepuff->r.scale = flrand(0.3, 0.5); + scale = flrand(0.3, 0.5); + VectorSet(smokepuff->r.scale, scale, scale, scale); smokepuff->d_scale = 2; smokepuff->d_alpha = -2; smokepuff->radius = 10.0F; @@ -763,7 +791,8 @@ void FXISpMslHit2(centity_t *owner, int type, int flags, vec3_t origin, vec3_t D // INSECT_SPEAR, // INSECT_RIGHTFOOT, // INSECT_LEFTFOOT, -static qboolean FXStaffElementThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXStaffElementThink(struct client_entity_s *self, centity_t *owner) { float Frac, Multiplier; @@ -799,7 +828,8 @@ static qboolean FXStaffElementThink(struct client_entity_s *self, centity_t *own // ----------------- // ************************************************************************************************ -static qboolean FXISwordTrailThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXISwordTrailThink(struct client_entity_s *self, centity_t *owner) { int NoOfIntervals; client_entity_t *TrailEnt; @@ -842,6 +872,8 @@ static qboolean FXISwordTrailThink(struct client_entity_s *self, centity_t *owne while (NoOfIntervals >= 0) { + float scale; + VectorMA(last_org, incr, diff, newpoint); TrailEnt=ClientEntity_new(FX_SPELLHANDS, self->flags & ~CEF_NO_DRAW, newpoint, 0, 100); VectorCopy(newpoint, TrailEnt->origin); @@ -852,7 +884,8 @@ static qboolean FXISwordTrailThink(struct client_entity_s *self, centity_t *owne TrailEnt->d_scale=-0.25; TrailEnt->d_alpha=-0.1; TrailEnt->color.c=0x50000018; - TrailEnt->r.scale=self->xscale*2.0; + scale = self->xscale * 2.0; + VectorSet(TrailEnt->r.scale, scale, scale, scale); TrailEnt->startTime=fxi.cl->frame.servertime-100; TrailEnt->AnimSpeed=0.20; TrailEnt->NoOfAnimFrames=2; diff --git a/src/game/effects/fx_lightning.c b/src/game/effects/fx_lightning.c index 8968ee8a5..eb05cff58 100644 --- a/src/game/effects/fx_lightning.c +++ b/src/game/effects/fx_lightning.c @@ -55,11 +55,12 @@ void PreCacheLightning() client_entity_t *MakeLightningPiece(int type, float width, vec3_t start, vec3_t end, float radius) { client_entity_t *lightning; + float scale; lightning = ClientEntity_new(FX_LIGHTNING, CEF_DONT_LINK, start, NULL, 250); lightning->r.model = lightning_models[type]; lightning->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - lightning->r.scale = width; + VectorSet(lightning->r.scale, width, width, width); lightning->radius = radius; lightning->alpha = 0.95; lightning->d_alpha = -4.0; @@ -72,7 +73,8 @@ client_entity_t *MakeLightningPiece(int type, float width, vec3_t start, vec3_t lightning->r.model = lightning_models[type]; lightning->r.frame = 1; lightning->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - lightning->r.scale = width * LIGHTNING_WIDTH_MULT; + scale = width * LIGHTNING_WIDTH_MULT; + VectorSet(lightning->r.scale, scale, scale, scale); lightning->radius = radius; lightning->alpha = 0.5; lightning->d_alpha = -1.250; @@ -87,7 +89,8 @@ client_entity_t *MakeLightningPiece(int type, float width, vec3_t start, vec3_t lightning->r.model = lightning_models[type + LIGHTNING_JOINT_OFFSET]; lightning->r.frame = 0; lightning->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - lightning->r.scale = width * LIGHTNING_JOINT_SCALE; + scale = width * LIGHTNING_JOINT_SCALE; + VectorSet(lightning->r.scale, scale, scale, scale); lightning->radius = radius; lightning->alpha = 0.95; lightning->d_alpha = -2.0; @@ -172,7 +175,8 @@ void LightningBolt(int model, float width, vec3_t startpos, vec3_t endpos) } -static qboolean FXLightningThink(client_entity_t *thinker, centity_t *owner) +static qboolean +FXLightningThink(client_entity_t *thinker, centity_t *owner) { if (fxi.cl->time - thinker->lastThinkTime < thinker->LifeTime) { @@ -232,7 +236,7 @@ void FXPowerLightning(centity_t *Owner, int Type, int Flags, vec3_t Origin) client_entity_t *lightning; client_particle_t *spark; int i; - float length; + float length, scale; float curang, degreeinc; vec3_t lastvel, upvel; @@ -245,7 +249,7 @@ void FXPowerLightning(centity_t *Owner, int Type, int Flags, vec3_t Origin) lightning = ClientEntity_new(FX_POWER_LIGHTNING, CEF_AUTO_ORIGIN, Origin, NULL, 750); lightning->r.model = lightning_models[LIGHTNING_TYPE_GREEN]; lightning->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - lightning->r.scale = width; + VectorSet(lightning->r.scale, width, width, width); lightning->d_scale = -0.5*width; lightning->radius = length; lightning->alpha = 0.95; @@ -260,7 +264,8 @@ void FXPowerLightning(centity_t *Owner, int Type, int Flags, vec3_t Origin) lightning->r.model = lightning_models[LIGHTNING_TYPE_GREEN]; lightning->r.frame = 1; lightning->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - lightning->r.scale = width * LIGHTNING_POWER_WIDTH_MULT; + scale = width * LIGHTNING_POWER_WIDTH_MULT; + VectorSet(lightning->r.scale, scale, scale, scale); lightning->d_scale = -0.5*width; lightning->radius = length; lightning->alpha = 0.5; @@ -275,7 +280,7 @@ void FXPowerLightning(centity_t *Owner, int Type, int Flags, vec3_t Origin) lightning->r.model = lightning_models[6]; // The bright halo model lightning->r.frame = 1; lightning->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - lightning->r.scale = 0.75; + VectorSet(lightning->r.scale, 0.75, 0.75, 0.75); lightning->d_scale = 2.0; lightning->radius = 128.0; lightning->alpha = 0.95; @@ -285,7 +290,8 @@ void FXPowerLightning(centity_t *Owner, int Type, int Flags, vec3_t Origin) // Now add a bunch of sparks to the source too to add interest. for(i=0; i<8; i++) - { // Half green, half yellow particles + { + // Half green, half yellow particles if (i&0x01) spark = ClientParticle_new(PART_16x16_SPARK_Y, lightning->color, 1000); else @@ -303,7 +309,7 @@ void FXPowerLightning(centity_t *Owner, int Type, int Flags, vec3_t Origin) lightning->r.origin[2] += 8.0; lightning->r.frame = 1; lightning->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - lightning->r.scale = 2.0; + VectorSet(lightning->r.scale, 2.0, 2.0, 2.0); lightning->d_scale = -2.0; lightning->radius = 128.0; lightning->alpha = 0.95; @@ -364,7 +370,7 @@ void FXPowerLightning(centity_t *Owner, int Type, int Flags, vec3_t Origin) VectorAdd(lightning->velocity, upvel, lightning->velocity); VectorAdd(lightning->velocity2, upvel, lightning->velocity2); - lightning->r.scale = .5; + VectorSet(lightning->r.scale, .5, .5, .5); lightning->d_scale = 32.0; lightning->alpha = 0.1; lightning->d_alpha = 3.0; diff --git a/src/game/effects/fx_maceball.c b/src/game/effects/fx_maceball.c index 1167d8f83..a960b461a 100644 --- a/src/game/effects/fx_maceball.c +++ b/src/game/effects/fx_maceball.c @@ -45,11 +45,12 @@ void PreCacheMaceball() #define BALL_GROWTH 0.05 #define BALL_MAX (6.0 * BALL_RADIUS) -static qboolean FXMaceballThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXMaceballThink(struct client_entity_s *self, centity_t *owner) { self->dlight->intensity = 150.0 + (cos(fxi.cl->time * 0.01) * 20.0); self->r.angles[2] += ANGLE_30; - if(self->r.scale >= BALL_MAX) + if (AVG_VEC3T(self->r.scale) >= BALL_MAX) { self->d_scale = 0.0; } @@ -63,7 +64,7 @@ void FXMaceball(centity_t *owner, int type, int flags, vec3_t origin) glow = ClientEntity_new(type, flags, origin, 0, 100); glow->r.model = mace_models[0]; - glow->r.scale = BALL_RADIUS; + VectorSet(glow->r.scale, BALL_RADIUS, BALL_RADIUS, BALL_RADIUS); glow->d_scale = BALL_GROWTH; glow->color.c = 0xff00ffff; glow->dlight = CE_DLight_new(glow->color, 150.0F, 0.0F); @@ -138,7 +139,7 @@ void FXMaceballBounce(centity_t *owner, int type, int flags, vec3_t origin) VectorAdd(ring->velocity, norm, ring->velocity); VectorAdd(ring->velocity2, norm, ring->velocity2); - ring->r.scale = .5; + VectorSet(ring->r.scale, .5, .5, .5); ring->d_scale = 16.0; ring->alpha = 0.1; ring->d_alpha = 4.0; @@ -195,7 +196,7 @@ void FXMaceballExplode(centity_t *owner,int type,int flags,vec3_t origin) explosion=ClientEntity_new(type,CEF_DONT_LINK|CEF_ADDITIVE_PARTS,origin,dir,750); explosion->r.model = mace_models[3]; explosion->r.flags |= RF_TRANSLUCENT; - explosion->r.scale = 0.17; + VectorSet(explosion->r.scale, 0.17, 0.17, 0.17); explosion->d_scale = -0.17; explosion->d_alpha = -1.4; explosion->radius = 64.0; @@ -241,7 +242,8 @@ void FXMaceballExplode(centity_t *owner,int type,int flags,vec3_t origin) // --------------------- // ************************************************************************************************ -static qboolean FXRipperExplodeLightThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXRipperExplodeLightThink(struct client_entity_s *self, centity_t *owner) { if (fxi.cl->time > self->lastThinkTime) return false; @@ -254,7 +256,8 @@ static qboolean FXRipperExplodeLightThink(struct client_entity_s *self, centity_ -static qboolean FXRipperExplodeBallThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXRipperExplodeBallThink(struct client_entity_s *self, centity_t *owner) { client_entity_t *trail; vec3_t diff, curpos; @@ -271,7 +274,7 @@ static qboolean FXRipperExplodeBallThink(struct client_entity_s *self, centity_t trail->r.flags = RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; VectorCopy(self->velocity, trail->velocity); VectorScale(trail->velocity, -1.0, trail->acceleration); - trail->r.scale = scale; + VectorSet(trail->r.scale, scale, scale, scale); trail->d_scale = -scale; trail->alpha = 0.3; trail->d_alpha = -0.6; @@ -336,7 +339,7 @@ void FXRipperExplode(centity_t *owner, int type, int flags, vec3_t origin) Vec3ScaleAssign(RIPPER_EXPLODE_SPEED, ripper->velocity); // Set up the basic attributes - ripper->r.scale = 0.25; + VectorSet(ripper->r.scale, 0.25, 0.25, 0.25); ripper->r.color = color; ripper->radius = 10.0F; ripper->Update = FXRipperExplodeBallThink; @@ -357,7 +360,7 @@ void FXRipperExplode(centity_t *owner, int type, int flags, vec3_t origin) flash->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; flash->radius = 20.0; - flash->r.scale = 0.75; + VectorSet(flash->r.scale, 0.75, 0.75, 0.75); flash->d_scale = -1.0; flash->d_alpha = -1.4; fxi.S_StartSound(flash->r.origin, -1, CHAN_WEAPON, fxi.S_RegisterSound("weapons/RipperImpact.wav"), 1, ATTN_NORM, 0); @@ -399,7 +402,7 @@ void FXRipperExplode(centity_t *owner, int type, int flags, vec3_t origin) VectorAdd(ring->velocity, flash->velocity, ring->velocity); VectorAdd(ring->velocity2, flash->velocity, ring->velocity2); - ring->r.scale = .5; + VectorSet(ring->r.scale, .5, .5, .5); ring->d_scale = 32.0; ring->alpha = 0.1; ring->d_alpha = 3.0; @@ -435,7 +438,7 @@ void FXRipperExplode(centity_t *owner, int type, int flags, vec3_t origin) VectorCopy(origin, flash->r.startpos); flash->radius = length*0.5; - flash->r.scale = 8.0; + VectorSet(flash->r.scale, 8.0, 8.0, 8.0); flash->d_scale = -8.0; flash->alpha = 0.5; flash->d_alpha = -1.0; @@ -455,7 +458,7 @@ void FXRipperExplode(centity_t *owner, int type, int flags, vec3_t origin) flash->r.frame = 1; flash->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - flash->r.scale = .16; + VectorSet(flash->r.scale, .16, .16, .16); flash->d_scale = -.16; flash->alpha = 0.5; flash->d_alpha = -1.0; diff --git a/src/game/effects/fx_magicmissile.c b/src/game/effects/fx_magicmissile.c index 9986fa159..f19950fa6 100644 --- a/src/game/effects/fx_magicmissile.c +++ b/src/game/effects/fx_magicmissile.c @@ -18,9 +18,12 @@ #include "utilities.h" #include "../header/g_playstats.h" -static qboolean FXMagicMissileTrailThink(struct client_entity_s *Self, centity_t *Owner); -static qboolean FXMagicMissileModelThink1(struct client_entity_s *Self, centity_t *Owner); -static qboolean FXMagicMissileModelThink2(struct client_entity_s *Self, centity_t *Owner); +static qboolean +FXMagicMissileTrailThink(struct client_entity_s *Self, centity_t *Owner); +static qboolean +FXMagicMissileModelThink1(struct client_entity_s *Self, centity_t *Owner); +static qboolean +FXMagicMissileModelThink2(struct client_entity_s *Self, centity_t *Owner); #define NUM_MISSILE_MODELS 3 @@ -45,7 +48,8 @@ void PreCacheArray() #define ARRAY_TRAIL_COUNT 3 #define TRAIL_SPEED 32.0 -static qboolean FXMagicMissileTrailThink(struct client_entity_s *Self, centity_t *Owner) +static qboolean +FXMagicMissileTrailThink(struct client_entity_s *Self, centity_t *Owner) { int i; client_entity_t *trail; @@ -58,6 +62,8 @@ static qboolean FXMagicMissileTrailThink(struct client_entity_s *Self, centity_t // for(i = 0; i < count; i++) for (i=0; i<2; i++) // Each cardinal direction { + float scale; + trail = ClientEntity_new(FX_WEAPON_MAGICMISSILE, 0, Self->r.origin, @@ -79,7 +85,8 @@ static qboolean FXMagicMissileTrailThink(struct client_entity_s *Self, centity_t trail->r.model = array_models[0]; trail->r.flags = RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - trail->r.scale = flrand(ARRAY_TRAIL_SCALE, ARRAY_TRAIL_SCALE + 0.1); + scale = flrand(ARRAY_TRAIL_SCALE, ARRAY_TRAIL_SCALE + 0.1); + VectorSet(trail->r.scale, scale, scale, scale); trail->d_scale = -1.0; trail->d_alpha = -2.0; trail->radius = 20.0; @@ -100,7 +107,7 @@ static qboolean FXMagicMissileTrailThink(struct client_entity_s *Self, centity_t VectorMA(trail->r.origin, -0.1, Self->velocity, trail->r.endpos); VectorScale(Self->velocity, 0.9, trail->velocity); VectorScale(Self->velocity, 0.5, trail->velocity2); - trail->r.scale = 12.0; + VectorSet(trail->r.scale, 12.0, 12.0, 12.0); trail->d_scale = -24.0; trail->d_alpha = -2.0; @@ -114,14 +121,15 @@ static qboolean FXMagicMissileTrailThink(struct client_entity_s *Self, centity_t // ------------------------- // ************************************************************************************************ -static qboolean FXMagicMissileModelThink1(struct client_entity_s *Self, centity_t *Owner) +static qboolean +FXMagicMissileModelThink1(struct client_entity_s *Self, centity_t *Owner) { - Self->d_scale=0.0; - Self->r.scale = 0.8; + Self->d_scale = 0.0; + VectorSet(Self->r.scale, 0.8, 0.8, 0.8); - Self->Update=FXMagicMissileModelThink2; + Self->Update = FXMagicMissileModelThink2; - FXMagicMissileTrailThink(Self,Owner); + FXMagicMissileTrailThink(Self, Owner); return true; } @@ -130,7 +138,8 @@ static qboolean FXMagicMissileModelThink1(struct client_entity_s *Self, centity_ // ------------------------- // ************************************************************************************************ -static qboolean FXMagicMissileModelThink2(struct client_entity_s *Self, centity_t *Owner) +static qboolean +FXMagicMissileModelThink2(struct client_entity_s *Self, centity_t *Owner) { FXMagicMissileTrailThink(Self,Owner); return true; @@ -173,7 +182,7 @@ void FXMagicMissile(centity_t *Owner,int Type,int Flags,vec3_t Origin) VectorScale(Missile->up, TRAIL_SPEED, Missile->up); Missile->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD; - Missile->r.scale=0.4; + VectorSet(Missile->r.scale, 0.4, 0.4, 0.4); Missile->alpha=1.0; Missile->d_alpha=0.0; Missile->d_scale=4.0; @@ -208,10 +217,13 @@ void FXMagicMissileExplode(centity_t *owner, int type, int flags, vec3_t origin) for(i = 0; i < NUM_ARRAY_EXPLODE_PARTS; i++) { + float scale; + smokepuff = ClientEntity_new(type, flags, origin, 0, 500); smokepuff->r.model = array_models[1]; - smokepuff->r.scale = flrand(ARRAY_SCALE * 0.75, ARRAY_SCALE * 1.5); + scale = flrand(ARRAY_SCALE * 0.75, ARRAY_SCALE * 1.5); + VectorSet(smokepuff->r.scale, scale, scale, scale); smokepuff->r.flags = RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; VectorRandomCopy(dir, smokepuff->velocity, ARRAY_EXPLODE_SPEED); @@ -230,7 +242,7 @@ void FXMagicMissileExplode(centity_t *owner, int type, int flags, vec3_t origin) smokepuff->r.model = array_models[0]; smokepuff->r.frame = 0; - smokepuff->r.scale = 2.0; + VectorSet(smokepuff->r.scale, 2.0, 2.0, 2.0); smokepuff->r.flags = RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; VectorScale(dir, 8.0, smokepuff->velocity); @@ -258,7 +270,7 @@ void FXBlast(centity_t *owner, int type, int flags, vec3_t origin) client_entity_t *puff; client_particle_t *spark; paletteRGBA_t pal; - float length, scale; + float length; short slength[BLAST_NUM_SHOTS], syaw, spitch; int shot; vec3_t angles; @@ -278,6 +290,8 @@ void FXBlast(centity_t *owner, int type, int flags, vec3_t origin) angles[YAW] -= BLAST_ANGLE_INC * (BLAST_NUM_SHOTS-1) * 0.5; for (shot=0; shotr.model = array_models[1]; puff->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - puff->r.scale = scale; + VectorSet(puff->r.scale, scale, scale, scale); puff->radius = 14.0; puff->alpha = 0.95; // puff->d_alpha = -1.0; @@ -313,7 +327,8 @@ void FXBlast(centity_t *owner, int type, int flags, vec3_t origin) puff->r.model = array_models[0]; puff->r.frame = 0; puff->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - puff->r.scale = 1.0 + length * 0.001; // Bigger when further out. + scale = 1.0 + length * 0.001; // Bigger when further out. + VectorSet(puff->r.scale, scale, scale, scale); puff->alpha = 0.95; puff->d_scale = -5.0; puff->d_alpha = -1.0; diff --git a/src/game/effects/fx_mist.c b/src/game/effects/fx_mist.c index bf2efc3dc..d4de3fa35 100644 --- a/src/game/effects/fx_mist.c +++ b/src/game/effects/fx_mist.c @@ -45,15 +45,16 @@ Approach(float curr, float dest, float rate) static qboolean FXMistThink(client_entity_t *mist, centity_t *owner) { - float mod; + float mod, scale; mist->flags &= ~CEF_DISAPPEARED; mist->Scale += flrand(-0.05, 0.05) * mist->SpawnData; mist->Scale = Q_min( Q_max(mist->Scale, 0.6 * mist->SpawnData), 1.4 * mist->SpawnData); - mist->r.scale = Approach(mist->r.scale, mist->Scale, 0.003 * mist->SpawnData); + scale = Approach(AVG_VEC3T(mist->r.scale), mist->Scale, 0.003 * mist->SpawnData); + VectorSet(mist->r.scale, scale, scale, scale); - mod = (mist->r.scale / mist->SpawnData) * MIST_ALPHA; + mod = (AVG_VEC3T(mist->r.scale) / mist->SpawnData) * MIST_ALPHA; if(mist->r.depth > MIST_FAR) { mist->alpha = mod; @@ -80,7 +81,7 @@ void FXMist(centity_t *owner, int type, int flags, vec3_t origin) mist->r.model = mist_models[0]; mist->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - mist->r.scale = mist->SpawnData; + VectorSet(mist->r.scale, mist->SpawnData, mist->SpawnData, mist->SpawnData); mist->flags |= CEF_NOMOVE; mist->Update = FXMistThink; diff --git a/src/game/effects/fx_mork.c b/src/game/effects/fx_mork.c index 56ca5128d..9f2bfe00b 100644 --- a/src/game/effects/fx_mork.c +++ b/src/game/effects/fx_mork.c @@ -122,12 +122,15 @@ enum { //FX_M_STRAFE // ************************************************************************************************ -static qboolean FXMorkTrailThink_old(struct client_entity_s *self, centity_t *owner) +static qboolean +FXMorkTrailThink_old(struct client_entity_s *self, centity_t *owner) { - if (self->alpha <= 0.1 || self->r.scale <= 0.0) + if (self->alpha <= 0.1 || AVG_VEC3T(self->r.scale) <= 0.0) return false; - self->r.scale -= 0.1; + self->r.scale[0] -= 0.1; + self->r.scale[1] -= 0.1; + self->r.scale[2] -= 0.1; return true; } @@ -144,14 +147,17 @@ void FXMorkMissileExplode_old(struct client_entity_s *self, centity_t *owner, ve while(i--) { + float scale; + if (!i) SmokePuff=ClientEntity_new(FX_M_EFFECTS,0,owner->origin,NULL,500); else SmokePuff=ClientEntity_new(FX_M_EFFECTS,0,owner->origin,NULL,1500); SmokePuff->r.model = Morkproj_models[1]; - SmokePuff->r.scale=flrand(0.5,1.0); - SmokePuff->d_scale=-4.0; + scale = flrand(0.5,1.0); + VectorSet(SmokePuff->r.scale, scale, scale, scale); + SmokePuff->d_scale = -4.0; SmokePuff->r.flags |=RF_FULLBRIGHT|RF_TRANSLUCENT|RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; SmokePuff->r.frame=0; @@ -170,13 +176,16 @@ void FXMorkMissileExplode_old(struct client_entity_s *self, centity_t *owner, ve } } -static qboolean FXCWTrailThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXCWTrailThink(struct client_entity_s *self, centity_t *owner) { vec3_t forward; - if (self->alpha <= 0.1 || self->r.scale <= 0.0) + if (self->alpha <= 0.1 || AVG_VEC3T(self->r.scale) <= 0.0) return false; - self->r.scale -= 0.15; + self->r.scale[0] -= 0.15; + self->r.scale[1] -= 0.15; + self->r.scale[2] -= 0.15; VectorCopy(owner->lerp_origin, self->r.origin); @@ -191,21 +200,26 @@ static qboolean FXCWTrailThink(struct client_entity_s *self, centity_t *owner) } -static qboolean FXMorkTrailThink2(struct client_entity_s *self, centity_t *owner) +static qboolean +FXMorkTrailThink2(struct client_entity_s *self, centity_t *owner) { - if (self->alpha <= 0.1 || self->r.scale <= 0.0) + if (self->alpha <= 0.1 || AVG_VEC3T(self->r.scale) <= 0.0) return false; - self->r.scale -= 0.15; + self->r.scale[0] -= 0.15; + self->r.scale[1] -= 0.15; + self->r.scale[2] -= 0.15; return true; } -static qboolean FXMorkMissileTrailThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXMorkMissileTrailThink(struct client_entity_s *self, centity_t *owner) { -// client_entity_t *TrailEnt; + float scale; - self->r.scale = flrand(0.35, 0.65); + scale = flrand(0.35, 0.65); + VectorSet(self->r.scale, scale, scale, scale); MorkMakeLightningPiece(self->startpos, owner->origin, 2000, 400, false); VectorCopy(owner->origin, self->startpos); @@ -219,7 +233,8 @@ static qboolean FXMorkMissileTrailThink(struct client_entity_s *self, centity_t ==================*/ -static qboolean FXQuakeThink (struct client_entity_s *self, centity_t *owner) +static qboolean +FXQuakeThink (struct client_entity_s *self, centity_t *owner) { if(self->LifeTime <= 0) return (false); @@ -235,13 +250,15 @@ static qboolean FXQuakeThink (struct client_entity_s *self, centity_t *owner) ==================*/ -static qboolean FXMorkPPTrailThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXMorkPPTrailThink(struct client_entity_s *self, centity_t *owner) { client_entity_t *TrailEnt; client_particle_t *spark; int i, numparts; vec3_t offset; int parttype; + float scale; if(self->r.color.r<250) self->r.color.r += 8; @@ -268,9 +285,11 @@ static qboolean FXMorkPPTrailThink(struct client_entity_s *self, centity_t *owne TrailEnt->r.color = self->r.color; TrailEnt->r.spriteType = SPRITE_LINE; TrailEnt->r.tile = 1; - TrailEnt->r.scale = 1.5 * self->r.scale/0.35; + scale = 1.5 * AVG_VEC3T(self->r.scale) / 0.35; + VectorSet(TrailEnt->r.scale, scale, scale, scale); TrailEnt->alpha = 1.0; - TrailEnt->r.scale = self->r.scale/0.35; + scale = AVG_VEC3T(self->r.scale) / 0.35; + VectorSet(TrailEnt->r.scale, scale, scale, scale); VectorCopy( self->startpos, TrailEnt->r.startpos ); VectorCopy( owner->origin , TrailEnt->r.endpos ); @@ -283,7 +302,7 @@ static qboolean FXMorkPPTrailThink(struct client_entity_s *self, centity_t *owne VectorCopy(owner->origin, self->startpos); - numparts = floor(irand(6, 9)*self->r.scale); + numparts = floor(irand(6, 9) * AVG_VEC3T(self->r.scale)); if (numparts>500) numparts=500; for(i = 0; i < numparts; i++) @@ -351,7 +370,8 @@ static qboolean FXMorkPPTrailThink(struct client_entity_s *self, centity_t *owne #define NUM_Morkpp_models 6 -static qboolean FXMPPExplosionBallThink(client_entity_t *explosion, centity_t *owner) +static qboolean +FXMPPExplosionBallThink(client_entity_t *explosion, centity_t *owner) { explosion->LifeTime--; if (explosion->LifeTime<=0) @@ -370,7 +390,8 @@ static qboolean FXMPPExplosionBallThink(client_entity_t *explosion, centity_t *o return true; } -static qboolean FXMPPExplosionSmallBallThink(client_entity_t *explosion, centity_t *owner) +static qboolean +FXMPPExplosionSmallBallThink(client_entity_t *explosion, centity_t *owner) { client_entity_t *flash; @@ -383,7 +404,7 @@ static qboolean FXMPPExplosionSmallBallThink(client_entity_t *explosion, centity { // The explosion ball becomes visible and flashes fxi.Activate_Screen_Flash(0xff0077ff); explosion->alpha = 1.0; - explosion->r.scale= 0.1; + VectorSet(explosion->r.scale, 0.1, 0.1, 0.1); explosion->d_alpha=-5.0; explosion->d_scale=8.0; @@ -391,10 +412,10 @@ static qboolean FXMPPExplosionSmallBallThink(client_entity_t *explosion, centity flash->r.model = Morkpp_models[2]; flash->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT;// | RF_FULLBRIGHT; flash->r.frame = 1; - flash->radius=128; - flash->r.scale=1.0; - flash->d_alpha=-4.0; - flash->d_scale=-4.0; + flash->radius = 128; + VectorSet(flash->r.scale, 1.0, 1.0, 1.0); + flash->d_alpha = -4.0; + flash->d_scale = -4.0; AddEffect(NULL, flash); return (true); @@ -439,7 +460,8 @@ qboolean FXMPPExplosionCoreUpdate (client_entity_t *self, centity_t *owner) return true; } -static qboolean FXMPPExplosionCoreThink(client_entity_t *core, centity_t *owner) +static qboolean +FXMPPExplosionCoreThink(client_entity_t *core, centity_t *owner) { client_entity_t *newcore; vec3_t pos; @@ -464,7 +486,7 @@ static qboolean FXMPPExplosionCoreThink(client_entity_t *core, centity_t *owner) newcore->r.frame = 0;//1 newcore->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT;// | RF_FULLBRIGHT; newcore->radius = 128; - newcore->r.scale= core->r.scale; + VectorCopy(core->r.scale, newcore->r.scale); newcore->alpha = core->alpha; newcore->d_alpha= -(newcore->alpha*4.0); newcore->d_scale= 2.0; @@ -494,7 +516,7 @@ void FXMPPExplode(client_entity_t *explosion, centity_t *owner, int type, int fl subexplosion->r.model = Morkpp_models[4]; subexplosion->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT;// | RF_FULLBRIGHT; subexplosion->alpha = 0.1; - subexplosion->r.scale=0.01; + VectorSet(subexplosion->r.scale, 0.01, 0.01, 0.01); subexplosion->radius=128; subexplosion->r.color.r = irand(150, 250); @@ -521,7 +543,7 @@ void FXMPPExplode(client_entity_t *explosion, centity_t *owner, int type, int fl explosion->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT;// | RF_FULLBRIGHT; explosion->flags |= CEF_ADDITIVE_PARTS; explosion->alpha = 1.0; - explosion->r.scale= 2;//0.1; + VectorSet(explosion->r.scale, 2, 2, 2);//0.1; explosion->d_alpha=-0.3;//-2.0; explosion->d_scale= 0.0;//4.0; explosion->radius=128; @@ -558,10 +580,10 @@ void FXMPPExplode(client_entity_t *explosion, centity_t *owner, int type, int fl explosion->r.model = Morkpp_models[2]; explosion->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT;// | RF_FULLBRIGHT; explosion->r.frame = 1; - explosion->radius=128; - explosion->r.scale=1.5; - explosion->d_alpha=-4.0; - explosion->d_scale=-4.0; + explosion->radius = 128; + VectorSet(explosion->r.scale, 1.5, 1.5, 1.5); + explosion->d_alpha = -4.0; + explosion->d_scale = -4.0; AddEffect(NULL, explosion); // ...and draw the MPP rising from the explosion @@ -571,7 +593,7 @@ void FXMPPExplode(client_entity_t *explosion, centity_t *owner, int type, int fl explosion->r.color.c = 0xFF00aaFF; explosion->r.frame = 0; explosion->radius=128; - explosion->r.scale=1.0; + VectorSet(explosion->r.scale, 1.0, 1.0, 1.0); VectorScale(dir, 0.25, explosion->velocity); // explosion->velocity[2] += 64; explosion->acceleration[2] = 64; @@ -598,13 +620,16 @@ void FXMorkMissileExplode(struct client_entity_s *self, centity_t *owner, vec3_t while(i--) { + float scale; + if (!i) SmokePuff=ClientEntity_new(FX_M_EFFECTS,0,owner->origin,NULL,500); else SmokePuff=ClientEntity_new(FX_M_EFFECTS,0,owner->origin,NULL,1500); SmokePuff->r.model = Morkproj_models[1]; - SmokePuff->r.scale=flrand(0.5,1.0); + scale = flrand(0.5, 1.0); + VectorSet(SmokePuff->r.scale, scale, scale, scale); SmokePuff->d_scale=-2.0; SmokePuff->r.flags |=RF_FULLBRIGHT|RF_TRANSLUCENT|RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; @@ -629,7 +654,8 @@ void FXMorkMissileExplode(struct client_entity_s *self, centity_t *owner, vec3_t FX_M_READYPP ===============================*/ -static qboolean FXMorkPPReadyThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXMorkPPReadyThink(struct client_entity_s *self, centity_t *owner) { int add_rate = 5; client_particle_t *spark; @@ -658,7 +684,7 @@ static qboolean FXMorkPPReadyThink(struct client_entity_s *self, centity_t *owne self->dlight->intensity += 10; - numparts = floor(irand(6, 9)*self->r.scale); + numparts = floor(irand(6, 9) * AVG_VEC3T(self->r.scale)); if (numparts>500) numparts=500; for(i = 0; i < numparts; i++) @@ -719,16 +745,18 @@ static qboolean FXMorkPPReadyThink(struct client_entity_s *self, centity_t *owne =====================*/ -static qboolean FXMorkShieldThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXMorkShieldThink(struct client_entity_s *self, centity_t *owner) { return true; } -static qboolean FXMorkShieldForm(struct client_entity_s *self, centity_t *owner) +static qboolean +FXMorkShieldForm(struct client_entity_s *self, centity_t *owner) { client_entity_t *Trail; - if (self->r.scale <= 2.5) + if (AVG_VEC3T(self->r.scale) <= 2.5) { return false; self->d_alpha = 0.0; @@ -737,7 +765,7 @@ static qboolean FXMorkShieldForm(struct client_entity_s *self, centity_t *owner) return true; } - if (self->r.scale <= 3.0 && !self->SpawnInfo) + if (AVG_VEC3T(self->r.scale) <= 3.0 && !self->SpawnInfo) { self->SpawnInfo = 1; Trail=ClientEntity_new(FX_M_EFFECTS, 0, self->origin, NULL, 100); @@ -746,7 +774,7 @@ static qboolean FXMorkShieldForm(struct client_entity_s *self, centity_t *owner) Trail->r.flags |= RF_TRANSLUCENT | RF_FULLBRIGHT | RF_REFLECTION; Trail->alpha = self->alpha; - Trail->r.scale = self->r.scale; + VectorCopy(self->r.scale, Trail->r.scale); Trail->d_scale = 4.0; Trail->d_alpha = -0.15; @@ -793,7 +821,8 @@ client_entity_t *MorkMakeLightningPiece(vec3_t start, vec3_t end, float radius, lightning->alpha = 0.95; } lightning->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - lightning->r.scale = M_LIGHTNING_WIDTH; + VectorSet(lightning->r.scale, + M_LIGHTNING_WIDTH, M_LIGHTNING_WIDTH, M_LIGHTNING_WIDTH); lightning->r.tile = tile_num; lightning->radius = radius; lightning->d_alpha = -4.0; @@ -808,7 +837,8 @@ client_entity_t *MorkMakeLightningPiece(vec3_t start, vec3_t end, float radius, lightning->r.model = Morklightning_models[1]; lightning->r.frame = irand(0, 1); lightning->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - lightning->r.scale = M_LIGHTNING_WIDTH2; + VectorSet(lightning->r.scale, + M_LIGHTNING_WIDTH2, M_LIGHTNING_WIDTH2, M_LIGHTNING_WIDTH2); lightning->radius = radius; lightning->r.tile = 1; lightning->alpha = 0.5; @@ -967,7 +997,7 @@ void CWPlasma(vec3_t top, vec3_t groundpos, int flags) ring = ClientEntity_new(FX_M_EFFECTS, 0, bottom, NULL, 20); ring->r.model = CW_models[1]; ring->r.flags |= RF_FIXED | RF_GLOW | RF_TRANSLUCENT; - ring->r.scale = 1.0f; + VectorSet(ring->r.scale, 1.0f, 1.0f, 1.0f); ring->alpha = 0.5; ring->SpawnInfo = 0; ring->Update = FXCWRingUpdate; @@ -1056,7 +1086,8 @@ qboolean MorkEyesParticleUpdate(client_particle_t *self, qboolean ignore) return true; } -static qboolean FXMorkEyes (struct client_entity_s *self, centity_t *owner) +static qboolean +FXMorkEyes (struct client_entity_s *self, centity_t *owner) { vec3_t angles, forward, right, pos, pos2, side; int num_parts, e, n; @@ -1114,13 +1145,15 @@ static qboolean FXMorkEyes (struct client_entity_s *self, centity_t *owner) return (true); } -static qboolean FXMorkEyes2 (struct client_entity_s *self, centity_t *owner) +static qboolean +FXMorkEyes2(struct client_entity_s *self, centity_t *owner) { vec3_t angles, forward, right, pos, pos2, side; int num_parts, e, n; client_particle_t *flame; matrix3_t RotationMatrix; client_entity_t *fx; + float scale; // This tells if we are wasting our time, because the reference points are culled. if (!RefPointsValid(owner)) @@ -1203,7 +1236,8 @@ VectorCopy ((centity_t *)(self->extra))->referenceInfo->references[MORK_LEYEREF fx->r.color.c = 0xe5007fff; fx->r.model = Morkproj_models[3]; fx->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - fx->r.scale = flrand(0.15, 0.25); + scale = flrand(0.15, 0.25); + VectorSet(fx->r.scale, scale, scale, scale); fx->alpha = flrand(0.85, 0.95); fx->radius = 100.0f; AddEffect(NULL,fx); @@ -1218,13 +1252,16 @@ VectorCopy ((centity_t *)(self->extra))->referenceInfo->references[MORK_LEYEREF ===============================*/ -static qboolean ShoveThink (struct client_entity_s *self, centity_t *owner) +static qboolean +ShoveThink (struct client_entity_s *self, centity_t *owner) { int dec_rate = 5; if (self->alpha <= 0.1)// || self->r.scale > 0.0) return false; - self->r.scale += 0.1; + self->r.scale[0] += 0.1; + self->r.scale[1] += 0.1; + self->r.scale[2] += 0.1; if(self->r.color.g>10) self->r.color.g-=dec_rate; @@ -1241,27 +1278,34 @@ static qboolean ShoveThink (struct client_entity_s *self, centity_t *owner) return (true); } -static qboolean ShoveInnerThink (struct client_entity_s *self, centity_t *owner) +static qboolean +ShoveInnerThink (struct client_entity_s *self, centity_t *owner) { - if (self->alpha <= 0.1 || self->alpha > 2.0 || self->r.scale <= 0.1) + if (self->alpha <= 0.1 || self->alpha > 2.0 || AVG_VEC3T(self->r.scale) <= 0.1) return false; - self->r.scale -= 0.1; + self->r.scale[0] -= 0.1; + self->r.scale[1] -= 0.1; + self->r.scale[2] -= 0.1; return (true); } -static qboolean ShoveOuterThink (struct client_entity_s *self, centity_t *owner) +static qboolean +ShoveOuterThink (struct client_entity_s *self, centity_t *owner) { if (self->alpha <= 0.1 || self->alpha > 1.0) return false; - self->r.scale += 0.1; + self->r.scale[0] += 0.1; + self->r.scale[1] += 0.1; + self->r.scale[2] += 0.1; return (true); } -static qboolean FXMorkShove(struct client_entity_s *self, centity_t *owner) +static qboolean +FXMorkShove(struct client_entity_s *self, centity_t *owner) { client_entity_t *TrailEnt; vec3_t forward, right, pos1, pos2, pos3, pos4, pos5, pos6, pos7, pos8, crap, angles; @@ -1380,25 +1424,29 @@ static qboolean FXMorkShove(struct client_entity_s *self, centity_t *owner) TrailEnt->r.tile = 1; TrailEnt->r.scale = (dist/32)*4; if(TrailEnt->r.scale<1) - TrailEnt->r.scale = 1; + VectorSet(TrailEnt->r.scale, 1.0, 1.0, 1.0); TrailEnt->alpha = 1.0; - TrailEnt->r.scale = 1.0; + VectorSet(TrailEnt->r.scale, 1.0, 1.0, 1.0); TrailEnt->d_alpha = -1.5; TrailEnt->d_scale = 0.5;*/ TrailEnt->Update = ShoveThink; if(j) - {//white inner + { + //white inner + float scale; + TrailEnt->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD_ALPHA; TrailEnt->r.model = Morkproj_models[2]; TrailEnt->r.spriteType = SPRITE_LINE; TrailEnt->r.tile = 1; - TrailEnt->r.scale = (dist/32); - if(TrailEnt->r.scale<1) - TrailEnt->r.scale = 1; + scale = (dist/32); + VectorSet(TrailEnt->r.scale, scale, scale, scale); + if(AVG_VEC3T(TrailEnt->r.scale) < 1) + VectorSet(TrailEnt->r.scale, 1.0, 1.0, 1.0); TrailEnt->alpha = 2.0; - TrailEnt->r.scale = 1.0; + VectorSet(TrailEnt->r.scale, 1.0, 1.0, 1.0); TrailEnt->d_alpha = -1.0; TrailEnt->d_scale = -0.1; @@ -1406,17 +1454,23 @@ static qboolean FXMorkShove(struct client_entity_s *self, centity_t *owner) // TrailEnt->Update = FXMorkTrailThink_old; } else - {//blue outer + { + //blue outer + float scale; + TrailEnt->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD_ALPHA; TrailEnt->r.model = Morkproj_models[2]; TrailEnt->r.spriteType = SPRITE_LINE; TrailEnt->r.tile = 1; - TrailEnt->r.scale = (dist/32)*4; - if(TrailEnt->r.scale<4) - TrailEnt->r.scale = 4; + scale = (dist / 32) * 4; + VectorSet(TrailEnt->r.scale, scale, scale, scale); + if(AVG_VEC3T(TrailEnt->r.scale) < 4) + { + VectorSet(TrailEnt->r.scale, 4, 4, 4); + } TrailEnt->alpha = 1.0; - TrailEnt->r.scale = 4.0; + VectorSet(TrailEnt->r.scale, 4, 4, 4); TrailEnt->r.color.r = 100; TrailEnt->r.color.g = 75; TrailEnt->r.color.b = 250; @@ -1454,7 +1508,8 @@ qboolean ParticleFadeToBlue(client_particle_t *self, qboolean ignore) return true; } -static qboolean FXMorkBeamCircle (struct client_entity_s *self, centity_t *owner) +static qboolean +FXMorkBeamCircle (struct client_entity_s *self, centity_t *owner) { vec3_t angles, up; @@ -1471,7 +1526,8 @@ static qboolean FXMorkBeamCircle (struct client_entity_s *self, centity_t *owner return true; } -static qboolean FXMorkBeam (struct client_entity_s *self, centity_t *owner) +static qboolean +FXMorkBeam (struct client_entity_s *self, centity_t *owner) { client_entity_t *TrailEnt; int numparts, parttype; @@ -1495,7 +1551,7 @@ static qboolean FXMorkBeam (struct client_entity_s *self, centity_t *owner) TrailEnt->r.spriteType = SPRITE_LINE; TrailEnt->r.tile = 1; TrailEnt->alpha = 2.0; - TrailEnt->r.scale = 1.0; + VectorSet(TrailEnt->r.scale, 1.0, 1.0, 1.0); VectorCopy( self->startpos, TrailEnt->r.startpos ); VectorCopy( owner->origin , TrailEnt->r.endpos ); @@ -1522,9 +1578,9 @@ static qboolean FXMorkBeam (struct client_entity_s *self, centity_t *owner) TrailEnt->r.spriteType = SPRITE_LINE; TrailEnt->r.tile = 1; - TrailEnt->r.scale = 16; + VectorSet(TrailEnt->r.scale, 16, 16, 16); TrailEnt->alpha = 1.0; - TrailEnt->r.scale = 4.0; + VectorSet(TrailEnt->r.scale, 4, 4, 4); TrailEnt->r.color.r = 100; TrailEnt->r.color.g = 75; TrailEnt->r.color.b = 250; @@ -1541,7 +1597,7 @@ static qboolean FXMorkBeam (struct client_entity_s *self, centity_t *owner) VectorCopy(owner->origin, self->startpos); - numparts = floor(irand(6, 9)*self->r.scale); + numparts = floor(irand(6, 9) * AVG_VEC3T(self->r.scale)); if (numparts>500) numparts=500; for(i = 0; i < numparts; i++) @@ -1647,7 +1703,8 @@ void FXMorkReadyRefs (centity_t *owner,int type,int flags,vec3_t origin) } -static qboolean DreamyHyperMechaAtomicGalaxyPhaseIIPlusEXAlphaSolidProRad_ParticleUpdate_opt (struct client_particle_s *self, int crap) +static qboolean +DreamyHyperMechaAtomicGalaxyPhaseIIPlusEXAlphaSolidProRad_ParticleUpdate_opt (struct client_particle_s *self, int crap) { float d_time, d_time2; int d_msec, yaw; @@ -1827,7 +1884,8 @@ static qboolean DreamyHyperMechaAtomicGalaxyPhaseIIPlusEXAlphaSolidProRad_Partic return (true); } -static qboolean DreamyHyperMechaAtomicGalaxyPhaseIIPlusEXAlphaSolidProRad_SpawnerUpdate (struct client_entity_s *self, centity_t *owner) +static qboolean +DreamyHyperMechaAtomicGalaxyPhaseIIPlusEXAlphaSolidProRad_SpawnerUpdate (struct client_entity_s *self, centity_t *owner) { vec3_t angles, forward, o_pos, pos; int num_parts, n; @@ -1893,7 +1951,7 @@ void DreamyHyperMechaAtomicGalaxyPhaseIIPlusEXAlphaSolidProRad (centity_t *owner fx->r.color.c = 0xFFFFFFFF; fx->r.model = Morkproj_models[3]; fx->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - fx->r.scale = 3; + VectorSet(fx->r.scale, 3, 3, 3); fx->alpha = 1; fx->Update = KeepSelfAI; fx->radius = 1000.0f; @@ -1912,13 +1970,16 @@ void ImpFireBallExplode(struct client_entity_s *self, centity_t *owner, vec3_t d while(i--) { + float scale; + if (!i) SmokePuff=ClientEntity_new(FX_M_EFFECTS,0,owner->origin,NULL,500); else SmokePuff=ClientEntity_new(FX_M_EFFECTS,0,owner->origin,NULL,1500); SmokePuff->r.model = Imp_models[1]; - SmokePuff->r.scale=flrand(0.5,1.0); + scale = flrand(0.5, 1.0); + VectorSet(SmokePuff->r.scale, scale, scale, scale); SmokePuff->d_scale=-2.0; SmokePuff->r.flags |=RF_FULLBRIGHT|RF_TRANSLUCENT|RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; @@ -1945,6 +2006,7 @@ qboolean ImpFireBallUpdate (struct client_entity_s *self, centity_t *owner) vec3_t angles, fwd, right; int num_parts, i; paletteRGBA_t LightColor; + float scale; VectorScale(self->r.angles, 180.0/M_PI, angles); AngleVectors(angles, fwd, right, NULL); @@ -1978,7 +2040,8 @@ qboolean ImpFireBallUpdate (struct client_entity_s *self, centity_t *owner) //trail - self->r.scale = flrand(0.35, 0.65); + scale = flrand(0.35, 0.65); + VectorSet(self->r.scale, scale, scale, scale); TrailEnt=ClientEntity_new(FX_M_EFFECTS, CEF_DONT_LINK, @@ -1999,7 +2062,7 @@ qboolean ImpFireBallUpdate (struct client_entity_s *self, centity_t *owner) TrailEnt->r.color.a = 255; TrailEnt->r.spriteType = SPRITE_LINE; TrailEnt->r.tile = 1; - TrailEnt->r.scale = 3.0; + VectorSet(TrailEnt->r.scale, 3, 3, 3); VectorCopy( self->startpos, TrailEnt->r.startpos ); VectorCopy( owner->origin , TrailEnt->r.endpos ); @@ -2029,6 +2092,7 @@ qboolean FXCWUpdate (struct client_entity_s *self, centity_t *owner) vec3_t angles, fwd, right, vec; int num_parts, i; paletteRGBA_t LightColor = {{{255, 255, 255, 255}}}; + float scale; client_entity_t *placeholder; placeholder = ClientEntity_new(FX_M_EFFECTS, CEF_NO_DRAW|CEF_ABSOLUTE_PARTS, self->r.origin, NULL, 500); @@ -2076,7 +2140,7 @@ qboolean FXCWUpdate (struct client_entity_s *self, centity_t *owner) TrailEnt->r.spriteType = SPRITE_LINE; TrailEnt->r.tile = 1; TrailEnt->alpha = 1.0; - TrailEnt->r.scale = 3.0; + VectorSet(TrailEnt->r.scale, 3.0, 3.0, 3.0); VectorCopy( self->startpos, TrailEnt->r.startpos ); VectorCopy( owner->current.origin , TrailEnt->r.endpos ); @@ -2100,13 +2164,14 @@ qboolean FXCWUpdate (struct client_entity_s *self, centity_t *owner) if (r_detail->value != DETAIL_HIGH) { TrailEnt->r.model = CW_models[0]; - TrailEnt->r.scale = flrand(1.0, 2.5); + scale = flrand(1.0, 2.5); + VectorSet(TrailEnt->r.scale, scale, scale, scale); } else { TrailEnt->r.model = Morkproj_models[2]; TrailEnt->flags |= CEF_USE_SCALE2; - TrailEnt->r.scale = 3.0; + VectorSet(TrailEnt->r.scale, 3.0, 3.0, 3.0); TrailEnt->r.scale2 = 0.2; } @@ -2141,7 +2206,8 @@ qboolean FXCWUpdate (struct client_entity_s *self, centity_t *owner) //============================================== - self->r.scale = flrand(0.65, 0.95); + scale = flrand(0.65, 0.95); + VectorSet(self->r.scale, scale, scale, scale); VectorCopy(owner->current.origin, self->startpos); @@ -2162,7 +2228,7 @@ void FXCWStars (centity_t *owner,int type,int flags, vec3_t vel) fx->r.color.g = 50; fx->r.color.b = 255; fx->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - fx->r.scale = 0.8; + VectorSet(fx->r.scale, 0.8, 0.8, 0.8); fx->AddToView = LinkedEntityUpdatePlacement; VectorCopy(owner->origin, fx->startpos); @@ -2362,7 +2428,7 @@ qboolean FXBuoyPathDelayedStart (struct client_entity_s *self, centity_t *owner) TrailEnt->r.spriteType = SPRITE_LINE; TrailEnt->alpha = 1.0; - TrailEnt->r.scale = 7.0; + VectorSet(TrailEnt->r.scale, 7.0, 7.0, 7.0); VectorSubtract(self->startpos, self->endpos, v); dist = VectorLength(v); @@ -2421,7 +2487,7 @@ void FXMMoBlur(centity_t *owner, vec3_t org, vec3_t angles, qboolean dagger) VectorCopy(angles, blur->r.angles); blur->r.model = ass_dagger_model[0]; blur->alpha = 0.75; - blur->r.scale = 0.9; + VectorSet(blur->r.scale, 0.9, 0.9, 0.9); blur->d_alpha = -3.0; blur->d_scale = -0.3; @@ -2438,10 +2504,10 @@ void FXMMoBlur(centity_t *owner, vec3_t org, vec3_t angles, qboolean dagger) blur->d_alpha = -1.0; blur->d_scale = -0.1; blur->alpha = 1.0; - blur->r.scale = 1.0; + VectorSet(blur->r.scale, 1.0, 1.0, 1.0); } blur->r.flags = RF_TRANSLUCENT | RF_TRANS_ADD_ALPHA | RF_GLOW; - blur->r.scale = 1.0; + VectorSet(blur->r.scale, 1.0, 1.0, 1.0); blur->Update = FXMMoBlurUpdate; blur->updateTime = 20; AddEffect(NULL,blur); @@ -2631,7 +2697,7 @@ void FXQuakeRing ( vec3_t origin ) VectorAdd(ring->velocity, norm, ring->velocity); VectorAdd(ring->velocity2, norm, ring->velocity2); - ring->r.scale = 8.0; + VectorSet(ring->r.scale, 8.0, 8.0, 8.0); ring->d_scale = 32.0; ring->alpha = 0.75; ring->d_alpha = -1.0; @@ -2673,14 +2739,16 @@ void FXGroundAttack( vec3_t origin ) AddEffect(NULL, glow); } -static qboolean beam_update(struct client_entity_s *self, centity_t *owner) +static qboolean +beam_update(struct client_entity_s *self, centity_t *owner) { //TODO: Cool ass effects here return true; } -static qboolean beam_add_to_view(struct client_entity_s *self, centity_t *owner) +static qboolean +beam_add_to_view(struct client_entity_s *self, centity_t *owner) { LinkedEntityUpdatePlacement(self, owner); VectorCopy(self->r.origin, self->r.endpos); @@ -2698,7 +2766,7 @@ void FXMorkBeam2 ( centity_t *owner, vec3_t startpos ) fx->radius = 1024; fx->r.model = Morkproj_models[2]; - fx->r.scale = 8; + VectorSet(fx->r.scale, 8, 8, 8); fx->alpha = 1.0; fx->r.color.c = 0xFFFFFFFF; @@ -2711,8 +2779,11 @@ void FXMorkBeam2 ( centity_t *owner, vec3_t startpos ) AddEffect(owner, fx); } -static qboolean missile_add_to_view(struct client_entity_s *self, centity_t *owner) +static qboolean +missile_add_to_view(struct client_entity_s *self, centity_t *owner) { + float scale; + LinkedEntityUpdatePlacement(self, owner); VectorCopy(self->r.origin, self->r.startpos); @@ -2723,12 +2794,14 @@ static qboolean missile_add_to_view(struct client_entity_s *self, centity_t *own VectorNormalize(self->direction); VectorMA(self->r.startpos, irand(self->LifeTime/4, self->LifeTime), self->direction, self->r.endpos); - self->r.scale = flrand(1.0, 2.0); + scale = flrand(1.0, 2.0); + VectorSet(self->r.scale, scale, scale, scale); return true; } -static qboolean MorkMissileThink1(struct client_entity_s *self, centity_t *owner) +static qboolean +MorkMissileThink1(struct client_entity_s *self, centity_t *owner) { if (self->LifeTime < 24) { @@ -2738,16 +2811,19 @@ static qboolean MorkMissileThink1(struct client_entity_s *self, centity_t *owner return true; } -static qboolean MorkMissileThink2(struct client_entity_s *self, centity_t *owner) +static qboolean +MorkMissileThink2(struct client_entity_s *self, centity_t *owner) { if (self->alpha < 0.25) { self->alpha += 0.1; } - if (self->r.scale < 3.0) + if (AVG_VEC3T(self->r.scale) < 3.0) { - self->r.scale += 0.1; + self->r.scale[0] += 0.1; + self->r.scale[1] += 0.1; + self->r.scale[2] += 0.1; } if (self->dlight->intensity <= 200.0f) @@ -2758,16 +2834,19 @@ static qboolean MorkMissileThink2(struct client_entity_s *self, centity_t *owner return true; } -static qboolean MorkMissileThink3(struct client_entity_s *self, centity_t *owner) +static qboolean +MorkMissileThink3(struct client_entity_s *self, centity_t *owner) { if (self->alpha < 0.5) { self->alpha += 0.1; } - if (self->r.scale < 1.0) + if (AVG_VEC3T(self->r.scale) < 1.0) { - self->r.scale += 0.1; + self->r.scale[0] += 0.1; + self->r.scale[1] += 0.1; + self->r.scale[2] += 0.1; } if (self->SpawnInfo > irand(15, 20)) @@ -2790,6 +2869,8 @@ void FXMorkMissile ( centity_t *owner, vec3_t startpos ) while (i--) { + float scale; + fx = ClientEntity_new( FX_M_EFFECTS, CEF_OWNERS_ORIGIN, startpos, NULL, 17); fx->r.spriteType = SPRITE_LINE; @@ -2797,7 +2878,8 @@ void FXMorkMissile ( centity_t *owner, vec3_t startpos ) fx->radius = 1024; fx->r.model = morc_models[1]; - fx->r.scale = flrand(0.1, 1.0); + scale = flrand(0.1, 1.0); + VectorSet(fx->r.scale, scale, scale, scale); fx->r.scale2 = 0.1; fx->alpha = 1.0; fx->r.color.c = 0xFFFFFFFF; @@ -2822,7 +2904,7 @@ void FXMorkMissile ( centity_t *owner, vec3_t startpos ) fx->r.model = morc_models[2]; fx->r.flags |= RF_TRANS_ADD | RF_TRANSLUCENT | RF_FULLBRIGHT; fx->alpha = 0.1; - fx->r.scale = 0.1; + VectorSet(fx->r.scale, 0.1, 0.1, 0.1); fx->Update = MorkMissileThink2; fx->AddToView = LinkedEntityUpdatePlacement; @@ -2834,7 +2916,7 @@ void FXMorkMissile ( centity_t *owner, vec3_t startpos ) fx->r.model = morc_models[3]; fx->r.flags |= RF_TRANS_ADD | RF_TRANSLUCENT | RF_FULLBRIGHT; fx->alpha = 0.1; - fx->r.scale = 0.1; + VectorSet(fx->r.scale, 0.1, 0.1, 0.1); fx->Update = MorkMissileThink3; fx->AddToView = LinkedEntityUpdatePlacement; @@ -2882,7 +2964,7 @@ void FXMorkMissileHit ( vec3_t origin, vec3_t dir ) fx = ClientEntity_new( FX_M_EFFECTS, CEF_OWNERS_ORIGIN | CEF_DONT_LINK, origin, NULL, 2000); fx->r.model = morc_models[3]; fx->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT | RF_FULLBRIGHT | RF_NODEPTHTEST; - fx->r.scale = 1; + VectorSet(fx->r.scale, 1.0, 1.0, 1.0); fx->alpha = 0.5; fx->d_alpha = -1.0; fx->d_scale = 16.0; @@ -2896,12 +2978,15 @@ void FXMorkMissileHit ( vec3_t origin, vec3_t dir ) FXMTrailThink -----------------------------------------------*/ -static qboolean FXMTrailThink(struct client_entity_s *self, centity_t *Owner) +static qboolean +FXMTrailThink(struct client_entity_s *self, centity_t *Owner) { - if (self->alpha <= 0.1 || self->r.scale <= 0.0) + if (self->alpha <= 0.1 || AVG_VEC3T(self->r.scale) <= 0.0) return false; - self->r.scale -= 0.1; + self->r.scale[0] -= 0.1; + self->r.scale[1] -= 0.1; + self->r.scale[2] -= 0.1; self->r.scale2 -= 0.1; return true; @@ -2911,11 +2996,14 @@ static qboolean FXMTrailThink(struct client_entity_s *self, centity_t *Owner) FXMMissileTrailThink -----------------------------------------------*/ -static qboolean FXMMissileTrailThink(struct client_entity_s *self, centity_t *Owner) +static qboolean +FXMMissileTrailThink(struct client_entity_s *self, centity_t *Owner) { client_entity_t *TrailEnt; + float scale; - self->r.scale = flrand(0.35, 0.65); + scale = flrand(0.35, 0.65); + VectorSet(self->r.scale, scale, scale, scale); TrailEnt=ClientEntity_new(FX_M_EFFECTS, CEF_DONT_LINK, @@ -2930,9 +3018,9 @@ static qboolean FXMMissileTrailThink(struct client_entity_s *self, centity_t *Ow TrailEnt->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD_ALPHA; TrailEnt->r.model = morc_models[5]; - TrailEnt->r.spriteType = SPRITE_LINE; + TrailEnt->r.spriteType = SPRITE_LINE; TrailEnt->r.tile = 1; - TrailEnt->r.scale = 2.0; + VectorSet(TrailEnt->r.scale, 2.0, 2.0, 2.0); TrailEnt->r.scale2 = 2.0; TrailEnt->alpha = 0.5; @@ -2967,7 +3055,7 @@ void FXMorkTrackingMissile ( centity_t *owner, vec3_t origin, vec3_t velocity ) Trail->r.model = morc_models[4]; Trail->r.color.c = 0xFFFFFFFF; Trail->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - Trail->r.scale = 1.0; + VectorSet(Trail->r.scale, 1.0, 1.0, 1.0); Trail->AddToView = LinkedEntityUpdatePlacement; VectorCopy(origin, Trail->startpos); @@ -2992,7 +3080,7 @@ void FXMorkRecharge( centity_t *owner, vec3_t velocity ) Trail->r.model = morc_models[irand(6, 8)]; Trail->r.color.c = 0xFFFFFFFF; Trail->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - Trail->r.scale = 0.1; + VectorSet(Trail->r.scale, 0.1, 0.1, 0.1); Trail->velocity[2] = 32; Trail->acceleration[2] = 64; Trail->d_scale = 2.0; @@ -3032,7 +3120,7 @@ qboolean mssithra_explosion_think (client_entity_t *self, centity_t *owner) explosion->r.model = mssithra_models[5]; explosion->r.flags |= RF_FULLBRIGHT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - explosion->r.scale = 0.1; + VectorSet(explosion->r.scale, 0.1, 0.1, 0.1); explosion->radius = 500; explosion->r.color.c = 0xFFFFFFFF; explosion->alpha = 0.75; @@ -3054,7 +3142,7 @@ qboolean mssithra_explosion_think (client_entity_t *self, centity_t *owner) explosion->r.model = mssithra_models[irand(0, 1)]; explosion->r.flags |= RF_FULLBRIGHT; - explosion->r.scale = 0.1; + VectorSet(explosion->r.scale, 0.1, 0.1, 0.1); explosion->radius = 500; explosion->r.color.c = 0xFFFFFFFF; explosion->alpha = 0.75; @@ -3079,12 +3167,15 @@ qboolean mssithra_explosion_think (client_entity_t *self, centity_t *owner) while (i--) { + float scale; + TrailEnt=ClientEntity_new(FX_M_EFFECTS, 0, self->r.origin, 0, 17); TrailEnt->r.model = mssithra_models[irand(3, 4)]; TrailEnt->r.flags |= RF_FULLBRIGHT; - TrailEnt->r.scale = flrand(0.5, 1.5); + scale = flrand(0.5, 1.5); + VectorSet(TrailEnt->r.scale, scale, scale, scale); TrailEnt->alpha = 1.0; VectorRandomCopy(dir, TrailEnt->velocity, 1.25); @@ -3106,6 +3197,8 @@ qboolean mssithra_explosion_think (client_entity_t *self, centity_t *owner) while (i--) { + float scale; + TrailEnt=ClientEntity_new(FX_M_EFFECTS, 0, self->r.origin, 0, 500); TrailEnt->r.model = mssithra_models[2]; @@ -3114,7 +3207,8 @@ qboolean mssithra_explosion_think (client_entity_t *self, centity_t *owner) TrailEnt->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; TrailEnt->r.color.c = 0xFFFFFFFF; - TrailEnt->r.scale = flrand(1.0, 2.5); + scale = flrand(1.0, 2.5); + VectorSet(TrailEnt->r.scale, scale, scale, scale); TrailEnt->alpha = 1.0; TrailEnt->d_alpha = -1.0; TrailEnt->d_scale = -1.0; @@ -3191,8 +3285,15 @@ qboolean ArrowDrawTrail (client_entity_t *self, centity_t *owner) if (self->flags & CEF_FLAG6) { - if (self->r.scale > 8.0) - self->r.scale = self->r.scale2 = flrand(8.0, 12.0); + if (AVG_VEC3T(self->r.scale) > 8.0) + { + float scale; + + scale = flrand(8.0, 12.0); + VectorSet(self->r.scale, scale, scale, scale); + self->r.scale2 = scale; + } + if (self->SpawnInfo > -64) self->SpawnInfo-=4; @@ -3207,8 +3308,14 @@ qboolean ArrowDrawTrail (client_entity_t *self, centity_t *owner) } else { - if (self->r.scale > 4.0) - self->r.scale = self->r.scale2 = flrand(4.0, 6.0); + if (AVG_VEC3T(self->r.scale) > 4.0) + { + float scale; + + scale = flrand(4.0, 6.0); + VectorSet(self->r.scale, scale, scale, scale); + self->r.scale2 = scale; + } //Let the trail slowly extend if (self->SpawnInfo > -64) @@ -3230,7 +3337,7 @@ void FXMSsithraArrow( centity_t *owner, vec3_t velocity, qboolean super ) spawner->r.spriteType = SPRITE_LINE; spawner->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; spawner->r.color.c = 0xFFFFFFFF; - spawner->r.scale = 1.0; + VectorSet(spawner->r.scale, 1.0, 1.0, 1.0); spawner->alpha = 1.0; spawner->LifeTime = 0; @@ -3267,6 +3374,8 @@ void FXMSsithraArrowCharge( vec3_t startpos ) while (i--) { + float scale; + TrailEnt=ClientEntity_new(FX_M_EFFECTS, 0, startpos, 0, 500); TrailEnt->r.model = mssithra_models[2]; @@ -3276,7 +3385,8 @@ void FXMSsithraArrowCharge( vec3_t startpos ) TrailEnt->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; TrailEnt->flags |= CEF_USE_VELOCITY2; TrailEnt->r.color.c = 0xFFFFFFFF; - TrailEnt->r.scale = flrand(4.0, 6.0); + scale = flrand(4.0, 6.0); + VectorSet(TrailEnt->r.scale, scale, scale, scale); TrailEnt->alpha = 0.1; TrailEnt->d_alpha = 0.25; TrailEnt->d_scale = 0.0; @@ -3348,7 +3458,7 @@ void FXMEffects(centity_t *owner,int type,int flags, vec3_t org) fx->r.color.g = 50; fx->r.color.b = 200; fx->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - fx->r.scale = 0.35; + VectorSet(fx->r.scale, 0.35, 0.35, 0.35); fx->d_scale = 1.5; fx->AddToView = LinkedEntityUpdatePlacement; @@ -3393,7 +3503,7 @@ void FXMEffects(centity_t *owner,int type,int flags, vec3_t org) fx->r.color.g = 200; fx->r.color.b = 110; fx->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - fx->r.scale = 0.5; + VectorSet(fx->r.scale, 0.5, 0.5, 0.5); fx->AddToView = LinkedEntityUpdatePlacement; VectorCopy(owner->origin, fx->startpos); @@ -3434,7 +3544,7 @@ void FXMEffects(centity_t *owner,int type,int flags, vec3_t org) fx->radius = 500; fx->r.model = Morkproj_models[3]; fx->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - fx->r.scale = 0.5; + VectorSet(fx->r.scale, 0.5, 0.5, 0.5); fx->LifeTime = i * 120; VectorCopy(owner->origin, fx->startpos); @@ -3469,7 +3579,7 @@ void FXMEffects(centity_t *owner,int type,int flags, vec3_t org) fx->r.flags |= (RF_TRANSLUCENT | RF_FULLBRIGHT); fx->alpha = 0.0; - fx->r.scale = 4.0; + VectorSet(fx->r.scale, 4.0, 4.0, 4.0); fx->d_scale = -1.5; fx->d_alpha = 0.25; @@ -3521,7 +3631,7 @@ void FXMEffects(centity_t *owner,int type,int flags, vec3_t org) fx->r.color.a = 10; fx->dlight=CE_DLight_new(fx->r.color,150.0f,0.0f); fx->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - fx->r.scale = 0.1; + VectorSet(fx->r.scale, 0.1, 0.1, 0.1); fx->d_scale = 0.5; fx->Update = FXMorkPPReadyThink; @@ -3552,7 +3662,7 @@ void FXMEffects(centity_t *owner,int type,int flags, vec3_t org) fx->r.frame = 2; fx->radius = 64; - fx->r.scale = 0.5; + VectorSet(fx->r.scale, 0.5, 0.5, 0.5); fx->d_alpha = 0.0f; fx->d_scale = 0.0f; fx->r.color.c = 0xe5007fff; diff --git a/src/game/effects/fx_morph.c b/src/game/effects/fx_morph.c index 6beea7aa0..1110702f5 100644 --- a/src/game/effects/fx_morph.c +++ b/src/game/effects/fx_morph.c @@ -42,7 +42,8 @@ void PreCacheMorph() #define PART_OFF 5.0 #define NUM_TRAIL_PARTS 6 -static qboolean FXMorphMissileThink(client_entity_t *missile, centity_t *owner) +static qboolean +FXMorphMissileThink(client_entity_t *missile, centity_t *owner) { int i; client_particle_t *ce; @@ -130,7 +131,7 @@ void FXMorphMissile(centity_t *owner, int type, int flags, vec3_t origin) Vec3ScaleAssign(ARROW_SPEED, missile->velocity); missile->r.model = morph_models[1]; - missile->r.scale = 3.0; + VectorSet(missile->r.scale, 3.0, 3.0, 3.0); missile->r.angles[0] = -1.57; missile->Update = FXMorphMissileThink; missile->radius = 32.0F; @@ -173,7 +174,7 @@ void FXMorphMissile_initial(centity_t *owner, int type, int flags, vec3_t origin Vec3ScaleAssign(ARROW_SPEED, missile->velocity); missile->r.model = morph_models[1]; - missile->r.scale = 3.0; + VectorSet(missile->r.scale, 3.0, 3.0, 3.0); missile->r.angles[0] = -1.57; missile->Update = FXMorphMissileThink; missile->radius = 32.0F; @@ -195,8 +196,8 @@ void FXMorphMissile_initial(centity_t *owner, int type, int flags, vec3_t origin glow->color.c = MORPH_COL; glow->r.color.c = MORPH_COL; glow->dlight = CE_DLight_new(glow->color, GLOW_INTENSITY, -GLOW_INTENSITY); - glow->d_scale = 1.8; - glow->r.scale = 0.5; + glow->d_scale = 1.8; + VectorSet(glow->r.scale, 0.5, 0.5, 0.5); glow->d_alpha = -1.0; glow->SpawnInfo = MORPH_GLOW_DUR; @@ -263,12 +264,13 @@ void FXMorphExplode(centity_t *owner, int type, int flags, vec3_t origin) ce->velocity[1]+=flrand(-SMOKE_SPEED,SMOKE_SPEED); ce->velocity[2]+=flrand(-SMOKE_SPEED,SMOKE_SPEED); - AddParticleToList(dlight, ce); + AddParticleToList(dlight, ce); } } // make the feather float down -static qboolean FXFeatherThink(client_entity_t *self, centity_t *owner) +static qboolean +FXFeatherThink(client_entity_t *self, centity_t *owner) { float scale; @@ -354,6 +356,8 @@ void FXChickenExplode(centity_t *owner, int type, int flags, vec3_t origin) while (i--) { + float scale; + feather = ClientEntity_new(type, flags & ~CEF_OWNERS_ORIGIN , origin, NULL, 40); feather->radius = 5.0F; feather->r.model = morph_models[irand(2, 3)]; @@ -361,7 +365,8 @@ void FXChickenExplode(centity_t *owner, int type, int flags, vec3_t origin) feather->Update = FXFeatherThink; feather->acceleration[2] = irand(-85, -120); VectorSet(feather->velocity, flrand(-100,100), flrand(-100,100), flrand(50,150)); - feather->r.scale = flrand(0.5, 1.5); + scale = flrand(0.5, 1.5); + VectorSet(feather->r.scale, scale, scale, scale); feather->SpawnInfo = 170; feather->yscale = flrand(0.05,0.2); feather->xscale = flrand(-0.2,0.2); @@ -377,6 +382,8 @@ void FXChickenExplode(centity_t *owner, int type, int flags, vec3_t origin) { for (i=0; i<20; i++) { + float scale; + feather = ClientEntity_new(type, flags & ~CEF_OWNERS_ORIGIN , origin, NULL, 40); feather->radius = 5.0F; feather->r.model = morph_models[irand(2, 3)]; @@ -384,7 +391,8 @@ void FXChickenExplode(centity_t *owner, int type, int flags, vec3_t origin) feather->Update = FXFeatherThink; feather->acceleration[2] = -85; VectorSet(feather->velocity, flrand(-FEATH_RAD,FEATH_RAD), flrand(-FEATH_RAD,FEATH_RAD), flrand(80,140)); - feather->r.scale = flrand(0.5, 2.5); + scale = flrand(0.5, 2.5); + VectorSet(feather->r.scale, scale, scale, scale); feather->SpawnInfo = 170; feather->yscale = flrand(0.1,0.3); feather->xscale = flrand(-0.3,0.3); diff --git a/src/game/effects/fx_objects.c b/src/game/effects/fx_objects.c index d67b1ee22..8c11d03fb 100644 --- a/src/game/effects/fx_objects.c +++ b/src/game/effects/fx_objects.c @@ -64,7 +64,7 @@ void FXBarrelExplode(centity_t *owner, int type, int flags, vec3_t origin) flrand(-BARREL_EXPLODE_SPEED, BARREL_EXPLODE_SPEED), flrand(-BARREL_EXPLODE_SPEED, BARREL_EXPLODE_SPEED), flrand(-BARREL_EXPLODE_SPEED, BARREL_EXPLODE_SPEED)); - subexplosion->r.scale = 0.1; + VectorSet(subexplosion->r.scale, 0.1, 0.1, 0.1); subexplosion->d_scale = 3.0 + ballnum; subexplosion->d_alpha = -1.5 - 0.5*ballnum; @@ -77,7 +77,7 @@ void FXBarrelExplode(centity_t *owner, int type, int flags, vec3_t origin) explosion->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT;// | RF_FULLBRIGHT; explosion->flags |= CEF_ADDITIVE_PARTS | CEF_PULSE_ALPHA; explosion->alpha = 0.1; - explosion->r.scale= 0.1; + VectorSet(explosion->r.scale, 0.1, 0.1, 0.1); explosion->d_alpha = 3.0; explosion->d_scale=5.0; explosion->radius=128; @@ -115,7 +115,7 @@ void FXBarrelExplode(centity_t *owner, int type, int flags, vec3_t origin) explosion->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT;// | RF_FULLBRIGHT; explosion->r.frame = 1; explosion->radius=128; - explosion->r.scale=2.0; + VectorSet(explosion->r.scale, 2.0, 2.0, 2.0); explosion->d_alpha=-4.0; explosion->d_scale=-4.0; AddEffect(NULL, explosion); diff --git a/src/game/effects/fx_pespell.c b/src/game/effects/fx_pespell.c index 4e9bc4826..e4cec9e93 100644 --- a/src/game/effects/fx_pespell.c +++ b/src/game/effects/fx_pespell.c @@ -48,7 +48,8 @@ enum // FXPESpellTrailThink // ************************************************************************************************ -static qboolean FXPESpellTrailThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXPESpellTrailThink(struct client_entity_s *self, centity_t *owner) { client_entity_t *TrailEnt; vec3_t accel_dir; @@ -62,6 +63,8 @@ static qboolean FXPESpellTrailThink(struct client_entity_s *self, centity_t *own i = GetScaledCount( irand(self->SpawnInfo >> 3, self->SpawnInfo >> 2), 0.8 ); while(i--) { + float scale; + TrailEnt = ClientEntity_new(FX_PE_SPELL, 0, self->r.origin, NULL, 1000); TrailEnt->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; @@ -69,7 +72,8 @@ static qboolean FXPESpellTrailThink(struct client_entity_s *self, centity_t *own VectorNormalize(accel_dir); TrailEnt->r.model = spell_models[0]; - TrailEnt->r.scale = SPELL_SCALE + flrand(0.0, 0.05); + scale = SPELL_SCALE + flrand(0.0, 0.05); + VectorSet(TrailEnt->r.scale, scale, scale, scale); TrailEnt->r.color.r = irand(40, 60); TrailEnt->r.color.g = irand(245, 255); @@ -155,13 +159,16 @@ void FXPESpellExplode(centity_t *owner,int type,int flags,vec3_t origin, vec3_t while(i--) { + float scale; + if (!i) SmokePuff=ClientEntity_new(type,flags,origin,NULL,500); else SmokePuff=ClientEntity_new(type,flags,origin,NULL,1000); SmokePuff->r.model = spell_models[1]; - SmokePuff->r.scale=flrand(0.8,1.6); + scale = flrand(0.8, 1.6); + VectorSet(SmokePuff->r.scale, scale, scale, scale); SmokePuff->d_scale=-2.0; VectorRandomCopy(dir, SmokePuff->velocity, 64.0); @@ -198,7 +205,8 @@ void FXPESpellExplode(centity_t *owner,int type,int flags,vec3_t origin, vec3_t // FXPESpell2TrailThink // ************************************************************************************************ -static qboolean FXPESpell2TrailThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXPESpell2TrailThink(struct client_entity_s *self, centity_t *owner) { client_entity_t *TrailEnt; vec3_t accel_dir; @@ -212,6 +220,8 @@ static qboolean FXPESpell2TrailThink(struct client_entity_s *self, centity_t *ow i = GetScaledCount( irand(self->SpawnInfo >> 3, self->SpawnInfo >> 2), 0.8 ); while(i--) { + float scale; + TrailEnt = ClientEntity_new(FX_PE_SPELL, 0, self->r.origin, NULL, 1000); TrailEnt->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; @@ -221,7 +231,8 @@ static qboolean FXPESpell2TrailThink(struct client_entity_s *self, centity_t *ow TrailEnt->r.model = spell_models[2]; TrailEnt->r.frame = irand(0,1); - TrailEnt->r.scale = SPELL_SCALE + flrand(0.0, 0.05); + scale = SPELL_SCALE + flrand(0.0, 0.05); + VectorSet(TrailEnt->r.scale, scale, scale, scale); /*TrailEnt->r.color.g = irand(40, 60); TrailEnt->r.color.b = irand(245, 255); @@ -307,13 +318,16 @@ void FXPESpell2Explode(centity_t *owner,int type,int flags,vec3_t origin, vec3_t while(i--) { + float scale; + if (!i) SmokePuff=ClientEntity_new(type,flags,origin,NULL,500); else SmokePuff=ClientEntity_new(type,flags,origin,NULL,1000); SmokePuff->r.model = spell_models[3]; - SmokePuff->r.scale=flrand(0.8,1.6); + scale = flrand(0.8, 1.6); + VectorSet(SmokePuff->r.scale, scale, scale, scale); SmokePuff->d_scale=-2.0; VectorRandomCopy(dir, SmokePuff->velocity, 64.0); @@ -351,7 +365,8 @@ void FXPESpell2Explode(centity_t *owner,int type,int flags,vec3_t origin, vec3_t // FXPESpell3TrailThink // ************************************************************************************************ -static qboolean FXPESpell3TrailThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXPESpell3TrailThink(struct client_entity_s *self, centity_t *owner) { client_entity_t *TrailEnt; vec3_t accel_dir; @@ -365,6 +380,8 @@ static qboolean FXPESpell3TrailThink(struct client_entity_s *self, centity_t *ow i = GetScaledCount( irand(self->SpawnInfo >> 3, self->SpawnInfo >> 2), 0.8 ); while(i--) { + float scale; + TrailEnt = ClientEntity_new(FX_PE_SPELL, 0, self->r.origin, NULL, 1000); TrailEnt->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; @@ -372,7 +389,8 @@ static qboolean FXPESpell3TrailThink(struct client_entity_s *self, centity_t *ow VectorNormalize(accel_dir); TrailEnt->r.model = spell_models[0]; - TrailEnt->r.scale = SPELL_SCALE + flrand(0.0, 0.05); + scale = SPELL_SCALE + flrand(0.0, 0.05); + VectorSet(TrailEnt->r.scale, scale, scale, scale); /*TrailEnt->r.color.g = irand(40, 60); TrailEnt->r.color.r = irand(245, 255); @@ -458,13 +476,16 @@ void FXPESpell3Explode(centity_t *owner,int type,int flags,vec3_t origin, vec3_t while(i--) { + float scale; + if (!i) SmokePuff=ClientEntity_new(type,flags,origin,NULL,500); else SmokePuff=ClientEntity_new(type,flags,origin,NULL,1000); SmokePuff->r.model = spell_models[4]; - SmokePuff->r.scale=flrand(1.0, 1.8); + scale = flrand(1.0, 1.8); + VectorSet(SmokePuff->r.scale, scale, scale, scale); SmokePuff->d_scale=-2.0; VectorRandomCopy(dir, SmokePuff->velocity, 64.0); diff --git a/src/game/effects/fx_phoenix.c b/src/game/effects/fx_phoenix.c index c8788b74b..b09947e1e 100644 --- a/src/game/effects/fx_phoenix.c +++ b/src/game/effects/fx_phoenix.c @@ -38,7 +38,8 @@ #define SMOKETRAIL_SCALE 0.25 #define SMOKETRAIL_ALPHA 0.5 -static qboolean FXPhoenixMissilePowerThink(client_entity_t *missile, centity_t *owner); +static qboolean +FXPhoenixMissilePowerThink(client_entity_t *missile, centity_t *owner); void FXPhoenixExplodePower(centity_t *owner, int type, int flags, vec3_t origin, vec3_t dir); @@ -58,7 +59,8 @@ void PreCachePhoenix() // ----------------------------------------------------------------------------------------- -static qboolean FXPhoenixMissileThink(client_entity_t *missile, centity_t *owner) +static qboolean +FXPhoenixMissileThink(client_entity_t *missile, centity_t *owner) { int i; int dur; @@ -94,7 +96,8 @@ static qboolean FXPhoenixMissileThink(client_entity_t *missile, centity_t *owner smoke->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; smoke->radius = 64.0F; smoke->alpha = SMOKETRAIL_ALPHA; - smoke->r.scale = SMOKETRAIL_SCALE; + VectorSet(smoke->r.scale, + SMOKETRAIL_SCALE, SMOKETRAIL_SCALE, SMOKETRAIL_SCALE); smoke->velocity[0] = right[0]*2.0; smoke->velocity[1] = right[1]*2.0; smoke->velocity[2] = right[2]*2.0; @@ -114,7 +117,8 @@ static qboolean FXPhoenixMissileThink(client_entity_t *missile, centity_t *owner smoke->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; smoke->radius = 128.0F; smoke->alpha = SMOKETRAIL_ALPHA; - smoke->r.scale = SMOKETRAIL_SCALE; + VectorSet(smoke->r.scale, + SMOKETRAIL_SCALE, SMOKETRAIL_SCALE, SMOKETRAIL_SCALE); smoke->velocity[0] = -right[0]*2.0; smoke->velocity[1] = -right[1]*2.0; smoke->velocity[2] = -right[2]*2.0; @@ -210,7 +214,7 @@ void FXPhoenixMissile(centity_t *owner, int type, int flags, vec3_t origin) missile->lastThinkTime = fxi.cl->time + (50*7); // Time to play last frame. missile->NoOfAnimFrames = 7; // End on frame number 7. missile->Scale = 1; // Positive frame count - missile->r.scale= .8; + VectorSet(missile->r.scale, .8, .8, .8); if(flags & CEF_FLAG6) { missile->Update = FXPhoenixMissilePowerThink; @@ -272,7 +276,8 @@ qboolean FXPhoenixExplosionSmallBallThink(client_entity_t *explosion, centity_t return true; } -static qboolean FXPhoenixExplosionBirdThink(client_entity_t *bird, centity_t *owner) +static qboolean +FXPhoenixExplosionBirdThink(client_entity_t *bird, centity_t *owner) { client_entity_t *newbird; vec3_t pos; @@ -300,7 +305,7 @@ static qboolean FXPhoenixExplosionBirdThink(client_entity_t *bird, centity_t *ow newbird->r.frame = 1; newbird->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT;// | RF_FULLBRIGHT; newbird->radius = 128; - newbird->r.scale= bird->r.scale; + VectorCopy(bird->r.scale, newbird->r.scale); newbird->alpha = bird->alpha; newbird->d_alpha= -(newbird->alpha*4.0); newbird->d_scale= 2.0; @@ -319,7 +324,7 @@ client_entity_t *CreatePhoenixSmallExplosion(vec3_t ballorigin) subexplosion->r.model = phoen_models[4]; subexplosion->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT;// | RF_FULLBRIGHT; subexplosion->alpha = 1.0; - subexplosion->r.scale = 1.0; + VectorSet(subexplosion->r.scale, 1.0, 1.0, 1.0); subexplosion->radius=128; subexplosion->startTime = fxi.cl->time; subexplosion->lastThinkTime = fxi.cl->time; @@ -374,7 +379,7 @@ void FXPhoenixExplode(centity_t *owner, int type, int flags, vec3_t origin) flrand(-EXPLODE_BALL_SPEED, EXPLODE_BALL_SPEED) + (dir[0]*EXPLODE_BALL_SPEED), flrand(-EXPLODE_BALL_SPEED, EXPLODE_BALL_SPEED) + (dir[1]*EXPLODE_BALL_SPEED), flrand(-EXPLODE_BALL_SPEED, EXPLODE_BALL_SPEED) + (dir[2]*EXPLODE_BALL_SPEED)); - subexplosion->r.scale = 0.1; + VectorSet(subexplosion->r.scale, 0.1, 0.1, 0.1); subexplosion->d_scale = 3.0 + ballnum; subexplosion->d_alpha = -1.5 - 0.5*ballnum; @@ -388,7 +393,7 @@ void FXPhoenixExplode(centity_t *owner, int type, int flags, vec3_t origin) explosion->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT;// | RF_FULLBRIGHT; explosion->flags |= CEF_ADDITIVE_PARTS | CEF_PULSE_ALPHA; explosion->alpha = 0.1; - explosion->r.scale= 0.1; + VectorSet(explosion->r.scale, 0.1, 0.1, 0.1); explosion->d_alpha = 3.0; explosion->d_scale=5.0; explosion->radius=128; @@ -427,7 +432,7 @@ void FXPhoenixExplode(centity_t *owner, int type, int flags, vec3_t origin) explosion->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT;// | RF_FULLBRIGHT; explosion->r.frame = 1; explosion->radius=128; - explosion->r.scale=1.5; + VectorSet(explosion->r.scale, 1.5, 1.5, 1.5); explosion->d_alpha=-4.0; explosion->d_scale=-4.0; AddEffect(NULL, explosion); @@ -446,7 +451,7 @@ void FXPhoenixExplode(centity_t *owner, int type, int flags, vec3_t origin) explosion->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT;// | RF_FULLBRIGHT; explosion->r.frame = 0; explosion->radius=128; - explosion->r.scale=0.1; + VectorSet(explosion->r.scale, 0.1, 0.1, 0.1); VectorScale(dir, 0.25, explosion->velocity); explosion->acceleration[2] = 64; explosion->alpha = 1.0; @@ -468,7 +473,8 @@ void FXPhoenixExplode(centity_t *owner, int type, int flags, vec3_t origin) #define PHOENIXPOWER_PARTS_PER_TRAIL 8 #define PHOENIXPOWER_RADIUS 72.0 -static qboolean FXPhoenixExplosionBirdThinkPower(client_entity_t *bird, centity_t *owner) +static qboolean +FXPhoenixExplosionBirdThinkPower(client_entity_t *bird, centity_t *owner) { bird->LifeTime--; if (bird->LifeTime <= 0) @@ -503,7 +509,7 @@ void FXPhoenixExplodePower(centity_t *owner, int type, int flags, vec3_t origin, explosion->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT;// | RF_FULLBRIGHT; explosion->flags |= CEF_ADDITIVE_PARTS; explosion->alpha = 1.0; - explosion->r.scale= .1; + VectorSet(explosion->r.scale, .1, .1, .1); explosion->d_alpha=-2.0/1.5; explosion->radius=128; explosion->LifeTime=EXPLODE_LIFETIME; @@ -537,9 +543,9 @@ void FXPhoenixExplodePower(centity_t *owner, int type, int flags, vec3_t origin, subexplosion->r.model = phoen_models[2]; subexplosion->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT;// | RF_FULLBRIGHT; subexplosion->r.frame = 1; - subexplosion->radius=128; - subexplosion->r.scale=1.5; - subexplosion->d_alpha=-1.0; + subexplosion->radius = 128; + VectorSet(subexplosion->r.scale, 1.5, 1.5, 1.5); + subexplosion->d_alpha = -1.0; AddEffect(NULL, subexplosion); for(j = 0; j < numParts; j++) @@ -568,8 +574,8 @@ void FXPhoenixExplodePower(centity_t *owner, int type, int flags, vec3_t origin, subexplosion->r.model = phoen_models[2]; subexplosion->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT;// | RF_FULLBRIGHT; subexplosion->r.frame = 1; - subexplosion->radius=128; - subexplosion->r.scale=1.5; + subexplosion->radius = 128; + VectorSet(subexplosion->r.scale, 1.5, 1.5, 1.5); subexplosion->d_alpha=-1.0; AddEffect(NULL, subexplosion); @@ -603,7 +609,7 @@ void FXPhoenixExplodePower(centity_t *owner, int type, int flags, vec3_t origin, explosion->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT;// | RF_FULLBRIGHT; explosion->r.frame = 0; explosion->radius=128; - explosion->r.scale=1.0; + VectorSet(explosion->r.scale, 1.0, 1.0, 1.0); VectorScale(dir, 192.0, explosion->velocity); explosion->acceleration[2] = 256.0; explosion->alpha = 1.0; @@ -619,7 +625,7 @@ void FXPhoenixExplodePower(centity_t *owner, int type, int flags, vec3_t origin, explosion->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT;// | RF_FULLBRIGHT; explosion->r.frame = 0; explosion->radius=128; - explosion->r.scale=1.0; + VectorSet(explosion->r.scale, 1.0, 1.0, 1.0); VectorScale(dir, 192.0, explosion->velocity); explosion->acceleration[2] = 256.0; explosion->alpha = 1.0; @@ -632,7 +638,8 @@ void FXPhoenixExplodePower(centity_t *owner, int type, int flags, vec3_t origin, fxi.S_StartSound(origin, -1, CHAN_AUTO, fxi.S_RegisterSound("weapons/PhoenixPowerHit.wav"), 1, ATTN_NORM, 0); } -static qboolean FXPhoenixMissilePowerThink(client_entity_t *missile, centity_t *owner) +static qboolean +FXPhoenixMissilePowerThink(client_entity_t *missile, centity_t *owner) { int i, dur; client_particle_t *flame; @@ -668,7 +675,10 @@ static qboolean FXPhoenixMissilePowerThink(client_entity_t *missile, centity_t * smoke->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; smoke->radius = 64.0F; smoke->alpha = SMOKETRAIL_ALPHA; - smoke->r.scale = SMOKETRAIL_SCALE * 2.5; + VectorSet(smoke->r.scale, + SMOKETRAIL_SCALE * 2.5, + SMOKETRAIL_SCALE * 2.5, + SMOKETRAIL_SCALE * 2.5); smoke->velocity[0] = sideVal * right[0]*2.0; smoke->velocity[1] = sideVal * right[1]*2.0; smoke->velocity[2] = sideVal * right[2]*2.0; diff --git a/src/game/effects/fx_pickup.c b/src/game/effects/fx_pickup.c index 50ba541d9..0a2732637 100644 --- a/src/game/effects/fx_pickup.c +++ b/src/game/effects/fx_pickup.c @@ -35,7 +35,7 @@ void FXPickup(centity_t *owner, int type, int flags, vec3_t origin) ce->r.model = pickup_models[0]; ce->r.frame = 1; ce->r.flags = RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - ce->r.scale = 0.4; + VectorSet(ce->r.scale, 0.4, 0.4, 0.4); ce->alpha = .75; ce->d_scale = 1.0; ce->d_alpha = 2.5; diff --git a/src/game/effects/fx_pickuppuzzle.c b/src/game/effects/fx_pickuppuzzle.c index 06a670b51..fa4e75042 100644 --- a/src/game/effects/fx_pickuppuzzle.c +++ b/src/game/effects/fx_pickuppuzzle.c @@ -64,7 +64,8 @@ void PreCachePuzzleItems() // -------------------------------------------------------------- -static qboolean FXPuzzlePickupThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXPuzzlePickupThink(struct client_entity_s *self, centity_t *owner) { // Rotate and bob VectorCopy(owner->current.origin, self->r.origin); @@ -79,6 +80,7 @@ void FXPuzzlePickup(centity_t *owner, int type, int flags, vec3_t origin) client_entity_t *ce; byte tag; vec3_t angles; + float scale; fxi.GetEffect(owner, flags, clientEffectSpawners[FX_PICKUP_PUZZLE].formatString, &tag,&angles); @@ -89,7 +91,8 @@ void FXPuzzlePickup(centity_t *owner, int type, int flags, vec3_t origin) VectorCopy(ce->r.origin, ce->origin); ce->r.model = PuzzleModels[tag].model; ce->r.flags = RF_TRANSLUCENT | RF_GLOW; - ce->r.scale = PuzzleModels[tag].scale; + scale = PuzzleModels[tag].scale; + VectorSet(ce->r.scale, scale, scale, scale); ce->radius = 10.0; ce->alpha = 0.8; diff --git a/src/game/effects/fx_portal.c b/src/game/effects/fx_portal.c index 810514129..7d6aedd24 100644 --- a/src/game/effects/fx_portal.c +++ b/src/game/effects/fx_portal.c @@ -128,7 +128,7 @@ qboolean FXMagicPortalThink(client_entity_t *self, centity_t *owner) ripple->r.model = portal_models[0]; //ripple->r.flags |= RF_TRANS_ADD_ALPHA | RF_TRANS_ADD | RF_TRANSLUCENT | RF_FIXED | RF_TRANS_GHOST; ripple->r.flags |= RF_TRANS_ADD_ALPHA | RF_TRANS_ADD | RF_FIXED | RF_TRANS_GHOST; - ripple->r.scale = 0.1f; + VectorSet(ripple->r.scale, 0.1f, 0.1f, 0.1f); ripple->d_scale = 1.0f; if(!(self->flags & CEF_NO_DRAW)) { @@ -196,6 +196,8 @@ qboolean FXMagicPortalThink(client_entity_t *self, centity_t *owner) while (i--) { + float scale; + line=ClientEntity_new(FX_WEAPON_STAFF_STRIKE, 0, owner->current.origin, 0, 600); line->r.model = portal_models[2]; @@ -204,7 +206,8 @@ qboolean FXMagicPortalThink(client_entity_t *self, centity_t *owner) line->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; line->r.color.c = 0xFFFFFFFF; - line->r.scale = flrand(1.0, 2.5); + scale = flrand(1.0, 2.5); + VectorSet(line->r.scale, scale, scale, scale); line->alpha = flrand(1.0, 0.75); line->d_alpha = -2.0; line->d_scale = -1.0; diff --git a/src/game/effects/fx_redrain.c b/src/game/effects/fx_redrain.c index aa7756ed2..0041eda5b 100644 --- a/src/game/effects/fx_redrain.c +++ b/src/game/effects/fx_redrain.c @@ -115,7 +115,8 @@ qboolean FXRedRainDropUpdate(client_entity_t *drop, centity_t *owner) // Red Rain area // This constantly starts new drops up at the top. It also spawns a splash, which is set to go off at the appropriate fall time -static qboolean FXRedRainThink(client_entity_t *rain, centity_t *owner) +static qboolean +FXRedRainThink(client_entity_t *rain, centity_t *owner) { client_entity_t *splash; client_entity_t *drop; @@ -162,7 +163,7 @@ static qboolean FXRedRainThink(client_entity_t *rain, centity_t *owner) drop->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; drop->alpha = 0.75; drop->SpawnInfo = rain->SpawnInfo; - drop->r.scale = width; + VectorSet(drop->r.scale, width, width, width); drop->radius = RAIN_HEIGHT; VectorCopy(origin, drop->r.startpos); VectorCopy(origin, drop->r.endpos); @@ -237,7 +238,8 @@ void FXRedRain(centity_t *Owner, int Type, int Flags, vec3_t Origin) // The red rain projectile's trail of red sparks. -static qboolean FXRedRainMissileThink(client_entity_t *missile, centity_t *owner) +static qboolean +FXRedRainMissileThink(client_entity_t *missile, centity_t *owner) { int i; client_entity_t *ce; @@ -260,7 +262,7 @@ static qboolean FXRedRainMissileThink(client_entity_t *missile, centity_t *owner { ce->r.model = rain_models[0]; } - ce->r.scale = 1.0F; + VectorSet(ce->r.scale, 1.0F, 1.0F, 1.0F); ce->d_scale = 2.0F; ce->r.frame = 0; ce->r.flags = RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; @@ -335,7 +337,8 @@ void FXRedRainMissile(centity_t *Owner, int Type, int Flags, vec3_t Origin) // Thinker for the explosion, just fades the light -static qboolean FXRedRainDLightThink(client_entity_t *dlight, centity_t *owner) +static qboolean +FXRedRainDLightThink(client_entity_t *dlight, centity_t *owner) { dlight->dlight->intensity -= 10.0F; if(dlight->dlight->intensity < 0.0F) @@ -344,7 +347,8 @@ static qboolean FXRedRainDLightThink(client_entity_t *dlight, centity_t *owner) return true; } -static qboolean RedRainExplosionThink(client_entity_t *explosion, centity_t *owner) +static qboolean +RedRainExplosionThink(client_entity_t *explosion, centity_t *owner) { // The explosion bit should be drawn to orbit the rain generation spot. vec3_t targetpos, diffpos, dir, randomvect; float radius; @@ -354,7 +358,7 @@ static qboolean RedRainExplosionThink(client_entity_t *explosion, centity_t *own if (explosion->LifeTime > 1000) { // Vary intesity - explosion->alpha = 1.0 - explosion->r.scale*0.1; + explosion->alpha = 1.0 - AVG_VEC3T(explosion->r.scale) * 0.1; } else if(explosion->LifeTime == 1000) { // Fade them out @@ -438,12 +442,12 @@ void RedRainExplosion(vec3_t impactpos, vec3_t rainpos, int duration, qboolean p { explo->SpawnInfo = 1; explo->r.frame = 1; - explo->r.scale = 3; + VectorSet(explo->r.scale, 3, 3, 3); } else { explo->r.frame = 0; - explo->r.scale = 2.5; + VectorSet(explo->r.scale, 2.5, 2.5, 2.5); } AddEffect(owner, explo); @@ -462,7 +466,7 @@ void RedRainExplosion(vec3_t impactpos, vec3_t rainpos, int duration, qboolean p explo->r.frame = 0; explo->r.flags = RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; explo->radius = 16.0F; - explo->r.scale = 8.0F; + VectorSet(explo->r.scale, 8.0F, 8.0F, 8.0F); explo->d_scale = -16.0F; explo->d_alpha = -2.0F; AddEffect(NULL, explo); diff --git a/src/game/effects/fx_ripples.c b/src/game/effects/fx_ripples.c index 984fbbde1..11ee7fb72 100644 --- a/src/game/effects/fx_ripples.c +++ b/src/game/effects/fx_ripples.c @@ -25,7 +25,8 @@ void PreCacheRipples() // -------------------------------------------------------------- -static qboolean FXRippleSpawner(client_entity_t *spawner, centity_t *owner) +static qboolean +FXRippleSpawner(client_entity_t *spawner, centity_t *owner) { client_entity_t *ripple; float alpha; @@ -34,9 +35,9 @@ static qboolean FXRippleSpawner(client_entity_t *spawner, centity_t *owner) ripple = ClientEntity_new(-1, 0, spawner->origin, spawner->direction, 1000); - ripple->r.model = ripple_models[0]; + ripple->r.model = ripple_models[0]; ripple->r.flags |= RF_FIXED | RF_TRANSLUCENT | RF_ALPHA_TEXTURE; - ripple->r.scale = SCALE; + VectorSet(ripple->r.scale, SCALE, SCALE, SCALE); ripple->d_scale = DELTA_SCALE; ripple->alpha = alpha; ripple->d_alpha = -alpha; diff --git a/src/game/effects/fx_rope.c b/src/game/effects/fx_rope.c index a7d514635..568696a58 100644 --- a/src/game/effects/fx_rope.c +++ b/src/game/effects/fx_rope.c @@ -86,7 +86,8 @@ qboolean RopeCheckToHide(struct client_entity_s *self, centity_t *owner) FXRopeTopDrawAttached -----------------------------------------------*/ -static qboolean FXRopeTopDrawAttached(struct client_entity_s *self, centity_t *owner) +static qboolean +FXRopeTopDrawAttached(struct client_entity_s *self, centity_t *owner) { qboolean ret; vec3_t vec; @@ -112,7 +113,8 @@ static qboolean FXRopeTopDrawAttached(struct client_entity_s *self, centity_t *o FXRopeMiddleDrawAttached -----------------------------------------------*/ -static qboolean FXRopeMiddleDrawAttached(struct client_entity_s *self, centity_t *owner) +static qboolean +FXRopeMiddleDrawAttached(struct client_entity_s *self, centity_t *owner) { qboolean ret; @@ -140,7 +142,8 @@ static qboolean FXRopeMiddleDrawAttached(struct client_entity_s *self, centity_t FXRopeBottomDrawAttached -----------------------------------------------*/ -static qboolean FXRopeBottomDrawAttached(struct client_entity_s *self, centity_t *owner) +static qboolean +FXRopeBottomDrawAttached(struct client_entity_s *self, centity_t *owner) { centity_t *end, *grab; qboolean ret; @@ -237,7 +240,8 @@ static qboolean FXRopeBottomDrawAttached(struct client_entity_s *self, centity_t FXRopeTopDraw -----------------------------------------------*/ -static qboolean FXRopeTopDraw(struct client_entity_s *self, centity_t *owner) +static qboolean +FXRopeTopDraw(struct client_entity_s *self, centity_t *owner) { float lerp, oldtime, newtime; //float c_segs; @@ -340,7 +344,7 @@ void FXRope(centity_t *owner,int Type,int Flags,vec3_t Origin) rope->r.model = rope_models[model_type]; - rope->r.scale = 3; + VectorSet(rope->r.scale, 3, 3, 3); rope->radius = radius; rope->r.spriteType = SPRITE_LINE; @@ -379,7 +383,7 @@ void FXRope(centity_t *owner,int Type,int Flags,vec3_t Origin) VectorCopy(top, rope->direction); - rope->r.scale = 3; + VectorSet(rope->r.scale, 3, 3, 3); rope->radius = radius; VectorCopy(top, rope->r.startpos); @@ -410,7 +414,7 @@ void FXRope(centity_t *owner,int Type,int Flags,vec3_t Origin) ropem->r.model = rope_models[model_type]; - ropem->r.scale = 3; + VectorSet(ropem->r.scale, 3, 3, 3); ropem->radius = radius; ropem->r.tile = 1; @@ -439,7 +443,7 @@ void FXRope(centity_t *owner,int Type,int Flags,vec3_t Origin) ropeb->r.model = rope_models[model_type]; - ropeb->r.scale = 3; + VectorSet(ropeb->r.scale, 3, 3, 3); ropeb->radius = radius; ropeb->r.spriteType = SPRITE_LINE; diff --git a/src/game/effects/fx_scorchmark.c b/src/game/effects/fx_scorchmark.c index d4f45dbe4..9ad06dca2 100644 --- a/src/game/effects/fx_scorchmark.c +++ b/src/game/effects/fx_scorchmark.c @@ -24,7 +24,8 @@ void PreCacheScorch() } -static qboolean EndLessLoop(struct client_entity_s *self, centity_t *owner) +static qboolean +EndLessLoop(struct client_entity_s *self, centity_t *owner) { return true; } @@ -36,7 +37,8 @@ static qboolean EndLessLoop(struct client_entity_s *self, centity_t *owner) // The origin comes in 8 from the wall // No scorchmark generated if no wall found (_this does happen) -static qboolean GetTruePlane(vec3_t origin, vec3_t direction) +static qboolean +GetTruePlane(vec3_t origin, vec3_t direction) { trace_t trace; vec3_t end; @@ -76,7 +78,7 @@ void FXClientScorchmark(vec3_t origin, vec3_t dir) scorchmark->r.flags |= RF_FIXED | RF_TRANSLUCENT; scorchmark->radius = 10.0; - scorchmark->r.scale = 0.6; + VectorSet(scorchmark->r.scale, 0.6, 0.6, 0.6); scorchmark->Update = EndLessLoop; @@ -104,7 +106,7 @@ void FXScorchmark(centity_t *owner, int type, int flags, vec3_t origin) scorchmark->r.flags |= RF_FIXED | RF_TRANSLUCENT; scorchmark->radius = 10.0; - scorchmark->r.scale = 0.6; + VectorSet(scorchmark->r.scale, 0.6, 0.6, 0.6); scorchmark->Update = EndLessLoop; diff --git a/src/game/effects/fx_shadow.c b/src/game/effects/fx_shadow.c index e1b853fe3..aa925c372 100644 --- a/src/game/effects/fx_shadow.c +++ b/src/game/effects/fx_shadow.c @@ -36,7 +36,8 @@ void PrecacheShadow() shadow_models[0] = fxi.RegisterModel("models/fx/shadow/tris.fm"); } -static qboolean FXShadowUpdate(struct client_entity_s *self, centity_t *owner) +static qboolean +FXShadowUpdate(struct client_entity_s *self, centity_t *owner) { vec3_t startpos, endpos; vec3_t minmax = {0, 0, 0}; @@ -82,13 +83,15 @@ static qboolean FXShadowUpdate(struct client_entity_s *self, centity_t *owner) -static qboolean FXShadowReferenceUpdate(struct client_entity_s *self, centity_t *owner) +static qboolean +FXShadowReferenceUpdate(struct client_entity_s *self, centity_t *owner) { vec3_t startpos, endpos; vec3_t minmax = {0, 0, 0}; trace_t trace; int refpoint; matrix3_t rotmatrix; + float scale; // This tells if we are wasting our time, because the reference points are culled. if (!RefPointsValid(owner)) @@ -132,7 +135,9 @@ static qboolean FXShadowReferenceUpdate(struct client_entity_s *self, centity_t // Did hit the ground self->alpha = (1.0 - trace.fraction) * 0.8 + 0.01; - self->r.scale = (1.0 - trace.fraction) * 0.8; + scale = (1.0 - trace.fraction) * 0.8; + VectorSet(self->r.scale, scale, scale, scale); + if (r_detail->value != DETAIL_HIGH) { // Raise the shadow slightly off the target wall @@ -165,7 +170,7 @@ void FXShadow(centity_t *owner, int type, int flags, vec3_t origin) self->r.model = shadow_models[0]; self->r.flags |= RF_FULLBRIGHT|RF_TRANSLUCENT|RF_ALPHA_TEXTURE; self->radius = SHADOW_CHECK_DIST; - self->r.scale = scale; + VectorSet(self->r.scale, scale, scale, scale); self->AddToView = FXShadowUpdate; AddEffect(owner, self); @@ -184,7 +189,7 @@ void FXPlayerShadow(centity_t *owner, int type, int flags, vec3_t origin) self->r.model = shadow_models[0]; self->r.flags |= RF_FULLBRIGHT|RF_TRANSLUCENT|RF_ALPHA_TEXTURE; self->radius = SHADOW_CHECK_DIST; - self->r.scale = 1.0; + VectorSet(self->r.scale, 1.0, 1.0, 1.0); self->AddToView = FXShadowUpdate; AddEffect(owner, self); FXShadowUpdate(self, owner); @@ -196,7 +201,7 @@ void FXPlayerShadow(centity_t *owner, int type, int flags, vec3_t origin) self->r.flags |= RF_FULLBRIGHT|RF_TRANSLUCENT|RF_ALPHA_TEXTURE; self->radius = SHADOW_CHECK_DIST; self->refPoint = CORVUS_LEFTFOOT; - self->r.scale = 0.8; + VectorSet(self->r.scale, 0.8, 0.8, 0.8); self->AddToView = FXShadowReferenceUpdate; AddEffect(owner, self); FXShadowUpdate(self, owner); @@ -208,7 +213,7 @@ void FXPlayerShadow(centity_t *owner, int type, int flags, vec3_t origin) self->r.flags |= RF_FULLBRIGHT|RF_TRANSLUCENT|RF_ALPHA_TEXTURE; self->radius = SHADOW_CHECK_DIST; self->refPoint = CORVUS_RIGHTFOOT; - self->r.scale = 0.8; + VectorSet(self->r.scale, 0.8, 0.8, 0.8); self->AddToView = FXShadowReferenceUpdate; AddEffect(owner, self); FXShadowUpdate(self, owner); diff --git a/src/game/effects/fx_shrine.c b/src/game/effects/fx_shrine.c index e2eca8938..7f12aa205 100644 --- a/src/game/effects/fx_shrine.c +++ b/src/game/effects/fx_shrine.c @@ -105,7 +105,8 @@ Main Player routine - make large player, and fade it into us // kill the expanding player model when it fades away -static qboolean shrine_player_update(struct client_entity_s *self, centity_t *owner) +static qboolean +shrine_player_update(struct client_entity_s *self, centity_t *owner) { if (!(--self->SpawnInfo)) { @@ -119,7 +120,7 @@ static qboolean shrine_player_update(struct client_entity_s *self, centity_t *ow // Create a model of the player, and have it expand and fade, with a tint void FXShrinePlayerEffect(centity_t *owner, int type, int flags, vec3_t origin) { - client_entity_t *shrine_fx; + client_entity_t *shrine_fx; byte shrine_type; // no longer used - causes really hard to find crashes. @@ -130,14 +131,14 @@ void FXShrinePlayerEffect(centity_t *owner, int type, int flags, vec3_t origin) origin[2] += 60.0; // create the player shrine effect around the player to begin with - shrine_fx = ClientEntity_new(type, flags, origin, NULL, 100); + shrine_fx = ClientEntity_new(type, flags, origin, NULL, 100); shrine_fx->radius = 20.0F; if (owner->current.effects & EF_CHICKEN) shrine_fx->r.model = shrine_models[1]; else shrine_fx->r.model = shrine_models[0]; shrine_fx->d_scale = -1.2; - shrine_fx->r.scale = 3.0; + VectorSet(shrine_fx->r.scale, 3.0, 3.0, 3.0); shrine_fx->velocity[2] = -35.5; shrine_fx->r.flags = RF_TRANSLUCENT ; shrine_fx->r.fmnodeinfo = &owner->current.fmnodeinfo[0]; @@ -152,7 +153,7 @@ void FXShrinePlayerEffect(centity_t *owner, int type, int flags, vec3_t origin) shrine_fx->AddToView = LinkedEntityUpdatePlacement; VectorDegreesToRadians(&owner->current.angles[0],shrine_fx->r.angles); - AddEffect(owner, shrine_fx); + AddEffect(owner, shrine_fx); } @@ -165,7 +166,8 @@ Mana effect routine ---------------------------------------- */ -static qboolean FXShrineManaThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXShrineManaThink(struct client_entity_s *self, centity_t *owner) { client_particle_t *ce; paletteRGBA_t color; @@ -235,7 +237,8 @@ Armor effect routine */ -static qboolean FXShrineArmorThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXShrineArmorThink(struct client_entity_s *self, centity_t *owner) { client_particle_t *ce; paletteRGBA_t color; @@ -301,7 +304,8 @@ Lungs effect routines ---------------------------------------- */ -static qboolean FXShrineLungsThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXShrineLungsThink(struct client_entity_s *self, centity_t *owner) { client_particle_t *ce; paletteRGBA_t color; @@ -373,8 +377,8 @@ void FXShrineLightEffect(centity_t *owner, int type, int flags, vec3_t origin) glow->r.model = shrine_models[0]; glow->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; glow->AddToView = LinkedEntityUpdatePlacement; - glow->d_scale = 5.0; - glow->r.scale = 0.1; + glow->d_scale = 5.0; + VectorSet(glow->r.scale, 0.1, 0.1, 0.1); glow->d_alpha = -0.45; glow->alpha = 1.0; @@ -391,7 +395,8 @@ Staff Powerup Routines // create the two circles that ring the player -static qboolean FXShrineStaffThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXShrineStaffThink(struct client_entity_s *self, centity_t *owner) { client_particle_t *ce; vec3_t vel; @@ -648,7 +653,8 @@ void FXCreateLightning(struct client_entity_s *self, centity_t *owner) // make the lightning effect re-occur -static qboolean FXShrineHealthThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXShrineHealthThink(struct client_entity_s *self, centity_t *owner) { if (!(--self->SpawnInfo)) @@ -690,7 +696,8 @@ Reflect effect routines */ // create the two circles that ring the player -static qboolean FXShrineReflectThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXShrineReflectThink(struct client_entity_s *self, centity_t *owner) { client_particle_t *ce; int count, i; @@ -789,7 +796,8 @@ Ghosting effect Routines */ // make the glow go away -static qboolean FXShrineGlowThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXShrineGlowThink(struct client_entity_s *self, centity_t *owner) { if (!(--self->SpawnInfo)) { @@ -797,12 +805,13 @@ static qboolean FXShrineGlowThink(struct client_entity_s *self, centity_t *owner } self->d_alpha = -0.45; - self->d_scale = -1.0; + self->d_scale = -1.0; return true; } // create the little glow bits.. -static qboolean FXShrineGhostThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXShrineGhostThink(struct client_entity_s *self, centity_t *owner) { int i; client_entity_t *glow; @@ -823,8 +832,8 @@ static qboolean FXShrineGhostThink(struct client_entity_s *self, centity_t *owne glow->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; glow->SpawnInfo = 2; glow->AddToView = OffsetLinkedEntityUpdatePlacement; - glow->d_scale = flrand(0.5, 2.0); - glow->r.scale = 0.1; + glow->d_scale = flrand(0.5, 2.0); + VectorSet(glow->r.scale, 0.1, 0.1, 0.1); glow->d_alpha = 1.0; glow->alpha = 0.1; glow->Update = FXShrineGlowThink; @@ -855,7 +864,8 @@ Speed effect routine */ // create the two circles that ring the player -static qboolean FXShrineSpeedThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXShrineSpeedThink(struct client_entity_s *self, centity_t *owner) { client_particle_t *ce; int count, i; @@ -937,7 +947,8 @@ Weapons Power Up effect routine */ // create the two circles that ring the player -static qboolean FXShrinePowerupThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXShrinePowerupThink(struct client_entity_s *self, centity_t *owner) { client_particle_t *ce; int count, i; @@ -1055,7 +1066,8 @@ static short ShrineParticle[12][2] = // make the shrine glow ball effect shimmer, and give off steam -static qboolean FXShrineBallThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXShrineBallThink(struct client_entity_s *self, centity_t *owner) { client_particle_t *ce; paletteRGBA_t color; @@ -1202,7 +1214,7 @@ void FXShrineBallExplode(centity_t *owner, int type, int flags, vec3_t origin) burst->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT;// | RF_FULLBRIGHT; burst->r.frame = 1; burst->radius=64; - burst->r.scale=1.0; + VectorSet(burst->r.scale, 1.0, 1.0, 1.0); burst->d_alpha=-4.0; burst->d_scale=-4.0; AddEffect(NULL, burst); diff --git a/src/game/effects/fx_smoke.c b/src/game/effects/fx_smoke.c index a690e9621..f8887ea21 100644 --- a/src/game/effects/fx_smoke.c +++ b/src/game/effects/fx_smoke.c @@ -34,7 +34,7 @@ void FXDarkSmoke(vec3_t origin, float scale, float range) effect = ClientEntity_new(-1, RF_TRANSLUCENT, origin, NULL, 500); effect->r.model = smoke_models[0]; - effect->r.scale = scale; + VectorSet(effect->r.scale, scale, scale, scale); effect->r.color.c = 0xaa777777; duration = Q_ftol(GetTimeToReachDistance(50.0, 0.0, range)); @@ -57,7 +57,7 @@ void FXSmoke(vec3_t origin, float scale, float range) effect = ClientEntity_new(-1, RF_TRANSLUCENT, origin, NULL, 500); effect->r.model = smoke_models[0]; - effect->r.scale = scale; + VectorSet(effect->r.scale, scale, scale, scale); effect->r.color.c = 0xffffffff; duration = Q_ftol(GetTimeToReachDistance(50.0, 0.0, range)); @@ -72,13 +72,15 @@ void FXSmoke(vec3_t origin, float scale, float range) AddEffect(NULL, effect); // add the effect as independent world effect } -static qboolean FXSmokeSpawner(struct client_entity_s *self, centity_t *owner) +static qboolean +FXSmokeSpawner(struct client_entity_s *self, centity_t *owner) { - FXSmoke(self->r.origin, self->r.scale, self->Scale); + FXSmoke(self->r.origin, AVG_VEC3T(self->r.scale), self->Scale); return true; } -static qboolean FXSmokeSpawner2(struct client_entity_s *self, centity_t *owner) +static qboolean +FXSmokeSpawner2(struct client_entity_s *self, centity_t *owner) { if(self->LifeTime--) { @@ -114,11 +116,15 @@ void FXEnvSmoke(centity_t *owner,int type,int flags,vec3_t origin) } else { + float fscale; + fxi.GetEffect(owner,flags,clientEffectSpawners[FX_ENVSMOKE].formatString, &scale, &dir, &speed, &wait, &maxrange); AnglesFromDir(dir, self->r.angles); self->velocity[0] = speed * 10; self->Scale = maxrange; - self->r.scale = 32.0 / scale; + fscale = 32.0 / scale; + VectorSet(self->r.scale, fscale, fscale, fscale); + self->updateTime = wait * 1000; self->Update = FXSmokeSpawner; AddEffect(owner, self); diff --git a/src/game/effects/fx_sparks.c b/src/game/effects/fx_sparks.c index cb08208e8..4c5eb8384 100644 --- a/src/game/effects/fx_sparks.c +++ b/src/game/effects/fx_sparks.c @@ -69,9 +69,9 @@ void GenericSparks(centity_t *owner, int type, int flags, vec3_t origin, vec3_t effect->acceleration[2] = flrand(-200.0, -100.0); if (type == FX_BLOCK_SPARKS) - effect->r.scale = 0.5; + VectorSet(effect->r.scale, 0.5, 0.5, 0.5); else - effect->r.scale = 0.25; + VectorSet(effect->r.scale, 0.25, 0.25, 0.25); effect->d_scale = flrand(-0.25, -0.75); effect->color.c = 0xFFFFFFFF; @@ -82,6 +82,8 @@ void GenericSparks(centity_t *owner, int type, int flags, vec3_t origin, vec3_t //Create spark streaks for(i = 0; i < count; i++) { + float scale; + effect = ClientEntity_new(type, flags, origin, NULL, 1000); effect->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; @@ -89,9 +91,10 @@ void GenericSparks(centity_t *owner, int type, int flags, vec3_t origin, vec3_t effect->r.model = spark_models[MODEL_SPARKSTREAK]; effect->r.spriteType = SPRITE_LINE; effect->r.tile = 1.0; - effect->r.scale = 2; + VectorSet(effect->r.scale, 2, 2, 2); effect->alpha = 1.0; - effect->r.scale = flrand(0.5, 1.0); + scale = flrand(0.5, 1.0); + VectorSet(effect->r.scale, scale, scale, scale); VectorRandomCopy(dir, work, 0.5); VectorScale(work, irand(100.0, 125.0), effect->velocity); diff --git a/src/game/effects/fx_sphereofannihlation.c b/src/game/effects/fx_sphereofannihlation.c index 7f12102b9..be7cecaf3 100644 --- a/src/game/effects/fx_sphereofannihlation.c +++ b/src/game/effects/fx_sphereofannihlation.c @@ -53,9 +53,11 @@ extern void FXClientLensFlare(centity_t *owner,int Type,int Flags,vec3_t Origin, // FXSphereOfAnnihilationSphereThink - // **************************************************************************** -static qboolean FXSphereOfAnnihilationSphereThink(struct client_entity_s *Self, centity_t *Owner) +static qboolean +FXSphereOfAnnihilationSphereThink(struct client_entity_s *Self, centity_t *Owner) { - float detail_scale; + float detail_scale, scale; + if(r_detail->value == DETAIL_LOW) detail_scale = 0.7; else @@ -64,11 +66,8 @@ static qboolean FXSphereOfAnnihilationSphereThink(struct client_entity_s *Self, else detail_scale = 1.0; - Self->r.scale = ( - Owner->current.scale[0] + - Owner->current.scale[1] + - Owner->current.scale[2] - ) / 3 * detail_scale; + scale = AVG_VEC3T(Owner->current.scale) * detail_scale; + VectorSet(Self->r.scale, scale, scale, scale); return true; } @@ -77,7 +76,8 @@ static qboolean FXSphereOfAnnihilationSphereThink(struct client_entity_s *Self, // FXSphereOfAnnihilationAuraThink - // **************************************************************************** -static qboolean FXSphereOfAnnihilationAuraThink(struct client_entity_s *Self, centity_t *Owner) +static qboolean +FXSphereOfAnnihilationAuraThink(struct client_entity_s *Self, centity_t *Owner) { vec3_t TrailStart,Trail; float TrailLength,DeltaTrailLength; @@ -195,11 +195,7 @@ void FXSphereOfAnnihilation(centity_t *Owner,int Type,int Flags,vec3_t Origin) SphereThinker->r.model = sphere_models[1]; SphereThinker->r.flags |= RF_TRANSLUCENT; - SphereThinker->r.scale = ( - Owner->current.scale[0] + - Owner->current.scale[1] + - Owner->current.scale[2] - ) / 3; + VectorCopy(Owner->current.scale, SphereThinker->r.scale); SphereThinker->radius = 70.0; SphereThinker->Update = FXSphereOfAnnihilationSphereThink; SphereThinker->AddToView = LinkedEntityUpdatePlacement; @@ -211,7 +207,8 @@ void FXSphereOfAnnihilation(centity_t *Owner,int Type,int Flags,vec3_t Origin) // FXSphereOfAnnihilationGlowballThink - // **************************************************************************** -static qboolean FXSphereOfAnnihilationGlowballThink(struct client_entity_s *Self, centity_t *Owner) +static qboolean +FXSphereOfAnnihilationGlowballThink(struct client_entity_s *Self, centity_t *Owner) { client_entity_t *Spark; int dur; @@ -278,7 +275,8 @@ static qboolean FXSphereOfAnnihilationGlowballThink(struct client_entity_s *Self // FXSphereOfAnnihilationGlowballSpawnerThink - // **************************************************************************** -static qboolean FXSphereOfAnnihilationGlowballSpawnerThink(struct client_entity_s *Self, centity_t *Owner) +static qboolean +FXSphereOfAnnihilationGlowballSpawnerThink(struct client_entity_s *Self, centity_t *Owner) { client_entity_t *Glowball; centity_t *controller; @@ -445,7 +443,8 @@ void FXSphereOfAnnihilationGlowballs(centity_t *Owner,int Type,int Flags,vec3_t // FXSphereOfAnnihilationSphereExplodeThink - // **************************************************************************** -static qboolean FXSphereOfAnnihilationSphereExplodeThink(struct client_entity_s *Self, centity_t *Owner) +static qboolean +FXSphereOfAnnihilationSphereExplodeThink(struct client_entity_s *Self, centity_t *Owner) { float Frac, Multiplier; @@ -469,7 +468,7 @@ static qboolean FXSphereOfAnnihilationSphereExplodeThink(struct client_entity_s Self->r.angles[1]+=(M_PI/27.0); - Self->radius=FX_SPHERE_EXPLOSION_BASE_RADIUS*Self->r.scale; + Self->radius = FX_SPHERE_EXPLOSION_BASE_RADIUS * AVG_VEC3T(Self->r.scale); Multiplier=1.0-Frac/(Self->NoOfAnimFrames-1); @@ -505,18 +504,18 @@ void FXSphereOfAnnihilationExplode(centity_t *Owner, int Type, int Flags, vec3_t FXClientScorchmark(Origin, Dir); } // Create an expanding ball of blue fire. - Explosion=ClientEntity_new(Type,Flags | CEF_ADDITIVE_PARTS,Origin,NULL,50); + Explosion = ClientEntity_new(Type,Flags | CEF_ADDITIVE_PARTS,Origin,NULL,50); Explosion->r.model = sphere_models[3]; - Explosion->r.flags=RF_FULLBRIGHT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - Explosion->r.scale=0.01; - Explosion->color.c=0xffffffff; - Explosion->d_scale=2.5; - Explosion->NoOfAnimFrames=(int)Size; - Explosion->AnimSpeed=1.0; - Explosion->radius=FX_SPHERE_EXPLOSION_BASE_RADIUS*Explosion->r.scale; - Explosion->dlight=CE_DLight_new(LightColor,Explosion->radius/0.7,0); - Explosion->Update=FXSphereOfAnnihilationSphereExplodeThink; + Explosion->r.flags = RF_FULLBRIGHT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; + VectorSet(Explosion->r.scale, 0.01, 0.01, 0.01); + Explosion->color.c = 0xffffffff; + Explosion->d_scale = 2.5; + Explosion->NoOfAnimFrames = (int)Size; + Explosion->AnimSpeed = 1.0; + Explosion->radius = FX_SPHERE_EXPLOSION_BASE_RADIUS * AVG_VEC3T(Explosion->r.scale); + Explosion->dlight = CE_DLight_new(LightColor, Explosion->radius/0.7,0); + Explosion->Update = FXSphereOfAnnihilationSphereExplodeThink; AddEffect(NULL,Explosion); @@ -565,6 +564,7 @@ void FXSphereOfAnnihilationPower(centity_t *Owner,int Type,int Flags,vec3_t Orig byte len2; int len; int count; + float scale; fxi.GetEffect(Owner,Flags,clientEffectSpawners[FX_WEAPON_SPHEREPOWER].formatString,dir,&size, &len2); @@ -583,9 +583,9 @@ void FXSphereOfAnnihilationPower(centity_t *Owner,int Type,int Flags,vec3_t Orig exp1->r.model = sphere_models[6]; exp1->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT; exp1->r.frame = 0; - exp1->radius=128; - exp1->d_alpha=-4.0; - exp1->r.scale=.25; + exp1->radius = 128; + exp1->d_alpha = -4.0; + VectorSet(exp1->r.scale, .25, .25, .25); exp1->d_scale = -0.5; if (Flags & CEF_FLAG8) { @@ -605,7 +605,8 @@ void FXSphereOfAnnihilationPower(centity_t *Owner,int Type,int Flags,vec3_t Orig beam->r.model = sphere_models[5]; beam->r.spriteType = SPRITE_LINE; beam->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - beam->r.scale = (size-3) * 6; + scale = (size - 3) * 6; + VectorSet(beam->r.scale, scale, scale, scale); beam->radius = 256; beam->alpha = 0.95; beam->d_alpha = -5.0; @@ -649,7 +650,7 @@ void FXSphereOfAnnihilationPower(centity_t *Owner,int Type,int Flags,vec3_t Orig exp1->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT; exp1->r.frame = 0; exp1->radius=128; - exp1->r.scale= 1; + VectorSet(exp1->r.scale, 1.0, 1.0, 1.0); exp1->d_scale = 1; exp1->d_alpha = -2.0; AddEffect(NULL, exp1); @@ -674,12 +675,13 @@ void FXSphereOfAnnihilationPower(centity_t *Owner,int Type,int Flags,vec3_t Orig // FXSpherePlayerExplodeThink - // **************************************************************************** -static qboolean FXSpherePlayerExplodeThink(struct client_entity_s *self, centity_t *Owner) +static qboolean +FXSpherePlayerExplodeThink(struct client_entity_s *self, centity_t *Owner) { if (fxi.cl->time > self->nextEventTime) { self->d_alpha = -5.0; - self->dlight->d_intensity = -self->radius*2.0; + self->dlight->d_intensity = -self->radius * 2.0; if (fxi.cl->time > self->nextEventTime + 1000) { @@ -688,14 +690,15 @@ static qboolean FXSpherePlayerExplodeThink(struct client_entity_s *self, centity } else { - self->dlight->intensity=(FX_SPHERE_EXPLOSION_BASE_RADIUS*self->r.scale*1.7); + self->dlight->intensity = (FX_SPHERE_EXPLOSION_BASE_RADIUS * AVG_VEC3T(self->r.scale) * 1.7); } return true; } -static qboolean FXSpherePlayerExplodeAddToView(struct client_entity_s *self, centity_t *Owner) +static qboolean +FXSpherePlayerExplodeAddToView(struct client_entity_s *self, centity_t *Owner) { self->r.angles[0]+=(M_PI/32.0)*(fxi.cl->time-self->lastThinkTime)/50.0; self->r.angles[1]+=(M_PI/27.0)*(fxi.cl->time-self->lastThinkTime)/50.0; @@ -706,7 +709,8 @@ static qboolean FXSpherePlayerExplodeAddToView(struct client_entity_s *self, cen } -static qboolean FXSpherePlayerExplodeGlowballThink(client_entity_t *glowball, centity_t *owner) +static qboolean +FXSpherePlayerExplodeGlowballThink(client_entity_t *glowball, centity_t *owner) { vec3_t angvect; @@ -727,7 +731,8 @@ static qboolean FXSpherePlayerExplodeGlowballThink(client_entity_t *glowball, ce } -static qboolean FXSpherePlayerExplodeGlowballTerminate(client_entity_t *glowball, centity_t *owner) +static qboolean +FXSpherePlayerExplodeGlowballTerminate(client_entity_t *glowball, centity_t *owner) { // Don't instantly delete yourself. Don't accept any more updates and die out within a second. glowball->d_alpha = -5.0; // Fade out. @@ -758,7 +763,7 @@ void FXSpherePlayerExplode(centity_t *Owner, int Type, int Flags, vec3_t Origin) explosion->r.model = sphere_models[3]; explosion->r.flags=RF_FULLBRIGHT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - explosion->r.scale=0.01; + VectorSet(explosion->r.scale, 0.01, 0.01, 0.01); explosion->color.c=0xffffffff; explosion->alpha = 1.0; explosion->d_alpha = 0.0; @@ -789,7 +794,7 @@ void FXSpherePlayerExplode(centity_t *Owner, int Type, int Flags, vec3_t Origin) glowball->AddToView = FXSpherePlayerExplodeGlowballThink; glowball->alpha = 1.0; glowball->d_alpha = 0.0; - glowball->r.scale = 1.0; + VectorSet(glowball->r.scale, 1.0, 1.0, 1.0); glowball->d_scale = 3.0; glowball->Update = FXSpherePlayerExplodeGlowballTerminate; glowball->lastThinkTime = glowball->SpawnDelay = fxi.cl->time; @@ -825,7 +830,7 @@ void FXSpherePlayerExplode(centity_t *Owner, int Type, int Flags, vec3_t Origin) explosion->r.frame = 1; explosion->radius= 128; explosion->d_alpha= -4.0; - explosion->r.scale= 1.0; + VectorSet(explosion->r.scale, 1.0, 1.0, 1.0); explosion->d_scale = -4.0; AddEffect(NULL, explosion); diff --git a/src/game/effects/fx_spoo.c b/src/game/effects/fx_spoo.c index df6e4ecbe..d7c7f4f67 100644 --- a/src/game/effects/fx_spoo.c +++ b/src/game/effects/fx_spoo.c @@ -71,7 +71,7 @@ static qboolean FXSpooTrailThink(struct client_entity_s *self, centity_t *owner) VectorSet(TrailEnt->velocity, flrand(-64.0F, 64.0F), flrand(-64.0F, 64.0F), -64.0F); - TrailEnt->r.scale = 0.65; + VectorSet(TrailEnt->r.scale, 0.65, 0.65, 0.65); TrailEnt->alpha = 1.0f; TrailEnt->r.flags |= RF_TRANSLUCENT | RF_FULLBRIGHT; TrailEnt->d_scale = flrand(-4.0, -3.5); @@ -114,6 +114,8 @@ void FXSpooSplat(centity_t *owner,int type,int Flags,vec3_t origin) while (count--) { + float scale; + TrailEnt=ClientEntity_new(FX_SPOO, 0, origin, @@ -128,7 +130,8 @@ void FXSpooSplat(centity_t *owner,int type,int Flags,vec3_t origin) VectorSet(TrailEnt->acceleration, 0, 0, -128); - TrailEnt->r.scale = flrand(0.75, 1.0); + scale = flrand(0.75, 1.0); + VectorSet(TrailEnt->r.scale, scale, scale, scale); TrailEnt->alpha=1.0; TrailEnt->r.flags |= RF_TRANSLUCENT; diff --git a/src/game/effects/fx_ssarrow.c b/src/game/effects/fx_ssarrow.c index 6c0394e4b..c91e7d231 100644 --- a/src/game/effects/fx_ssarrow.c +++ b/src/game/effects/fx_ssarrow.c @@ -79,7 +79,7 @@ static qboolean FXSsithraArrowMissileThink(client_entity_t *missile, centity_t * ce->r.flags = RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; ce->r.color = missile->color; ce->radius = 16.0F; - ce->r.scale = 0.1F; + VectorSet(ce->r.scale, 0.1F, 0.1F, 0.1F); ce->d_scale = 2.0F; ce->d_alpha = -2.2F; AddEffect(NULL, ce); diff --git a/src/game/effects/fx_ssithra.c b/src/game/effects/fx_ssithra.c index 6a573d165..6cf131dd1 100644 --- a/src/game/effects/fx_ssithra.c +++ b/src/game/effects/fx_ssithra.c @@ -43,7 +43,8 @@ enum // FXSsithraArrowTrailThink // ************************************************************************************************ -static qboolean FXSsithraArrowTrailThink(struct client_entity_s *self, centity_t *owner) +static qboolean +FXSsithraArrowTrailThink(struct client_entity_s *self, centity_t *owner) { client_entity_t *TrailEnt; vec3_t accel_dir; @@ -65,15 +66,21 @@ static qboolean FXSsithraArrowTrailThink(struct client_entity_s *self, centity_t VectorNormalize(accel_dir); if (self->flags & CEF_FLAG7) - {//powered + { + float scale; + + //powered TrailEnt->r.flags |= (RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA); TrailEnt->r.model = arrow_models[1]; - TrailEnt->r.scale = (ARROW_SCALE + flrand(0.0, 0.05)); + scale = (ARROW_SCALE + flrand(0.0, 0.05)); + VectorSet(TrailEnt->r.scale, scale, scale, scale); VectorRandomCopy(self->r.origin, TrailEnt->r.origin, flrand(-8.0, 8.0)); VectorScale(accel_dir, flrand(-100.0, -400.0), TrailEnt->velocity); } else { + float scale; + //make _this use tinting instead of darken? TrailEnt->r.flags |= RF_TRANSLUCENT;//darken TrailEnt->r.color.r = 75; @@ -81,7 +88,8 @@ static qboolean FXSsithraArrowTrailThink(struct client_entity_s *self, centity_t TrailEnt->r.color.b = 100; TrailEnt->r.color.a = 100; TrailEnt->r.model = arrow_models[0]; - TrailEnt->r.scale = ARROW_SCALE + flrand(-0.2, 0.2); + scale = ARROW_SCALE + flrand(-0.2, 0.2); + VectorSet(TrailEnt->r.scale, scale, scale, scale); VectorRandomCopy(self->r.origin, TrailEnt->r.origin, flrand(-5.0, 5.0)); VectorScale(accel_dir, flrand(-50.0, -400.0), TrailEnt->velocity); } @@ -115,7 +123,7 @@ void FXDoSsithraArrow(centity_t *owner, int type, int flags, vec3_t origin, vec3 missile->r.flags |= RF_GLOW; missile->r.model = arrow_models[2]; missile->r.skinnum = 0; - missile->r.scale = 1.0; + VectorSet(missile->r.scale, 1.0, 1.0, 1.0); LightColor.c = 0xff2040ff; // Orange light lightsize = 120.0; @@ -145,7 +153,7 @@ void FXDoSsithraArrow2(centity_t *owner, int type, int flags, vec3_t origin, vec missile->flags |= CEF_FLAG7; missile->r.model = arrow_models[2]; missile->r.skinnum = 0; - missile->r.scale = 1.5; + VectorSet(missile->r.scale, 1.5, 1.5, 1.5); LightColor.c = 0xff0000ff; // Red light lightsize = 160.0; @@ -186,14 +194,17 @@ void FXSsithraArrowBoom(centity_t *owner,int type,int flags,vec3_t origin, vec3_ while(i--) { + float scale; + if (!i) SmokePuff=ClientEntity_new(type,flags,origin,NULL,500); else SmokePuff=ClientEntity_new(type,flags,origin,NULL,1000); SmokePuff->r.model = arrow_models[0]; - SmokePuff->r.scale=flrand(0.8,1.6); - SmokePuff->d_scale=-2.0; + scale = flrand(0.8, 1.6); + VectorSet(SmokePuff->r.scale, scale, scale, scale); + SmokePuff->d_scale = -2.0; VectorRandomCopy(dir, SmokePuff->velocity, 64.0); SmokePuff->acceleration[0] = flrand(-200, 200); @@ -241,14 +252,17 @@ void FXSsithraArrow2Boom(centity_t *owner,int type,int flags,vec3_t origin, vec3 while(i--) { + float scale; + if (!i) SmokePuff=ClientEntity_new(type,flags,origin,NULL,500); else SmokePuff=ClientEntity_new(type,flags,origin,NULL,1000); SmokePuff->r.model = arrow_models[1]; - SmokePuff->r.scale=flrand(1.2,2.0); - SmokePuff->d_scale=-2.0; + scale = flrand(1.2,2.0); + VectorSet(SmokePuff->r.scale, scale, scale, scale); + SmokePuff->d_scale = -2.0; VectorRandomCopy(dir, SmokePuff->velocity, 200); SmokePuff->velocity[2] += 100.0; diff --git a/src/game/effects/fx_staff.c b/src/game/effects/fx_staff.c index e2c77aa66..3d57e21c0 100644 --- a/src/game/effects/fx_staff.c +++ b/src/game/effects/fx_staff.c @@ -66,6 +66,7 @@ void FXStaffStrike(centity_t *owner,int Type,int Flags,vec3_t Origin) vec3_t dir; byte powerlevel; int i, white; + float scale; fxi.GetEffect(owner,Flags,clientEffectSpawners[FX_WEAPON_STAFF_STRIKE].formatString, &dir, &powerlevel); @@ -81,7 +82,8 @@ void FXStaffStrike(centity_t *owner,int Type,int Flags,vec3_t Origin) TrailEnt->r.model = staffhit_models[1]; TrailEnt->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - TrailEnt->r.scale = flrand(0.75, 1.0); + scale = flrand(0.75, 1.0); + VectorSet(TrailEnt->r.scale, scale, scale, scale); TrailEnt->alpha = 0.75; TrailEnt->d_alpha = -2.0; TrailEnt->d_scale = -2.0; @@ -111,7 +113,8 @@ void FXStaffStrike(centity_t *owner,int Type,int Flags,vec3_t Origin) TrailEnt->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; TrailEnt->r.color.c = 0xFFFFFFFF; - TrailEnt->r.scale = flrand(1.0, 2.5); + scale = flrand(1.0, 2.5); + VectorSet(TrailEnt->r.scale, scale, scale, scale); TrailEnt->alpha = 1.0; TrailEnt->d_alpha = -1.0; TrailEnt->d_scale = -1.0; @@ -143,7 +146,8 @@ void FXStaffStrike(centity_t *owner,int Type,int Flags,vec3_t Origin) TrailEnt->r.model = staffhit_models[3]; TrailEnt->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - TrailEnt->r.scale = flrand(0.25, 0.5); + scale = flrand(0.25, 0.5); + VectorSet(TrailEnt->r.scale, scale, scale, scale); TrailEnt->alpha = 0.9; TrailEnt->d_alpha = -2.0; TrailEnt->d_scale = 2.0; @@ -176,7 +180,8 @@ void FXStaffStrike(centity_t *owner,int Type,int Flags,vec3_t Origin) TrailEnt->r.model = staffhit_models[1]; TrailEnt->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - TrailEnt->r.scale = flrand(0.75, 1.0); + scale = flrand(0.75, 1.0); + VectorSet(TrailEnt->r.scale, scale, scale, scale); TrailEnt->alpha = 0.75; TrailEnt->d_alpha = -2.0; TrailEnt->d_scale = -2.0; @@ -192,6 +197,8 @@ void FXStaffStrike(centity_t *owner,int Type,int Flags,vec3_t Origin) while (i--) { + float scale; + TrailEnt=ClientEntity_new(FX_WEAPON_STAFF_STRIKE, Flags & ~CEF_NO_DRAW, Origin, 0, 500); TrailEnt->r.model = staffhit_models[0]; @@ -200,7 +207,8 @@ void FXStaffStrike(centity_t *owner,int Type,int Flags,vec3_t Origin) TrailEnt->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; TrailEnt->r.color.c = 0xFFFFFFFF; - TrailEnt->r.scale = flrand(1.0, 2.5); + scale = flrand(1.0, 2.5); + VectorSet(TrailEnt->r.scale, scale, scale, scale); TrailEnt->alpha = flrand(1.0, 0.75); TrailEnt->d_alpha = -2.0; TrailEnt->d_scale = -1.0; @@ -233,7 +241,8 @@ void FXStaffStrike(centity_t *owner,int Type,int Flags,vec3_t Origin) // ------------------------ // ************************************************************************************************ -static qboolean FXStaffElementThink(struct client_entity_s *Self, centity_t *owner) +static qboolean +FXStaffElementThink(struct client_entity_s *Self, centity_t *owner) { float Frac, Multiplier; @@ -269,7 +278,8 @@ static qboolean FXStaffElementThink(struct client_entity_s *Self, centity_t *own // ----------------- // ************************************************************************************************ -static qboolean FXStaffLevel2Think(struct client_entity_s *Self, centity_t *owner) +static qboolean +FXStaffLevel2Think(struct client_entity_s *Self, centity_t *owner) { int I; int NoOfIntervals, white; @@ -327,6 +337,8 @@ static qboolean FXStaffLevel2Think(struct client_entity_s *Self, centity_t *owne while (NoOfIntervals >= 0) { + float scale; + VectorMA(curpivot, STAFF_LENGTH, adjnormal, newpoint); TrailEnt=ClientEntity_new(FX_SPELLHANDS, Self->flags & ~CEF_NO_DRAW, newpoint, 0, 2000); @@ -341,7 +353,8 @@ static qboolean FXStaffLevel2Think(struct client_entity_s *Self, centity_t *owne TrailEnt->r.flags=RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - TrailEnt->r.scale = flrand(0.2, 0.3); + scale = flrand(0.2, 0.3); + VectorSet(TrailEnt->r.scale, scale, scale, scale); TrailEnt->d_scale = flrand(-0.5, -1.0); TrailEnt->velocity[0] = irand(-8, 8); @@ -380,6 +393,8 @@ static qboolean FXStaffLevel2Think(struct client_entity_s *Self, centity_t *owne if (!irand(0,3)) { + float scale; + TrailEnt=ClientEntity_new(FX_SPELLHANDS, Self->flags & ~CEF_NO_DRAW, newpoint, 0, 5000); TrailEnt->r.model = staff_models[STAFF_TRAIL_SMOKE]; @@ -388,7 +403,8 @@ static qboolean FXStaffLevel2Think(struct client_entity_s *Self, centity_t *owne TrailEnt->r.flags=RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - TrailEnt->r.scale = flrand(0.1, 0.15); + scale = flrand(0.1, 0.15); + VectorSet(TrailEnt->r.scale, scale, scale, scale); TrailEnt->d_scale = 1.0; TrailEnt->alpha = 0.75; @@ -436,7 +452,8 @@ static qboolean FXStaffLevel2Think(struct client_entity_s *Self, centity_t *owne return true; } -static qboolean FXStaffLevel3Think(struct client_entity_s *Self, centity_t *owner) +static qboolean +FXStaffLevel3Think(struct client_entity_s *Self, centity_t *owner) { int I; int NoOfIntervals, white; @@ -503,7 +520,7 @@ static qboolean FXStaffLevel3Think(struct client_entity_s *Self, centity_t *owne TrailEnt->r.flags=RF_TRANSLUCENT | RF_TRANS_ADD; - TrailEnt->r.scale = 0.3; + VectorSet(TrailEnt->r.scale, 0.3, 0.3, 0.3); TrailEnt->d_scale = -0.75; TrailEnt->alpha = 0.75; @@ -547,7 +564,8 @@ static qboolean FXStaffLevel3Think(struct client_entity_s *Self, centity_t *owne return true; } -static qboolean FXStaffThink(struct client_entity_s *Self, centity_t *owner) +static qboolean +FXStaffThink(struct client_entity_s *Self, centity_t *owner) { int I; int NoOfIntervals; @@ -619,15 +637,16 @@ static qboolean FXStaffThink(struct client_entity_s *Self, centity_t *owner) if (owner->current.effects & EF_BLOOD_ENABLED) { - TrailEnt->r.color.c=0x50000018; - TrailEnt->r.scale=Self->xscale; + TrailEnt->r.color.c = 0x50000018; } else { TrailEnt->r.color = Self->color; - TrailEnt->r.scale=Self->xscale; } + VectorSet(TrailEnt->r.scale, + Self->xscale, Self->xscale, Self->xscale); + TrailEnt->AddToView=OffsetLinkedEntityUpdatePlacement; AddEffect(owner,TrailEnt); @@ -717,7 +736,8 @@ void FXStaff(centity_t *owner,int Type,int Flags,vec3_t Origin) // ----------------- // ************************************************************************************************ -static qboolean FXStaffCreateThink(struct client_entity_s *Self, centity_t *owner) +static qboolean +FXStaffCreateThink(struct client_entity_s *Self, centity_t *owner) { int NoOfIntervals; client_entity_t *TrailEnt; @@ -771,7 +791,10 @@ static qboolean FXStaffCreateThink(struct client_entity_s *Self, centity_t *owne TrailEnt->d_scale=-0.25; TrailEnt->d_alpha=-0.1; TrailEnt->color.c=color; - TrailEnt->r.scale=Self->NoOfAnimFrames*.05; + VectorSet(TrailEnt->r.scale, + Self->NoOfAnimFrames * .05, + Self->NoOfAnimFrames * .05, + Self->NoOfAnimFrames * .05); TrailEnt->AnimSpeed=0.20; TrailEnt->NoOfAnimFrames=2; TrailEnt->Update=FXStaffElementThink; @@ -782,11 +805,14 @@ static qboolean FXStaffCreateThink(struct client_entity_s *Self, centity_t *owne } else if(Self->classID == STAFF_TRAIL2) { + float scale; + TrailEnt->r.frame = 0; TrailEnt->r.flags=RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - TrailEnt->r.scale = flrand(0.1, 0.2); + scale = flrand(0.1, 0.2); + VectorSet(TrailEnt->r.scale, scale, scale, scale); TrailEnt->d_scale = flrand(-0.25, -0.5); TrailEnt->velocity[0] = irand(-8, 8); @@ -808,7 +834,7 @@ static qboolean FXStaffCreateThink(struct client_entity_s *Self, centity_t *owne TrailEnt->r.flags=RF_TRANSLUCENT | RF_TRANS_ADD; - TrailEnt->r.scale = 0.2; + VectorSet(TrailEnt->r.scale, 0.2, 0.2, 0.2); TrailEnt->d_scale = -0.35; TrailEnt->alpha = 0.75; @@ -921,7 +947,7 @@ void FXStaffCreatePoof(centity_t *owner,int Type,int Flags,vec3_t Origin) stafffx->color.r=255; stafffx->color.g=255; stafffx->color.b=255; - stafffx->r.scale=0.5; + VectorSet(stafffx->r.scale, 0.5, 0.5, 0.5); stafffx->AnimSpeed=0.20; stafffx->NoOfAnimFrames=2; stafffx->Update=FXStaffElementThink; @@ -945,7 +971,7 @@ void FXStaffCreatePoof(centity_t *owner,int Type,int Flags,vec3_t Origin) stafffx->color.r=255; stafffx->color.g=255; stafffx->color.b=255; - stafffx->r.scale=0.5; + VectorSet(stafffx->r.scale, 0.5, 0.5, 0.5); stafffx->AnimSpeed=0.20; stafffx->NoOfAnimFrames=2; stafffx->Update=FXStaffElementThink; @@ -962,7 +988,8 @@ void FXStaffCreatePoof(centity_t *owner,int Type,int Flags,vec3_t Origin) // ----------------- // ************************************************************************************************ -static qboolean FXStaffRemoveThink(struct client_entity_s *Self, centity_t *owner) +static qboolean +FXStaffRemoveThink(struct client_entity_s *Self, centity_t *owner) { int NoOfIntervals; client_entity_t *TrailEnt; @@ -1012,11 +1039,14 @@ static qboolean FXStaffRemoveThink(struct client_entity_s *Self, centity_t *owne TrailEnt->AddToView=OffsetLinkedEntityUpdatePlacement; if(Self->classID == STAFF_TRAIL || Self->refPoint == STAFF_TYPE_HELL) { + float scale; + TrailEnt->r.frame=1; TrailEnt->d_scale=-0.25; TrailEnt->d_alpha=-0.1; TrailEnt->color.c=color; - TrailEnt->r.scale=Self->NoOfAnimFrames*.05; + scale = Self->NoOfAnimFrames * .05; + VectorSet(TrailEnt->r.scale, scale, scale, scale); TrailEnt->AnimSpeed=0.20; TrailEnt->NoOfAnimFrames=2; TrailEnt->Update=FXStaffElementThink; @@ -1026,11 +1056,14 @@ static qboolean FXStaffRemoveThink(struct client_entity_s *Self, centity_t *owne } else if(Self->classID == STAFF_TRAIL2) { + float scale; + TrailEnt->r.frame = 0; TrailEnt->r.flags=RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - TrailEnt->r.scale = flrand(0.1, 0.2); + scale = flrand(0.1, 0.2); + VectorSet(TrailEnt->r.scale, scale, scale, scale); TrailEnt->d_scale = flrand(-0.5, -1.0); TrailEnt->velocity[0] = irand(-8, 8); @@ -1052,7 +1085,7 @@ static qboolean FXStaffRemoveThink(struct client_entity_s *Self, centity_t *owne TrailEnt->r.flags=RF_TRANSLUCENT | RF_TRANS_ADD; - TrailEnt->r.scale = 0.2; + VectorSet(TrailEnt->r.scale, 0.2, 0.2, 0.2); TrailEnt->d_scale = -0.35; TrailEnt->alpha = 0.75; diff --git a/src/game/effects/fx_tbeast.c b/src/game/effects/fx_tbeast.c index 24a69dbaf..780ac72eb 100644 --- a/src/game/effects/fx_tbeast.c +++ b/src/game/effects/fx_tbeast.c @@ -40,8 +40,9 @@ static qboolean FXTBDustPuffThink(client_entity_t *DustPuff, centity_t *owner) void FXTBDustPuff(int type, int flags, vec3_t origin,float inangle) { - client_entity_t *DustPuff; - vec3_t angles, forward; + client_entity_t *DustPuff; + vec3_t angles, forward; + float scale; VectorSet(angles, 0, inangle, 0); DustPuff = ClientEntity_new(type, flags, origin, NULL, 100); @@ -55,7 +56,8 @@ void FXTBDustPuff(int type, int flags, vec3_t origin,float inangle) VectorScale(forward, flrand(30.0F, 100.0F), DustPuff->velocity); DustPuff->velocity[2] = flrand(25.0F, 75.0F); DustPuff->acceleration[2] = DustPuff->velocity[2] * -1.23F; - DustPuff->r.scale = flrand(0.15, 0.3); + scale = flrand(0.15, 0.3); + VectorSet(DustPuff->r.scale, scale, scale, scale); DustPuff->d_scale = 0.75F; DustPuff->d_alpha = -1.0F; diff --git a/src/game/effects/fx_teleport.c b/src/game/effects/fx_teleport.c index c0f369357..6bb5eac0f 100644 --- a/src/game/effects/fx_teleport.c +++ b/src/game/effects/fx_teleport.c @@ -72,7 +72,7 @@ void PlayerTeleportin(centity_t *owner, int type, int flags, vec3_t origin) teleport_fx->r.flags = RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; teleport_fx->r.frame = 0; - teleport_fx->r.scale = 1.8; + VectorSet(teleport_fx->r.scale, 1.8, 1.8, 1.8); teleport_fx->d_scale = -3.0; AddEffect(owner, teleport_fx); @@ -137,7 +137,7 @@ void PlayerTeleportout(centity_t *owner, int type, int flags, vec3_t origin) teleport_fx->r.flags = RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; teleport_fx->r.frame = 0; - teleport_fx->r.scale = 0.5; + VectorSet(teleport_fx->r.scale, 0.5, 0.5, 0.5); teleport_fx->d_scale = 3.0; AddEffect(owner, teleport_fx); diff --git a/src/game/effects/fx_tome.c b/src/game/effects/fx_tome.c index 649ad09e0..7478cabf5 100644 --- a/src/game/effects/fx_tome.c +++ b/src/game/effects/fx_tome.c @@ -141,7 +141,7 @@ void FXTomeOfPower(centity_t *owner, int type, int flags, vec3_t origin) tome->r.model = torch_models[1]; tome->r.flags |= RF_FULLBRIGHT|RF_TRANSLUCENT|RF_TRANS_ADD|RF_TRANS_ADD_ALPHA; tome->flags |= CEF_ADDITIVE_PARTS | CEF_ABSOLUTE_PARTS; - tome->r.scale = 0.55; + VectorSet(tome->r.scale, 0.55, 0.55, 0.55); tome->color.c = 0xe5ff2020; tome->radius = 128; tome->Update = FXTomeThink; @@ -238,7 +238,7 @@ void FXplayertorch(centity_t *owner, int type, int flags, vec3_t origin) effect = ClientEntity_new(type, flags, origin, NULL, 100); effect->r.model = torch_models[0]; effect->r.flags |= RF_FULLBRIGHT | RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - effect->r.scale = .35; + VectorSet(effect->r.scale, .35, .35, .35); effect->color.c = 0xffffff; effect->dlight = CE_DLight_new(effect->color, 250.0F, 0.0F); effect->Update = FXplayertorch_think; diff --git a/src/game/effects/fx_tornado.c b/src/game/effects/fx_tornado.c index c57aacf5c..70e394560 100644 --- a/src/game/effects/fx_tornado.c +++ b/src/game/effects/fx_tornado.c @@ -97,7 +97,7 @@ void FXTornadoBall(centity_t *owner, int type, int flags, vec3_t origin) glow->LifeTime = fxi.cl->time + (TORN_DUR * 1000) + 200; glow->r.model = torn_models[0]; - glow->r.scale = 0.4; + VectorSet(glow->r.scale, 0.4, 0.4, 0.4); AddEffect(owner, glow); } @@ -267,7 +267,7 @@ void FXTornadoBallExplode(centity_t *owner, int type, int flags, vec3_t origin) burst->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA | RF_TRANSLUCENT;// | RF_FULLBRIGHT; burst->r.frame = 1; burst->radius=64; - burst->r.scale=1.0; + VectorSet(burst->r.scale, 1.0, 1.0, 1.0); burst->d_alpha=-4.0; burst->d_scale=-4.0; AddEffect(NULL, burst); diff --git a/src/game/effects/fx_wall.c b/src/game/effects/fx_wall.c index 5a6f796dc..13e437c5d 100644 --- a/src/game/effects/fx_wall.c +++ b/src/game/effects/fx_wall.c @@ -50,7 +50,8 @@ void PreCacheWall() #define FIREWORM_BLASTNUM 12 #define FIREWORM_BLASTRAD 32 -static qboolean FXFireWormThink(client_entity_t *worm, centity_t *owner) +static qboolean +FXFireWormThink(client_entity_t *worm, centity_t *owner) { client_entity_t *blast; client_particle_t *spark, *spark2; @@ -75,18 +76,21 @@ static qboolean FXFireWormThink(client_entity_t *worm, centity_t *owner) } else { + float scale; + blast = ClientEntity_new(FX_WEAPON_FIREWAVE, CEF_ADDITIVE_PARTS, worm->endpos, NULL, 500); blast->r.model = wall_models[2]; blast->r.frame = 2; // Circular halo for blast. blast->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; blast->alpha = 0.95; blast->d_alpha = -0.5; - blast->r.scale = 0.25*worm->r.scale; - blast->d_scale = -3.0*worm->r.scale; + scale = 0.25 * AVG_VEC3T(worm->r.scale); + VectorSet(blast->r.scale, scale, scale, scale); + blast->d_scale = -3.0* AVG_VEC3T(worm->r.scale); VectorSet(blast->velocity, - flrand(-0.25*FIREWORM_BLASTVEL*worm->r.scale, 0.25*FIREWORM_BLASTVEL*worm->r.scale), - flrand(-0.25*FIREWORM_BLASTVEL*worm->r.scale, 0.25*FIREWORM_BLASTVEL*worm->r.scale), - flrand(0, 0.25*FIREWORM_BLASTVEL*worm->r.scale)); + flrand(-0.25*FIREWORM_BLASTVEL* AVG_VEC3T(worm->r.scale), 0.25*FIREWORM_BLASTVEL* AVG_VEC3T(worm->r.scale)), + flrand(-0.25*FIREWORM_BLASTVEL* AVG_VEC3T(worm->r.scale), 0.25*FIREWORM_BLASTVEL* AVG_VEC3T(worm->r.scale)), + flrand(0, 0.25*FIREWORM_BLASTVEL* AVG_VEC3T(worm->r.scale))); AddEffect(NULL, blast); // Spray out in a big ring @@ -102,14 +106,14 @@ static qboolean FXFireWormThink(client_entity_t *worm, centity_t *owner) // Higher particle spark = ClientParticle_new(irand(PART_32x32_FIRE0, PART_32x32_FIRE2), color, 500); - VectorScale(diffpos, FIREWORM_BLASTRAD*worm->r.scale, spark->origin); - VectorScale(diffpos, flrand(0.45, 0.5)*FIREWORM_BLASTVEL*worm->r.scale, spark->velocity); - spark->velocity[2] += flrand(0.80, 1.0)*FIREWORM_BLASTVEL*worm->r.scale; + VectorScale(diffpos, FIREWORM_BLASTRAD* AVG_VEC3T(worm->r.scale), spark->origin); + VectorScale(diffpos, flrand(0.45, 0.5)*FIREWORM_BLASTVEL* AVG_VEC3T(worm->r.scale), spark->velocity); + spark->velocity[2] += flrand(0.80, 1.0)*FIREWORM_BLASTVEL* AVG_VEC3T(worm->r.scale); spark->color.a = 254; spark->d_alpha = flrand(-512.0, -768.0); - spark->scale = 16.0*worm->r.scale; - spark->d_scale = flrand(8.0, 16.0)*worm->r.scale; + spark->scale = 16.0* AVG_VEC3T(worm->r.scale); + spark->d_scale = flrand(8.0, 16.0)* AVG_VEC3T(worm->r.scale); AddParticleToList(blast, spark); @@ -122,8 +126,8 @@ static qboolean FXFireWormThink(client_entity_t *worm, centity_t *owner) spark2->color.a = 254; spark2->d_alpha = flrand(-512.0, -768.0); - spark2->scale = 16.0*worm->r.scale; - spark2->d_scale = flrand(8.0, 16.0)*worm->r.scale; + spark2->scale = 16.0* AVG_VEC3T(worm->r.scale); + spark2->d_scale = flrand(8.0, 16.0)* AVG_VEC3T(worm->r.scale); AddParticleToList(blast, spark2); } @@ -134,14 +138,14 @@ static qboolean FXFireWormThink(client_entity_t *worm, centity_t *owner) spark = ClientParticle_new(irand(PART_32x32_FIRE0, PART_32x32_FIRE2), color, 500); VectorSet(spark->velocity, - flrand(-0.1*FIREWORM_BLASTVEL*worm->r.scale, 0.1*FIREWORM_BLASTVEL*worm->r.scale), - flrand(-0.1*FIREWORM_BLASTVEL*worm->r.scale, 0.1*FIREWORM_BLASTVEL*worm->r.scale), - flrand(-0.2*FIREWORM_BLASTVEL*worm->r.scale, 0.2*FIREWORM_BLASTVEL*worm->r.scale)); + flrand(-0.1*FIREWORM_BLASTVEL* AVG_VEC3T(worm->r.scale), 0.1*FIREWORM_BLASTVEL* AVG_VEC3T(worm->r.scale)), + flrand(-0.1*FIREWORM_BLASTVEL* AVG_VEC3T(worm->r.scale), 0.1*FIREWORM_BLASTVEL* AVG_VEC3T(worm->r.scale)), + flrand(-0.2*FIREWORM_BLASTVEL* AVG_VEC3T(worm->r.scale), 0.2*FIREWORM_BLASTVEL* AVG_VEC3T(worm->r.scale))); spark->velocity[2] += FIREWORM_BLASTVEL; spark->color.a = 254; spark->d_alpha = flrand(-512.0, -768.0); - spark->scale = 16.0*worm->r.scale; + spark->scale = 16.0* AVG_VEC3T(worm->r.scale); spark->d_scale = flrand(-8.0, -16.0); AddParticleToList(blast, spark); @@ -172,16 +176,16 @@ static qboolean FXFireWormThink(client_entity_t *worm, centity_t *owner) spark = ClientParticle_new(irand(PART_32x32_FIRE0, PART_32x32_FIRE2), color, 500); VectorSet(spark->velocity, - flrand(-0.25*FIREWORM_TRAILVEL, 0.25*FIREWORM_TRAILVEL), - flrand(-0.25*FIREWORM_TRAILVEL, 0.25*FIREWORM_TRAILVEL), - flrand(-0.25*FIREWORM_TRAILVEL, 0.25*FIREWORM_TRAILVEL)); + flrand(-0.25 * FIREWORM_TRAILVEL, 0.25 * FIREWORM_TRAILVEL), + flrand(-0.25 * FIREWORM_TRAILVEL, 0.25 * FIREWORM_TRAILVEL), + flrand(-0.25 * FIREWORM_TRAILVEL, 0.25 * FIREWORM_TRAILVEL)); VectorMA(spark->velocity, 0.5, worm->velocity, spark->velocity); VectorScale(spark->velocity, -2.0, spark->acceleration); spark->color.a = 254; spark->d_alpha = flrand(-512.0, -768.0); - spark->scale = 20.0*worm->r.scale; - spark->d_scale = flrand(8.0, 16.0)*worm->r.scale; + spark->scale = 20.0* AVG_VEC3T(worm->r.scale); + spark->d_scale = flrand(8.0, 16.0)* AVG_VEC3T(worm->r.scale); AddParticleToList(blast, spark); } @@ -224,7 +228,7 @@ static void FXFireWaveImpact(client_entity_t *wall) blast->radius = 64.0; blast->alpha = 0.95; - blast->r.scale = 1.6; + VectorSet(blast->r.scale, 1.6, 1.6, 1.6); blast->d_scale = -2.0; blast->d_alpha = -2.0; @@ -235,7 +239,8 @@ static void FXFireWaveImpact(client_entity_t *wall) } -static qboolean FXFireWaveThink(client_entity_t *wall, centity_t *owner) +static qboolean +FXFireWaveThink(client_entity_t *wall, centity_t *owner) { client_entity_t *blast, *worm; vec3_t destpt, spawnpt, spawnvel, bottom, minmax={0,0,0}; @@ -331,8 +336,9 @@ static qboolean FXFireWaveThink(client_entity_t *wall, centity_t *owner) blast->acceleration[2] += -300.0; blast->alpha = 0.01; blast->d_alpha = flrand(4.0, 5.0); - blast->r.scale = scale*detailscale; - blast->d_scale = scale*detailscale * flrand(-1.0, -1.5); + VectorSet(blast->r.scale, + scale * detailscale, scale * detailscale, scale * detailscale); + blast->d_scale = scale * detailscale * flrand(-1.0, -1.5); AddEffect(NULL, blast); @@ -377,14 +383,17 @@ static qboolean FXFireWaveThink(client_entity_t *wall, centity_t *owner) blast->acceleration[2] += 300.0; blast->alpha = 0.01; blast->d_alpha = flrand(4.0, 5.0); - blast->r.scale = scale*detailscale; + VectorSet(blast->r.scale, + scale * detailscale, scale * detailscale, scale * detailscale); blast->d_scale = scale*detailscale * flrand(-1.0, -1.5); AddEffect(NULL, blast); } if (fxi.cl->time >= wall->nextEventTime) - { // Spawn a worm. + { + // Spawn a worm. + float scale; // Find a random spot somewhere to have a fire worm hit. VectorMA(wall->r.origin, flrand(-1.0,1.0) * wall->radius, wall->right, destpt); @@ -414,7 +423,8 @@ static qboolean FXFireWaveThink(client_entity_t *wall, centity_t *owner) worm->alpha = 0.95; // New worm, but a small one. - worm->r.scale = 0.5*detailscale; + scale = 0.5*detailscale; + VectorSet(worm->r.scale, scale, scale, scale); worm->Update = FXFireWormThink; worm->color.c = 0xff0080ff; @@ -486,6 +496,7 @@ void FXFireWaveWorm(centity_t *owner, int type, int flags, vec3_t origin) vec3_t bottom, minmax={0,0,0}; trace_t trace; float detailscale; + float scale; switch((int)(r_detail->value)) { @@ -528,7 +539,9 @@ void FXFireWaveWorm(centity_t *owner, int type, int flags, vec3_t origin) VectorCopy(spawnpt, worm->startpos); VectorCopy(origin, worm->endpos); worm->alpha = 0.95; - worm->r.scale = 1.5*detailscale; + scale = 1.5*detailscale; + VectorSet(worm->r.scale, scale, scale, scale); + worm->Update = FXFireWormThink; worm->color.c = 0xff0080ff; worm->dlight = CE_DLight_new(worm->color, 128.0, 0.0); @@ -581,7 +594,7 @@ static void FXFireBurstImpact(client_entity_t *wall) blast->radius = 64.0; blast->alpha = 0.95; - blast->r.scale = 1.2; + VectorSet(blast->r.scale, 1.2, 1.2, 1.2); blast->d_scale = -2.0; blast->d_alpha = -2.0; @@ -595,7 +608,8 @@ static void FXFireBurstImpact(client_entity_t *wall) #define FIREBURST_PART_SPEED 160 -static qboolean FXFireBurstThink(client_entity_t *wall, centity_t *owner) +static qboolean +FXFireBurstThink(client_entity_t *wall, centity_t *owner) { client_entity_t *burst; @@ -674,6 +688,8 @@ static qboolean FXFireBurstThink(client_entity_t *wall, centity_t *owner) j=1; // for(j = 0; j < 2; j++) { + float scale; + burst = ClientEntity_new(FX_WEAPON_FIREBURST, 0, org, NULL, 1000); burst->r.model = wall_models[1]; @@ -689,7 +705,8 @@ static qboolean FXFireBurstThink(client_entity_t *wall, centity_t *owner) burst->velocity[2] *= .5; } - burst->r.scale = flrand(0.5, 0.75)*detailscale; + scale = flrand(0.5, 0.75) * detailscale; + VectorSet(burst->r.scale, scale, scale, scale); burst->radius = 20.0; burst->d_scale = 1.0; burst->d_alpha = -2.5; @@ -745,7 +762,7 @@ void FXFireBurst(centity_t *owner, int type, int flags, vec3_t origin) wall->Update = FXFireBurstThink; wall->radius = FIREBLAST_RADIUS; wall->color.c = 0xff00afff; -// wall->r.scale = 8.0; +// VectorSet(wall->r.scale, 8.0, 8.0, 8.0); // wall->d_scale = 56.0; wall->dlight = CE_DLight_new(wall->color, 150.0F, 0.0F); wall->lastThinkTime = fxi.cl->time; @@ -760,7 +777,7 @@ void FXFireBurst(centity_t *owner, int type, int flags, vec3_t origin) wall->r.flags |= RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; wall->radius = 64.0; - wall->r.scale = 0.1; + VectorSet(wall->r.scale, 0.1, 0.1, 0.1); wall->d_scale = 4.0; wall->alpha = 0.95; wall->d_alpha = -2.0; diff --git a/src/game/effects/fx_waterentrysplash.c b/src/game/effects/fx_waterentrysplash.c index b67cbdc30..f38191f1a 100644 --- a/src/game/effects/fx_waterentrysplash.c +++ b/src/game/effects/fx_waterentrysplash.c @@ -27,14 +27,16 @@ void PreCacheWaterSplash() #define SCALE 0.3 #define SPLASH_RADIUS 20 -static qboolean FXWaterEntrySplashThinkerThink(struct client_entity_s *Self, centity_t *Owner); +static qboolean +FXWaterEntrySplashThinkerThink(struct client_entity_s *Self, centity_t *Owner); // ************************************************************************************************ // FXWaterEntryRippleThinkerThink // ------------------------------ // ************************************************************************************************ -static qboolean FXWaterEntrySplashThinkerThink(struct client_entity_s *Self, centity_t *Owner) +static qboolean +FXWaterEntrySplashThinkerThink(struct client_entity_s *Self, centity_t *Owner) { client_entity_t *EntryRipple; @@ -58,15 +60,15 @@ static qboolean FXWaterEntrySplashThinkerThink(struct client_entity_s *Self, cen if (Self->flags & CEF_FLAG7) { // Random ripples. - EntryRipple->r.scale=0.1; + VectorSet(EntryRipple->r.scale, 0.1, 0.1, 0.1); EntryRipple->d_scale=0.7; EntryRipple->r.origin[0] += flrand(-6.0,6.0); EntryRipple->r.origin[1] += flrand(-6.0,6.0); } else { - EntryRipple->r.scale=SCALE; - EntryRipple->d_scale=1.0; + VectorSet(EntryRipple->r.scale, SCALE, SCALE, SCALE); + EntryRipple->d_scale = 1.0; } AddEffect(NULL,EntryRipple); @@ -126,9 +128,12 @@ void FXDoWaterEntrySplash(centity_t *Owner,int Type,int Flags,vec3_t Origin, byt DeltaTheta=(2*M_PI)/12; for(Theta=0.0;Theta<(2*M_PI);Theta+=DeltaTheta) { + float scale; + splash = ClientEntity_new(Type,Flags,Origin,Dir,500); splash->r.model = water_models[1]; - splash->r.scale = flrand(0.15, 0.25); + scale = flrand(0.15, 0.25); + VectorSet(splash->r.scale, scale, scale, scale); splash->r.flags = RF_TRANSLUCENT; splash->r.frame = 1; splash->radius = 2.0; @@ -153,9 +158,12 @@ void FXDoWaterEntrySplash(centity_t *Owner,int Type,int Flags,vec3_t Origin, byt DeltaTheta=(2*M_PI)/6; for(Theta=0.0;Theta<(2*M_PI);Theta+=DeltaTheta) { + float scale; + splash = ClientEntity_new(Type,Flags,Origin,Dir,800); splash->r.model = water_models[1]; - splash->r.scale = flrand(0.1, 0.2); + scale = flrand(0.1, 0.2); + VectorSet(splash->r.scale, scale, scale, scale); splash->r.flags = RF_TRANSLUCENT; splash->r.frame = 1; splash->radius = 2.0; @@ -182,7 +190,7 @@ void FXDoWaterEntrySplash(centity_t *Owner,int Type,int Flags,vec3_t Origin, byt splash=ClientEntity_new(FX_WATER_ENTRYSPLASH, Flags&(~CEF_OWNERS_ORIGIN), Origin, Dir, 1200); splash->r.model = water_models[0]; - splash->r.scale=SCALE*2.0; + VectorSet(splash->r.scale, SCALE * 2.0, SCALE * 2.0, SCALE * 2.0); splash->r.frame=0; splash->r.flags |= RF_FIXED|RF_TRANSLUCENT|RF_ALPHA_TEXTURE; splash->alpha=0.6; @@ -201,7 +209,7 @@ void FXDoWaterEntrySplash(centity_t *Owner,int Type,int Flags,vec3_t Origin, byt splash=ClientEntity_new(FX_WATER_ENTRYSPLASH, Flags&(~CEF_OWNERS_ORIGIN), Origin, Dir, 1200); splash->r.model = water_models[0]; - splash->r.scale=SCALE; + VectorSet(splash->r.scale, SCALE, SCALE, SCALE); splash->r.frame=0; splash->r.flags |= RF_FIXED|RF_TRANSLUCENT|RF_ALPHA_TEXTURE; splash->alpha=0.6; diff --git a/src/game/effects/fx_waterwake.c b/src/game/effects/fx_waterwake.c index 5586e2e86..085b577f4 100644 --- a/src/game/effects/fx_waterwake.c +++ b/src/game/effects/fx_waterwake.c @@ -54,7 +54,7 @@ void FXWaterWake(centity_t *owner, int type, int flags, vec3_t origin) self->r.origin[1]=CreatorClientEntity->origin[1]; self->r.origin[0]=CreatorClientEntity->origin[0]; self->alpha=0.7; - self->r.scale=0.3; + VectorSet(self->r.scale, 0.3, 0.3, 0.3);; self->r.flags |= RF_FIXED|RF_TRANSLUCENT|RF_TRANS_ADD|RF_TRANS_ADD_ALPHA; self->r.angles[YAW]=YawAngle; diff --git a/src/game/effects/fx_weaponpickup.c b/src/game/effects/fx_weaponpickup.c index c0a301356..99e62da6d 100644 --- a/src/game/effects/fx_weaponpickup.c +++ b/src/game/effects/fx_weaponpickup.c @@ -113,17 +113,25 @@ void FXWeaponPickup(centity_t *owner, int type, int flags, vec3_t origin) VectorCopy(ce->r.origin, ce->origin); ce->r.flags = RF_TRANSLUCENT | RF_GLOW; + if(!tag)//sorry bob, just temporary... - ce->flags|=CEF_NO_DRAW; + { + ce->flags |= CEF_NO_DRAW; + } else + { ce->r.model = weapon_models[tag - 2]; - ce->r.scale = 0.5; + } + + VectorSet(ce->r.scale, 0.5, 0.5, 0.5); ce->radius = 10.0; ce->alpha = 0.8; ce->Update = FXWeaponPickupThink; if (tag == ITEM_WEAPON_FIREWALL) - ce->r.scale = 1; + { + VectorSet(ce->r.scale, 1.0, 1.0, 1.0); + } if (tag == ITEM_WEAPON_PHOENIXBOW) ce->r.skinnum = 1; diff --git a/src/game/effects/generic_character_effects.c b/src/game/effects/generic_character_effects.c index fdec425f8..e4765fe7c 100644 --- a/src/game/effects/generic_character_effects.c +++ b/src/game/effects/generic_character_effects.c @@ -154,10 +154,19 @@ void FXOgleHitPuff(centity_t *owner, int type, int flags, vec3_t origin) } effect->alpha = 0.35; - if(speed>1) - effect->r.scale = flrand(0.3, 0.75); + + if(speed > 1) + { + float scale; + + scale = flrand(0.3, 0.75); + VectorSet(effect->r.scale, scale, scale, scale); + } else - effect->r.scale = 0.1; + { + VectorSet(effect->r.scale, 0.1, 0.1, 0.1); + } + effect->d_scale = 2.0; effect->d_alpha = -2.0; effect->color.c = 0xFFFFFFFF; @@ -209,10 +218,16 @@ void FXOgleHitPuff(centity_t *owner, int type, int flags, vec3_t origin) effect->Update = PebbleUpdate; effect->alpha = 1.0; - if(speed>1) - effect->r.scale = flrand(0.8, 1.5) * speed/100; + if(speed > 1) + { + float scale = flrand(0.8, 1.5) * speed / 100; + VectorSet(effect->r.scale, scale, scale, scale); + } else - effect->r.scale = flrand(0.1, 0.25); + { + float scale = flrand(0.1, 0.25); + VectorSet(effect->r.scale, scale, scale, scale); + } effect->d_scale = 0.0; effect->d_alpha = 0.0; effect->color.c = 0xFFFFFFFF; @@ -246,7 +261,7 @@ void FXGenericHitPuff(centity_t *owner, int type, int flags, vec3_t origin) VectorScale(work, 50.0, effect->velocity); effect->acceleration[2] = -100.0; effect->alpha = 0.5; - effect->r.scale = 0.1; + VectorSet(effect->r.scale, 0.1, 0.1, 0.1); effect->d_scale = 1.0; effect->d_alpha = -1.0; effect->color.c = 0xFFFFFFFF; @@ -261,7 +276,7 @@ void FXGenericHitPuff(centity_t *owner, int type, int flags, vec3_t origin) effect->r.model = genfx_models[5]; effect->r.frame = 0; effect->r.flags = RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; - effect->r.scale = 0.4; + VectorSet(effect->r.scale, 0.4, 0.4, 0.4); effect->alpha = .95; effect->d_scale = -1.6; effect->d_alpha = -3.0; // Alpha goes up to 1, then down to zero. diff --git a/src/game/effects/generic_weapon_effects.c b/src/game/effects/generic_weapon_effects.c index 2b53d32ec..db19dfa57 100644 --- a/src/game/effects/generic_weapon_effects.c +++ b/src/game/effects/generic_weapon_effects.c @@ -39,6 +39,8 @@ void FXCreateArmorHit(centity_t *owner,int Type,int Flags,vec3_t Origin) while (i--) { + float scale; + TrailEnt=ClientEntity_new(Type, Flags & ~CEF_NO_DRAW, Origin, 0, 500); TrailEnt->r.model = armorhit_models[0]; @@ -47,7 +49,8 @@ void FXCreateArmorHit(centity_t *owner,int Type,int Flags,vec3_t Origin) TrailEnt->r.flags |= RF_TRANSLUCENT | RF_TRANS_ADD | RF_TRANS_ADD_ALPHA; TrailEnt->r.color.c = 0xFFFFFFFF; - TrailEnt->r.scale = flrand(1.0, 2.5); + scale = flrand(1.0, 2.5); + VectorSet(TrailEnt->r.scale, scale, scale, scale); TrailEnt->alpha = flrand(1.0, 0.75); TrailEnt->d_alpha = -2.0; TrailEnt->d_scale = -1.0; diff --git a/src/game/effects/main.c b/src/game/effects/main.c index 8b1de9ba2..da460f6e1 100644 --- a/src/game/effects/main.c +++ b/src/game/effects/main.c @@ -726,7 +726,7 @@ AddServerEntities(frame_t *frame) ent->skin = NULL; // No custom skin. } - ent->scale = (s1->scale[0] + s1->scale[1] + s1->scale[2]) / 3; + VectorCopy(s1->scale, ent->scale); if(s1->color[0] || s1->color[1] ||