From 39014b173294049b4e14f283894b0d6baa2e6da0 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 21 Jan 2016 20:13:55 +0100 Subject: [PATCH] - make the startalpha parameter of A_SpawnParticle a float to be consistent with other functions that want an alpha value. --- src/thingdef/thingdef_codeptr.cpp | 4 ++-- wadsrc/static/actors/actor.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 6fd1b3aa8..22a0b8d10 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -2645,14 +2645,14 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnParticle) ACTION_PARAM_COLOR(color, 6); ACTION_PARAM_INT(lifetime, 7); ACTION_PARAM_BOOL(fullbright, 8); - ACTION_PARAM_INT(startalpha, 9); // Byte trans + ACTION_PARAM_FIXED(startalphaf, 9); ACTION_PARAM_INT(size, 10); ACTION_PARAM_INT(fadestep, 11); ACTION_PARAM_FIXED(accelx, 12); ACTION_PARAM_FIXED(accely, 13); ACTION_PARAM_FIXED(accelz, 14); - startalpha = clamp(startalpha, 0, 0xFF); // Clamp to byte + BYTE startalpha = (BYTE)Scale(clamp(startalphaf, 0, FRACUNIT), 255, FRACUNIT); lifetime = clamp(lifetime, 0, 0xFF); // Clamp to byte fadestep = clamp(fadestep, -1, 0xFF); // Clamp to byte inc. -1 (indicating automatic) size = clamp(size, 0, 0xFF); // Clamp to byte diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index 0d31851b7..093ace107 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -234,7 +234,7 @@ ACTOR Actor native //: Thinker action native A_SetScale(float scalex, float scaley = 0, int ptr = AAPTR_DEFAULT); action native A_SetMass(int mass); action native A_SpawnDebris(class spawntype, bool transfer_translation = false, float mult_h = 1, float mult_v = 1); - action native A_SpawnParticle(float xoff, float yoff, float zoff, float velx, float vely, float velz, color color1, int lifetime, bool fullbright = false, int startalpha = 255, int size = 1, int fadestep = -1, float accelx = 0.0, float accely = 0.0, float accelz = 0.0); + action native A_SpawnParticle(float xoff, float yoff, float zoff, float velx, float vely, float velz, color color1, int lifetime, bool fullbright = false, float startalpha = 1, int size = 1, int fadestep = -1, float accelx = 0.0, float accely = 0.0, float accelz = 0.0); action native A_CheckSight(state label); action native A_ExtChase(bool usemelee, bool usemissile, bool playactive = true, bool nightmarefast = false); action native A_DropInventory(class itemtype);