diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e2cd84b1..e06bc4359 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -323,8 +323,8 @@ set(OC_CLONK_SOURCES src/landscape/C4Material.h src/landscape/C4MaterialList.cpp src/landscape/C4MaterialList.h - src/landscape/C4DynamicParticles.cpp - src/landscape/C4DynamicParticles.h + src/landscape/C4Particles.cpp + src/landscape/C4Particles.h src/landscape/C4PathFinder.cpp src/landscape/C4PathFinder.h src/landscape/C4PXS.cpp diff --git a/docs/sdk/particle/index.xml b/docs/sdk/particle/index.xml index 77747f522..9a772599f 100644 --- a/docs/sdk/particle/index.xml +++ b/docs/sdk/particle/index.xml @@ -47,7 +47,7 @@ The coordinates for the source rectangle within Graphics.png of a particle specify the first phase of the particle graphics the other phases should follow to the right and can be continued in the next row. The animation length is then automatically determined from the image size. Properties Each particle has different attributes like position, lifetime, size and more. These are set by script when creating the particle. - The following properties can be contained in a proplist passed to CreateParticleEx. For an example, see CreateParticleEx + The following properties can be contained in a proplist passed to CreateParticle. For an example, see CreateParticle You can assign either constants to the properties (f.e. R = 200) or use certain value provider functions (f.e. R = PV_Linear(200, 0)). Available value provider functions are: PV_Linear PV_Direction diff --git a/docs/sdk/script/fn/CreateParticleEx.xml b/docs/sdk/script/fn/CreateParticle.xml similarity index 93% rename from docs/sdk/script/fn/CreateParticleEx.xml rename to docs/sdk/script/fn/CreateParticle.xml index 633469fa2..b24a7bceb 100644 --- a/docs/sdk/script/fn/CreateParticleEx.xml +++ b/docs/sdk/script/fn/CreateParticle.xml @@ -4,7 +4,7 @@ - CreateParticleEx + CreateParticle Particles 5.3.4 OC @@ -72,7 +72,7 @@ var particles = ForceX = PV_Random(-5, 5, 15), Phase = PV_Step(1, 0, 10) }; -CreateParticleEx("Fire", 0, 0, PV_Random(-200, 200), PV_Random(-200, 200), PV_Random(18, 38 * 5), particles, 100); +CreateParticle("Fire", 0, 0, PV_Random(-200, 200), PV_Random(-200, 200), PV_Random(18, 38 * 5), particles, 100); Casts 100 particles with a previously defined behavior. diff --git a/docs/sdk/script/fn/PC_Bounce.xml b/docs/sdk/script/fn/PC_Bounce.xml index 93f8e68d3..64ec784da 100644 --- a/docs/sdk/script/fn/PC_Bounce.xml +++ b/docs/sdk/script/fn/PC_Bounce.xml @@ -20,7 +20,7 @@ A particle collision function. The particle will bounce off the ground on collision. If your particles get stuck instead of bouncing, you might need to increase the CollisionVertex value a bit. See the particle documentation for further explanations of the particle system. - CreateParticleEx + CreateParticle PV_Linear PV_Direction PV_Random diff --git a/docs/sdk/script/fn/PC_Die.xml b/docs/sdk/script/fn/PC_Die.xml index 6d653be64..b7ebb94a6 100644 --- a/docs/sdk/script/fn/PC_Die.xml +++ b/docs/sdk/script/fn/PC_Die.xml @@ -13,7 +13,7 @@ A particle collision function. The particle will die on collision. See the particle documentation for further explanations of the particle system. - CreateParticleEx + CreateParticle PV_Linear PV_Direction PV_Random diff --git a/docs/sdk/script/fn/PC_Stop.xml b/docs/sdk/script/fn/PC_Stop.xml index 9f498685b..560658eae 100644 --- a/docs/sdk/script/fn/PC_Stop.xml +++ b/docs/sdk/script/fn/PC_Stop.xml @@ -13,7 +13,7 @@ A particle collision function. The particle will set its velocity to zero on collision. See the particle documentation for further explanations of the particle system. - CreateParticleEx + CreateParticle PV_Linear PV_Direction PV_Random diff --git a/docs/sdk/script/fn/PV_Direction.xml b/docs/sdk/script/fn/PV_Direction.xml index 76756a7ab..5fc11d0bf 100644 --- a/docs/sdk/script/fn/PV_Direction.xml +++ b/docs/sdk/script/fn/PV_Direction.xml @@ -21,7 +21,7 @@ The value depends on the current angle of movement of the particle. Usually the factor-parameter can be left out, since the original purpose of this function is to be used for the rotation-property. See the particle documentation for further explanations of the particle system. - CreateParticleEx + CreateParticle PV_Linear PV_Random PV_Step diff --git a/docs/sdk/script/fn/PV_KeyFrames.xml b/docs/sdk/script/fn/PV_KeyFrames.xml index 054b5c3c5..9af2bbd9a 100644 --- a/docs/sdk/script/fn/PV_KeyFrames.xml +++ b/docs/sdk/script/fn/PV_KeyFrames.xml @@ -40,7 +40,7 @@ The value returned will be an interpolated value of the (smoothed) curve between the up to 4 key frames. PV_KeyFrames(0, 0, X, 1000, Y) is equivalent to PV_Linear(X, Y). See the particle documentation for further explanations of the particle system. - CreateParticleEx + CreateParticle PV_Linear PV_Direction PV_Random diff --git a/docs/sdk/script/fn/PV_Linear.xml b/docs/sdk/script/fn/PV_Linear.xml index c6664338f..02f078070 100644 --- a/docs/sdk/script/fn/PV_Linear.xml +++ b/docs/sdk/script/fn/PV_Linear.xml @@ -25,7 +25,7 @@ The value will go linearly from start_value to end_value over the life of the particle. See the particle documentation for further explanations of the particle system. - CreateParticleEx + CreateParticle PV_Direction PV_Random PV_Step diff --git a/docs/sdk/script/fn/PV_Random.xml b/docs/sdk/script/fn/PV_Random.xml index 6c5f8f951..d9ad69b83 100644 --- a/docs/sdk/script/fn/PV_Random.xml +++ b/docs/sdk/script/fn/PV_Random.xml @@ -33,7 +33,7 @@ The value will be a random number in the interval from start_value to (not including) end_value. The values in between are not whole integers, but are also in fraction of integers. This means that PV_Random(0, 1) can not only return one value (the 0) but a lot of different values in the interval between 0 and 1. See the particle documentation for further explanations of the particle system. - CreateParticleEx + CreateParticle PV_Linear PV_Direction PV_Step diff --git a/docs/sdk/script/fn/PV_Speed.xml b/docs/sdk/script/fn/PV_Speed.xml index a070138d2..23f18d721 100644 --- a/docs/sdk/script/fn/PV_Speed.xml +++ b/docs/sdk/script/fn/PV_Speed.xml @@ -25,7 +25,7 @@ The value will depend on the speed of the particle. See the particle documentation for further explanations of the particle system. - CreateParticleEx + CreateParticle PV_Linear PV_Direction PV_Random diff --git a/docs/sdk/script/fn/PV_Step.xml b/docs/sdk/script/fn/PV_Step.xml index fde1f33fb..c09d3ba31 100644 --- a/docs/sdk/script/fn/PV_Step.xml +++ b/docs/sdk/script/fn/PV_Step.xml @@ -32,7 +32,7 @@ PV_Step can be used for values that do not depend on the particle age (unlike f.e. PV_Linear). See the particle documentation for further explanations of the particle system. - CreateParticleEx + CreateParticle PV_Linear PV_Direction PV_Random diff --git a/docs/sdk/script/fn/PV_Wind.xml b/docs/sdk/script/fn/PV_Wind.xml index 8fe6f372a..9d46cb648 100644 --- a/docs/sdk/script/fn/PV_Wind.xml +++ b/docs/sdk/script/fn/PV_Wind.xml @@ -25,7 +25,7 @@ The value will depend on the wind at the current position of the particle. See the particle documentation for further explanations of the particle system. - CreateParticleEx + CreateParticle PV_Direction PV_Random PV_Step diff --git a/planet/Arena.ocf/FrozenFortress.ocs/Script.c b/planet/Arena.ocf/FrozenFortress.ocs/Script.c index 1d3cfcade..1df0ec180 100644 --- a/planet/Arena.ocf/FrozenFortress.ocs/Script.c +++ b/planet/Arena.ocf/FrozenFortress.ocs/Script.c @@ -99,7 +99,7 @@ global func FxGeysirExplosionTimer(object target, effect) y-=3; for(var i=0; i<(45); i++)InsertMaterial(Material("Water"),x+RandomX(-9,9),y-Random(5),RandomX(-10,10)+RandomX(-5,5)+RandomX(-10,10),-(10+Random(50)+Random(30)+Random(60))); for(var i=0; i<(25); i++)InsertMaterial(Material("Water"),x+RandomX(-16,16),y-Random(5),RandomX(-10,10)+RandomX(-15,15)+RandomX(-20,20),-(10+Random(50))); - CreateParticleEx("Air", PV_Random(x-6, x+6), PV_Random(y-3, y), PV_Random(-15, 15), PV_Random(-90, -5), PV_Random(20, 100), Particles_Air()); + CreateParticle("Air", PV_Random(x-6, x+6), PV_Random(y-3, y), PV_Random(-15, 15), PV_Random(-90, -5), PV_Random(20, 100), Particles_Air()); if(effect.counter>2072) effect.counter=0; for(var obj in FindObjects(Find_InRect(x-30,y-200,60,210))) { diff --git a/planet/Arena.ocf/FrozenFortress.ocs/Scrolls.ocd/FrostboltScroll.ocd/Script.c b/planet/Arena.ocf/FrozenFortress.ocs/Scrolls.ocd/FrostboltScroll.ocd/Script.c index a242cdbc5..d860770da 100644 --- a/planet/Arena.ocf/FrozenFortress.ocs/Scrolls.ocd/FrostboltScroll.ocd/Script.c +++ b/planet/Arena.ocf/FrozenFortress.ocs/Scrolls.ocd/FrostboltScroll.ocd/Script.c @@ -85,8 +85,8 @@ public func FxFrostboltTimer(pTarget, effect, iEffectTime) effect.x=x; effect.y=y; - CreateParticleEx("Air", PV_Random(x - 3, x + 3), PV_Random(y - 3, y + 3), PV_Random(-10, 10), PV_Random(-10, 10), 5, effect.air_particles, 10); - CreateParticleEx("MagicFire", PV_Random(x - 3, x + 3), PV_Random(y - 3, y + 3), PV_Random(-10, 10), PV_Random(-10, 10), 10, effect.air_particles, 10); + CreateParticle("Air", PV_Random(x - 3, x + 3), PV_Random(y - 3, y + 3), PV_Random(-10, 10), PV_Random(-10, 10), 5, effect.air_particles, 10); + CreateParticle("MagicFire", PV_Random(x - 3, x + 3), PV_Random(y - 3, y + 3), PV_Random(-10, 10), PV_Random(-10, 10), 10, effect.air_particles, 10); } diff --git a/planet/Arena.ocf/FrozenFortress.ocs/Scrolls.ocd/HardeningScroll.ocd/Script.c b/planet/Arena.ocf/FrozenFortress.ocs/Scrolls.ocd/HardeningScroll.ocd/Script.c index b4ec7293e..5bee60ce1 100644 --- a/planet/Arena.ocf/FrozenFortress.ocs/Scrolls.ocd/HardeningScroll.ocd/Script.c +++ b/planet/Arena.ocf/FrozenFortress.ocs/Scrolls.ocd/HardeningScroll.ocd/Script.c @@ -31,7 +31,7 @@ public func FxHardeningSpellTimer(pTarget, effect, iEffectTime) var x = effect.x; var y = effect.y; - CreateParticleEx("Air", PV_Random(x - 10, x + 10), PV_Random(y - 10, y + 10), xdir, ydir, PV_Random(20, 40), Particles_Air(), 4); + CreateParticle("Air", PV_Random(x - 10, x + 10), PV_Random(y - 10, y + 10), xdir, ydir, PV_Random(20, 40), Particles_Air(), 4); if(!GBackSolid(x,y)) { @@ -48,7 +48,7 @@ public func FxHardeningSpellTimer(pTarget, effect, iEffectTime) if(GetMaterial(x,y) == Material("Snow")) { DrawMaterialQuad("Ice",x,y,x+1,y,x+1,y+1,x,y+1); - CreateParticleEx("Air", x , y, xdir/3, ydir/3, PV_Random(20, 40), Particles_Air()); + CreateParticle("Air", x , y, xdir/3, ydir/3, PV_Random(20, 40), Particles_Air()); } } if(iEffectTime > 360) { return -1; } diff --git a/planet/Arena.ocf/FrozenFortress.ocs/Scrolls.ocd/WindScroll.ocd/Script.c b/planet/Arena.ocf/FrozenFortress.ocs/Scrolls.ocd/WindScroll.ocd/Script.c index eb75f82e0..f905923e7 100644 --- a/planet/Arena.ocf/FrozenFortress.ocs/Scrolls.ocd/WindScroll.ocd/Script.c +++ b/planet/Arena.ocf/FrozenFortress.ocs/Scrolls.ocd/WindScroll.ocd/Script.c @@ -41,12 +41,12 @@ public func FxWindScrollStormTimer(pTarget, effect, iEffectTime) { var r=Random(360); var d=Random(40); - CreateParticleEx("Air", Sin(r,d)+x,-Cos(r,d)+y, xdir/3, ydir/3, PV_Random(10, 30), effect.particles, 1); + CreateParticle("Air", Sin(r,d)+x,-Cos(r,d)+y, xdir/3, ydir/3, PV_Random(10, 30), effect.particles, 1); return 1; } else if(iEffectTime<180 ) { - CreateParticleEx("Air", PV_Random(x - 20, x + 20), PV_Random(y - 20, y + 20), xdir/2, ydir/2, PV_Random(10, 30), effect.particles, 5); + CreateParticle("Air", PV_Random(x - 20, x + 20), PV_Random(y - 20, y + 20), xdir/2, ydir/2, PV_Random(10, 30), effect.particles, 5); for(var obj in FindObjects(Find_Distance(40,x,y),Find_Not(Find_Category(C4D_Structure)))) { if(PathFree(x,y,obj->GetX(),obj->GetY())) diff --git a/planet/Arena.ocf/FrozenFortress.ocs/System.ocg/Explode.c b/planet/Arena.ocf/FrozenFortress.ocs/System.ocg/Explode.c index 9799d11ea..7f44e114a 100644 --- a/planet/Arena.ocf/FrozenFortress.ocs/System.ocg/Explode.c +++ b/planet/Arena.ocf/FrozenFortress.ocs/System.ocg/Explode.c @@ -87,9 +87,9 @@ global func BlueExplosionEffect(int level, int x, int y) Size = PV_Random(level - 5, level + 5) }; // Blast particle. - CreateParticleEx("SmokeDirty", x, y, PV_Random(-2, 2), PV_Random(-2, 2), PV_Random(20, 40), smoke, 10); - CreateParticleEx("MagicFire", x, y, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(5, 10), fire, 20); - if(!GBackLiquid(x,y)) CreateParticleEx("SphereSpark", x, y, PV_Random(-100, 100), PV_Random(-100, 100), PV_Random(5, 36 * 3), glimmer, level); + CreateParticle("SmokeDirty", x, y, PV_Random(-2, 2), PV_Random(-2, 2), PV_Random(20, 40), smoke, 10); + CreateParticle("MagicFire", x, y, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(5, 10), fire, 20); + if(!GBackLiquid(x,y)) CreateParticle("SphereSpark", x, y, PV_Random(-100, 100), PV_Random(-100, 100), PV_Random(5, 36 * 3), glimmer, level); if(GBackLiquid(x,y)) CastObjects(Fx_Bubble, level * 4 / 10, level, x, y); return; diff --git a/planet/Arena.ocf/Hideout.ocs/LifeGem.ocd/Script.c b/planet/Arena.ocf/Hideout.ocs/LifeGem.ocd/Script.c index 5d670421e..905adb436 100644 --- a/planet/Arena.ocf/Hideout.ocs/LifeGem.ocd/Script.c +++ b/planet/Arena.ocf/Hideout.ocs/LifeGem.ocd/Script.c @@ -29,7 +29,7 @@ func FxSparkleStart(target, effect, temp) func FxSparkleTimer(target, effect, effect_time) { if(this()->Contained() || !Random(2)) return FX_OK; - CreateParticleEx("MagicRing", 0, 0, 0, 0, effect.Interval, effect.particles, 1); + CreateParticle("MagicRing", 0, 0, 0, 0, effect.Interval, effect.particles, 1); return FX_OK; } @@ -74,10 +74,10 @@ func FxGemHealingTimer(target, effect, effect_time) target->DoEnergy(500, true); - target->CreateParticleEx("Magic", PV_Random(-5, +5), PV_Random(-8, 8), PV_Random(-1, 1), PV_Random(-10, -5), PV_Random(10, 20), effect.glimmer_particles, 3); + target->CreateParticle("Magic", PV_Random(-5, +5), PV_Random(-8, 8), PV_Random(-1, 1), PV_Random(-10, -5), PV_Random(10, 20), effect.glimmer_particles, 3); if(!Random(10)) effect.switcher = !effect.switcher; if(effect.switcher) - target->CreateParticleEx("MagicSpark", PV_Random(-3, 3), PV_Random(0, 8), PV_Random(-1, 1), PV_Random(-2, -1), PV_Random(20, 30), effect.sparks, 2); + target->CreateParticle("MagicSpark", PV_Random(-3, 3), PV_Random(0, 8), PV_Random(-1, 1), PV_Random(-2, -1), PV_Random(20, 30), effect.sparks, 2); } func FxGemHealingDamage(target, effect, damage, cause) diff --git a/planet/Arena.ocf/Hideout.ocs/PyreGem.ocd/Script.c b/planet/Arena.ocf/Hideout.ocs/PyreGem.ocd/Script.c index d17a4315c..dc7837a90 100644 --- a/planet/Arena.ocf/Hideout.ocs/PyreGem.ocd/Script.c +++ b/planet/Arena.ocf/Hideout.ocs/PyreGem.ocd/Script.c @@ -87,7 +87,7 @@ global func FxGemPyreTimer(object target, effect, int time) if(e)clr=RGB(190+Random(10),0,20+Random(20)); var xoff = Sin(r, d); var yoff = -Cos(r, d); - CreateParticleEx("Air", x + xoff, y + yoff, PV_Random(xoff - 3, xoff + 3), PV_Random(yoff - 3, yoff + 3), PV_Random(5, 10), effect.particles, 2); + CreateParticle("Air", x + xoff, y + yoff, PV_Random(xoff - 3, xoff + 3), PV_Random(yoff - 3, yoff + 3), PV_Random(5, 10), effect.particles, 2); } for(var obj in FindObjects(Find_NoContainer(), Find_OCF(OCF_Alive), Find_Distance(((time/2)+1)*6,x,y),Find_Not(Find_Distance((time/2)*4,x,y)),Find_ID(Clonk))) @@ -99,7 +99,7 @@ global func FxGemPyreTimer(object target, effect, int time) if(PathFree(x,y,obj->GetX(),obj->GetY())) { obj->DoEnergy((-BoundBy((30-time),1,26)*3)/5,0,0,effect.thrower); - obj->CreateParticleEx("MagicFire", 0, 0, PV_Random(-15, 15), PV_Random(-15, 15), PV_Random(5, 10), effect.particles, 20); + obj->CreateParticle("MagicFire", 0, 0, PV_Random(-15, 15), PV_Random(-15, 15), PV_Random(5, 10), effect.particles, 20); obj->Fling(RandomX(-2,2),-2-(BoundBy((30-time),10,30)/10)); effect.objects[GetLength(effect.objects)] = obj; } diff --git a/planet/Arena.ocf/Hideout.ocs/ShieldGem.ocd/Script.c b/planet/Arena.ocf/Hideout.ocs/ShieldGem.ocd/Script.c index 87aa9d151..3d4666ce3 100644 --- a/planet/Arena.ocf/Hideout.ocs/ShieldGem.ocd/Script.c +++ b/planet/Arena.ocf/Hideout.ocs/ShieldGem.ocd/Script.c @@ -74,12 +74,12 @@ global func FxGemShieldCreationTimer(object target, effect, int time) var shield=CreateObject(CrystalShield,x+Sin(time*7,35),y+Cos(time*7,35)); shield->SetR(-time*7); shield->SetClrModulation(clr); - CreateParticleEx("MagicSpark", x+Sin(time*7,39),y+Cos(time*7,39), PV_Random(-10, 10), PV_Random(-10, 10), PV_Random(10, 20), effect.particles, 10); + CreateParticle("MagicSpark", x+Sin(time*7,39),y+Cos(time*7,39), PV_Random(-10, 10), PV_Random(-10, 10), PV_Random(10, 20), effect.particles, 10); var shield=CreateObject(CrystalShield,x-Sin(-7+time*7,35),y+Cos(-7+time*7,35)); shield->SetR(-7 + time*7); shield->SetClrModulation(clr); - CreateParticleEx("MagicSpark", x-Sin(-7+time*7,39),y+Cos(-7+time*7,39), PV_Random(-10, 10), PV_Random(-10, 10), PV_Random(10, 20), effect.particles, 10); + CreateParticle("MagicSpark", x-Sin(-7+time*7,39),y+Cos(-7+time*7,39), PV_Random(-10, 10), PV_Random(-10, 10), PV_Random(10, 20), effect.particles, 10); return 1; } diff --git a/planet/Arena.ocf/Hideout.ocs/ShieldGem.ocd/SolidCrystal.ocd/Script.c b/planet/Arena.ocf/Hideout.ocs/ShieldGem.ocd/SolidCrystal.ocd/Script.c index 9610eedb0..f6cde819a 100644 --- a/planet/Arena.ocf/Hideout.ocs/ShieldGem.ocd/SolidCrystal.ocd/Script.c +++ b/planet/Arena.ocf/Hideout.ocs/ShieldGem.ocd/SolidCrystal.ocd/Script.c @@ -31,7 +31,7 @@ func FxSelfdestructionStart(target, effect, temp) func FxSelfdestructionTimer(object target, effect, int timer) { - CreateParticleEx("Magic", PV_Random(-4, 4), PV_Random(-4, 4), PV_Random(-3, 3), PV_Random(-3, 3), PV_Random(10, 30), effect.particles, 3); + CreateParticle("Magic", PV_Random(-4, 4), PV_Random(-4, 4), PV_Random(-3, 3), PV_Random(-3, 3), PV_Random(10, 30), effect.particles, 3); if(timer>175) target->RemoveObject(); return 1; } diff --git a/planet/Arena.ocf/Hideout.ocs/SlowGem.ocd/Script.c b/planet/Arena.ocf/Hideout.ocs/SlowGem.ocd/Script.c index 62d2cd3f8..d82777bfe 100644 --- a/planet/Arena.ocf/Hideout.ocs/SlowGem.ocd/Script.c +++ b/planet/Arena.ocf/Hideout.ocs/SlowGem.ocd/Script.c @@ -78,7 +78,7 @@ global func FxGemSlowFieldTimer(object target, effect, int time) var r=Random(360); var d=Min(Random(20)+Random(130),62); if(!PathFree(x,y,x + Sin(r,d), y - Cos(r,d))) continue; - CreateParticleEx("MagicFire", x + Sin(r,d), y - Cos(r,d), PV_Random(-2, 2), PV_Random(0, 4), PV_Random(10, 40), effect.particles, 2); + CreateParticle("MagicFire", x + Sin(r,d), y - Cos(r,d), PV_Random(-2, 2), PV_Random(0, 4), PV_Random(10, 40), effect.particles, 2); } for(var obj in FindObjects(Find_Distance(62,x,y))) { diff --git a/planet/Arena.ocf/MoltenMonarch.ocs/Script.c b/planet/Arena.ocf/MoltenMonarch.ocs/Script.c index 45f8a6064..559b4107e 100644 --- a/planet/Arena.ocf/MoltenMonarch.ocs/Script.c +++ b/planet/Arena.ocf/MoltenMonarch.ocs/Script.c @@ -73,7 +73,7 @@ global func FxBlessTheKingTimer(object target, effect, int timer) if(king->Contents(0)) king->Contents(0)->~MakeKingSize(); if(king->Contents(1)) king->Contents(1)->~MakeKingSize(); - king->CreateParticleEx("Fire", PV_Random(-4, 4), PV_Random(-11, 8), PV_Random(-10, 10), PV_Random(-10, 10), PV_Random(10, 30), effect.particles, 10); + king->CreateParticle("Fire", PV_Random(-4, 4), PV_Random(-11, 8), PV_Random(-10, 10), PV_Random(-10, 10), PV_Random(10, 30), effect.particles, 10); return 1; } @@ -90,7 +90,7 @@ global func FxDeathByFireTimer(object target, effect, int timer) for(var obj in FindObjects(Find_InRect(55,0,50,30),Find_OCF(OCF_Alive),Find_Not(Find_ID(MovingBrick)))) obj->RemoveObject(); - CreateParticleEx("Fire", PV_Random(55, 90), PV_Random(0, 40), PV_Random(-1, 1), PV_Random(0, 20), PV_Random(10, 40), Particles_Fire(), 20); + CreateParticle("Fire", PV_Random(55, 90), PV_Random(0, 40), PV_Random(-1, 1), PV_Random(0, 20), PV_Random(10, 40), Particles_Fire(), 20); } global func FxLavaBrickResetTimer(object target, effect, int timer) diff --git a/planet/Arena.ocf/MoltenMonarch.ocs/System.ocg/King_Bow.c b/planet/Arena.ocf/MoltenMonarch.ocs/System.ocg/King_Bow.c index 3f1bae423..a87a26cb0 100644 --- a/planet/Arena.ocf/MoltenMonarch.ocs/System.ocg/King_Bow.c +++ b/planet/Arena.ocf/MoltenMonarch.ocs/System.ocg/King_Bow.c @@ -37,7 +37,7 @@ public func FinishedAiming(object clonk, int angle) public func FxExplosiveArrowTimer(pTarget, effect, iEffectTime) { - pTarget->CreateParticleEx("Fire", 0, 0, PV_Random(-10, 10), PV_Random(-10, 10), PV_Random(10, 20), Particles_Glimmer(), 5); + pTarget->CreateParticle("Fire", 0, 0, PV_Random(-10, 10), PV_Random(-10, 10), PV_Random(10, 20), Particles_Glimmer(), 5); effect.timer++; if(!pTarget->GetXDir() && !pTarget->GetYDir()) effect.timer = Max(effect.timer,65); if(effect.timer>90) pTarget->Explode(15+Random(7)); diff --git a/planet/Arena.ocf/MoltenMonarch.ocs/System.ocg/King_Musket.c b/planet/Arena.ocf/MoltenMonarch.ocs/System.ocg/King_Musket.c index 79e43444b..9415c14ee 100644 --- a/planet/Arena.ocf/MoltenMonarch.ocs/System.ocg/King_Musket.c +++ b/planet/Arena.ocf/MoltenMonarch.ocs/System.ocg/King_Musket.c @@ -48,8 +48,8 @@ private func FireWeapon(object clonk, int angle) var x = Sin(angle, 20); var y = -Cos(angle, 20); - CreateParticleEx("Smoke", IX, IY, PV_Random(x - 20, x + 20), PV_Random(y - 20, y + 20), PV_Random(40, 60), Particles_Smoke(), 20); + CreateParticle("Smoke", IX, IY, PV_Random(x - 20, x + 20), PV_Random(y - 20, y + 20), PV_Random(40, 60), Particles_Smoke(), 20); clonk->CreateMuzzleFlash(IX, IY, angle, 20); - CreateParticleEx("Flash", 0, 0, 0, 0, 8, Particles_Flash()); + CreateParticle("Flash", 0, 0, 0, 0, 8, Particles_Flash()); } diff --git a/planet/Arena.ocf/Overcast.ocs/Script.c b/planet/Arena.ocf/Overcast.ocs/Script.c index fe0b91d20..2468dcdfa 100644 --- a/planet/Arena.ocf/Overcast.ocs/Script.c +++ b/planet/Arena.ocf/Overcast.ocs/Script.c @@ -184,7 +184,7 @@ global func FxWindChannelTimer(object target, proplist effect) continue; obj->SetYDir(speed - 36, 100); } - CreateParticleEx("Air", 464+Random(40), 344+Random(112), RandomX(-1,1), -30, PV_Random(10, 40), Overcast_air_particles); + CreateParticle("Air", 464+Random(40), 344+Random(112), RandomX(-1,1), -30, PV_Random(10, 40), Overcast_air_particles); // Divider with random wind. if (!Random(100)) @@ -212,11 +212,11 @@ global func FxWindChannelTimer(object target, proplist effect) } } if (effect.Divider == 1) - CreateParticleEx("Air", 464+Random(40), 280+Random(10), RandomX(-1,1), -30, PV_Random(10, 40), Overcast_air_particles); + CreateParticle("Air", 464+Random(40), 280+Random(10), RandomX(-1,1), -30, PV_Random(10, 40), Overcast_air_particles); if (effect.Divider == 0) - CreateParticleEx("Air", 464+Random(40), 280+Random(10), RandomX(-20,-10), -20, PV_Random(10, 40), Overcast_air_particles); + CreateParticle("Air", 464+Random(40), 280+Random(10), RandomX(-20,-10), -20, PV_Random(10, 40), Overcast_air_particles); if (effect.Divider == 2) - CreateParticleEx("Air", 464+Random(40), 280+Random(10), RandomX(10,20), -20, PV_Random(10, 40), Overcast_air_particles); + CreateParticle("Air", 464+Random(40), 280+Random(10), RandomX(10,20), -20, PV_Random(10, 40), Overcast_air_particles); // Second shaft with upward wind. for (var obj in FindObjects(Find_InRect(464, 96, 40, 144))) @@ -243,7 +243,7 @@ global func FxWindChannelTimer(object target, proplist effect) continue; obj->SetYDir(speed - 36, 100); } - CreateParticleEx("Air", 464+Random(40), 160+Random(96), RandomX(-1,1), -30, PV_Random(10, 40), Overcast_air_particles); + CreateParticle("Air", 464+Random(40), 160+Random(96), RandomX(-1,1), -30, PV_Random(10, 40), Overcast_air_particles); return 1; } @@ -340,7 +340,7 @@ func OnClonkLeftRelaunch(object clonk) { var pos = GetRandomSpawn(); clonk->SetPosition(pos[0],pos[1]); - CreateParticleEx("Air", pos[0],pos[1], PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(5, 10), Overcast_air_particles, 25); + CreateParticle("Air", pos[0],pos[1], PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(5, 10), Overcast_air_particles, 25); return; } diff --git a/planet/Arena.ocf/Overcast.ocs/Scrolls.ocd/FireballScroll.ocd/Script.c b/planet/Arena.ocf/Overcast.ocs/Scrolls.ocd/FireballScroll.ocd/Script.c index ef66b804e..9faea2d5f 100644 --- a/planet/Arena.ocf/Overcast.ocs/Scrolls.ocd/FireballScroll.ocd/Script.c +++ b/planet/Arena.ocf/Overcast.ocs/Scrolls.ocd/FireballScroll.ocd/Script.c @@ -54,9 +54,9 @@ public func FxFireballTimer(pTarget, effect, iEffectTime) var xspeed = Sin(angle, 6); var yspeed = -Cos(angle, 6); - CreateParticleEx("SmokeDirty", x, y, PV_Random(-2, 2), PV_Random(-2, 2), PV_Random(30, 60), Particles_SmokeTrail(), 1); - CreateParticleEx("FireDense", x, y, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(5, 20), Particles_Fire(), 10); - CreateParticleEx("Fire", x, y, PV_Random(0, - 10 * xspeed), PV_Random(0, - 10 * yspeed), PV_Random(20, 90), Particles_Glimmer(), 10); + CreateParticle("SmokeDirty", x, y, PV_Random(-2, 2), PV_Random(-2, 2), PV_Random(30, 60), Particles_SmokeTrail(), 1); + CreateParticle("FireDense", x, y, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(5, 20), Particles_Fire(), 10); + CreateParticle("Fire", x, y, PV_Random(0, - 10 * xspeed), PV_Random(0, - 10 * yspeed), PV_Random(20, 90), Particles_Glimmer(), 10); effect.x += xspeed; effect.y += yspeed; diff --git a/planet/Arena.ocf/Overcast.ocs/Scrolls.ocd/WindScroll.ocd/Script.c b/planet/Arena.ocf/Overcast.ocs/Scrolls.ocd/WindScroll.ocd/Script.c index ea4246eda..b08fe4ef6 100644 --- a/planet/Arena.ocf/Overcast.ocs/Scrolls.ocd/WindScroll.ocd/Script.c +++ b/planet/Arena.ocf/Overcast.ocs/Scrolls.ocd/WindScroll.ocd/Script.c @@ -42,12 +42,12 @@ public func FxWindScrollStormTimer(pTarget, effect, iEffectTime) { var r=Random(360); var d=Random(40); - CreateParticleEx("Air", Sin(r,d)+x,-Cos(r,d)+y, xdir/3, ydir/3, PV_Random(10, 30), effect.particles, 1); + CreateParticle("Air", Sin(r,d)+x,-Cos(r,d)+y, xdir/3, ydir/3, PV_Random(10, 30), effect.particles, 1); return 1; } else if(iEffectTime<180 ) { - CreateParticleEx("Air", PV_Random(x - 20, x + 20), PV_Random(y - 20, y + 20), xdir/2, ydir/2, PV_Random(10, 30), effect.particles, 5); + CreateParticle("Air", PV_Random(x - 20, x + 20), PV_Random(y - 20, y + 20), xdir/2, ydir/2, PV_Random(10, 30), effect.particles, 5); for(var obj in FindObjects(Find_Distance(40,x,y),Find_Not(Find_Category(C4D_Structure)))) { diff --git a/planet/Arena.ocf/ScorchedGardens.ocs/Grass.ocd/Script.c b/planet/Arena.ocf/ScorchedGardens.ocs/Grass.ocd/Script.c index 7719388c9..516e4475a 100644 --- a/planet/Arena.ocf/ScorchedGardens.ocs/Grass.ocd/Script.c +++ b/planet/Arena.ocf/ScorchedGardens.ocs/Grass.ocd/Script.c @@ -27,7 +27,7 @@ private func Destroy() G = 50, B = 50 }; - CreateParticleEx("Grass", 0, 0, PV_Random(-20, 20), PV_Random(-20, 10), PV_Random(30, 100), particles, 30); + CreateParticle("Grass", 0, 0, PV_Random(-20, 20), PV_Random(-20, 10), PV_Random(30, 100), particles, 30); RemoveObject(); } diff --git a/planet/Arena.ocf/ScorchedGardens.ocs/Script.c b/planet/Arena.ocf/ScorchedGardens.ocs/Script.c index 143b87625..300d43b84 100644 --- a/planet/Arena.ocf/ScorchedGardens.ocs/Script.c +++ b/planet/Arena.ocf/ScorchedGardens.ocs/Script.c @@ -98,7 +98,7 @@ protected func OnPlayerRelaunch(int plr) func OnClonkLeftRelaunch(object clonk) { - clonk->CreateParticleEx("Fire", 0, 0, PV_Random(-20, 20), PV_Random(-40, 5), PV_Random(20, 90), Particles_Glimmer(), 30); + clonk->CreateParticle("Fire", 0, 0, PV_Random(-20, 20), PV_Random(-40, 5), PV_Random(20, 90), Particles_Glimmer(), 30); clonk->SetYDir(-5); return; } diff --git a/planet/Arena.ocf/ThunderousSkies.ocs/Script.c b/planet/Arena.ocf/ThunderousSkies.ocs/Script.c index d36f2d9f7..a07906ff6 100644 --- a/planet/Arena.ocf/ThunderousSkies.ocs/Script.c +++ b/planet/Arena.ocf/ThunderousSkies.ocs/Script.c @@ -112,7 +112,7 @@ global func FxBlessTheKingTimer(object target, effect, int timer) particles = ThunderousSkies_air_particles_red; duration *= 2; } - king->CreateParticleEx("Air", 0, 8, PV_Random(-10, 10),PV_Random(0, 10), PV_Random(duration, 2 * duration), particles, 4); + king->CreateParticle("Air", 0, 8, PV_Random(-10, 10),PV_Random(0, 10), PV_Random(duration, 2 * duration), particles, 4); return 1; } @@ -128,8 +128,8 @@ global func FxChanneledWindTimer() obj->SetYDir(Max(obj->GetYDir()-5,-50)); obj->SetXDir(obj->GetXDir()+RandomX(-1,1)); } - CreateParticleEx("Air", 230+Random(40),398,RandomX(-1,1),-30, PV_Random(10, 30), ThunderousSkies_air_particles); - CreateParticleEx("Air", 700+Random(60),348,RandomX(-1,1),-30, PV_Random(10, 30), ThunderousSkies_air_particles); + CreateParticle("Air", 230+Random(40),398,RandomX(-1,1),-30, PV_Random(10, 30), ThunderousSkies_air_particles); + CreateParticle("Air", 700+Random(60),348,RandomX(-1,1),-30, PV_Random(10, 30), ThunderousSkies_air_particles); } global func FxBalloonsTimer() @@ -159,7 +159,7 @@ global func FxBalloonsTimer() var balloon = CreateObject(TargetBalloon, x, y-30, NO_OWNER); balloon->SetProperty("load",target); target->SetAction("Attach", balloon); - CreateParticleEx("Flash", x, y, 0, 0, 8, Particles_Flash()); + CreateParticle("Flash", x, y, 0, 0, 8, Particles_Flash()); AddEffect("HorizontalMoving", balloon, 1, 1, balloon); balloon->SetXDir(((Random(2)*2)-1) * (Random(4)+3)); } @@ -201,7 +201,7 @@ private func MakeTarget(int x, int y) var balloon = CreateObject(TargetBalloon, x, y-30, NO_OWNER); balloon->SetProperty("load",target); target->SetAction("Attach", balloon); - CreateParticleEx("Flash", x, y, 0, 0, 8, Particles_Flash()); + CreateParticle("Flash", x, y, 0, 0, 8, Particles_Flash()); } diff --git a/planet/Arena.ocf/ThunderousSkies.ocs/Scrolls.ocd/FireballScroll.ocd/Script.c b/planet/Arena.ocf/ThunderousSkies.ocs/Scrolls.ocd/FireballScroll.ocd/Script.c index 61f147974..3786a9f73 100644 --- a/planet/Arena.ocf/ThunderousSkies.ocs/Scrolls.ocd/FireballScroll.ocd/Script.c +++ b/planet/Arena.ocf/ThunderousSkies.ocs/Scrolls.ocd/FireballScroll.ocd/Script.c @@ -64,9 +64,9 @@ public func FxFireballTimer(pTarget, effect, iEffectTime) var xspeed = Sin(angle, 6); var yspeed = -Cos(angle, 6); - CreateParticleEx("SmokeDirty", x, y, PV_Random(-2, 2), PV_Random(-2, 2), PV_Random(30, 60), Particles_SmokeTrail(), 1); - CreateParticleEx("FireDense", x, y, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(5, 20), Particles_Fire(), 10); - CreateParticleEx("Fire", x, y, PV_Random(0, - 10 * xspeed), PV_Random(0, - 10 * yspeed), PV_Random(20, 90), Particles_Glimmer(), 10); + CreateParticle("SmokeDirty", x, y, PV_Random(-2, 2), PV_Random(-2, 2), PV_Random(30, 60), Particles_SmokeTrail(), 1); + CreateParticle("FireDense", x, y, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(5, 20), Particles_Fire(), 10); + CreateParticle("Fire", x, y, PV_Random(0, - 10 * xspeed), PV_Random(0, - 10 * yspeed), PV_Random(20, 90), Particles_Glimmer(), 10); effect.x += xspeed; effect.y += yspeed; diff --git a/planet/Arena.ocf/ThunderousSkies.ocs/Scrolls.ocd/ThunderScroll.ocd/Script.c b/planet/Arena.ocf/ThunderousSkies.ocs/Scrolls.ocd/ThunderScroll.ocd/Script.c index dc8521382..7126dcd92 100644 --- a/planet/Arena.ocf/ThunderousSkies.ocs/Scrolls.ocd/ThunderScroll.ocd/Script.c +++ b/planet/Arena.ocf/ThunderousSkies.ocs/Scrolls.ocd/ThunderScroll.ocd/Script.c @@ -59,14 +59,14 @@ global func FxThunderStrikeTimer(pTarget, effect, iEffectTime) if(!(i%5)) for(var k=0; k~Fall(projectile->GetController()); RemoveObject(); } diff --git a/planet/Arena.ocf/Windmill.ocs/BigBoomattack.ocd/Script.c b/planet/Arena.ocf/Windmill.ocs/BigBoomattack.ocd/Script.c index 71799740b..90b1f8d45 100644 --- a/planet/Arena.ocf/Windmill.ocs/BigBoomattack.ocd/Script.c +++ b/planet/Arena.ocf/Windmill.ocs/BigBoomattack.ocd/Script.c @@ -47,7 +47,7 @@ protected func FxFlightTimer(object pTarget, effect, int iEffectTime) var xdir = GetXDir() / 2; var ydir = GetYDir() / 2; - CreateParticleEx("FireDense", x, y, PV_Random(xdir - 20, xdir + 20), PV_Random(ydir - 20, ydir + 20), PV_Random(16 * 6, 38 * 6), {Prototype = Particles_Thrust(), Size = PV_Random(40, 60)}, 5); + CreateParticle("FireDense", x, y, PV_Random(xdir - 20, xdir + 20), PV_Random(ydir - 20, ydir + 20), PV_Random(16 * 6, 38 * 6), {Prototype = Particles_Thrust(), Size = PV_Random(40, 60)}, 5); fuel--; } diff --git a/planet/Arena.ocf/Windmill.ocs/Boomattack.ocd/Script.c b/planet/Arena.ocf/Windmill.ocs/Boomattack.ocd/Script.c index 8f1d4743b..02f24f57c 100644 --- a/planet/Arena.ocf/Windmill.ocs/Boomattack.ocd/Script.c +++ b/planet/Arena.ocf/Windmill.ocs/Boomattack.ocd/Script.c @@ -43,7 +43,7 @@ protected func FxFlightTimer(object pTarget, effect, int iEffectTime) var xdir = GetXDir() / 2; var ydir = GetYDir() / 2; - CreateParticleEx("FireDense", x, y, PV_Random(xdir - 4, xdir + 4), PV_Random(ydir - 4, ydir + 4), PV_Random(16, 38), Particles_Thrust(), 5); + CreateParticle("FireDense", x, y, PV_Random(xdir - 4, xdir + 4), PV_Random(ydir - 4, ydir + 4), PV_Random(16, 38), Particles_Thrust(), 5); fuel--; diff --git a/planet/Experimental.ocd/Moss.ocd/Lichen.ocd/Script.c b/planet/Experimental.ocd/Moss.ocd/Lichen.ocd/Script.c index 3bdb58cea..00ca58276 100644 --- a/planet/Experimental.ocd/Moss.ocd/Lichen.ocd/Script.c +++ b/planet/Experimental.ocd/Moss.ocd/Lichen.ocd/Script.c @@ -56,7 +56,7 @@ private func Destroy() Rotation = PV_Direction(PV_Random(900, 1100)), Phase = PV_Random(0, 1) }; - CreateParticleEx("Lichen", PV_Random(-5, 5), PV_Random(-5, 5), PV_Random(-30, 30), PV_Random(-30, 30), PV_Random(36, 36 * 4), particles, 40); + CreateParticle("Lichen", PV_Random(-5, 5), PV_Random(-5, 5), PV_Random(-30, 30), PV_Random(-30, 30), PV_Random(36, 36 * 4), particles, 40); RemoveObject(); } diff --git a/planet/Experimental.ocf/CableLorrys.ocs/CableCars.ocd/Libraries.ocd/CableCar.ocd/Selector.ocd/Script.c b/planet/Experimental.ocf/CableLorrys.ocs/CableCars.ocd/Libraries.ocd/CableCar.ocd/Selector.ocd/Script.c index 977846d33..b7696afbd 100644 --- a/planet/Experimental.ocf/CableLorrys.ocs/CableCars.ocd/Libraries.ocd/CableCar.ocd/Selector.ocd/Script.c +++ b/planet/Experimental.ocf/CableLorrys.ocs/CableCars.ocd/Libraries.ocd/CableCar.ocd/Selector.ocd/Script.c @@ -39,5 +39,5 @@ public func ObjectControl(int plr, int ctrl, int x, int y, int strength, bool re protected func FxParticlesTimer(object target, effect, int time) { var angle = time*10 % 360; - CreateParticleEx("SphereSpark", Sin(angle, 13), -Cos(angle, 13), 0, 0, PV_Random(20, 30), Particles_Spark()); + CreateParticle("SphereSpark", Sin(angle, 13), -Cos(angle, 13), 0, 0, PV_Random(20, 30), Particles_Spark()); } \ No newline at end of file diff --git a/planet/Experimental.ocf/OCTier.ocs/OCTier.ocd/Script.c b/planet/Experimental.ocf/OCTier.ocs/OCTier.ocd/Script.c index f9b3add69..6db095b1d 100644 --- a/planet/Experimental.ocf/OCTier.ocs/OCTier.ocd/Script.c +++ b/planet/Experimental.ocf/OCTier.ocs/OCTier.ocd/Script.c @@ -33,7 +33,7 @@ func Footstep() G = (clr >> 8) & 0xff, B = clr & 0xff, }; - CreateParticleEx("Dust", PV_Random(dir * -5, dir * -3), 8, PV_Random(dir * 2, dir * 1), PV_Random(-2, -3), PV_Random(36, 2 * 36), particles, 5); + CreateParticle("Dust", PV_Random(dir * -5, dir * -3), 8, PV_Random(dir * 2, dir * 1), PV_Random(-2, -3), PV_Random(36, 2 * 36), particles, 5); Sound("StepSoft?"); } } diff --git a/planet/Missions.ocf/DarkCastle.ocs/EnvironmentObjs.ocd/Candle.ocd/Script.c b/planet/Missions.ocf/DarkCastle.ocs/EnvironmentObjs.ocd/Candle.ocd/Script.c index 0e81b517b..3798f4826 100644 --- a/planet/Missions.ocf/DarkCastle.ocs/EnvironmentObjs.ocd/Candle.ocd/Script.c +++ b/planet/Missions.ocf/DarkCastle.ocs/EnvironmentObjs.ocd/Candle.ocd/Script.c @@ -19,7 +19,7 @@ protected func Construction() { private func Shining() { - CreateParticleEx("Fire", 0, -5, 0, PV_Random(-1, 1), 20, Particles_Fire(), 2); + CreateParticle("Fire", 0, -5, 0, PV_Random(-1, 1), 20, Particles_Fire(), 2); //check if position changed if (x != GetX() && y != GetY()) diff --git a/planet/Missions.ocf/DarkCastle.ocs/System.ocg/Scorches.c b/planet/Missions.ocf/DarkCastle.ocs/System.ocg/Scorches.c index 07c1ce35a..1ec448f9d 100644 --- a/planet/Missions.ocf/DarkCastle.ocs/System.ocg/Scorches.c +++ b/planet/Missions.ocf/DarkCastle.ocs/System.ocg/Scorches.c @@ -19,6 +19,6 @@ global func FxFireScorchingTimer(object target, proplist effect, int time) if (time >= effect.duration) { RemoveObject(); return FX_Execute_Kill; } // particles var wind = BoundBy(GetWind(), -5, 5); - CreateParticleEx("SmokeDirty", PV_Random(-5, 5), PV_Random(-5, 5), wind, -effect.strength/8, PV_Random(20, 40), Particles_SmokeTrail(), 2); + CreateParticle("SmokeDirty", PV_Random(-5, 5), PV_Random(-5, 5), wind, -effect.strength/8, PV_Random(20, 40), Particles_SmokeTrail(), 2); return FX_OK; } diff --git a/planet/Missions.ocf/Skylands.ocs/Storm.ocd/Script.c b/planet/Missions.ocf/Skylands.ocs/Storm.ocd/Script.c index 373cee9fb..c3114a531 100644 --- a/planet/Missions.ocf/Skylands.ocs/Storm.ocd/Script.c +++ b/planet/Missions.ocf/Skylands.ocs/Storm.ocd/Script.c @@ -215,7 +215,7 @@ private func ExecuteStream(proplist s) //Log("segment %d", i_segment); if (!s.is_blocked[i_segment+1]) StreamBlockVertex(s, i_segment+1); if (storm_debug) - CreateParticleEx("SphereSpark", s.x[i_segment], s.y[i_segment], 0, 0, 36, {Size = 12}); + CreateParticle("SphereSpark", s.x[i_segment], s.y[i_segment], 0, 0, 36, {Size = 12}); continue; } // current segment base point @@ -312,7 +312,7 @@ private func ExecuteStream(proplist s) var v = Distance(vx,vy); vx = vx * s.dir_len / v; vy = vy * s.dir_len / v / 2; - CreateParticleEx("Dust", PV_Random(x - 10, x + 10), PV_Random(y - 10, y + 10), PV_Random(vx * 80 / 100, vx * 120 / 100), PV_Random(vy, vy * 140 / 100), PV_Random(20, 40), storm_particles,local_strength); + CreateParticle("Dust", PV_Random(x - 10, x + 10), PV_Random(y - 10, y + 10), PV_Random(vx * 80 / 100, vx * 120 / 100), PV_Random(vy, vy * 140 / 100), PV_Random(20, 40), storm_particles,local_strength); } } } diff --git a/planet/Objects.ocd/Clonk.ocd/Animations.ocd/Script.c b/planet/Objects.ocd/Clonk.ocd/Animations.ocd/Script.c index 5f511578a..b97bbcbb7 100644 --- a/planet/Objects.ocd/Clonk.ocd/Animations.ocd/Script.c +++ b/planet/Objects.ocd/Clonk.ocd/Animations.ocd/Script.c @@ -392,7 +392,7 @@ func Footstep() G = (clr >> 8) & 0xff, B = clr & 0xff, }; - CreateParticleEx("Dust", PV_Random(dir * -2, dir * -1), 8, PV_Random(dir * 2, dir * 1), PV_Random(-2, -3), PV_Random(36, 2 * 36), particles, 5); + CreateParticle("Dust", PV_Random(dir * -2, dir * -1), 8, PV_Random(dir * 2, dir * 1), PV_Random(-2, -3), PV_Random(36, 2 * 36), particles, 5); Sound("StepSoft?"); } } @@ -976,7 +976,7 @@ func FxIntSwimTimer(pTarget, effect, iTime) B = (color >> 0) & 0xff, Attach = ATTACH_Front, }; - CreateParticleEx("Wave", 0, -4, (RandomX(-5,5)-(-1+2*GetDir())*4)/4, 0, 16, particles); + CreateParticle("Wave", 0, -4, (RandomX(-5,5)-(-1+2*GetDir())*4)/4, 0, 16, particles); } Sound("Splash?"); } @@ -1052,7 +1052,7 @@ func Hit(int iXSpeed, int iYSpeed) G = (clr >> 8) & 0xff, B = clr & 0xff, }; - CreateParticleEx("Dust", PV_Random(-4, 4), 8, PV_Random(-3, 3), PV_Random(-2, -4), PV_Random(36, 2 * 36), particles, 12); + CreateParticle("Dust", PV_Random(-4, 4), 8, PV_Random(-3, 3), PV_Random(-2, -4), PV_Random(36, 2 * 36), particles, 12); } } } @@ -1069,7 +1069,7 @@ func Hit(int iXSpeed, int iYSpeed) G = (clr >> 8) & 0xff, B = clr & 0xff, }; - CreateParticleEx("Dust", PV_Random(-4, 4), 8, PV_Random(-3, 3), PV_Random(-2, -4), PV_Random(36, 2 * 36), particles, 12); + CreateParticle("Dust", PV_Random(-4, 4), 8, PV_Random(-3, 3), PV_Random(-2, -4), PV_Random(36, 2 * 36), particles, 12); } } } @@ -1138,7 +1138,7 @@ func FxRollingTimer(object target, int num, int timer) G = (clr >> 8) & 0xff, B = clr & 0xff, }; - CreateParticleEx("Dust", PV_Random(dir * -2, dir * -1), 8, PV_Random(dir * 2, dir * 1), PV_Random(-2, -5), PV_Random(36, 2 * 36), particles, 6); + CreateParticle("Dust", PV_Random(dir * -2, dir * -1), 8, PV_Random(dir * 2, dir * 1), PV_Random(-2, -5), PV_Random(36, 2 * 36), particles, 6); } } diff --git a/planet/Objects.ocd/Effects.ocd/Cloud.ocd/Script.c b/planet/Objects.ocd/Effects.ocd/Cloud.ocd/Script.c index 35ea85ccb..5ae78f7bd 100644 --- a/planet/Objects.ocd/Effects.ocd/Cloud.ocd/Script.c +++ b/planet/Objects.ocd/Effects.ocd/Cloud.ocd/Script.c @@ -39,7 +39,7 @@ func Show(int clr, int layer, int size,bool diffuse) x = Sin(angle,+radius); y = Cos(angle,-radius/3); - CreateParticleEx("Cloud", x, y, PV_Random(-diffuse, +diffuse), 0, 0, particles); + CreateParticle("Cloud", x, y, PV_Random(-diffuse, +diffuse), 0, 0, particles); } } diff --git a/planet/Objects.ocd/Effects.ocd/Trajectory.ocd/Script.c b/planet/Objects.ocd/Effects.ocd/Trajectory.ocd/Script.c index 6d02a0a55..994de37e6 100644 --- a/planet/Objects.ocd/Effects.ocd/Trajectory.ocd/Script.c +++ b/planet/Objects.ocd/Effects.ocd/Trajectory.ocd/Script.c @@ -55,7 +55,7 @@ global func AddTrajectory(object pObj, int iX, int iY, int iXDir, int iYDir, int // If we are far enough away insert a new point if(Distance((iXOld - iX) / iFaktor, (iYOld - iY) / iFaktor) >= spacing) { - pTrajectory->CreateParticleEx("Magic", iX/iFaktor - pTrajectory->GetX(), iY/iFaktor - pTrajectory->GetY(), 0, 0, 0, particles); + pTrajectory->CreateParticle("Magic", iX/iFaktor - pTrajectory->GetX(), iY/iFaktor - pTrajectory->GetY(), 0, 0, 0, particles); iXOld = iX; iYOld = iY; } // Or is it here already? diff --git a/planet/Objects.ocd/Environment.ocd/Cloud.ocd/Lightning.ocd/Script.c b/planet/Objects.ocd/Environment.ocd/Cloud.ocd/Lightning.ocd/Script.c index 59b35ddce..a75c6ab42 100644 --- a/planet/Objects.ocd/Environment.ocd/Cloud.ocd/Lightning.ocd/Script.c +++ b/planet/Objects.ocd/Environment.ocd/Cloud.ocd/Lightning.ocd/Script.c @@ -128,7 +128,7 @@ private func DrawRotatedParticleLine(string particle, int x1, int y1, int x2, in }; for (var i = count+1; --i; ) { - CreateParticleEx(particle, x1 + deltax * i / count, y1 + deltay * i / count, 0, 0, 18, particle_prop); + CreateParticle(particle, x1 + deltax * i / count, y1 + deltay * i / count, 0, 0, 18, particle_prop); } } diff --git a/planet/Objects.ocd/Environment.ocd/Meteor.ocd/Script.c b/planet/Objects.ocd/Environment.ocd/Meteor.ocd/Script.c index 10db6be00..76626e76b 100644 --- a/planet/Objects.ocd/Environment.ocd/Meteor.ocd/Script.c +++ b/planet/Objects.ocd/Environment.ocd/Meteor.ocd/Script.c @@ -91,10 +91,10 @@ protected func FxIntMeteorTimer() ydir -= size * ydir ** 2 / 11552000; // Magic number. SetYDir(ydir, 100); // Smoke trail. - CreateParticleEx("Smoke", PV_Random(-2, 2), PV_Random(-2, 2), PV_Random(-3, 3), PV_Random(-3, 3), 30 + Random(60), Particles_SmokeTrail(), 5); + CreateParticle("Smoke", PV_Random(-2, 2), PV_Random(-2, 2), PV_Random(-3, 3), PV_Random(-3, 3), 30 + Random(60), Particles_SmokeTrail(), 5); // Fire trail. - CreateParticleEx("MagicSpark", 0, 0, PV_Random(-20, 20), PV_Random(-20, 20), 16, Particles_SparkFire(), 4); - CreateParticleEx("Fire", PV_Random(-size / 8, size / 8), PV_Random(-size / 8, size / 8), PV_Random(-1, 1), PV_Random(-1, 1), 30, Particles_FireTrail(), 6 + size / 10); + CreateParticle("MagicSpark", 0, 0, PV_Random(-20, 20), PV_Random(-20, 20), 16, Particles_SparkFire(), 4); + CreateParticle("Fire", PV_Random(-size / 8, size / 8), PV_Random(-size / 8, size / 8), PV_Random(-1, 1), PV_Random(-1, 1), 30, Particles_FireTrail(), 6 + size / 10); // Sound. // Burning and friction decrease size. @@ -114,7 +114,7 @@ protected func Hit(int xdir, int ydir) Prototype = Particles_Fire(), Attach = nil }; - CreateParticleEx("Fire", PV_Random(-size / 4, size / 4), PV_Random(-size / 4, size / 4), PV_Random(-size/4, size/4), PV_Random(-size/4, size/4), 30, particles, 20 + size); + CreateParticle("Fire", PV_Random(-size / 4, size / 4), PV_Random(-size / 4, size / 4), PV_Random(-size/4, size/4), PV_Random(-size/4, size/4), 30, particles, 20 + size); // Explode meteor, explode size scales with the energy of the meteor. var dam = size * speed2 / 500; dam = BoundBy(size/2, 5, 30); diff --git a/planet/Objects.ocd/Goals.ocd/CaptureTheFlag.ocd/Flag.ocd/Script.c b/planet/Objects.ocd/Goals.ocd/CaptureTheFlag.ocd/Flag.ocd/Script.c index 8fc9f3fb1..baf81c028 100644 --- a/planet/Objects.ocd/Goals.ocd/CaptureTheFlag.ocd/Flag.ocd/Script.c +++ b/planet/Objects.ocd/Goals.ocd/CaptureTheFlag.ocd/Flag.ocd/Script.c @@ -112,7 +112,7 @@ protected func FxFlagCarriedTimer(object target, effect) // Draw partical line following the flag. if (Distance(x, y, newx, newy) > 5) { - target->CreateParticleEx("SphereSpark", 0, 0, 0, 0, PV_Random(36 * 3, 36 * 3 + 10), effect.tracer_particles); + target->CreateParticle("SphereSpark", 0, 0, 0, 0, PV_Random(36 * 3, 36 * 3 + 10), effect.tracer_particles); effect.x=newx; effect.y=newy; } diff --git a/planet/Objects.ocd/Goals.ocd/Parkour.ocd/CheckPoint.ocd/Script.c b/planet/Objects.ocd/Goals.ocd/Parkour.ocd/CheckPoint.ocd/Script.c index 6e9859a2a..33d2f6091 100644 --- a/planet/Objects.ocd/Goals.ocd/Parkour.ocd/CheckPoint.ocd/Script.c +++ b/planet/Objects.ocd/Goals.ocd/Parkour.ocd/CheckPoint.ocd/Script.c @@ -294,7 +294,7 @@ protected func UpdateGraphics(int time) checkpoint_particles.R = (color >> 16) & 0xff; checkpoint_particles.G = (color >> 8) & 0xff; checkpoint_particles.B = (color >> 0) & 0xff; - CreateParticleEx("SphereSpark", Sin(angle, cp_size), -Cos(angle, cp_size), 0, 0, 18 * 5, checkpoint_particles); + CreateParticle("SphereSpark", Sin(angle, cp_size), -Cos(angle, cp_size), 0, 0, 18 * 5, checkpoint_particles); return; } diff --git a/planet/Objects.ocd/Helpers.ocd/ItemSpark.ocd/Script.c b/planet/Objects.ocd/Helpers.ocd/ItemSpark.ocd/Script.c index 78421fdfd..d41185ae9 100644 --- a/planet/Objects.ocd/Helpers.ocd/ItemSpark.ocd/Script.c +++ b/planet/Objects.ocd/Helpers.ocd/ItemSpark.ocd/Script.c @@ -126,8 +126,8 @@ func FxCheckStuckTimer(_, effect) func FxSparkleTimer(_, effect) { - CreateParticleEx("ItemSpark", PV_Random(0, GetXDir()/10), PV_Random(0, GetYDir()/10), GetXDir(), GetYDir(), 36, ItemSpark_particle, 5); - CreateParticleEx("ItemSpark", PV_Random(0, GetXDir()/10), PV_Random(0, GetYDir()/10), GetXDir(), GetYDir(), 20, ItemSpark_particle_additive, 5); + CreateParticle("ItemSpark", PV_Random(0, GetXDir()/10), PV_Random(0, GetYDir()/10), GetXDir(), GetYDir(), 36, ItemSpark_particle, 5); + CreateParticle("ItemSpark", PV_Random(0, GetXDir()/10), PV_Random(0, GetYDir()/10), GetXDir(), GetYDir(), 20, ItemSpark_particle_additive, 5); if(!Random(36)) for(var i=0;i<3;++i) @@ -161,8 +161,8 @@ func FxSparkleDeathTimer(_, effect, effect_time) effect.velY*=-1; } - effect.from->CreateParticleEx("ItemSpark", AbsX(effect.x), AbsY(effect.y), 0, 0, 18, ItemSpark_particle, 1); - effect.from->CreateParticleEx("ItemSpark", AbsX(effect.x), AbsY(effect.y), 0, 0, 10, ItemSpark_particle_additive, 1); + effect.from->CreateParticle("ItemSpark", AbsX(effect.x), AbsY(effect.y), 0, 0, 18, ItemSpark_particle, 1); + effect.from->CreateParticle("ItemSpark", AbsX(effect.x), AbsY(effect.y), 0, 0, 10, ItemSpark_particle_additive, 1); effect.xT+=effect.velX; effect.yT+=effect.velY; diff --git a/planet/Objects.ocd/Helpers.ocd/ObjectRestorer.ocd/Script.c b/planet/Objects.ocd/Helpers.ocd/ObjectRestorer.ocd/Script.c index 5bb13fe42..62ede2bd7 100644 --- a/planet/Objects.ocd/Helpers.ocd/ObjectRestorer.ocd/Script.c +++ b/planet/Objects.ocd/Helpers.ocd/ObjectRestorer.ocd/Script.c @@ -90,7 +90,7 @@ protected func FxRestoreTimer(object target, effect, int time) var y = init_y - Cos(angle, 2 * time); target->SetPosition(x, y); - CreateParticleEx("SphereSpark", 0, 0, 0, 0, 36, particles, 1); + CreateParticle("SphereSpark", 0, 0, 0, 0, 36, particles, 1); return 1; } @@ -136,7 +136,7 @@ protected func FxRestoreStop(object target, effect, int reason, bool temporary) to_x = to_container->GetX(); to_y = to_container->GetY(); } - CreateParticleEx("SphereSpark", to_x - GetX(), to_y - GetY(), PV_Random(-50, 50), PV_Random(-50, 50), PV_Random(2, 10), particles, 10); + CreateParticle("SphereSpark", to_x - GetX(), to_y - GetY(), PV_Random(-50, 50), PV_Random(-50, 50), PV_Random(2, 10), particles, 10); } // Sound. //TODO new sound. diff --git a/planet/Objects.ocd/Items.ocd/Resources.ocd/Ruby.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Resources.ocd/Ruby.ocd/Script.c index 1eb9cdfeb..318f630fb 100644 --- a/planet/Objects.ocd/Items.ocd/Resources.ocd/Ruby.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Resources.ocd/Ruby.ocd/Script.c @@ -35,7 +35,7 @@ func FxSparkleStart(target, effect, temp) func FxSparkleTimer(target, effect, effect_time) { if(this()->Contained() || !Random(2)) return FX_OK; - CreateParticleEx("MagicRing", 0, 0, 0, 0, effect.Interval, effect.particles, 1); + CreateParticle("MagicRing", 0, 0, 0, 0, effect.Interval, effect.particles, 1); return FX_OK; } diff --git a/planet/Objects.ocd/Items.ocd/Tools.ocd/Axe.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Tools.ocd/Axe.ocd/Script.c index 5ad2fd0a9..570b0c7e6 100644 --- a/planet/Objects.ocd/Items.ocd/Tools.ocd/Axe.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Tools.ocd/Axe.ocd/Script.c @@ -194,7 +194,7 @@ func FxIntAxeTimer(object clonk, effect, int time) // need to be behind the Clonk? if (clonk.Plane > effect.tree.Plane) particles = {Prototype = Particles_WoodChip(), Attach = ATTACH_Back}; - clonk->CreateParticleEx("WoodChip", x, 4, PV_Random(-12, 12), PV_Random(-13, -6), PV_Random(36 * 3, 36 * 10), particles, 10); + clonk->CreateParticle("WoodChip", x, 4, PV_Random(-12, 12), PV_Random(-13, -6), PV_Random(36 * 3, 36 * 10), particles, 10); // Damage tree effect.tree->DoDamage(this.ChopStrength, 3, clonk->GetOwner()); // 3 = FX_Call_DmgChop } @@ -237,7 +237,7 @@ func FxIntSplitTimer(object clonk, effect, int time) if(clonk->GetDirection() == COMD_Left) x = x * -1; //Create the woodchip particle - clonk->CreateParticleEx("WoodChip", x, 4, PV_Random(-12, 12), PV_Random(-13, -6), PV_Random(36 * 3, 36 * 10), Particles_WoodChip(), 10); + clonk->CreateParticle("WoodChip", x, 4, PV_Random(-12, 12), PV_Random(-13, -6), PV_Random(36 * 3, 36 * 10), Particles_WoodChip(), 10); } // Tree split! if ((axe_swing_time * 12) / time == 1) diff --git a/planet/Objects.ocd/Items.ocd/Tools.ocd/Balloon.ocd/BalloonDeployed.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Tools.ocd/Balloon.ocd/BalloonDeployed.ocd/Script.c index ad9f3eaa5..7b9c3f43d 100644 --- a/planet/Objects.ocd/Items.ocd/Tools.ocd/Balloon.ocd/BalloonDeployed.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Tools.ocd/Balloon.ocd/BalloonDeployed.ocd/Script.c @@ -13,7 +13,7 @@ protected func Initialize() AddEffect("Float",this,1,1,this); //Special Effects - CreateParticleEx("Air", PV_Random(-1, 1), PV_Random(15, 17), PV_Random(-3, 3), PV_Random(0, 2), 18, Particles_Air(), 20); + CreateParticle("Air", PV_Random(-1, 1), PV_Random(15, 17), PV_Random(-3, 3), PV_Random(0, 2), 18, Particles_Air(), 20); } private func Deflate() @@ -29,7 +29,7 @@ private func Deflate() private func DeflateEffect() { var act_time = GetActTime(); - CreateParticleEx("Air", PV_Random(-1, 1), PV_Random(-1, 5), PV_Random(-act_time, act_time), PV_Random(-act_time, act_time), 18, Particles_Air(), act_time); + CreateParticle("Air", PV_Random(-1, 1), PV_Random(-1, 5), PV_Random(-act_time, act_time), PV_Random(-act_time, act_time), 18, Particles_Air(), act_time); } private func Pack() @@ -73,7 +73,7 @@ public func IsProjectileTarget(target,shooter) public func OnProjectileHit() { //Pop! - CreateParticleEx("Air", 0, -10, PV_Random(-10, 10), PV_Random(-10, 10), 10, Particles_Air(), 30); + CreateParticle("Air", 0, -10, PV_Random(-10, 10), PV_Random(-10, 10), 10, Particles_Air(), 30); Sound("BalloonPop"); if (rider) { diff --git a/planet/Objects.ocd/Items.ocd/Tools.ocd/Boompack.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Tools.ocd/Boompack.ocd/Script.c index a9bb5194d..563b8c147 100644 --- a/planet/Objects.ocd/Items.ocd/Tools.ocd/Boompack.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Tools.ocd/Boompack.ocd/Script.c @@ -134,7 +134,7 @@ protected func FxFlightTimer(object pTarget, effect, int iEffectTime) var xdir = GetXDir() / 2; var ydir = GetYDir() / 2; - CreateParticleEx("FireDense", x, y, PV_Random(xdir - 4, xdir + 4), PV_Random(ydir - 4, ydir + 4), PV_Random(16, 38), Particles_Thrust(), 5); + CreateParticle("FireDense", x, y, PV_Random(xdir - 4, xdir + 4), PV_Random(ydir - 4, ydir + 4), PV_Random(16, 38), Particles_Thrust(), 5); fuel--; } diff --git a/planet/Objects.ocd/Items.ocd/Tools.ocd/Dynamite.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Tools.ocd/Dynamite.ocd/Script.c index f42e67078..4ecf0b83a 100644 --- a/planet/Objects.ocd/Items.ocd/Tools.ocd/Dynamite.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Tools.ocd/Dynamite.ocd/Script.c @@ -133,7 +133,7 @@ private func Fusing() // Effekt if(GetActTime() < FuseTime() - 20) - CreateParticleEx("Fire", x, y, PV_Random(x - 5, x + 5), PV_Random(y - 15, y + 5), PV_Random(10, 40), Particles_Glimmer(), 3); + CreateParticle("Fire", x, y, PV_Random(x - 5, x + 5), PV_Random(y - 15, y + 5), PV_Random(10, 40), Particles_Glimmer(), 3); // Explosion else if(GetActTime() > FuseTime()) DoExplode(); diff --git a/planet/Objects.ocd/Items.ocd/Tools.ocd/DynamiteBox.ocd/Fuse.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Tools.ocd/DynamiteBox.ocd/Fuse.ocd/Script.c index d910b1e39..88948b662 100644 --- a/planet/Objects.ocd/Items.ocd/Tools.ocd/DynamiteBox.ocd/Fuse.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Tools.ocd/DynamiteBox.ocd/Fuse.ocd/Script.c @@ -90,7 +90,7 @@ func FxIntFusingTimer() fuse_x += Sin(iAngle, speed); fuse_y +=-Cos(iAngle, speed); - CreateParticleEx("Fire", fuse_x/10-GetX(), fuse_y/10-GetY(), PV_Random(-10, 10), PV_Random(-10, 10), PV_Random(10, 40), Particles_Glimmer(), 3); + CreateParticle("Fire", fuse_x/10-GetX(), fuse_y/10-GetY(), PV_Random(-10, 10), PV_Random(-10, 10), PV_Random(10, 40), Particles_Glimmer(), 3); SetVertexXY(fuse_vertex, fuse_x/10, fuse_y/10); } diff --git a/planet/Objects.ocd/Items.ocd/Tools.ocd/Pickaxe.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Tools.ocd/Pickaxe.ocd/Script.c index 1aae77a20..08fe012ef 100644 --- a/planet/Objects.ocd/Items.ocd/Tools.ocd/Pickaxe.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Tools.ocd/Pickaxe.ocd/Script.c @@ -120,13 +120,13 @@ protected func DoSwing(object clonk, int ix, int iy) B = clr & 0xff, Size = PV_KeyFrames(0, 0, 0, 200, PV_Random(2, 50), 1000, 0), }; - CreateParticleEx("Dust", x2, y2, PV_Random(-3, 3), PV_Random(-3, -3), PV_Random(18, 1 * 36), particles, 3); + CreateParticle("Dust", x2, y2, PV_Random(-3, 3), PV_Random(-3, -3), PV_Random(18, 1 * 36), particles, 3); Sound("Dig?"); } //It's solid, but not diggable. So it is a hard mineral. else { - CreateParticleEx("Spark", x2*9/10,y2*9/10, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(10, 20), Particles_Glimmer(), 10); + CreateParticle("Spark", x2*9/10,y2*9/10, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(10, 20), Particles_Glimmer(), 10); Sound("Clang?"); } diff --git a/planet/Objects.ocd/Items.ocd/Tools.ocd/PowderKeg.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Tools.ocd/PowderKeg.ocd/Script.c index f7a40dd79..c22957b2b 100644 --- a/planet/Objects.ocd/Items.ocd/Tools.ocd/PowderKeg.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Tools.ocd/PowderKeg.ocd/Script.c @@ -86,7 +86,7 @@ public func Incineration() public func FxFuseTimer(object target, effect, int timer) { - CreateParticleEx("Fire", 0, 0, PV_Random(-10, 10), PV_Random(-20, 10), PV_Random(10, 40), Particles_Glimmer(), 6); + CreateParticle("Fire", 0, 0, PV_Random(-10, 10), PV_Random(-20, 10), PV_Random(10, 40), Particles_Glimmer(), 6); if(timer > 90) { //17-32 explosion radius diff --git a/planet/Objects.ocd/Items.ocd/Tools.ocd/Shovel.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Tools.ocd/Shovel.ocd/Script.c index fe0a3da96..5d3510a49 100644 --- a/planet/Objects.ocd/Items.ocd/Tools.ocd/Shovel.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Tools.ocd/Shovel.ocd/Script.c @@ -152,7 +152,7 @@ public func Dust(object target) B = clr & 0xff, Size = PV_KeyFrames(0, 0, 0, 300, 40, 1000, 15), }; - CreateParticleEx("Dust", groundx, groundy, PV_Random(-3, 3), PV_Random(-3, 3), PV_Random(18, 1 * 36), particles, 3); + CreateParticle("Dust", groundx, groundy, PV_Random(-3, 3), PV_Random(-3, 3), PV_Random(18, 1 * 36), particles, 3); } } diff --git a/planet/Objects.ocd/Items.ocd/Tools.ocd/TeleGlove.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Tools.ocd/TeleGlove.ocd/Script.c index d2e7a953b..7ba6be484 100644 --- a/planet/Objects.ocd/Items.ocd/Tools.ocd/TeleGlove.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Tools.ocd/TeleGlove.ocd/Script.c @@ -133,7 +133,7 @@ public func ControlUseHolding(object clonk, ix, iy) if(distp < reach) { //Particles moving towards object - CreateParticleEx("ElectroSpark", ix + xs, iy + ys, PV_Random(-xs/2, -xs/4), PV_Random(-ys/2, -ys/4), PV_Random(5, 10), particles, 5); + CreateParticle("ElectroSpark", ix + xs, iy + ys, PV_Random(-xs/2, -xs/4), PV_Random(-ys/2, -ys/4), PV_Random(5, 10), particles, 5); //Particles emitting from clonk var wp = 1; @@ -143,7 +143,7 @@ public func ControlUseHolding(object clonk, ix, iy) var xdir = Sin(xp, 10); var ydir = -Cos(yp, 10); var distance = Random(distp); - CreateParticleEx("ElectroSpark", Sin(xp, distance), -Cos(yp, distance), PV_Random(xdir - 5, xdir + 5), PV_Random(ydir - 2, ydir + 2), PV_Random(5, 10), particles, 5); + CreateParticle("ElectroSpark", Sin(xp, distance), -Cos(yp, distance), PV_Random(xdir - 5, xdir + 5), PV_Random(ydir - 2, ydir + 2), PV_Random(5, 10), particles, 5); } var target; @@ -188,7 +188,7 @@ public func ControlUseHolding(object clonk, ix, iy) target_object->SetSpeed(Sin(angle, speed), -Cos(angle, speed)); //Particles emitting from object - target_object->CreateParticleEx("ElectroSpark", 0, 0, PV_Random(xs/8, xs/10), PV_Random(ys/8, ys/10), PV_Random(5, 10), particles, 5); + target_object->CreateParticle("ElectroSpark", 0, 0, PV_Random(xs/8, xs/10), PV_Random(ys/8, ys/10), PV_Random(5, 10), particles, 5); } else LostTargetObject(target_object); diff --git a/planet/Objects.ocd/Items.ocd/Tools.ocd/WindBag.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Tools.ocd/WindBag.ocd/Script.c index ecb6d36cd..6a963af24 100644 --- a/planet/Objects.ocd/Items.ocd/Tools.ocd/WindBag.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Tools.ocd/WindBag.ocd/Script.c @@ -84,7 +84,7 @@ protected func Load() sound=true; } Amount += 2; //Air is sucked in. - CreateParticleEx("Air", SX, SY, Sin(A + R,-D / 2), Cos(A + R,-D / 2), 18, {Prototype = Particles_Air(), Size = PV_KeyFrames(0, 0, 0, 250, 3, 1000, 0)}); + CreateParticle("Air", SX, SY, Sin(A + R,-D / 2), Cos(A + R,-D / 2), 18, {Prototype = Particles_Air(), Size = PV_KeyFrames(0, 0, 0, 250, 3, 1000, 0)}); } else if(GBackSolid(0,0) || GBackLiquid(0,0)) { @@ -124,7 +124,7 @@ private func FireWeapon(object pClonk,iX,iY) if(!GBackSolid(SX,SY)) { - CreateParticleEx("Air", SX, SY, Sin(180 - iAngle + (R),(Amount / 2) + 25), Cos(180 - iAngle + (R),(Amount / 2) + 25), 36, Particles_Air()); + CreateParticle("Air", SX, SY, Sin(180 - iAngle + (R),(Amount / 2) + 25), Cos(180 - iAngle + (R),(Amount / 2) + 25), 36, Particles_Air()); } } diff --git a/planet/Objects.ocd/Items.ocd/Weapons.ocd/GrenadeLauncher.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Weapons.ocd/GrenadeLauncher.ocd/Script.c index 7fead04a4..43fb517c0 100644 --- a/planet/Objects.ocd/Items.ocd/Weapons.ocd/GrenadeLauncher.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Weapons.ocd/GrenadeLauncher.ocd/Script.c @@ -172,10 +172,10 @@ private func FireWeapon(object clonk, int angle) var x = Sin(angle, 20); var y = -Cos(angle, 20); - CreateParticleEx("Smoke", IX, IY, PV_Random(x - 20, x + 20), PV_Random(y - 20, y + 20), PV_Random(40, 60), Particles_Smoke(), 20); + CreateParticle("Smoke", IX, IY, PV_Random(x - 20, x + 20), PV_Random(y - 20, y + 20), PV_Random(40, 60), Particles_Smoke(), 20); clonk->CreateMuzzleFlash(IX, IY, angle, 40); - CreateParticleEx("Flash", 0, 0, 0, 0, 8, Particles_Flash()); + CreateParticle("Flash", 0, 0, 0, 0, 8, Particles_Flash()); } func RejectCollect(id shotid, object shot) diff --git a/planet/Objects.ocd/Items.ocd/Weapons.ocd/IronBomb.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Weapons.ocd/IronBomb.ocd/Script.c index 3c2cf2d01..10eea0b0d 100644 --- a/planet/Objects.ocd/Items.ocd/Weapons.ocd/IronBomb.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Weapons.ocd/IronBomb.ocd/Script.c @@ -32,7 +32,7 @@ func FxFuseBurnTimer(object bomb, int num, int timer) var i = 3; var x = +Sin(GetR(), i); var y = -Cos(GetR(), i); - CreateParticleEx("Smoke", x, y, x, y, PV_Random(18, 36), Particles_Smoke(), 2); + CreateParticle("Smoke", x, y, x, y, PV_Random(18, 36), Particles_Smoke(), 2); if(timer == 1) Sound("FuseLoop",nil,nil,nil,+1); if(timer >= 90) @@ -59,7 +59,7 @@ func DoExplode() Sound("BlastLiquid2"); else Sound("BlastMetal"); - CreateParticleEx("Smoke", PV_Random(-30, 30), PV_Random(-30, 30), 0, 0, PV_Random(40, 60), Particles_Smoke(), 60); + CreateParticle("Smoke", PV_Random(-30, 30), PV_Random(-30, 30), 0, 0, PV_Random(40, 60), Particles_Smoke(), 60); Explode(24); } diff --git a/planet/Objects.ocd/Items.ocd/Weapons.ocd/IronBomb.ocd/Shrapnel.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Weapons.ocd/IronBomb.ocd/Shrapnel.ocd/Script.c index 3c14c70e5..5045c39fb 100644 --- a/planet/Objects.ocd/Items.ocd/Weapons.ocd/IronBomb.ocd/Shrapnel.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Weapons.ocd/IronBomb.ocd/Shrapnel.ocd/Script.c @@ -25,7 +25,7 @@ protected func Hit() ShakeFree(6); RemoveEffect("HitCheck",this); Sound("BulletHitGround?"); - CreateParticleEx("Spark", 0, 0, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(10, 20), Particles_Glimmer(), 3); + CreateParticle("Spark", 0, 0, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(10, 20), Particles_Glimmer(), 3); RemoveObject(); } diff --git a/planet/Objects.ocd/Items.ocd/Weapons.ocd/Musket.ocd/Ammo.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Weapons.ocd/Musket.ocd/Ammo.ocd/Script.c index 3511d9a29..aa1f3900f 100644 --- a/planet/Objects.ocd/Items.ocd/Weapons.ocd/Musket.ocd/Ammo.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Weapons.ocd/Musket.ocd/Ammo.ocd/Script.c @@ -17,7 +17,7 @@ protected func Hit() Sound("BulletHitGround?"); - CreateParticleEx("Spark", 0, 0, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(10, 20), Particles_Glimmer(), 3); + CreateParticle("Spark", 0, 0, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(10, 20), Particles_Glimmer(), 3); RemoveObject(); } diff --git a/planet/Objects.ocd/Items.ocd/Weapons.ocd/Musket.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Weapons.ocd/Musket.ocd/Script.c index 1e3506189..657c9dea3 100644 --- a/planet/Objects.ocd/Items.ocd/Weapons.ocd/Musket.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Weapons.ocd/Musket.ocd/Script.c @@ -170,10 +170,10 @@ private func FireWeapon(object clonk, int angle) // Muzzle Flash & gun smoke var x = Sin(angle, 20); var y = -Cos(angle, 20); - CreateParticleEx("Smoke", IX, IY, PV_Random(x - 20, x + 20), PV_Random(y - 20, y + 20), PV_Random(40, 60), Particles_Smoke(), 20); + CreateParticle("Smoke", IX, IY, PV_Random(x - 20, x + 20), PV_Random(y - 20, y + 20), PV_Random(40, 60), Particles_Smoke(), 20); clonk->CreateMuzzleFlash(IX, IY, angle, 20); - CreateParticleEx("Flash", 0, 0, 0, 0, 8, Particles_Flash()); + CreateParticle("Flash", 0, 0, 0, 0, 8, Particles_Flash()); } func RejectCollect(id shotid, object shot) diff --git a/planet/Objects.ocd/Items.ocd/Weapons.ocd/Sword.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Weapons.ocd/Sword.ocd/Script.c index bd9e77f6c..e9fe2c80a 100644 --- a/planet/Objects.ocd/Items.ocd/Weapons.ocd/Sword.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Weapons.ocd/Sword.ocd/Script.c @@ -254,7 +254,7 @@ func CheckStrike(iTime) { particle.Phase = PV_Linear(4, 7); } - obj->CreateParticleEx("SwordSlice", RandomX(-1,1), RandomX(-1,1), 0, 0, 6, particle); + obj->CreateParticle("SwordSlice", RandomX(-1,1), RandomX(-1,1), 0, 0, 6, particle); } // sound and done. We can only hit one target diff --git a/planet/Objects.ocd/Libraries.ocd/GoldSeller.ocd/Script.c b/planet/Objects.ocd/Libraries.ocd/GoldSeller.ocd/Script.c index e35ae66e2..2cf7e91f7 100644 --- a/planet/Objects.ocd/Libraries.ocd/GoldSeller.ocd/Script.c +++ b/planet/Objects.ocd/Libraries.ocd/GoldSeller.ocd/Script.c @@ -82,8 +82,8 @@ func FxAutoSellValuablesTimer(_, effect, time) value += valuable->GetValue(); - CreateParticleEx("Flash", valuable->GetX() - GetX(), valuable->GetY() - GetY(), 0, 0, 8, { Prototype = Particles_Flash(), Size = 2 * Max(5, Max(valuable->GetDefWidth(), valuable->GetDefHeight())) }); - CreateParticleEx("Dust", valuable->GetX() - GetX(), valuable->GetY() - GetY(), PV_Random(-10, 10), PV_Random(-10, 10), PV_Random(18, 36), dust_particles, 10); + CreateParticle("Flash", valuable->GetX() - GetX(), valuable->GetY() - GetY(), 0, 0, 8, { Prototype = Particles_Flash(), Size = 2 * Max(5, Max(valuable->GetDefWidth(), valuable->GetDefHeight())) }); + CreateParticle("Dust", valuable->GetX() - GetX(), valuable->GetY() - GetY(), PV_Random(-10, 10), PV_Random(-10, 10), PV_Random(18, 36), dust_particles, 10); valuable->RemoveObject(); } diff --git a/planet/Objects.ocd/Rules.ocd/Gravestones.ocd/Script.c b/planet/Objects.ocd/Rules.ocd/Gravestones.ocd/Script.c index 85fc77d93..d90f9abad 100644 --- a/planet/Objects.ocd/Rules.ocd/Gravestones.ocd/Script.c +++ b/planet/Objects.ocd/Rules.ocd/Gravestones.ocd/Script.c @@ -41,7 +41,7 @@ public func FxIntGravestoneStart(object clonk, proplist effect) B = 50, Size = PV_KeyFrames(0, 0, 0, 300, 40, 1000, 15) }; - effect.grave->CreateParticleEx("Dust", 0, 0, PV_Random(-3, 3), PV_Random(-3, 3), PV_Random(18, 1 * 36), particles, 6); + effect.grave->CreateParticle("Dust", 0, 0, PV_Random(-3, 3), PV_Random(-3, 3), PV_Random(18, 1 * 36), particles, 6); } public func FxIntGravestoneStop(object clonk, proplist effect, int reason) diff --git a/planet/Objects.ocd/Structures.ocd/Armory.ocd/Script.c b/planet/Objects.ocd/Structures.ocd/Armory.ocd/Script.c index e606a8862..2941c2e10 100644 --- a/planet/Objects.ocd/Structures.ocd/Armory.ocd/Script.c +++ b/planet/Objects.ocd/Structures.ocd/Armory.ocd/Script.c @@ -57,7 +57,7 @@ private func Smoking() if (!Random(2)) Smoke(x,y + 4,20); if(!Random(2)) - CreateParticleEx("Fire", PV_Random(x-1, x+1), PV_Random(y-2, y+2), 0, PV_Random(-1, 0), PV_Random(18, 36), Particles_Fire(), 2); + CreateParticle("Fire", PV_Random(x-1, x+1), PV_Random(y-2, y+2), 0, PV_Random(-1, 0), PV_Random(18, 36), Particles_Fire(), 2); } local ActMap = { diff --git a/planet/Objects.ocd/Structures.ocd/Compensator.ocd/Script.c b/planet/Objects.ocd/Structures.ocd/Compensator.ocd/Script.c index 6611be8ed..e09eebc2f 100644 --- a/planet/Objects.ocd/Structures.ocd/Compensator.ocd/Script.c +++ b/planet/Objects.ocd/Structures.ocd/Compensator.ocd/Script.c @@ -143,7 +143,7 @@ func FxSparkleTimer(target, effect, time) { effect.Interval *= 2; if(effect.Interval > 35*3) return -1; - CreateParticleEx("StarSpark", PV_Random(-3, 3), PV_Random(-14, -10), PV_Random(-5, 5), PV_Random(-8, 0), 10, Particles_Magic(), 4); + CreateParticle("StarSpark", PV_Random(-3, 3), PV_Random(-14, -10), PV_Random(-5, 5), PV_Random(-8, 0), 10, Particles_Magic(), 4); } func FxProducePowerTimer(target, effect, time) diff --git a/planet/Objects.ocd/Structures.ocd/Foundry.ocd/Script.c b/planet/Objects.ocd/Structures.ocd/Foundry.ocd/Script.c index d3cda3352..a43b49fa3 100644 --- a/planet/Objects.ocd/Structures.ocd/Foundry.ocd/Script.c +++ b/planet/Objects.ocd/Structures.ocd/Foundry.ocd/Script.c @@ -76,7 +76,7 @@ public func FxSmeltingTimer(object target, proplist effect, int time) { //Message(Format("Smelting %d",timer)); // Fire in the furnace. - CreateParticleEx("Fire", -10 * GetCalcDir(), 20, PV_Random(-1, 1), PV_Random(-1, 1), PV_Random(18, 36), Particles_Fire(), 2); + CreateParticle("Fire", -10 * GetCalcDir(), 20, PV_Random(-1, 1), PV_Random(-1, 1), PV_Random(18, 36), Particles_Fire(), 2); // Smoke from the pipes. Smoke( -9*GetCalcDir(), -31, 6); @@ -96,7 +96,7 @@ public func FxSmeltingTimer(object target, proplist effect, int time) // Fire from the pouring exit. if (Inside(time, 244, 290)) - CreateParticleEx("Fire", 17 * GetCalcDir(), 19, PV_Random(-2, 0), PV_Random(1, 3), PV_Random(18, 36), Particles_Fire(), 2); + CreateParticle("Fire", 17 * GetCalcDir(), 19, PV_Random(-2, 0), PV_Random(1, 3), PV_Random(18, 36), Particles_Fire(), 2); if (time == 290) { diff --git a/planet/Objects.ocd/Structures.ocd/Kitchen.ocd/Script.c b/planet/Objects.ocd/Structures.ocd/Kitchen.ocd/Script.c index 53eb52d74..5e39c5b0c 100644 --- a/planet/Objects.ocd/Structures.ocd/Kitchen.ocd/Script.c +++ b/planet/Objects.ocd/Structures.ocd/Kitchen.ocd/Script.c @@ -62,7 +62,7 @@ private func Smoking() if (!Random(6)) Smoke(10 * GetCalcDir(),-14,15+Random(3)); //Fire - CreateParticleEx("Fire", 13 * GetCalcDir(), 16, PV_Random(-1, 1), PV_Random(-1, 1), PV_Random(18, 36), Particles_Fire(), 2); + CreateParticle("Fire", 13 * GetCalcDir(), 16, PV_Random(-1, 1), PV_Random(-1, 1), PV_Random(18, 36), Particles_Fire(), 2); } local ActMap = { diff --git a/planet/Objects.ocd/Structures.ocd/Sawmill.ocd/Script.c b/planet/Objects.ocd/Structures.ocd/Sawmill.ocd/Script.c index 8df32f8f2..995e52b87 100644 --- a/planet/Objects.ocd/Structures.ocd/Sawmill.ocd/Script.c +++ b/planet/Objects.ocd/Structures.ocd/Sawmill.ocd/Script.c @@ -128,7 +128,7 @@ public func FxSawingTimer(object target, proplist effect, int time) { var dir = GetCalcDir(); if (time >= this.SpinStep * 3 && time % 5) - CreateParticleEx("WoodChip", PV_Random(-7 * dir, -3 * dir), PV_Random(3, 6), PV_Random(-5 * dir, -11 * dir), PV_Random(-4, -2), PV_Random(36 * 3, 36 * 10), Particles_WoodChip(), 3); + CreateParticle("WoodChip", PV_Random(-7 * dir, -3 * dir), PV_Random(3, 6), PV_Random(-5 * dir, -11 * dir), PV_Random(-4, -2), PV_Random(36 * 3, 36 * 10), Particles_WoodChip(), 3); if (!(time % 20)) Smoke(10 * GetCalcDir(),10,10); diff --git a/planet/Objects.ocd/Structures.ocd/Windmill.ocd/Script.c b/planet/Objects.ocd/Structures.ocd/Windmill.ocd/Script.c index d63e92bd6..23d47d96b 100644 --- a/planet/Objects.ocd/Structures.ocd/Windmill.ocd/Script.c +++ b/planet/Objects.ocd/Structures.ocd/Windmill.ocd/Script.c @@ -119,7 +119,7 @@ public func FxCrushingTimer(object target, proplist effect, int time) G = 200, B = 100 }; - CreateParticleEx("Dust", PV_Random(11 * dir, 13 * dir), 40, PV_Random(-5, 5), PV_Random(-13, -6), PV_Random(36 * 3, 36 * 10), particles, 3); + CreateParticle("Dust", PV_Random(11 * dir, 13 * dir), 40, PV_Random(-5, 5), PV_Random(-13, -6), PV_Random(36 * 3, 36 * 10), particles, 3); return 1; } diff --git a/planet/Objects.ocd/Vegetation.ocd/Fern.ocd/Script.c b/planet/Objects.ocd/Vegetation.ocd/Fern.ocd/Script.c index aa95df4b8..259f7447d 100644 --- a/planet/Objects.ocd/Vegetation.ocd/Fern.ocd/Script.c +++ b/planet/Objects.ocd/Vegetation.ocd/Fern.ocd/Script.c @@ -19,7 +19,7 @@ private func Initialize() public func Incineration() { - CreateParticleEx("Grass", 0, 0, PV_Random(-20, 20), PV_Random(-20, 10), PV_Random(30, 100), Particles_Straw(), 30); + CreateParticle("Grass", 0, 0, PV_Random(-20, 20), PV_Random(-20, 10), PV_Random(30, 100), Particles_Straw(), 30); RemoveObject(); } diff --git a/planet/Objects.ocd/Vegetation.ocd/Grass.ocd/Script.c b/planet/Objects.ocd/Vegetation.ocd/Grass.ocd/Script.c index f9049a63b..db752f9e3 100644 --- a/planet/Objects.ocd/Vegetation.ocd/Grass.ocd/Script.c +++ b/planet/Objects.ocd/Vegetation.ocd/Grass.ocd/Script.c @@ -23,7 +23,7 @@ public func OnShockwaveHit() private func Destroy() { - CreateParticleEx("Grass", 0, 0, PV_Random(-20, 20), PV_Random(-20, 10), PV_Random(30, 100), Particles_Straw(), 30); + CreateParticle("Grass", 0, 0, PV_Random(-20, 20), PV_Random(-20, 10), PV_Random(30, 100), Particles_Straw(), 30); RemoveObject(); } diff --git a/planet/Objects.ocd/Vegetation.ocd/Lichen.ocd/Script.c b/planet/Objects.ocd/Vegetation.ocd/Lichen.ocd/Script.c index ca7fcc796..2b8592bf4 100644 --- a/planet/Objects.ocd/Vegetation.ocd/Lichen.ocd/Script.c +++ b/planet/Objects.ocd/Vegetation.ocd/Lichen.ocd/Script.c @@ -36,7 +36,7 @@ public func Harvest(object clonk) Rotation = PV_Direction(PV_Random(900, 1100)), Phase = PV_Random(0, 1) }; - CreateParticleEx("Lichen", PV_Random(-5, 5), PV_Random(-5, 5), PV_Random(-30, 30), PV_Random(-30, 30), PV_Random(36, 36 * 4), particles, 40); + CreateParticle("Lichen", PV_Random(-5, 5), PV_Random(-5, 5), PV_Random(-30, 30), PV_Random(-30, 30), PV_Random(36, 36 * 4), particles, 40); if (grow_stage) { diff --git a/planet/Objects.ocd/Vegetation.ocd/SproutBerryBush.ocd/Sprout.ocd/Script.c b/planet/Objects.ocd/Vegetation.ocd/SproutBerryBush.ocd/Sprout.ocd/Script.c index 08b5e5d04..868e85de7 100644 --- a/planet/Objects.ocd/Vegetation.ocd/SproutBerryBush.ocd/Sprout.ocd/Script.c +++ b/planet/Objects.ocd/Vegetation.ocd/SproutBerryBush.ocd/Sprout.ocd/Script.c @@ -210,7 +210,7 @@ func Damage() { // splatter if(grow_anim) - CreateParticleEx("Dust", 0, 0, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(20, 60), Particles_Material(RGB(50, 50, 255)), 30); + CreateParticle("Dust", 0, 0, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(20, 60), Particles_Material(RGB(50, 50, 255)), 30); // ouch! Die(false); diff --git a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous.ocd/ConiferousBurned.ocd/Script.c b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous.ocd/ConiferousBurned.ocd/Script.c index 6f3ef12cd..3b9fee773 100644 --- a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous.ocd/ConiferousBurned.ocd/Script.c +++ b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous.ocd/ConiferousBurned.ocd/Script.c @@ -108,7 +108,7 @@ func BurstIntoAshes() for(var mirror = -1; mirror <= 1; mirror += 2) { - CreateParticleEx("Dust", x * mirror, y * mirror, PV_Random(-3, 3), PV_Random(-3, -3), PV_Random(18, 1 * 36), particles, 2); + CreateParticle("Dust", x * mirror, y * mirror, PV_Random(-3, 3), PV_Random(-3, -3), PV_Random(18, 1 * 36), particles, 2); CastPXS("Ashes", 5, 30, x * mirror, y * mirror); } } diff --git a/planet/Objects.ocd/Vegetation.ocd/Trunk.ocd/Script.c b/planet/Objects.ocd/Vegetation.ocd/Trunk.ocd/Script.c index fc61628e2..908d565f8 100644 --- a/planet/Objects.ocd/Vegetation.ocd/Trunk.ocd/Script.c +++ b/planet/Objects.ocd/Vegetation.ocd/Trunk.ocd/Script.c @@ -68,7 +68,7 @@ func BurstIntoAshes() for(var mirror = -1; mirror <= 1; mirror += 2) { - CreateParticleEx("Dust", x * mirror, y * mirror, PV_Random(-3, 3), PV_Random(-3, -3), PV_Random(18, 1 * 36), particles, 2); + CreateParticle("Dust", x * mirror, y * mirror, PV_Random(-3, 3), PV_Random(-3, -3), PV_Random(18, 1 * 36), particles, 2); CastPXS("Ashes", 5, 30, x * mirror, y * mirror); } } diff --git a/planet/Objects.ocd/Vehicles.ocd/Airplane.ocd/Script.c b/planet/Objects.ocd/Vehicles.ocd/Airplane.ocd/Script.c index 4c8edbe56..6b2d47924 100644 --- a/planet/Objects.ocd/Vehicles.ocd/Airplane.ocd/Script.c +++ b/planet/Objects.ocd/Vehicles.ocd/Airplane.ocd/Script.c @@ -71,10 +71,10 @@ public func ContainedUseStop(object clonk, int ix, int iy) var x = Sin(angle, 20); var y = -Cos(angle, 20); - CreateParticleEx("Smoke", IX, IY, PV_Random(x - 20, x + 20), PV_Random(y - 20, y + 20), PV_Random(40, 60), Particles_Smoke(), 20); + CreateParticle("Smoke", IX, IY, PV_Random(x - 20, x + 20), PV_Random(y - 20, y + 20), PV_Random(40, 60), Particles_Smoke(), 20); CreateMuzzleFlash(IX, IY, angle, 20); - CreateParticleEx("Flash", 0, 0, GetXDir(), GetYDir(), 8, Particles_Flash()); + CreateParticle("Flash", 0, 0, GetXDir(), GetYDir(), 8, Particles_Flash()); AddEffect("IntCooldown", this,1,1,this); } @@ -213,7 +213,7 @@ private func FxIntPlaneTimer(object target, effect, int timer) R = colour, G = colour, B = colour, Size = PV_Linear(PV_Random(20, 30), PV_Random(70, 100)) }; - CreateParticleEx("Smoke", 0, 0, 0, 0, PV_Random(36, 2 * 36), particles, 2); + CreateParticle("Smoke", 0, 0, 0, 0, PV_Random(36, 2 * 36), particles, 2); } //Throttle-to-thrust lag diff --git a/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Script.c b/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Script.c index 7610f31ba..14d87e75f 100644 --- a/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Script.c +++ b/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Script.c @@ -94,7 +94,7 @@ public func FxIntAirshipMovementTimer(object target, proplist effect, int time) Prototype = Particles_Smoke(), R = colour, G = colour, B = colour }; - CreateParticleEx("Smoke", i, 18, 0, 0, PV_Random(36, 2 * 36), particles, 2); + CreateParticle("Smoke", i, 18, 0, 0, PV_Random(36, 2 * 36), particles, 2); } // Fan-blade sound if (!enginesound) diff --git a/planet/Objects.ocd/Vehicles.ocd/Cannon.ocd/Script.c b/planet/Objects.ocd/Vehicles.ocd/Cannon.ocd/Script.c index 1af0d9b13..9e9af18b7 100644 --- a/planet/Objects.ocd/Vehicles.ocd/Cannon.ocd/Script.c +++ b/planet/Objects.ocd/Vehicles.ocd/Cannon.ocd/Script.c @@ -275,11 +275,11 @@ protected func DoFire(object iammo, object clonk, int angle) var dist = 25; var px = Cos(r/angPrec - 90,dist); var py = Sin(r/angPrec - 90,dist) - 4; - CreateParticleEx("Flash", px, py, 0, 0, 8, Particles_Flash()); + CreateParticle("Flash", px, py, 0, 0, 8, Particles_Flash()); var x = Sin(r/angPrec, 20); var y = -Cos(r/angPrec, 20); - CreateParticleEx("Smoke", px, py, PV_Random(x - 20, x + 20), PV_Random(y - 20, y + 20), PV_Random(40, 60), Particles_Smoke(), 20); + CreateParticle("Smoke", px, py, PV_Random(x - 20, x + 20), PV_Random(y - 20, y + 20), PV_Random(40, 60), Particles_Smoke(), 20); CreateMuzzleFlash(px, py, r / angPrec, 60); //sound Sound("Blast3"); diff --git a/planet/Parkour.ocf/Boomshire.ocs/ArrowWheel.ocd/Script.c b/planet/Parkour.ocf/Boomshire.ocs/ArrowWheel.ocd/Script.c index 9c253bf47..4898b0315 100644 --- a/planet/Parkour.ocf/Boomshire.ocs/ArrowWheel.ocd/Script.c +++ b/planet/Parkour.ocf/Boomshire.ocs/ArrowWheel.ocd/Script.c @@ -20,7 +20,7 @@ public func ControlUp(object clonk) var arrw= CreateObject(Arrow,x,y,-1); arrw->Launch(30,80, clonk); arrw->SetGraphics("1"); - CreateParticleEx("Straw", 0, 0, PV_Random(-20, 20), PV_Random(-20,20), PV_Random(30, 120), Particles_Straw(), 20); + CreateParticle("Straw", 0, 0, PV_Random(-20, 20), PV_Random(-20,20), PV_Random(30, 120), Particles_Straw(), 20); } if(GetEffect("SparklingAttention",this)) RemoveEffect("SparklingAttention",this); } diff --git a/planet/Parkour.ocf/Boomshire.ocs/Script.c b/planet/Parkour.ocf/Boomshire.ocs/Script.c index 498777093..cbbe16acb 100644 --- a/planet/Parkour.ocf/Boomshire.ocs/Script.c +++ b/planet/Parkour.ocf/Boomshire.ocs/Script.c @@ -91,7 +91,7 @@ global func FxAutoOpenTimer(object pTarget, effect, int timer) global func FxSparklingAttentionTimer(object pTarget, effect, int timer) { - CreateParticleEx("Flash", 0, 0, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(8, 15), {Prototype = Particles_Flash(), Size = 10}, 10); + CreateParticle("Flash", 0, 0, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(8, 15), {Prototype = Particles_Flash(), Size = 10}, 10); } protected func Decoration() diff --git a/planet/Parkour.ocf/Boomshire.ocs/Target.ocd/Script.c b/planet/Parkour.ocf/Boomshire.ocs/Target.ocd/Script.c index 45cb6d01b..7d2738a7e 100644 --- a/planet/Parkour.ocf/Boomshire.ocs/Target.ocd/Script.c +++ b/planet/Parkour.ocf/Boomshire.ocs/Target.ocd/Script.c @@ -32,7 +32,7 @@ public func OnProjectileHit() public func Burst() { DrawParticleLine("Straw", 0, 0, AbsX(gate->GetX()), AbsY(gate->GetY()), 6, PV_Random(-5, 5), PV_Random(-5, 0), PV_Random(30, 60), Particles_Straw()); - CreateParticleEx("Straw", 0, 0, PV_Random(-30, 30), PV_Random(-30,30), PV_Random(30, 120), Particles_Straw(), 200); + CreateParticle("Straw", 0, 0, PV_Random(-30, 30), PV_Random(-30,30), PV_Random(30, 120), Particles_Straw(), 200); gate->OpenDoor(); RemoveObject(); } diff --git a/planet/Parkour.ocf/VolcanoEscapeEx.ocs/BigVolcano.ocd/Script.c b/planet/Parkour.ocf/VolcanoEscapeEx.ocs/BigVolcano.ocd/Script.c index 8ac5807ec..f2fcfb41e 100644 --- a/planet/Parkour.ocf/VolcanoEscapeEx.ocs/BigVolcano.ocd/Script.c +++ b/planet/Parkour.ocf/VolcanoEscapeEx.ocs/BigVolcano.ocd/Script.c @@ -110,7 +110,7 @@ func Execute() BlastFree(x,y-3,blast_size,GetController()); // gfx var particle_speed = blast_size * 3; - CreateParticleEx("FireDense", PV_Random(x - 1, x + 1), PV_Random(y - 4, y - 2), PV_Random(-particle_speed, particle_speed), PV_Random(-particle_speed, particle_speed), PV_Random(30, 40), Particles_Fire(), 5); + CreateParticle("FireDense", PV_Random(x - 1, x + 1), PV_Random(y - 4, y - 2), PV_Random(-particle_speed, particle_speed), PV_Random(-particle_speed, particle_speed), PV_Random(30, 40), Particles_Fire(), 5); if (!Random(5)) SoundAt("RockHit*", x,y-3, 100); } else if (speed <=50) diff --git a/planet/System.ocg/Creation.c b/planet/System.ocg/Creation.c index 7a090fae7..668bdea51 100644 --- a/planet/System.ocg/Creation.c +++ b/planet/System.ocg/Creation.c @@ -132,7 +132,7 @@ global func DrawParticleLine(string particle, int x0, int y0, int x1, int y1, in i2 = i * 256 / prtnum; i1 = 256 - i2; - CreateParticleEx(particle, x0 + (x1 - x0) * i / prtnum, y0 + (y1 - y0) * i-- / prtnum, xdir, ydir, lifetime, properties, 1); + CreateParticle(particle, x0 + (x1 - x0) * i / prtnum, y0 + (y1 - y0) * i-- / prtnum, xdir, ydir, lifetime, properties, 1); } // Succes, return number of created particles. return prtnum; diff --git a/planet/System.ocg/Explode.c b/planet/System.ocg/Explode.c index 4514e1a8e..51fd99b44 100644 --- a/planet/System.ocg/Explode.c +++ b/planet/System.ocg/Explode.c @@ -204,12 +204,12 @@ global func ExplosionEffect(int level, int x, int y, int smoothness) var star_size = PV_KeyFrames(0, 0, 0, 500, level * 2, 1000, 0); var shockwave_size = PV_Linear(0, level * 4); - CreateParticleEx("SmokeDirty", PV_Random(x - 10,x + 10), PV_Random(y - 10, y + 10), 0, PV_Random(-2, 0), PV_Random(50, 100), {Prototype = ExplosionParticles_Smoke, Size = smoke_size}, Max(2, wilderness_level / 10)); - CreateParticleEx("SmokeDirty", PV_Random(x - 5, x + 5), PV_Random(y - 5, y + 5), PV_Random(-1, 1), PV_Random(-1, 1), PV_Random(20, 40), {Prototype = ExplosionParticles_BlastSmoothBackground, Size = blast_smooth_size}, smoothness_level / 5); - CreateParticleEx("SmokeDirty", PV_Random(x - 5, x + 5), PV_Random(y - 5, y + 5), PV_Random(-1, 1), PV_Random(-1, 1), PV_Random(20, 40), {Prototype = ExplosionParticles_BlastSmooth, Size = blast_smooth_size}, smoothness_level / 5); - CreateParticleEx("Dust", PV_Random(x - 5, x + 5), PV_Random(y - 5, y + 5), 0, 0, PV_Random(18, 25), {Prototype = ExplosionParticles_Blast, Size = blast_size}, smoothness_level / 5); - CreateParticleEx("StarFlash", PV_Random(x - 6, x + 6), PV_Random(y - 6, y + 6), PV_Random(-wilderness_level/4, wilderness_level/4), PV_Random(-wilderness_level/4, wilderness_level/4), PV_Random(10, 12), {Prototype = ExplosionParticles_Star, Size = star_size}, wilderness_level / 3); - CreateParticleEx("Shockwave", x, y, 0, 0, 15, {Prototype = ExplosionParticles_Shockwave, Size = shockwave_size}, nil); + CreateParticle("SmokeDirty", PV_Random(x - 10,x + 10), PV_Random(y - 10, y + 10), 0, PV_Random(-2, 0), PV_Random(50, 100), {Prototype = ExplosionParticles_Smoke, Size = smoke_size}, Max(2, wilderness_level / 10)); + CreateParticle("SmokeDirty", PV_Random(x - 5, x + 5), PV_Random(y - 5, y + 5), PV_Random(-1, 1), PV_Random(-1, 1), PV_Random(20, 40), {Prototype = ExplosionParticles_BlastSmoothBackground, Size = blast_smooth_size}, smoothness_level / 5); + CreateParticle("SmokeDirty", PV_Random(x - 5, x + 5), PV_Random(y - 5, y + 5), PV_Random(-1, 1), PV_Random(-1, 1), PV_Random(20, 40), {Prototype = ExplosionParticles_BlastSmooth, Size = blast_smooth_size}, smoothness_level / 5); + CreateParticle("Dust", PV_Random(x - 5, x + 5), PV_Random(y - 5, y + 5), 0, 0, PV_Random(18, 25), {Prototype = ExplosionParticles_Blast, Size = blast_size}, smoothness_level / 5); + CreateParticle("StarFlash", PV_Random(x - 6, x + 6), PV_Random(y - 6, y + 6), PV_Random(-wilderness_level/4, wilderness_level/4), PV_Random(-wilderness_level/4, wilderness_level/4), PV_Random(10, 12), {Prototype = ExplosionParticles_Star, Size = star_size}, wilderness_level / 3); + CreateParticle("Shockwave", x, y, 0, 0, 15, {Prototype = ExplosionParticles_Shockwave, Size = shockwave_size}, nil); // cast either some sparks on land or bubbles under water if(GBackLiquid(x, y) && Global.CastBubbles) @@ -218,7 +218,7 @@ global func ExplosionEffect(int level, int x, int y, int smoothness) } else { - CreateParticleEx("Magic", PV_Random(x - 5, x + 5), PV_Random(y - 5, y + 5), PV_Random(-level_pow_fraction, level_pow_fraction), PV_Random(-level_pow_fraction, level_pow_fraction), PV_Random(25, 70), ExplosionParticles_Glimmer, level); + CreateParticle("Magic", PV_Random(x - 5, x + 5), PV_Random(y - 5, y + 5), PV_Random(-level_pow_fraction, level_pow_fraction), PV_Random(-level_pow_fraction, level_pow_fraction), PV_Random(25, 70), ExplosionParticles_Glimmer, level); } // very wild explosion? Smoke trails! @@ -543,9 +543,9 @@ global func FxSmokeTrailTimer(object target, proplist effect, int fxtime) { var x_dir_blast = x_dir / 200; var y_dir_blast = y_dir / 200; - CreateParticleEx("SmokeDirty", x, y, PV_Random(x_dir_blast - 2, x_dir_blast + 2), PV_Random(y_dir_blast - 2, y_dir_blast + 2), 18, effect.particles_blast, 2); + CreateParticle("SmokeDirty", x, y, PV_Random(x_dir_blast - 2, x_dir_blast + 2), PV_Random(y_dir_blast - 2, y_dir_blast + 2), 18, effect.particles_blast, 2); } - CreateParticleEx("Smoke", x, y, PV_Random(-2, 2), PV_Random(-2, 2), 50, effect.particles_smoke, 2); + CreateParticle("Smoke", x, y, PV_Random(-2, 2), PV_Random(-2, 2), 50, effect.particles_smoke, 2); // then calc next position @@ -575,7 +575,7 @@ global func Fireworks(int color, int x, int y) G = (color >> 8) & 0xff, B = (color >> 0) & 0xff, }; - CreateParticleEx("MagicFire", x, y, PV_Random(-100, 100), PV_Random(-100, 100), PV_Random(20, 200), glimmer, 100); + CreateParticle("MagicFire", x, y, PV_Random(-100, 100), PV_Random(-100, 100), PV_Random(20, 200), glimmer, 100); Smoke(x, y, 30); @@ -590,7 +590,7 @@ global func Fireworks(int color, int x, int y) ForceX = PV_Random(-10, 10), Stretch = PV_Speed(500, 1000) }; - CreateParticleEx("Spark", x, y, PV_Random(-200, 200), PV_Random(-200, 200), PV_Random(20, 60), sparks, 100); + CreateParticle("Spark", x, y, PV_Random(-200, 200), PV_Random(-200, 200), PV_Random(20, 60), sparks, 100); var flash = { @@ -599,7 +599,7 @@ global func Fireworks(int color, int x, int y) G = (color >> 8) & 0xff, B = (color >> 0) & 0xff, }; - CreateParticleEx("Flash", x, y, 0, 0, 8, flash); + CreateParticle("Flash", x, y, 0, 0, 8, flash); return; } diff --git a/planet/System.ocg/Particles.c b/planet/System.ocg/Particles.c index 24f79fea7..a437084ea 100644 --- a/planet/System.ocg/Particles.c +++ b/planet/System.ocg/Particles.c @@ -7,11 +7,11 @@ global func CreateMuzzleFlash(int x, int y, int angle, int size) { // main muzzle flash - CreateParticleEx("MuzzleFlash", x, y, 0, 0, 10, {Prototype = Particles_MuzzleFlash(), Size = size, Rotation = angle}); + CreateParticle("MuzzleFlash", x, y, 0, 0, 10, {Prototype = Particles_MuzzleFlash(), Size = size, Rotation = angle}); // and some additional little sparks var xdir = Sin(angle, size * 2); var ydir = -Cos(angle, size * 2); - CreateParticleEx("StarFlash", x, y, PV_Random(xdir - size, xdir + size), PV_Random(ydir - size, ydir + size), PV_Random(20, 60), Particles_Glimmer(), size); + CreateParticle("StarFlash", x, y, PV_Random(xdir - size, xdir + size), PV_Random(ydir - size, ydir + size), PV_Random(20, 60), Particles_Glimmer(), size); } global func Smoke(int x, int y, int level, int color) @@ -26,7 +26,7 @@ global func Smoke(int x, int y, int level, int color) particles.B = (color >> 0) & 0xff; } particles.Size = PV_Linear(PV_Random(level/2, level), PV_Random(2 * level, 3 * level)); - CreateParticleEx("Smoke", x, y, PV_Random(-level/3, level/3), PV_Random(-level/2, -level/3), PV_Random(level * 2, level * 10), particles, BoundBy(level/5, 3, 20)); + CreateParticle("Smoke", x, y, PV_Random(-level/3, level/3), PV_Random(-level/2, -level/3), PV_Random(level * 2, level * 10), particles, BoundBy(level/5, 3, 20)); } diff --git a/planet/Tests.ocf/OneMillionParticles.ocs/Script.c b/planet/Tests.ocf/OneMillionParticles.ocs/Script.c index fdb2cc119..cbfac59dc 100644 --- a/planet/Tests.ocf/OneMillionParticles.ocs/Script.c +++ b/planet/Tests.ocf/OneMillionParticles.ocs/Script.c @@ -29,7 +29,7 @@ func Initialize() global func Test1() { var t = GetTime(); - CreateParticleEx("FireDense", PV_Random(0, LandscapeWidth()), PV_Random(0, LandscapeHeight()/2), PV_Random(-10, 10), PV_Random(-10, 10), PV_Random(100, 300), PARTICLES, PARTICLES_PER_RUN); + CreateParticle("FireDense", PV_Random(0, LandscapeWidth()), PV_Random(0, LandscapeHeight()/2), PV_Random(-10, 10), PV_Random(-10, 10), PV_Random(100, 300), PARTICLES, PARTICLES_PER_RUN); t = GetTime() - t; FixLenLog("Test1 - batch creation", t, LOG_LINE_LEN, "ms"); MEASUREMENTS[0] = t; @@ -41,7 +41,7 @@ global func Test2() { var t = GetTime(); for (var i = 0; i < PARTICLES_PER_RUN; ++i) - CreateParticleEx("FireDense", PV_Random(0, LandscapeWidth()), PV_Random(0, LandscapeHeight()/2), PV_Random(-10, 10), PV_Random(-10, 10), PV_Random(100, 300), PARTICLES); + CreateParticle("FireDense", PV_Random(0, LandscapeWidth()), PV_Random(0, LandscapeHeight()/2), PV_Random(-10, 10), PV_Random(-10, 10), PV_Random(100, 300), PARTICLES); t = GetTime() - t; FixLenLog("Test2 - seperate creation", t, LOG_LINE_LEN, "ms"); MEASUREMENTS[1] = t; @@ -95,14 +95,14 @@ global func FxScorchEverythingTimer(target, effect, time) var glimmer_count = strength / 2; var fire_density = (strength - 30) / 10; var glimmer_speed = strength / 4; - CreateParticleEx("Fire", effect.x, effect.y, PV_Random(-glimmer_speed, glimmer_speed), PV_Random(-glimmer_speed, 5), PV_Random(Max(30, strength), Max(60, strength * 2)), effect.glimmer, glimmer_count); + CreateParticle("Fire", effect.x, effect.y, PV_Random(-glimmer_speed, glimmer_speed), PV_Random(-glimmer_speed, 5), PV_Random(Max(30, strength), Max(60, strength * 2)), effect.glimmer, glimmer_count); if (fire_density > 0) { var speed = 2 * fire_density; var size = 2 * fire_density; effect.fire.Size = PV_KeyFrames(0, 0, 0, 100, PV_Random(size, 2 * size), 900, PV_Random(2 * size, 3 * size), 1000, 0); - CreateParticleEx("FireDense", effect.x, effect.y, PV_Random(-speed, speed), PV_Random(-speed, speed), PV_Random(30, Min(60, fire_density * 20)), effect.fire_na, fire_density); - CreateParticleEx("Fire", effect.x, effect.y, PV_Random(-speed, speed), PV_Random(-speed, speed), PV_Random(30, Min(60, fire_density * 20)), effect.fire, fire_density); + CreateParticle("FireDense", effect.x, effect.y, PV_Random(-speed, speed), PV_Random(-speed, speed), PV_Random(30, Min(60, fire_density * 20)), effect.fire_na, fire_density); + CreateParticle("Fire", effect.x, effect.y, PV_Random(-speed, speed), PV_Random(-speed, speed), PV_Random(30, Min(60, fire_density * 20)), effect.fire, fire_density); } } diff --git a/planet/Tutorial.ocf/Tutorial03.ocs/Script.c b/planet/Tutorial.ocf/Tutorial03.ocs/Script.c index 6a850013b..cce78c425 100644 --- a/planet/Tutorial.ocf/Tutorial03.ocs/Script.c +++ b/planet/Tutorial.ocf/Tutorial03.ocs/Script.c @@ -180,12 +180,12 @@ private func MakeTarget(int x, int y, bool flying) { var balloon = CreateObject(TargetBalloon, x, y-30, NO_OWNER); target->SetAction("Attach", balloon); - CreateParticleEx("Flash", x, y - 50, 0, 0, 8, Particles_Flash()); + CreateParticle("Flash", x, y - 50, 0, 0, 8, Particles_Flash()); } if (flying == false) { - CreateParticleEx("Flash", x, y, 0, 0, 8, Particles_Flash()); + CreateParticle("Flash", x, y, 0, 0, 8, Particles_Flash()); target->SetAction("Float"); } return target; diff --git a/planet/Tutorial.ocf/Tutorial03.ocs/Target.ocd/Script.c b/planet/Tutorial.ocf/Tutorial03.ocs/Target.ocd/Script.c index 1fdbba3d1..dca1bc743 100644 --- a/planet/Tutorial.ocf/Tutorial03.ocs/Target.ocd/Script.c +++ b/planet/Tutorial.ocf/Tutorial03.ocs/Target.ocd/Script.c @@ -25,7 +25,7 @@ public func OnProjectileHit() public func Burst() { - CreateParticleEx("Straw", 0, 0, PV_Random(-30, 30), PV_Random(-30,30), PV_Random(30, 120), Particles_Straw(), 200); + CreateParticle("Straw", 0, 0, PV_Random(-30, 30), PV_Random(-30,30), PV_Random(30, 120), Particles_Straw(), 200); RemoveObject(); } diff --git a/planet/Tutorial.ocf/Tutorial03.ocs/Target.ocd/TargetBalloon.ocd/Script.c b/planet/Tutorial.ocf/Tutorial03.ocs/Target.ocd/TargetBalloon.ocd/Script.c index 61c236905..4bc3034d5 100644 --- a/planet/Tutorial.ocf/Tutorial03.ocs/Target.ocd/TargetBalloon.ocd/Script.c +++ b/planet/Tutorial.ocf/Tutorial03.ocs/Target.ocd/TargetBalloon.ocd/Script.c @@ -27,7 +27,7 @@ public func IsProjectileTarget(target,shooter) public func OnProjectileHit() { - CreateParticleEx("Air", 0, -10, PV_Random(-30, 30), PV_Random(-30,30), PV_Random(30, 120), Particles_Air(), 10); + CreateParticle("Air", 0, -10, PV_Random(-30, 30), PV_Random(-30,30), PV_Random(30, 120), Particles_Air(), 10); Sound("BalloonPop"); RemoveObject(); } diff --git a/planet/Tutorial.ocf/Tutorial04.ocs/SwordTarget.ocd/Script.c b/planet/Tutorial.ocf/Tutorial04.ocs/SwordTarget.ocd/Script.c index 7cf9867f8..d4d76ecf6 100644 --- a/planet/Tutorial.ocf/Tutorial04.ocs/SwordTarget.ocd/Script.c +++ b/planet/Tutorial.ocf/Tutorial04.ocs/SwordTarget.ocd/Script.c @@ -12,7 +12,7 @@ protected func Initialize() public func Burst() { - CreateParticleEx("Straw", 0, 0, PV_Random(-30, 30), PV_Random(-30,30), PV_Random(30, 120), Particles_Straw(), 200); + CreateParticle("Straw", 0, 0, PV_Random(-30, 30), PV_Random(-30,30), PV_Random(30, 120), Particles_Straw(), 200); RemoveObject(); return; } diff --git a/src/game/C4Application.cpp b/src/game/C4Application.cpp index f172547ef..c606ae0a6 100644 --- a/src/game/C4Application.cpp +++ b/src/game/C4Application.cpp @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include @@ -184,7 +184,7 @@ bool C4Application::DoInit(int argc, char * argv[]) } // after initializing graphics, the particle system can check for compatibility - ::DynamicParticles.DoInit(); + ::Particles.DoInit(); // Initialize gamepad if (!pGamePadControl && Config.General.GamepadEnabled) diff --git a/src/game/C4Game.cpp b/src/game/C4Game.cpp index 69ac4babf..eb5b137d5 100644 --- a/src/game/C4Game.cpp +++ b/src/game/C4Game.cpp @@ -592,7 +592,7 @@ void C4Game::Clear() Landscape.Clear(); PXS.Clear(); if (pGlobalEffects) { delete pGlobalEffects; pGlobalEffects=NULL; } - DynamicParticles.Clear(); + Particles.Clear(); ::MaterialMap.Clear(); TextureMap.Clear(); // texture map *MUST* be cleared after the materials, because of the patterns! //::GraphicsResource.Clear(); @@ -686,7 +686,7 @@ C4ST_NEW(ControlStat, "C4Game::Execute ExecuteControl") C4ST_NEW(ExecObjectsStat, "C4Game::Execute ExecObjects") C4ST_NEW(GEStats, "C4Game::Execute pGlobalEffects->Execute") C4ST_NEW(PXSStat, "C4Game::Execute PXS.Execute") -C4ST_NEW(DynPartStat, "C4Game::Execute DynamicParticles.Execute") +C4ST_NEW(DynPartStat, "C4Game::Execute Particles.Execute") C4ST_NEW(MassMoverStat, "C4Game::Execute MassMover.Execute") C4ST_NEW(WeatherStat, "C4Game::Execute Weather.Execute") C4ST_NEW(PlayersStat, "C4Game::Execute Players.Execute") @@ -732,7 +732,7 @@ bool C4Game::Execute() // Returns true if the game is over AddDbgRec(RCT_DbgFrame, &FrameCounter, sizeof(int32_t)); // allow the particle system to execute the next frame BEFORE the other game stuff is calculated since it will run in parallel to the main thread - DynamicParticles.CalculateNextStep(); + Particles.CalculateNextStep(); // Game @@ -1957,7 +1957,7 @@ bool C4Game::ReloadParticle(const char *szName) // safety if (!szName) return false; // get particle def - C4ParticleDef *pDef = DynamicParticles.definitions.GetDef(szName); + C4ParticleDef *pDef = Particles.definitions.GetDef(szName); if (!pDef) return false; // verbose LogF("Reloading particle %s from %s",pDef->Name.getData(),GetFilename(pDef->Filename.getData())); @@ -1965,7 +1965,7 @@ bool C4Game::ReloadParticle(const char *szName) if (!pDef->Reload()) { // safer: remove all particles - ::DynamicParticles.ClearAllParticles(); + ::Particles.ClearAllParticles(); // clear def delete pDef; // log @@ -3308,7 +3308,7 @@ bool C4Game::LoadScenarioSection(const char *szSection, DWORD dwFlags) //delete pGlobalEffects; pGlobalEffects=NULL; } // del particles as well - DynamicParticles.ClearAllParticles(); + Particles.ClearAllParticles(); // clear transfer zones TransferZones.Clear(); // backup old sky diff --git a/src/game/C4Viewport.cpp b/src/game/C4Viewport.cpp index 741d96855..9ffe246e0 100644 --- a/src/game/C4Viewport.cpp +++ b/src/game/C4Viewport.cpp @@ -257,7 +257,7 @@ void C4Viewport::Draw(C4TargetFacet &cgo0, bool fDrawOverlay) // draw global dynamic particles C4ST_STARTNEW(PartStat, "C4Viewport::Draw: Dynamic Particles") - ::DynamicParticles.DrawGlobalParticles(cgo); + ::Particles.DrawGlobalParticles(cgo); C4ST_STOP(PartStat) // Draw PathFinder diff --git a/src/gamescript/C4GameScript.cpp b/src/gamescript/C4GameScript.cpp index 620bec0ce..95898a3e7 100644 --- a/src/gamescript/C4GameScript.cpp +++ b/src/gamescript/C4GameScript.cpp @@ -1537,7 +1537,7 @@ static long FnDrawDefMap(C4PropList * _this, long iX, long iY, long iWdt, long i return ::Landscape.DrawDefMap(iX, iY, iWdt, iHgt, FnStringPar(szMapDef), true); } -static bool FnCreateParticleEx(C4PropList * _this, C4String *name, C4Value x, C4Value y, C4Value speedX, C4Value speedY, C4Value lifetime, C4PropList *properties, int amount) +static bool FnCreateParticle(C4PropList * _this, C4String *name, C4Value x, C4Value y, C4Value speedX, C4Value speedY, C4Value lifetime, C4PropList *properties, int amount) { // safety C4Object *obj = Object(_this); @@ -1546,17 +1546,17 @@ static bool FnCreateParticleEx(C4PropList * _this, C4String *name, C4Value x, C4 if (amount <= 0) amount = 1; // get particle - C4ParticleDef *pDef = ::DynamicParticles.definitions.GetDef(FnStringPar(name)); + C4ParticleDef *pDef = ::Particles.definitions.GetDef(FnStringPar(name)); if (!pDef) return false; // construct data - C4DynamicParticleValueProvider valueX, valueY, valueSpeedX, valueSpeedY, valueLifetime; + C4ParticleValueProvider valueX, valueY, valueSpeedX, valueSpeedY, valueLifetime; valueX.Set(x); valueY.Set(y); valueSpeedX.Set(speedX); valueSpeedY.Set(speedY); valueLifetime.Set(lifetime); // create - ::DynamicParticles.Create(pDef, valueX, valueY, valueSpeedX, valueSpeedY, valueLifetime, properties, amount, obj); + ::Particles.Create(pDef, valueX, valueY, valueSpeedX, valueSpeedY, valueLifetime, properties, amount, obj); #endif // success, even if not created return true; @@ -1567,15 +1567,15 @@ static bool FnClearParticles(C4PropList * _this) C4Object *obj; if (obj = Object(_this)) { - if (obj->DynamicBackParticles) - obj->DynamicBackParticles->Clear(); - if (obj->DynamicFrontParticles) - obj->DynamicFrontParticles->Clear(); + if (obj->BackParticles) + obj->BackParticles->Clear(); + if (obj->FrontParticles) + obj->FrontParticles->Clear(); } else { - if (::DynamicParticles.GetGlobalParticles()) - ::DynamicParticles.GetGlobalParticles()->Clear(); + if (::Particles.GetGlobalParticles()) + ::Particles.GetGlobalParticles()->Clear(); } // always return true @@ -2452,7 +2452,7 @@ void InitGameFunctionMap(C4AulScriptEngine *pEngine) AddFunc(pEngine, "MaterialName", FnMaterialName); AddFunc(pEngine, "DrawMap", FnDrawMap); AddFunc(pEngine, "DrawDefMap", FnDrawDefMap); - AddFunc(pEngine, "CreateParticleEx", FnCreateParticleEx); + AddFunc(pEngine, "CreateParticle", FnCreateParticle); AddFunc(pEngine, "ClearParticles", FnClearParticles); AddFunc(pEngine, "SetSkyAdjust", FnSetSkyAdjust); AddFunc(pEngine, "SetMatAdjust", FnSetMatAdjust); diff --git a/src/landscape/C4DynamicParticles.cpp b/src/landscape/C4Particles.cpp similarity index 70% rename from src/landscape/C4DynamicParticles.cpp rename to src/landscape/C4Particles.cpp index c4cad3add..6b73afb3a 100644 --- a/src/landscape/C4DynamicParticles.cpp +++ b/src/landscape/C4Particles.cpp @@ -16,7 +16,7 @@ */ #include -#include +#include // headers for particle loading #include @@ -58,17 +58,17 @@ C4ParticleDef::C4ParticleDef() : C4ParticleDefCore() // zero fields Gfx.Default(); // link into list - if (!DynamicParticles.definitions.first) + if (!Particles.definitions.first) { previous = NULL; - DynamicParticles.definitions.first = this; + Particles.definitions.first = this; } else { - previous = DynamicParticles.definitions.last; + previous = Particles.definitions.last; previous->next = this; } - DynamicParticles.definitions.last = this; + Particles.definitions.last = this; next = 0; } @@ -77,8 +77,8 @@ C4ParticleDef::~C4ParticleDef() // clear Clear(); // unlink from list - if (previous) previous->next = next; else DynamicParticles.definitions.first = next; - if (next) next->previous = previous; else DynamicParticles.definitions.last = previous; + if (previous) previous->next = next; else Particles.definitions.first = next; + if (next) next->previous = previous; else Particles.definitions.last = previous; } void C4ParticleDef::Clear() @@ -121,7 +121,7 @@ bool C4ParticleDef::Load(C4Group &group) // particle overloading C4ParticleDef *def_overload; - if ((def_overload = DynamicParticles.definitions.GetDef(Name.getData(), this))) + if ((def_overload = Particles.definitions.GetDef(Name.getData(), this))) { if (Config.Graphics.VerboseObjectLoading >= 1) { char ostr[250]; sprintf(ostr,LoadResStr("IDS_PRC_DEFOVERLOAD"),def_overload->Name.getData(),""); Log(ostr); } @@ -147,9 +147,9 @@ bool C4ParticleDef::Reload() } #ifndef USE_CONSOLE -const int C4DynamicParticle::DrawingData::vertexCountPerParticle(4); +const int C4Particle::DrawingData::vertexCountPerParticle(4); -void C4DynamicParticle::DrawingData::SetPosition(float x, float y, float size, float rotation, float stretch) +void C4Particle::DrawingData::SetPosition(float x, float y, float size, float rotation, float stretch) { if (size != originalSize || stretch != currentStretch) { @@ -186,7 +186,7 @@ void C4DynamicParticle::DrawingData::SetPosition(float x, float y, float size, f } } -void C4DynamicParticle::DrawingData::SetPhase(int phase, C4ParticleDef *sourceDef) +void C4Particle::DrawingData::SetPhase(int phase, C4ParticleDef *sourceDef) { this->phase = phase; phase = phase % sourceDef->Length; @@ -207,7 +207,7 @@ void C4DynamicParticle::DrawingData::SetPhase(int phase, C4ParticleDef *sourceDe vertices[3].u = xr; vertices[3].v = y; } -C4DynamicParticleValueProvider & C4DynamicParticleValueProvider::operator= (const C4DynamicParticleValueProvider &other) +C4ParticleValueProvider & C4ParticleValueProvider::operator= (const C4ParticleValueProvider &other) { startValue = other.startValue; endValue = other.endValue; @@ -237,19 +237,19 @@ C4DynamicParticleValueProvider & C4DynamicParticleValueProvider::operator= (cons keyFrameIndex = other.keyFrameIndex; break; default: - assert (false && "Trying to copy C4DynamicParticleValueProvider with invalid value type"); + assert (false && "Trying to copy C4ParticleValueProvider with invalid value type"); break; } // copy the other's children, too - for (std::vector::const_iterator iter = other.childrenValueProviders.begin(); iter != other.childrenValueProviders.end(); ++iter) + for (std::vector::const_iterator iter = other.childrenValueProviders.begin(); iter != other.childrenValueProviders.end(); ++iter) { - childrenValueProviders.push_back(new C4DynamicParticleValueProvider(**iter)); // custom copy constructor usage + childrenValueProviders.push_back(new C4ParticleValueProvider(**iter)); // custom copy constructor usage } return (*this); } -void C4DynamicParticleValueProvider::SetParameterValue(int type, const C4Value &value, float C4DynamicParticleValueProvider::*floatVal, int C4DynamicParticleValueProvider::*intVal, size_t keyFrameIndex) +void C4ParticleValueProvider::SetParameterValue(int type, const C4Value &value, float C4ParticleValueProvider::*floatVal, int C4ParticleValueProvider::*intVal, size_t keyFrameIndex) { // just an atomic data type if (value.GetType() == C4V_Int) @@ -264,7 +264,7 @@ void C4DynamicParticleValueProvider::SetParameterValue(int type, const C4Value & else if (value.GetType() == C4V_Array) { // might be another value provider! - C4DynamicParticleValueProvider *child = new C4DynamicParticleValueProvider(); + C4ParticleValueProvider *child = new C4ParticleValueProvider(); childrenValueProviders.push_back(child); child->Set(*value.getArray()); @@ -295,7 +295,7 @@ void C4DynamicParticleValueProvider::SetParameterValue(int type, const C4Value & } } -void C4DynamicParticleValueProvider::UpdatePointerValue(C4DynamicParticle *particle, C4DynamicParticleValueProvider *parent) +void C4ParticleValueProvider::UpdatePointerValue(C4Particle *particle, C4ParticleValueProvider *parent) { switch (typeOfValueToChange) { @@ -313,24 +313,24 @@ void C4DynamicParticleValueProvider::UpdatePointerValue(C4DynamicParticle *parti } } -void C4DynamicParticleValueProvider::UpdateChildren(C4DynamicParticle *particle) +void C4ParticleValueProvider::UpdateChildren(C4Particle *particle) { - for (std::vector::iterator iter = childrenValueProviders.begin(); iter != childrenValueProviders.end(); ++iter) + for (std::vector::iterator iter = childrenValueProviders.begin(); iter != childrenValueProviders.end(); ++iter) { (*iter)->UpdatePointerValue(particle, this); } } -void C4DynamicParticleValueProvider::FloatifyParameterValue(float C4DynamicParticleValueProvider::*value, float denominator, size_t keyFrameIndex) +void C4ParticleValueProvider::FloatifyParameterValue(float C4ParticleValueProvider::*value, float denominator, size_t keyFrameIndex) { if (value == 0) this->keyFrames[keyFrameIndex] /= denominator; else this->*value /= denominator; - for (std::vector::iterator iter = childrenValueProviders.begin(); iter != childrenValueProviders.end(); ++iter) + for (std::vector::iterator iter = childrenValueProviders.begin(); iter != childrenValueProviders.end(); ++iter) { - C4DynamicParticleValueProvider *child = *iter; + C4ParticleValueProvider *child = *iter; if (value == 0) { if (child->typeOfValueToChange == VAL_TYPE_KEYFRAMES && child->keyFrameIndex == keyFrameIndex) @@ -345,22 +345,22 @@ void C4DynamicParticleValueProvider::FloatifyParameterValue(float C4DynamicParti } -void C4DynamicParticleValueProvider::Floatify(float denominator) +void C4ParticleValueProvider::Floatify(float denominator) { - assert (denominator != 0.f && "Trying to floatify C4DynamicParticleValueProvider with denominator of 0"); + assert (denominator != 0.f && "Trying to floatify C4ParticleValueProvider with denominator of 0"); - if (valueFunction == &C4DynamicParticleValueProvider::Direction) + if (valueFunction == &C4ParticleValueProvider::Direction) { - FloatifyParameterValue(&C4DynamicParticleValueProvider::startValue, 1000.f); + FloatifyParameterValue(&C4ParticleValueProvider::startValue, 1000.f); return; } - FloatifyParameterValue(&C4DynamicParticleValueProvider::startValue, denominator); - FloatifyParameterValue(&C4DynamicParticleValueProvider::endValue, denominator); - FloatifyParameterValue(&C4DynamicParticleValueProvider::currentValue, denominator); + FloatifyParameterValue(&C4ParticleValueProvider::startValue, denominator); + FloatifyParameterValue(&C4ParticleValueProvider::endValue, denominator); + FloatifyParameterValue(&C4ParticleValueProvider::currentValue, denominator); // special treatment for keyframes - if (valueFunction == &C4DynamicParticleValueProvider::KeyFrames) + if (valueFunction == &C4ParticleValueProvider::KeyFrames) { for (size_t i = 0; i < keyFrameCount; ++i) { @@ -369,36 +369,36 @@ void C4DynamicParticleValueProvider::Floatify(float denominator) //LogF("KF is %f @ %f", keyFrames[2 * i + 1], keyFrames[2 * i]); } } - else if (valueFunction == &C4DynamicParticleValueProvider::Speed || valueFunction == &C4DynamicParticleValueProvider::Wind || valueFunction == &C4DynamicParticleValueProvider::Gravity) + else if (valueFunction == &C4ParticleValueProvider::Speed || valueFunction == &C4ParticleValueProvider::Wind || valueFunction == &C4ParticleValueProvider::Gravity) { - FloatifyParameterValue(&C4DynamicParticleValueProvider::speedFactor, 1000.0f); + FloatifyParameterValue(&C4ParticleValueProvider::speedFactor, 1000.0f); } } -void C4DynamicParticleValueProvider::RollRandom() +void C4ParticleValueProvider::RollRandom() { float range = endValue - startValue; float rnd = (float)(rand()) / (float)(RAND_MAX); currentValue = startValue + rnd * range; } -float C4DynamicParticleValueProvider::GetValue(C4DynamicParticle *forParticle) +float C4ParticleValueProvider::GetValue(C4Particle *forParticle) { UpdateChildren(forParticle); return (this->*valueFunction)(forParticle); } -float C4DynamicParticleValueProvider::Linear(C4DynamicParticle *forParticle) +float C4ParticleValueProvider::Linear(C4Particle *forParticle) { return startValue + (endValue - startValue) * forParticle->GetRelativeAge(); } -float C4DynamicParticleValueProvider::Const(C4DynamicParticle *forParticle) +float C4ParticleValueProvider::Const(C4Particle *forParticle) { return startValue; } -float C4DynamicParticleValueProvider::Random(C4DynamicParticle *forParticle) +float C4ParticleValueProvider::Random(C4Particle *forParticle) { if ((rerollInterval != 0 && ((int)forParticle->GetAge() % rerollInterval == 0)) || alreadyRolled == 0) { @@ -408,7 +408,7 @@ float C4DynamicParticleValueProvider::Random(C4DynamicParticle *forParticle) return currentValue; } -float C4DynamicParticleValueProvider::Direction(C4DynamicParticle *forParticle) +float C4ParticleValueProvider::Direction(C4Particle *forParticle) { float distX = forParticle->currentSpeedX; float distY = forParticle->currentSpeedY; @@ -419,12 +419,12 @@ float C4DynamicParticleValueProvider::Direction(C4DynamicParticle *forParticle) return startValue * (atan2(distY, distX) + (float)M_PI_2); } -float C4DynamicParticleValueProvider::Step(C4DynamicParticle *forParticle) +float C4ParticleValueProvider::Step(C4Particle *forParticle) { return currentValue + startValue * forParticle->GetAge() / delay; } -float C4DynamicParticleValueProvider::KeyFrames(C4DynamicParticle *forParticle) +float C4ParticleValueProvider::KeyFrames(C4Particle *forParticle) { float age = forParticle->GetRelativeAge(); // todo, implement smoothing @@ -450,7 +450,7 @@ float C4DynamicParticleValueProvider::KeyFrames(C4DynamicParticle *forParticle) return startValue; } -float C4DynamicParticleValueProvider::Speed(C4DynamicParticle *forParticle) +float C4ParticleValueProvider::Speed(C4Particle *forParticle) { float distX = forParticle->currentSpeedX; float distY = forParticle->currentSpeedY; @@ -459,49 +459,49 @@ float C4DynamicParticleValueProvider::Speed(C4DynamicParticle *forParticle) return startValue + speedFactor * speed; } -float C4DynamicParticleValueProvider::Wind(C4DynamicParticle *forParticle) +float C4ParticleValueProvider::Wind(C4Particle *forParticle) { return startValue + (0.01f * speedFactor * ::Weather.GetWind((int)forParticle->positionX, (int)forParticle->positionY)); } -float C4DynamicParticleValueProvider::Gravity(C4DynamicParticle *forParticle) +float C4ParticleValueProvider::Gravity(C4Particle *forParticle) { return startValue + (speedFactor * ::Landscape.Gravity); } -void C4DynamicParticleValueProvider::SetType(C4ParticleValueProviderID what) +void C4ParticleValueProvider::SetType(C4ParticleValueProviderID what) { switch (what) { case C4PV_Const: - valueFunction = &C4DynamicParticleValueProvider::Const; + valueFunction = &C4ParticleValueProvider::Const; break; case C4PV_Linear: - valueFunction = &C4DynamicParticleValueProvider::Linear; + valueFunction = &C4ParticleValueProvider::Linear; break; case C4PV_Random: - valueFunction = &C4DynamicParticleValueProvider::Random; + valueFunction = &C4ParticleValueProvider::Random; break; case C4PV_Direction: - valueFunction = &C4DynamicParticleValueProvider::Direction; + valueFunction = &C4ParticleValueProvider::Direction; break; case C4PV_Step: - valueFunction = &C4DynamicParticleValueProvider::Step; + valueFunction = &C4ParticleValueProvider::Step; break; case C4PV_KeyFrames: - valueFunction = &C4DynamicParticleValueProvider::KeyFrames; + valueFunction = &C4ParticleValueProvider::KeyFrames; break; case C4PV_Speed: - valueFunction = &C4DynamicParticleValueProvider::Speed; + valueFunction = &C4ParticleValueProvider::Speed; break; case C4PV_Wind: - valueFunction = &C4DynamicParticleValueProvider::Wind; + valueFunction = &C4ParticleValueProvider::Wind; break; case C4PV_Gravity: - valueFunction = &C4DynamicParticleValueProvider::Gravity; + valueFunction = &C4ParticleValueProvider::Gravity; break; default: - assert(false && "Invalid C4DynamicParticleValueProvider ID passed"); + assert(false && "Invalid C4ParticleValueProvider ID passed"); }; if (what != C4PV_Const) @@ -510,10 +510,10 @@ void C4DynamicParticleValueProvider::SetType(C4ParticleValueProviderID what) } } -void C4DynamicParticleValueProvider::Set(const C4ValueArray &fromArray) +void C4ParticleValueProvider::Set(const C4ValueArray &fromArray) { startValue = endValue = 1.0f; - valueFunction = &C4DynamicParticleValueProvider::Const; + valueFunction = &C4ParticleValueProvider::Const; size_t arraySize = (size_t) fromArray.GetSize(); if (arraySize < 2) return; @@ -526,7 +526,7 @@ void C4DynamicParticleValueProvider::Set(const C4ValueArray &fromArray) if (arraySize >= 2) { SetType(C4PV_Const); - SetParameterValue(VAL_TYPE_FLOAT, fromArray[1], &C4DynamicParticleValueProvider::startValue); + SetParameterValue(VAL_TYPE_FLOAT, fromArray[1], &C4ParticleValueProvider::startValue); } break; @@ -534,18 +534,18 @@ void C4DynamicParticleValueProvider::Set(const C4ValueArray &fromArray) if (arraySize >= 3) { SetType(C4PV_Linear); - SetParameterValue(VAL_TYPE_FLOAT, fromArray[1], &C4DynamicParticleValueProvider::startValue); - SetParameterValue(VAL_TYPE_FLOAT, fromArray[2], &C4DynamicParticleValueProvider::endValue); + SetParameterValue(VAL_TYPE_FLOAT, fromArray[1], &C4ParticleValueProvider::startValue); + SetParameterValue(VAL_TYPE_FLOAT, fromArray[2], &C4ParticleValueProvider::endValue); } break; case C4PV_Random: if (arraySize >= 3) { SetType(C4PV_Random); - SetParameterValue(VAL_TYPE_FLOAT, fromArray[1], &C4DynamicParticleValueProvider::startValue); - SetParameterValue(VAL_TYPE_FLOAT, fromArray[2], &C4DynamicParticleValueProvider::endValue); + SetParameterValue(VAL_TYPE_FLOAT, fromArray[1], &C4ParticleValueProvider::startValue); + SetParameterValue(VAL_TYPE_FLOAT, fromArray[2], &C4ParticleValueProvider::endValue); if (arraySize >= 4) - SetParameterValue(VAL_TYPE_INT, fromArray[3], 0, &C4DynamicParticleValueProvider::rerollInterval); + SetParameterValue(VAL_TYPE_INT, fromArray[3], 0, &C4ParticleValueProvider::rerollInterval); alreadyRolled = 0; } break; @@ -553,16 +553,16 @@ void C4DynamicParticleValueProvider::Set(const C4ValueArray &fromArray) if (arraySize >= 2) { SetType(C4PV_Direction); - SetParameterValue(VAL_TYPE_FLOAT, fromArray[1], &C4DynamicParticleValueProvider::startValue); + SetParameterValue(VAL_TYPE_FLOAT, fromArray[1], &C4ParticleValueProvider::startValue); } break; case C4PV_Step: if (arraySize >= 2) { SetType(C4PV_Step); - SetParameterValue(VAL_TYPE_FLOAT, fromArray[1], &C4DynamicParticleValueProvider::startValue); - SetParameterValue(VAL_TYPE_FLOAT, fromArray[2], &C4DynamicParticleValueProvider::currentValue); - SetParameterValue(VAL_TYPE_FLOAT, fromArray[3], &C4DynamicParticleValueProvider::delay); + SetParameterValue(VAL_TYPE_FLOAT, fromArray[1], &C4ParticleValueProvider::startValue); + SetParameterValue(VAL_TYPE_FLOAT, fromArray[2], &C4ParticleValueProvider::currentValue); + SetParameterValue(VAL_TYPE_FLOAT, fromArray[3], &C4ParticleValueProvider::delay); if (delay == 0.f) delay = 1.f; } break; @@ -570,7 +570,7 @@ void C4DynamicParticleValueProvider::Set(const C4ValueArray &fromArray) if (arraySize >= 5) { SetType(C4PV_KeyFrames); - SetParameterValue(VAL_TYPE_INT, fromArray[1], 0, &C4DynamicParticleValueProvider::smoothing); + SetParameterValue(VAL_TYPE_INT, fromArray[1], 0, &C4ParticleValueProvider::smoothing); keyFrames.resize(arraySize + 4 - 1); // 2*2 additional information floats at the beginning and ending, offset the first array item, though keyFrameCount = 0; @@ -599,24 +599,24 @@ void C4DynamicParticleValueProvider::Set(const C4ValueArray &fromArray) if (arraySize >= 3) { SetType(C4PV_Speed); - SetParameterValue(VAL_TYPE_FLOAT, fromArray[1], &C4DynamicParticleValueProvider::speedFactor); - SetParameterValue(VAL_TYPE_FLOAT, fromArray[2], &C4DynamicParticleValueProvider::startValue); + SetParameterValue(VAL_TYPE_FLOAT, fromArray[1], &C4ParticleValueProvider::speedFactor); + SetParameterValue(VAL_TYPE_FLOAT, fromArray[2], &C4ParticleValueProvider::startValue); } break; case C4PV_Wind: if (arraySize >= 3) { SetType(C4PV_Wind); - SetParameterValue(VAL_TYPE_FLOAT, fromArray[1], &C4DynamicParticleValueProvider::speedFactor); - SetParameterValue(VAL_TYPE_FLOAT, fromArray[2], &C4DynamicParticleValueProvider::startValue); + SetParameterValue(VAL_TYPE_FLOAT, fromArray[1], &C4ParticleValueProvider::speedFactor); + SetParameterValue(VAL_TYPE_FLOAT, fromArray[2], &C4ParticleValueProvider::startValue); } break; case C4PV_Gravity: if (arraySize >= 3) { SetType(C4PV_Gravity); - SetParameterValue(VAL_TYPE_FLOAT, fromArray[1], &C4DynamicParticleValueProvider::speedFactor); - SetParameterValue(VAL_TYPE_FLOAT, fromArray[2], &C4DynamicParticleValueProvider::startValue); + SetParameterValue(VAL_TYPE_FLOAT, fromArray[1], &C4ParticleValueProvider::speedFactor); + SetParameterValue(VAL_TYPE_FLOAT, fromArray[2], &C4ParticleValueProvider::startValue); } break; default: @@ -625,7 +625,7 @@ void C4DynamicParticleValueProvider::Set(const C4ValueArray &fromArray) } } -void C4DynamicParticleValueProvider::Set(const C4Value &value) +void C4ParticleValueProvider::Set(const C4Value &value) { C4ValueArray *valueArray= value.getArray(); @@ -635,13 +635,13 @@ void C4DynamicParticleValueProvider::Set(const C4Value &value) Set((float)value.getInt()); } -void C4DynamicParticleValueProvider::Set(float to) +void C4ParticleValueProvider::Set(float to) { SetType(C4PV_Const); startValue = endValue = to; } -C4DynamicParticleProperties::C4DynamicParticleProperties() +C4ParticleProperties::C4ParticleProperties() { blitMode = 0; attachment = C4ATTACH_None; @@ -666,7 +666,7 @@ C4DynamicParticleProperties::C4DynamicParticleProperties() phase.Set(0.f); } -void C4DynamicParticleProperties::Floatify() +void C4ParticleProperties::Floatify() { bouncyness /= 1000.f; @@ -687,7 +687,7 @@ void C4DynamicParticleProperties::Floatify() hasConstantColor = colorR.IsConstant() && colorG.IsConstant() && colorB.IsConstant() && colorAlpha.IsConstant(); } -void C4DynamicParticleProperties::Set(C4PropList *dataSource) +void C4ParticleProperties::Set(C4PropList *dataSource) { if (!dataSource) return; @@ -772,7 +772,7 @@ void C4DynamicParticleProperties::Set(C4PropList *dataSource) } -void C4DynamicParticleProperties::SetCollisionFunc(const C4Value &source) +void C4ParticleProperties::SetCollisionFunc(const C4Value &source) { C4ValueArray *valueArray; if (!(valueArray = source.getArray())) return; @@ -785,16 +785,16 @@ void C4DynamicParticleProperties::SetCollisionFunc(const C4Value &source) switch (type) { case C4PC_Die: - collisionCallback = &C4DynamicParticleProperties::CollisionDie; + collisionCallback = &C4ParticleProperties::CollisionDie; break; case C4PC_Bounce: - collisionCallback = &C4DynamicParticleProperties::CollisionBounce; + collisionCallback = &C4ParticleProperties::CollisionBounce; bouncyness = 1.f; if (arraySize >= 2) bouncyness = ((float)(*valueArray)[1].getInt()); break; case C4PC_Stop: - collisionCallback = &C4DynamicParticleProperties::CollisionStop; + collisionCallback = &C4ParticleProperties::CollisionStop; break; default: assert(false); @@ -802,28 +802,28 @@ void C4DynamicParticleProperties::SetCollisionFunc(const C4Value &source) } } -bool C4DynamicParticleProperties::CollisionBounce(C4DynamicParticle *forParticle) +bool C4ParticleProperties::CollisionBounce(C4Particle *forParticle) { forParticle->currentSpeedX = -forParticle->currentSpeedX * bouncyness; forParticle->currentSpeedY = -forParticle->currentSpeedY * bouncyness; return true; } -bool C4DynamicParticleProperties::CollisionStop(C4DynamicParticle *forParticle) +bool C4ParticleProperties::CollisionStop(C4Particle *forParticle) { forParticle->currentSpeedX = 0.f; forParticle->currentSpeedY = 0.f; return true; } -void C4DynamicParticle::Init() +void C4Particle::Init() { currentSpeedX = currentSpeedY = 0.f; positionX = positionY = 0.f; lifetime = startingLifetime = 5.f * 38.f; } -bool C4DynamicParticle::Exec(C4Object *obj, float timeDelta, C4ParticleDef *sourceDef) +bool C4Particle::Exec(C4Object *obj, float timeDelta, C4ParticleDef *sourceDef) { // die of old age? :< lifetime -= timeDelta; @@ -892,7 +892,7 @@ bool C4DynamicParticle::Exec(C4Object *obj, float timeDelta, C4ParticleDef *sour return true; } -void C4DynamicParticleChunk::Clear() +void C4ParticleChunk::Clear() { for (size_t i = 0; i < particleCount; ++i) { @@ -903,22 +903,22 @@ void C4DynamicParticleChunk::Clear() vertexCoordinates.clear(); } -void C4DynamicParticleChunk::DeleteAndReplaceParticle(size_t indexToReplace, size_t indexFrom) +void C4ParticleChunk::DeleteAndReplaceParticle(size_t indexToReplace, size_t indexFrom) { - C4DynamicParticle *oldParticle = particles[indexToReplace]; + C4Particle *oldParticle = particles[indexToReplace]; // try to replace the soon-to-be empty slot in the array if (indexFrom != indexToReplace) // false when "replacing" the last one { - std::copy(&vertexCoordinates[indexFrom * C4DynamicParticle::DrawingData::vertexCountPerParticle], &vertexCoordinates[indexFrom * C4DynamicParticle::DrawingData::vertexCountPerParticle] + C4DynamicParticle::DrawingData::vertexCountPerParticle, &vertexCoordinates[indexToReplace * C4DynamicParticle::DrawingData::vertexCountPerParticle]); + std::copy(&vertexCoordinates[indexFrom * C4Particle::DrawingData::vertexCountPerParticle], &vertexCoordinates[indexFrom * C4Particle::DrawingData::vertexCountPerParticle] + C4Particle::DrawingData::vertexCountPerParticle, &vertexCoordinates[indexToReplace * C4Particle::DrawingData::vertexCountPerParticle]); particles[indexToReplace] = particles[indexFrom]; - particles[indexToReplace]->drawingData.SetPointer(&vertexCoordinates[indexToReplace * C4DynamicParticle::DrawingData::vertexCountPerParticle]); + particles[indexToReplace]->drawingData.SetPointer(&vertexCoordinates[indexToReplace * C4Particle::DrawingData::vertexCountPerParticle]); } delete oldParticle; } -bool C4DynamicParticleChunk::Exec(C4Object *obj, float timeDelta) +bool C4ParticleChunk::Exec(C4Object *obj, float timeDelta) { for (size_t i = 0; i < particleCount; ++i) { @@ -931,10 +931,10 @@ bool C4DynamicParticleChunk::Exec(C4Object *obj, float timeDelta) return particleCount > 0; } -void C4DynamicParticleChunk::Draw(C4TargetFacet cgo, C4Object *obj) +void C4ParticleChunk::Draw(C4TargetFacet cgo, C4Object *obj) { if (particleCount == 0) return; - const int stride = sizeof(C4DynamicParticle::DrawingData::Vertex); + const int stride = sizeof(C4Particle::DrawingData::Vertex); assert(sourceDefinition && "No source definition assigned to particle chunk."); C4TexRef *textureRef = (*sourceDefinition->Gfx.GetFace().ppTex); assert(textureRef != 0 && "Particle definition had no texture assigned."); @@ -960,67 +960,67 @@ void C4DynamicParticleChunk::Draw(C4TargetFacet cgo, C4Object *obj) glTexCoordPointer(2, GL_FLOAT, stride, &(vertexCoordinates[0].u)); glColorPointer(4, GL_FLOAT, stride, &(vertexCoordinates[0].r)); - if (!DynamicParticles.usePrimitiveRestartIndexWorkaround) + if (!Particles.usePrimitiveRestartIndexWorkaround) { - glDrawElements(GL_TRIANGLE_STRIP, static_cast (5 * particleCount), GL_UNSIGNED_INT, ::DynamicParticles.GetPrimitiveRestartArray()); + glDrawElements(GL_TRIANGLE_STRIP, static_cast (5 * particleCount), GL_UNSIGNED_INT, ::Particles.GetPrimitiveRestartArray()); } else { - glMultiDrawElements(GL_TRIANGLE_STRIP, ::DynamicParticles.GetMultiDrawElementsCountArray(), GL_UNSIGNED_INT, const_cast(::DynamicParticles.GetMultiDrawElementsIndexArray()), static_cast (particleCount)); + glMultiDrawElements(GL_TRIANGLE_STRIP, ::Particles.GetMultiDrawElementsCountArray(), GL_UNSIGNED_INT, const_cast(::Particles.GetMultiDrawElementsIndexArray()), static_cast (particleCount)); } if (resetMatrix) glPopMatrix(); } -bool C4DynamicParticleChunk::IsOfType(C4ParticleDef *def, uint32_t _blitMode, uint32_t _attachment) const +bool C4ParticleChunk::IsOfType(C4ParticleDef *def, uint32_t _blitMode, uint32_t _attachment) const { return def == sourceDefinition && blitMode == _blitMode && attachment == _attachment; } -void C4DynamicParticleChunk::ReserveSpace(uint32_t forAmount) +void C4ParticleChunk::ReserveSpace(uint32_t forAmount) { uint32_t newSize = static_cast(particleCount) + forAmount + 1; - ::DynamicParticles.PreparePrimitiveRestartIndices(newSize); + ::Particles.PreparePrimitiveRestartIndices(newSize); if (particles.capacity() < newSize) particles.reserve(std::max(newSize, particles.capacity() * 2)); // resizing the points vector is relatively costly, hopefully we only do it rarely - while (vertexCoordinates.capacity() <= newSize * C4DynamicParticle::DrawingData::vertexCountPerParticle) + while (vertexCoordinates.capacity() <= newSize * C4Particle::DrawingData::vertexCountPerParticle) { - vertexCoordinates.reserve(std::max(C4DynamicParticle::DrawingData::vertexCountPerParticle * newSize, vertexCoordinates.capacity() * 2)); + vertexCoordinates.reserve(std::max(C4Particle::DrawingData::vertexCountPerParticle * newSize, vertexCoordinates.capacity() * 2)); // update all existing particles' pointers.. for (size_t i = 0; i < particleCount; ++i) - particles[i]->drawingData.SetPointer(&vertexCoordinates[i * C4DynamicParticle::DrawingData::vertexCountPerParticle]); + particles[i]->drawingData.SetPointer(&vertexCoordinates[i * C4Particle::DrawingData::vertexCountPerParticle]); } } -C4DynamicParticle *C4DynamicParticleChunk::AddNewParticle() +C4Particle *C4ParticleChunk::AddNewParticle() { size_t currentIndex = particleCount++; if (currentIndex < particles.size()) { - particles[currentIndex] = new C4DynamicParticle(); + particles[currentIndex] = new C4Particle(); } else { - particles.push_back(new C4DynamicParticle()); - vertexCoordinates.resize(vertexCoordinates.size() + C4DynamicParticle::DrawingData::vertexCountPerParticle); + particles.push_back(new C4Particle()); + vertexCoordinates.resize(vertexCoordinates.size() + C4Particle::DrawingData::vertexCountPerParticle); } - C4DynamicParticle *newParticle = particles[currentIndex]; - newParticle->drawingData.SetPointer(&vertexCoordinates[currentIndex * C4DynamicParticle::DrawingData::vertexCountPerParticle], true); + C4Particle *newParticle = particles[currentIndex]; + newParticle->drawingData.SetPointer(&vertexCoordinates[currentIndex * C4Particle::DrawingData::vertexCountPerParticle], true); return newParticle; } -void C4DynamicParticleList::Exec(float timeDelta) +void C4ParticleList::Exec(float timeDelta) { if (particleChunks.empty()) return; accessMutex.Enter(); - for (std::list::iterator iter = particleChunks.begin(); iter != particleChunks.end();) + for (std::list::iterator iter = particleChunks.begin(); iter != particleChunks.end();) { if (iter->Exec(targetObject, timeDelta)) { @@ -1036,7 +1036,7 @@ void C4DynamicParticleList::Exec(float timeDelta) accessMutex.Leave(); } -void C4DynamicParticleList::Draw(C4TargetFacet cgo, C4Object *obj) +void C4ParticleList::Draw(C4TargetFacet cgo, C4Object *obj) { if (particleChunks.empty()) return; @@ -1048,7 +1048,7 @@ void C4DynamicParticleList::Draw(C4TargetFacet cgo, C4Object *obj) glEnable(GL_TEXTURE_2D); - if (!DynamicParticles.usePrimitiveRestartIndexWorkaround) + if (!Particles.usePrimitiveRestartIndexWorkaround) { glPrimitiveRestartIndex(0xffffffff); glEnable(GL_PRIMITIVE_RESTART); @@ -1069,7 +1069,7 @@ void C4DynamicParticleList::Draw(C4TargetFacet cgo, C4Object *obj) accessMutex.Enter(); - for (std::list::iterator iter = particleChunks.begin(); iter != particleChunks.end(); ++iter) + for (std::list::iterator iter = particleChunks.begin(); iter != particleChunks.end(); ++iter) { iter->Draw(cgo, obj); } @@ -1082,32 +1082,32 @@ void C4DynamicParticleList::Draw(C4TargetFacet cgo, C4Object *obj) glPopMatrix(); - if (!DynamicParticles.usePrimitiveRestartIndexWorkaround) + if (!Particles.usePrimitiveRestartIndexWorkaround) { glDisable(GL_PRIMITIVE_RESTART); } glDisable(GL_TEXTURE_2D); } -void C4DynamicParticleList::Clear() +void C4ParticleList::Clear() { accessMutex.Enter(); particleChunks.clear(); accessMutex.Leave(); } -C4DynamicParticleChunk *C4DynamicParticleList::GetFittingParticleChunk(C4ParticleDef *def, uint32_t blitMode, uint32_t attachment, bool alreadyLocked) +C4ParticleChunk *C4ParticleList::GetFittingParticleChunk(C4ParticleDef *def, uint32_t blitMode, uint32_t attachment, bool alreadyLocked) { if (!alreadyLocked) accessMutex.Enter(); // if not cached, find correct chunk in list - C4DynamicParticleChunk *chunk = 0; + C4ParticleChunk *chunk = 0; if (lastAccessedChunk && lastAccessedChunk->IsOfType(def, blitMode, attachment)) chunk = lastAccessedChunk; else { - for (std::list::iterator iter = particleChunks.begin(); iter != particleChunks.end(); ++iter) + for (std::list::iterator iter = particleChunks.begin(); iter != particleChunks.end(); ++iter) { if (!iter->IsOfType(def, blitMode, attachment)) continue; chunk = &(*iter); @@ -1118,7 +1118,7 @@ C4DynamicParticleChunk *C4DynamicParticleList::GetFittingParticleChunk(C4Particl // add new chunk? if (!chunk) { - particleChunks.push_back(C4DynamicParticleChunk()); + particleChunks.push_back(C4ParticleChunk()); chunk = &particleChunks.back(); chunk->sourceDefinition = def; chunk->blitMode = blitMode; @@ -1134,19 +1134,19 @@ C4DynamicParticleChunk *C4DynamicParticleList::GetFittingParticleChunk(C4Particl return chunk; } -void C4DynamicParticleSystem::CalculationThread::Execute() +void C4ParticleSystem::CalculationThread::Execute() { - DynamicParticles.ExecuteCalculation(); + Particles.ExecuteCalculation(); } -C4DynamicParticleSystem::C4DynamicParticleSystem() : frameCounterAdvancedEvent(false) +C4ParticleSystem::C4ParticleSystem() : frameCounterAdvancedEvent(false) { currentSimulationTime = 0; globalParticles = 0; usePrimitiveRestartIndexWorkaround = false; } -C4DynamicParticleSystem::~C4DynamicParticleSystem() +C4ParticleSystem::~C4ParticleSystem() { Clear(); @@ -1157,7 +1157,7 @@ C4DynamicParticleSystem::~C4DynamicParticleSystem() delete (*iter); } -void C4DynamicParticleSystem::DoInit() +void C4ParticleSystem::DoInit() { // we use features that are only supported from 3.1 upwards. Check whether the graphics card supports that and - if not - use workarounds if (!GLEW_VERSION_3_1 || (glPrimitiveRestartIndex == 0)) @@ -1167,7 +1167,7 @@ void C4DynamicParticleSystem::DoInit() } } -void C4DynamicParticleSystem::ExecuteCalculation() +void C4ParticleSystem::ExecuteCalculation() { frameCounterAdvancedEvent.WaitFor(INFINITE); frameCounterAdvancedEvent.Reset(); @@ -1182,7 +1182,7 @@ void C4DynamicParticleSystem::ExecuteCalculation() particleListAccessMutex.Enter(); - for (std::list::iterator iter = particleLists.begin(); iter != particleLists.end(); ++iter) + for (std::list::iterator iter = particleLists.begin(); iter != particleLists.end(); ++iter) { iter->Exec(timeDelta); } @@ -1192,12 +1192,12 @@ void C4DynamicParticleSystem::ExecuteCalculation() } #endif -C4DynamicParticleList *C4DynamicParticleSystem::GetNewParticleList(C4Object *forObject) +C4ParticleList *C4ParticleSystem::GetNewParticleList(C4Object *forObject) { #ifdef USE_CONSOLE return 0; #else - C4DynamicParticleList *newList = 0; + C4ParticleList *newList = 0; particleListAccessMutex.Enter(); particleLists.emplace_back(forObject); @@ -1208,14 +1208,14 @@ C4DynamicParticleList *C4DynamicParticleSystem::GetNewParticleList(C4Object *for #endif } -void C4DynamicParticleSystem::ReleaseParticleList(C4DynamicParticleList *first, C4DynamicParticleList *second) +void C4ParticleSystem::ReleaseParticleList(C4ParticleList *first, C4ParticleList *second) { #ifndef USE_CONSOLE particleListAccessMutex.Enter(); - for(std::list::iterator iter = particleLists.begin(); iter != particleLists.end();) + for(std::list::iterator iter = particleLists.begin(); iter != particleLists.end();) { - C4DynamicParticleList *list = &(*iter); + C4ParticleList *list = &(*iter); if (list == first || list == second) { iter = particleLists.erase(iter); @@ -1231,16 +1231,16 @@ void C4DynamicParticleSystem::ReleaseParticleList(C4DynamicParticleList *first, } #ifndef USE_CONSOLE -void C4DynamicParticleSystem::Create(C4ParticleDef *of_def, C4DynamicParticleValueProvider &x, C4DynamicParticleValueProvider &y, C4DynamicParticleValueProvider &speedX, C4DynamicParticleValueProvider &speedY, C4DynamicParticleValueProvider &lifetime, C4PropList *properties, int amount, C4Object *object) +void C4ParticleSystem::Create(C4ParticleDef *of_def, C4ParticleValueProvider &x, C4ParticleValueProvider &y, C4ParticleValueProvider &speedX, C4ParticleValueProvider &speedY, C4ParticleValueProvider &lifetime, C4PropList *properties, int amount, C4Object *object) { // todo: check amount etc - C4DynamicParticleList * pxList(globalParticles); + C4ParticleList * pxList(globalParticles); // initialize the particle properties // this is done here, because it would also be the right place to implement caching - C4DynamicParticleProperties particleProperties; + C4ParticleProperties particleProperties; particleProperties.Set(properties); speedX.Floatify(10.f); @@ -1265,12 +1265,12 @@ void C4DynamicParticleSystem::Create(C4ParticleDef *of_def, C4DynamicParticleVal // move relative implies that the particle needs to be in the object's particle list (back OR front) // just select the front particles here - will be overwritten below if necessary - pxList = object->DynamicFrontParticles; + pxList = object->FrontParticles; } // figure out particle list to use - if (particleProperties.attachment & C4ATTACH_Front) pxList = object->DynamicFrontParticles; - else if (particleProperties.attachment & C4ATTACH_Back) pxList = object->DynamicBackParticles; + if (particleProperties.attachment & C4ATTACH_Front) pxList = object->FrontParticles; + else if (particleProperties.attachment & C4ATTACH_Back) pxList = object->BackParticles; } // sanity for global particles - might have to be created first @@ -1286,7 +1286,7 @@ void C4DynamicParticleSystem::Create(C4ParticleDef *of_def, C4DynamicParticleVal pxList->Lock(); // retrieve the fitting chunk for the particle (note that we tell the particle list, we already locked it) - C4DynamicParticleChunk *chunk = pxList->GetFittingParticleChunk(of_def, particleProperties.blitMode, particleProperties.attachment, true); + C4ParticleChunk *chunk = pxList->GetFittingParticleChunk(of_def, particleProperties.blitMode, particleProperties.attachment, true); // set up chunk to be able to contain enough particles chunk->ReserveSpace(static_cast(amount)); @@ -1300,7 +1300,7 @@ void C4DynamicParticleSystem::Create(C4ParticleDef *of_def, C4DynamicParticleVal if (lifetime.IsRandom()) lifetime.RollRandom(); // create a particle in the fitting chunk (note that we tell the particle list, we already locked it) - C4DynamicParticle *particle = chunk->AddNewParticle(); + C4Particle *particle = chunk->AddNewParticle(); // initialize some more properties particle->properties = particleProperties; @@ -1324,7 +1324,7 @@ void C4DynamicParticleSystem::Create(C4ParticleDef *of_def, C4DynamicParticleVal pxList->Unlock(); } -void C4DynamicParticleSystem::PreparePrimitiveRestartIndices(uint32_t forAmount) +void C4ParticleSystem::PreparePrimitiveRestartIndices(uint32_t forAmount) { if (!usePrimitiveRestartIndexWorkaround) { @@ -1383,7 +1383,7 @@ void C4DynamicParticleSystem::PreparePrimitiveRestartIndices(uint32_t forAmount) } #endif -void C4DynamicParticleSystem::Clear() +void C4ParticleSystem::Clear() { #ifndef USE_CONSOLE currentSimulationTime = 0; @@ -1393,14 +1393,14 @@ void C4DynamicParticleSystem::Clear() definitions.Clear(); } -void C4DynamicParticleSystem::ClearAllParticles() +void C4ParticleSystem::ClearAllParticles() { particleListAccessMutex.Enter(); particleLists.clear(); particleListAccessMutex.Leave(); } -C4ParticleDef *C4DynamicParticleSystemDefinitionList::GetDef(const char *name, C4ParticleDef *exclude) +C4ParticleDef *C4ParticleSystemDefinitionList::GetDef(const char *name, C4ParticleDef *exclude) { #ifndef USE_CONSOLE // seek list @@ -1413,11 +1413,11 @@ C4ParticleDef *C4DynamicParticleSystemDefinitionList::GetDef(const char *name, C } #ifndef USE_CONSOLE -void C4DynamicParticleSystemDefinitionList::Clear() +void C4ParticleSystemDefinitionList::Clear() { // the particle definitions update the list in their destructor while (first) delete first; } #endif -C4DynamicParticleSystem DynamicParticles; +C4ParticleSystem Particles; diff --git a/src/landscape/C4DynamicParticles.h b/src/landscape/C4Particles.h similarity index 66% rename from src/landscape/C4DynamicParticles.h rename to src/landscape/C4Particles.h index 9e1b14070..63f483544 100644 --- a/src/landscape/C4DynamicParticles.h +++ b/src/landscape/C4Particles.h @@ -21,8 +21,8 @@ #include -#ifndef INC_C4DynamicParticles -#define INC_C4DynamicParticles +#ifndef INC_C4Particles +#define INC_C4Particles enum C4ParticleValueProviderID { @@ -54,11 +54,11 @@ enum C4ParticleCollisionFuncID class C4ParticleDefCore; class C4ParticleDef; -class C4DynamicParticleList; -class C4DynamicParticleChunk; -class C4DynamicParticle; -class C4DynamicParticleProperties; -class C4DynamicParticleValueProvider; +class C4ParticleList; +class C4ParticleChunk; +class C4Particle; +class C4ParticleProperties; +class C4ParticleValueProvider; // core for particle defs class C4ParticleDefCore @@ -95,12 +95,12 @@ public: bool Reload(); // reload particle from stored position }; -typedef float (C4DynamicParticleValueProvider::*C4DynamicParticleValueProviderFunction) (C4DynamicParticle*); -typedef bool (C4DynamicParticleProperties::*C4DynamicParticleCollisionCallback) (C4DynamicParticle*); +typedef float (C4ParticleValueProvider::*C4ParticleValueProviderFunction) (C4Particle*); +typedef bool (C4ParticleProperties::*C4ParticleCollisionCallback) (C4Particle*); #ifndef USE_CONSOLE // the value providers are used to change the attributes of a particle over the lifetime -class C4DynamicParticleValueProvider +class C4ParticleValueProvider { protected: float startValue, endValue; @@ -124,15 +124,15 @@ protected: size_t keyFrameCount; std::vector keyFrames; - C4DynamicParticleValueProviderFunction valueFunction; + C4ParticleValueProviderFunction valueFunction; bool isConstant; - std::vector childrenValueProviders; + std::vector childrenValueProviders; union { - float C4DynamicParticleValueProvider::*floatValueToChange; - int C4DynamicParticleValueProvider::*intValueToChange; + float C4ParticleValueProvider::*floatValueToChange; + int C4ParticleValueProvider::*intValueToChange; size_t keyFrameIndex; }; enum @@ -144,21 +144,21 @@ protected: int typeOfValueToChange; public: - void UpdatePointerValue(C4DynamicParticle *particle, C4DynamicParticleValueProvider *parent); - void UpdateChildren(C4DynamicParticle *particle); - void FloatifyParameterValue(float C4DynamicParticleValueProvider::*value, float denominator, size_t keyFrameIndex = 0); - void SetParameterValue(int type, const C4Value &value, float C4DynamicParticleValueProvider::*floatVal, int C4DynamicParticleValueProvider::*intVal = 0, size_t keyFrameIndex = 0); + void UpdatePointerValue(C4Particle *particle, C4ParticleValueProvider *parent); + void UpdateChildren(C4Particle *particle); + void FloatifyParameterValue(float C4ParticleValueProvider::*value, float denominator, size_t keyFrameIndex = 0); + void SetParameterValue(int type, const C4Value &value, float C4ParticleValueProvider::*floatVal, int C4ParticleValueProvider::*intVal = 0, size_t keyFrameIndex = 0); bool IsConstant() const { return isConstant; } - bool IsRandom() const { return valueFunction == &C4DynamicParticleValueProvider::Random; } - C4DynamicParticleValueProvider() : startValue(0.f), endValue(0.f), currentValue(0.f), rerollInterval(0), smoothing(0), valueFunction(0), keyFrameCount(0), isConstant(true), floatValueToChange(0), typeOfValueToChange(VAL_TYPE_FLOAT) { } - ~C4DynamicParticleValueProvider() + bool IsRandom() const { return valueFunction == &C4ParticleValueProvider::Random; } + C4ParticleValueProvider() : startValue(0.f), endValue(0.f), currentValue(0.f), rerollInterval(0), smoothing(0), valueFunction(0), keyFrameCount(0), isConstant(true), floatValueToChange(0), typeOfValueToChange(VAL_TYPE_FLOAT) { } + ~C4ParticleValueProvider() { - for (std::vector::iterator iter = childrenValueProviders.begin(); iter != childrenValueProviders.end(); ++iter) + for (std::vector::iterator iter = childrenValueProviders.begin(); iter != childrenValueProviders.end(); ++iter) delete *iter; } - C4DynamicParticleValueProvider(const C4DynamicParticleValueProvider &other) { *this = other; } - C4DynamicParticleValueProvider & operator= (const C4DynamicParticleValueProvider &other); + C4ParticleValueProvider(const C4ParticleValueProvider &other) { *this = other; } + C4ParticleValueProvider & operator= (const C4ParticleValueProvider &other); void RollRandom(); // divides by denominator @@ -168,43 +168,43 @@ public: void Set(const C4Value &value); void Set(const C4ValueArray &fromArray); void Set(float to); // constant - float GetValue(C4DynamicParticle *forParticle); + float GetValue(C4Particle *forParticle); - float Linear(C4DynamicParticle *forParticle); - float Const(C4DynamicParticle *forParticle); - float Random(C4DynamicParticle *forParticle); - float KeyFrames(C4DynamicParticle *forParticle); - float Direction(C4DynamicParticle *forParticle); - float Step(C4DynamicParticle *forParticle); - float Speed(C4DynamicParticle *forParticle); - float Wind(C4DynamicParticle *forParticle); - float Gravity(C4DynamicParticle *forParticle); + float Linear(C4Particle *forParticle); + float Const(C4Particle *forParticle); + float Random(C4Particle *forParticle); + float KeyFrames(C4Particle *forParticle); + float Direction(C4Particle *forParticle); + float Step(C4Particle *forParticle); + float Speed(C4Particle *forParticle); + float Wind(C4Particle *forParticle); + float Gravity(C4Particle *forParticle); }; // the properties are part of every particle and contain certain changeable attributes -class C4DynamicParticleProperties +class C4ParticleProperties { public: bool hasConstantColor; bool hasCollisionVertex; - C4DynamicParticleValueProvider size, stretch; - C4DynamicParticleValueProvider forceX, forceY; - C4DynamicParticleValueProvider speedDampingX, speedDampingY; - C4DynamicParticleValueProvider colorR, colorG, colorB, colorAlpha; - C4DynamicParticleValueProvider rotation; - C4DynamicParticleValueProvider phase; - C4DynamicParticleValueProvider collisionVertex; + C4ParticleValueProvider size, stretch; + C4ParticleValueProvider forceX, forceY; + C4ParticleValueProvider speedDampingX, speedDampingY; + C4ParticleValueProvider colorR, colorG, colorB, colorAlpha; + C4ParticleValueProvider rotation; + C4ParticleValueProvider phase; + C4ParticleValueProvider collisionVertex; float bouncyness; - C4DynamicParticleCollisionCallback collisionCallback; + C4ParticleCollisionCallback collisionCallback; void SetCollisionFunc(const C4Value &source); uint32_t blitMode; uint32_t attachment; - C4DynamicParticleProperties(); + C4ParticleProperties(); void Set(C4PropList *dataSource); @@ -212,13 +212,13 @@ public: void Floatify(); - bool CollisionDie(C4DynamicParticle *forParticle) { return false; } - bool CollisionBounce(C4DynamicParticle *forParticle); - bool CollisionStop(C4DynamicParticle *forParticle); + bool CollisionDie(C4Particle *forParticle) { return false; } + bool CollisionBounce(C4Particle *forParticle); + bool CollisionStop(C4Particle *forParticle); }; // one single particle -class C4DynamicParticle +class C4Particle { public: @@ -297,7 +297,7 @@ protected: float positionX, positionY; float lifetime, startingLifetime; - C4DynamicParticleProperties properties; + C4ParticleProperties properties; public: float GetAge() const { return startingLifetime - lifetime; } @@ -305,7 +305,7 @@ public: float GetRelativeAge() const { return (startingLifetime != 0.f) ? (1.0f - (lifetime / startingLifetime)) : 0.f; } void Init(); - C4DynamicParticle() { Init(); } + C4Particle() { Init(); } void SetPosition(float x, float y) { @@ -316,14 +316,14 @@ public: bool Exec(C4Object *obj, float timeDelta, C4ParticleDef *sourceDef); - friend class C4DynamicParticleProperties; - friend class C4DynamicParticleValueProvider; - friend class C4DynamicParticleChunk; - friend class C4DynamicParticleSystem; + friend class C4ParticleProperties; + friend class C4ParticleValueProvider; + friend class C4ParticleChunk; + friend class C4ParticleSystem; }; // a chunk contains all of the single particles that can be drawn with one draw call (~"have certain similar attributes") -class C4DynamicParticleChunk +class C4ParticleChunk { private: C4ParticleDef *sourceDefinition; @@ -333,18 +333,18 @@ private: // whether the particles are translated according to the object's position uint32_t attachment; - std::vector particles; - std::vector vertexCoordinates; + std::vector particles; + std::vector vertexCoordinates; size_t particleCount; // delete the particle at indexTo. If possible, replace it with the particle at indexFrom to keep the particles tighly packed void DeleteAndReplaceParticle(size_t indexToReplace, size_t indexFrom); public: - C4DynamicParticleChunk() : sourceDefinition(0), blitMode(0), attachment(C4ATTACH_None), particleCount(0) + C4ParticleChunk() : sourceDefinition(0), blitMode(0), attachment(C4ATTACH_None), particleCount(0) { } - ~C4DynamicParticleChunk() + ~C4ParticleChunk() { Clear(); } @@ -355,30 +355,30 @@ public: bool IsOfType(C4ParticleDef *def, uint32_t _blitMode, uint32_t attachment) const; // before adding a particle, you should ReserveSpace for it - C4DynamicParticle *AddNewParticle(); + C4Particle *AddNewParticle(); // sets up internal data structures to be large enough for the passed amount of ADDITIONAL particles void ReserveSpace(uint32_t forAmount); - friend class C4DynamicParticleList; + friend class C4ParticleList; }; // this class must not be copied, because deleting the contained CStdCSec twice would be fatal // a particle list belongs to a game-world entity (objects or global particles) and contains the chunks associated with that entity -class C4DynamicParticleList : public boost::noncopyable +class C4ParticleList : public boost::noncopyable { private: - std::list particleChunks; + std::list particleChunks; C4Object *targetObject; // caching.. - C4DynamicParticleChunk *lastAccessedChunk; + C4ParticleChunk *lastAccessedChunk; // for making sure that the list is not drawn and calculated at the same time CStdCSec accessMutex; public: - C4DynamicParticleList(C4Object *obj = 0) : targetObject(obj), lastAccessedChunk(0) + C4ParticleList(C4Object *obj = 0) : targetObject(obj), lastAccessedChunk(0) { } @@ -392,20 +392,20 @@ public: void Exec(float timeDelta = 1.f); void Draw(C4TargetFacet cgo, C4Object *obj); - C4DynamicParticleChunk *GetFittingParticleChunk(C4ParticleDef *def, uint32_t blitMode, uint32_t attachment, bool alreadyLocked); - C4DynamicParticle *AddNewParticle(C4ParticleDef *def, uint32_t blitMode, uint32_t attachment, bool alreadyLocked, int remaining = 0); + C4ParticleChunk *GetFittingParticleChunk(C4ParticleDef *def, uint32_t blitMode, uint32_t attachment, bool alreadyLocked); + C4Particle *AddNewParticle(C4ParticleDef *def, uint32_t blitMode, uint32_t attachment, bool alreadyLocked, int remaining = 0); }; #endif // cares for the management of particle definitions -class C4DynamicParticleSystemDefinitionList +class C4ParticleSystemDefinitionList { #ifndef USE_CONSOLE private: // pointers to the last and first element of linked list of particle definitions C4ParticleDef *first, *last; public: - C4DynamicParticleSystemDefinitionList() : first(0), last(0) {} + C4ParticleSystemDefinitionList() : first(0), last(0) {} void Clear(); #endif C4ParticleDef *GetDef(const char *name, C4ParticleDef *exclude=0); @@ -414,7 +414,7 @@ public: }; // the global particle system interface class -class C4DynamicParticleSystem +class C4ParticleSystem { #ifndef USE_CONSOLE class CalculationThread : public StdThread @@ -434,7 +434,7 @@ private: std::vector multiDrawElementsCountArray; std::vector multiDrawElementsIndexArray; #endif - std::list particleLists; + std::list particleLists; CalculationThread calculationThread; CStdCSec particleListAccessMutex; @@ -445,13 +445,13 @@ private: // calculates the physics in all of the existing particle lists void ExecuteCalculation(); - C4DynamicParticleList *globalParticles; + C4ParticleList *globalParticles; #endif public: #ifndef USE_CONSOLE - C4DynamicParticleSystem(); - ~C4DynamicParticleSystem(); + C4ParticleSystem(); + ~C4ParticleSystem(); #endif // called to allow the particle system the simulation of another step void CalculateNextStep() @@ -470,7 +470,7 @@ public: #endif } - C4DynamicParticleList *GetGlobalParticles() + C4ParticleList *GetGlobalParticles() { #ifndef USE_CONSOLE return globalParticles; @@ -479,12 +479,12 @@ public: #endif } - C4DynamicParticleList *GetNewParticleList(C4Object *forTarget = 0); + C4ParticleList *GetNewParticleList(C4Object *forTarget = 0); // releases up to 2 lists - void ReleaseParticleList(C4DynamicParticleList *first, C4DynamicParticleList *second = 0); + void ReleaseParticleList(C4ParticleList *first, C4ParticleList *second = 0); // interface for particle definitions - C4DynamicParticleSystemDefinitionList definitions; + C4ParticleSystemDefinitionList definitions; #ifndef USE_CONSOLE // on some graphics card, glPrimitiveRestartIndex might not be supported @@ -497,7 +497,7 @@ public: void *GetPrimitiveRestartArray() { return (void*)&primitiveRestartIndices[0]; } // creates a new particle - void Create(C4ParticleDef *of_def, C4DynamicParticleValueProvider &x, C4DynamicParticleValueProvider &y, C4DynamicParticleValueProvider &speedX, C4DynamicParticleValueProvider &speedY, C4DynamicParticleValueProvider &lifetime, C4PropList *properties, int amount = 1, C4Object *object=NULL); + void Create(C4ParticleDef *of_def, C4ParticleValueProvider &x, C4ParticleValueProvider &y, C4ParticleValueProvider &speedX, C4ParticleValueProvider &speedY, C4ParticleValueProvider &lifetime, C4PropList *properties, int amount = 1, C4Object *object=NULL); // removes all of the existing particles (used f.e. for scenario section loading) void ClearAllParticles(); @@ -506,6 +506,6 @@ public: }; -extern C4DynamicParticleSystem DynamicParticles; +extern C4ParticleSystem Particles; #endif diff --git a/src/object/C4Object.cpp b/src/object/C4Object.cpp index a2240b807..aab2b748f 100644 --- a/src/object/C4Object.cpp +++ b/src/object/C4Object.cpp @@ -170,7 +170,7 @@ void C4Action::GetBridgeData(int32_t &riBridgeTime, bool &rfMoveClonk, bool &rfW C4Object::C4Object() { - DynamicFrontParticles = DynamicBackParticles = 0; + FrontParticles = BackParticles = 0; Default(); } @@ -232,10 +232,10 @@ void C4Object::Default() pGfxOverlay=NULL; iLastAttachMovementFrame=-1; - if (DynamicFrontParticles == 0) - DynamicFrontParticles = DynamicParticles.GetNewParticleList(this); - if (DynamicBackParticles == 0) - DynamicBackParticles = DynamicParticles.GetNewParticleList(this); + if (FrontParticles == 0) + FrontParticles = Particles.GetNewParticleList(this); + if (BackParticles == 0) + BackParticles = Particles.GetNewParticleList(this); } bool C4Object::Init(C4PropList *pDef, C4Object *pCreator, @@ -367,9 +367,9 @@ void C4Object::AssignRemoval(bool fExitContents) if (!Status) return; } // remove particles - if (DynamicFrontParticles != NULL) - DynamicParticles.ReleaseParticleList(DynamicFrontParticles, DynamicBackParticles); - DynamicFrontParticles = DynamicBackParticles = NULL; + if (FrontParticles != NULL) + Particles.ReleaseParticleList(FrontParticles, BackParticles); + FrontParticles = BackParticles = NULL; // Action idle SetAction(0); // Object system operation @@ -1900,7 +1900,7 @@ void C4Object::Draw(C4TargetFacet &cgo, int32_t iByPlayer, DrawMode eDrawMode, f if (Def->Line) { DrawLine(cgo); return; } // background particles (bounds not checked) - if (DynamicBackParticles) DynamicBackParticles->Draw(cgo, this); + if (BackParticles) BackParticles->Draw(cgo, this); // Object output position float newzoom; @@ -1928,7 +1928,7 @@ void C4Object::Draw(C4TargetFacet &cgo, int32_t iByPlayer, DrawMode eDrawMode, f if ( !Inside(offX+Shape.GetX()+Action.FacetX,cgo.X-Action.Facet.Wdt,cgo.X+cgo.Wdt) || (!Inside(offY+Shape.GetY()+Action.FacetY,cgo.Y-Action.Facet.Hgt,cgo.Y+cgo.Hgt)) ) { - if (DynamicFrontParticles && !Contained) DynamicFrontParticles->Draw(cgo, this); + if (FrontParticles && !Contained) FrontParticles->Draw(cgo, this); return; } } @@ -1937,7 +1937,7 @@ void C4Object::Draw(C4TargetFacet &cgo, int32_t iByPlayer, DrawMode eDrawMode, f if ( !Inside(offX+Shape.GetX(),cgo.X-Shape.Wdt,cgo.X+cgo.Wdt) || (!Inside(offY+Shape.GetY(),cgo.Y-Shape.Hgt,cgo.Y+cgo.Hgt)) ) { - if (DynamicFrontParticles && !Contained) DynamicFrontParticles->Draw(cgo, this); + if (FrontParticles && !Contained) FrontParticles->Draw(cgo, this); return; } } @@ -2114,8 +2114,8 @@ void C4Object::Draw(C4TargetFacet &cgo, int32_t iByPlayer, DrawMode eDrawMode, f // local particles in front of the object if (eDrawMode!=ODM_BaseOnly) { - if (DynamicFrontParticles) - DynamicFrontParticles->Draw(cgo, this); + if (FrontParticles) + FrontParticles->Draw(cgo, this); } // Debug Display //////////////////////////////////////////////////////////////////////// @@ -2454,10 +2454,10 @@ void C4Object::CompileFunc(StdCompiler *pComp, C4ValueNumbers * numbers) if (Unsorted) Game.fResortAnyObject = true; // initialize empty particle lists - if (DynamicFrontParticles == 0) - DynamicFrontParticles = DynamicParticles.GetNewParticleList(this); - if (DynamicBackParticles == 0) - DynamicBackParticles = DynamicParticles.GetNewParticleList(this); + if (FrontParticles == 0) + FrontParticles = Particles.GetNewParticleList(this); + if (BackParticles == 0) + BackParticles = Particles.GetNewParticleList(this); } @@ -2591,9 +2591,9 @@ void C4Object::ClearInfo(C4ObjectInfo *pInfo) void C4Object::Clear() { - if (DynamicFrontParticles != NULL) - DynamicParticles.ReleaseParticleList(DynamicFrontParticles, DynamicBackParticles); - DynamicFrontParticles = DynamicBackParticles = NULL; + if (FrontParticles != NULL) + Particles.ReleaseParticleList(FrontParticles, BackParticles); + FrontParticles = BackParticles = NULL; if (pEffects) { delete pEffects; pEffects=NULL; } if (pSolidMaskData) { delete pSolidMaskData; pSolidMaskData=NULL; } @@ -4738,9 +4738,9 @@ bool C4Object::StatusActivate() bool C4Object::StatusDeactivate(bool fClearPointers) { // clear particles - if (DynamicFrontParticles != NULL) - DynamicParticles.ReleaseParticleList(DynamicFrontParticles, DynamicBackParticles); - DynamicFrontParticles = DynamicBackParticles = NULL; + if (FrontParticles != NULL) + Particles.ReleaseParticleList(FrontParticles, BackParticles); + FrontParticles = BackParticles = NULL; // put into inactive list ::Objects.Remove(this); diff --git a/src/object/C4Object.h b/src/object/C4Object.h index 92caf4019..7bef1ecbb 100644 --- a/src/object/C4Object.h +++ b/src/object/C4Object.h @@ -31,7 +31,7 @@ #include "C4Def.h" #include "C4Sector.h" #include "C4Value.h" -#include "C4DynamicParticles.h" +#include "C4Particles.h" #include "C4PropList.h" #include "C4ObjectPtr.h" #include "StdMesh.h" @@ -176,7 +176,7 @@ public: C4DefGraphics *pGraphics; // currently set object graphics StdMeshInstance* pMeshInstance; // Instance for mesh-type objects C4Effect *pEffects; // linked list of effects - C4DynamicParticleList *DynamicFrontParticles, *DynamicBackParticles; // the same only for the dynamic particle system + C4ParticleList *FrontParticles, *BackParticles; // the same only for the dynamic particle system uint32_t ColorMod; // color by which the object-drawing is modulated uint32_t BlitMode; // extra blitting flags (like additive, ClrMod2, etc.) diff --git a/src/object/C4ObjectScript.cpp b/src/object/C4ObjectScript.cpp index bcbff5789..c9de944c2 100644 --- a/src/object/C4ObjectScript.cpp +++ b/src/object/C4ObjectScript.cpp @@ -2278,11 +2278,11 @@ static bool FnCreateParticleAtBone(C4Object* Obj, C4String* szName, C4String* sz x.y += DrawTransform(1,3); x.z += DrawTransform(2,3); // get particle - C4ParticleDef *pDef=::DynamicParticles.definitions.GetDef(FnStringPar(szName)); + C4ParticleDef *pDef=::Particles.definitions.GetDef(FnStringPar(szName)); if (!pDef) return false; // construct data - C4DynamicParticleValueProvider valueX, valueY, valueSpeedX, valueSpeedY, valueLifetime; + C4ParticleValueProvider valueX, valueY, valueSpeedX, valueSpeedY, valueLifetime; valueX.Set(x.x); valueY.Set(x.y); valueSpeedX.Set(dir.x); @@ -2290,7 +2290,7 @@ static bool FnCreateParticleAtBone(C4Object* Obj, C4String* szName, C4String* sz valueLifetime.Set(lifetime); // cast - ::DynamicParticles.Create(pDef, valueX, valueY, valueSpeedX, valueSpeedY, valueLifetime, properties, amount, Obj); + ::Particles.Create(pDef, valueX, valueY, valueSpeedX, valueSpeedY, valueLifetime, properties, amount, Obj); // success, even if not created return true;