mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-27 22:42:29 +00:00
Allow ACS SpawnDecal zoffset and distance args to be fixed point
The wiki currently says they should be fixed point but the code currently treats them as integers. Given that they are placed with double precision horizontally, it is odd that the same precision cannot be applied vertically. Changing this would break existing maps so add two flags to support both types.
This commit is contained in:
parent
cf30982ddf
commit
90381c4ad6
1 changed files with 5 additions and 3 deletions
|
@ -569,6 +569,8 @@ FRandom pr_acs ("ACS");
|
|||
// SpawnDecal flags
|
||||
#define SDF_ABSANGLE 1
|
||||
#define SDF_PERMANENT 2
|
||||
#define SDF_FIXED_ZOFF 4
|
||||
#define SDF_FIXED_DISTANCE 8
|
||||
|
||||
// GetArmorInfo
|
||||
enum
|
||||
|
@ -6054,7 +6056,7 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
}
|
||||
|
||||
case ACSF_SpawnDecal:
|
||||
// int SpawnDecal(int tid, str decalname, int flags, fixed angle, int zoffset, int distance)
|
||||
// int SpawnDecal(int tid, str decalname, int flags, fixed angle, int|fixed zoffset, int|fixed distance)
|
||||
// Returns number of decals spawned (not including spreading)
|
||||
{
|
||||
int count = 0;
|
||||
|
@ -6063,8 +6065,8 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
{
|
||||
int flags = (argCount > 2) ? args[2] : 0;
|
||||
DAngle angle = ACSToAngle((argCount > 3) ? args[3] : 0);
|
||||
int zoffset = (argCount > 4) ? args[4]: 0;
|
||||
int distance = (argCount > 5) ? args[5] : 64;
|
||||
double zoffset = (argCount > 4) ? ((flags & SDF_FIXED_ZOFF) ? ACSToDouble(args[4]) : args[4]) : 0;
|
||||
double distance = (argCount > 5) ? ((flags & SDF_FIXED_DISTANCE) ? ACSToDouble(args[5]) : args[5]) : 64;
|
||||
|
||||
if (args[0] == 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue