- level post-processor cleanup

This commit is contained in:
alexey.lysiuk 2019-10-27 16:31:56 +02:00
parent c5237ce58f
commit 098b1c5973
2 changed files with 60 additions and 60 deletions

View file

@ -3422,9 +3422,9 @@ DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingEdNum)
PARAM_SELF_PROLOGUE(DLevelPostProcessor); PARAM_SELF_PROLOGUE(DLevelPostProcessor);
PARAM_UINT(thing); PARAM_UINT(thing);
const int result = thing < self->loader->MapThingsConverted.Size() const int ednum = thing < self->loader->MapThingsConverted.Size()
? self->loader->MapThingsConverted[thing].EdNum : 0; ? self->loader->MapThingsConverted[thing].EdNum : 0;
ACTION_RETURN_INT(result); ACTION_RETURN_INT(ednum);
} }
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingEdNum) DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingEdNum)
@ -3442,61 +3442,15 @@ DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingEdNum)
return 0; return 0;
} }
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingAngle)
{
PARAM_SELF_PROLOGUE(DLevelPostProcessor);
PARAM_UINT(thing);
const int result = thing < self->loader->MapThingsConverted.Size()
? self->loader->MapThingsConverted[thing].angle : 0;
ACTION_RETURN_INT(result);
}
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingAngle)
{
PARAM_SELF_PROLOGUE(DLevelPostProcessor);
PARAM_UINT(thing);
PARAM_UINT(angle);
if (thing < self->loader->MapThingsConverted.Size())
{
self->loader->MapThingsConverted[thing].angle = angle;
}
return 0;
}
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingSkills)
{
PARAM_SELF_PROLOGUE(DLevelPostProcessor);
PARAM_UINT(thing);
const int result = thing < self->loader->MapThingsConverted.Size()
? self->loader->MapThingsConverted[thing].SkillFilter : 0;
ACTION_RETURN_INT(result);
}
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingSkills)
{
PARAM_SELF_PROLOGUE(DLevelPostProcessor);
PARAM_UINT(thing);
PARAM_UINT(skillmask);
if (thing < self->loader->MapThingsConverted.Size())
{
self->loader->MapThingsConverted[thing].SkillFilter = skillmask;
}
return 0;
}
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingPos) DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingPos)
{ {
PARAM_SELF_PROLOGUE(DLevelPostProcessor); PARAM_SELF_PROLOGUE(DLevelPostProcessor);
PARAM_UINT(thing); PARAM_UINT(thing);
const DVector3 result = thing < self->loader->MapThingsConverted.Size() const DVector3 pos = thing < self->loader->MapThingsConverted.Size()
? self->loader->MapThingsConverted[thing].pos ? self->loader->MapThingsConverted[thing].pos
: DVector3(0, 0, 0); : DVector3(0, 0, 0);
ACTION_RETURN_VEC3(result); ACTION_RETURN_VEC3(pos);
} }
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingXY) DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingXY)
@ -3528,14 +3482,60 @@ DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingZ)
return 0; return 0;
} }
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingAngle)
{
PARAM_SELF_PROLOGUE(DLevelPostProcessor);
PARAM_UINT(thing);
const int angle = thing < self->loader->MapThingsConverted.Size()
? self->loader->MapThingsConverted[thing].angle : 0;
ACTION_RETURN_INT(angle);
}
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingAngle)
{
PARAM_SELF_PROLOGUE(DLevelPostProcessor);
PARAM_UINT(thing);
PARAM_INT(angle);
if (thing < self->loader->MapThingsConverted.Size())
{
self->loader->MapThingsConverted[thing].angle = angle;
}
return 0;
}
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingSkills)
{
PARAM_SELF_PROLOGUE(DLevelPostProcessor);
PARAM_UINT(thing);
const int skills = thing < self->loader->MapThingsConverted.Size()
? self->loader->MapThingsConverted[thing].SkillFilter : 0;
ACTION_RETURN_INT(skills);
}
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingSkills)
{
PARAM_SELF_PROLOGUE(DLevelPostProcessor);
PARAM_UINT(thing);
PARAM_UINT(skillmask);
if (thing < self->loader->MapThingsConverted.Size())
{
self->loader->MapThingsConverted[thing].SkillFilter = skillmask;
}
return 0;
}
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingFlags) DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingFlags)
{ {
PARAM_SELF_PROLOGUE(DLevelPostProcessor); PARAM_SELF_PROLOGUE(DLevelPostProcessor);
PARAM_UINT(thing); PARAM_UINT(thing);
const unsigned result = thing < self->loader->MapThingsConverted.Size() const unsigned flags = thing < self->loader->MapThingsConverted.Size()
? self->loader->MapThingsConverted[thing].flags : 0; ? self->loader->MapThingsConverted[thing].flags : 0;
ACTION_RETURN_INT(result); ACTION_RETURN_INT(flags);
} }
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingFlags) DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingFlags)
@ -3556,9 +3556,9 @@ DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingSpecial)
PARAM_SELF_PROLOGUE(DLevelPostProcessor); PARAM_SELF_PROLOGUE(DLevelPostProcessor);
PARAM_UINT(thing); PARAM_UINT(thing);
const int result = thing < self->loader->MapThingsConverted.Size() const int special = thing < self->loader->MapThingsConverted.Size()
? self->loader->MapThingsConverted[thing].special : 0; ? self->loader->MapThingsConverted[thing].special : 0;
ACTION_RETURN_INT(result); ACTION_RETURN_INT(special);
} }
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingSpecial) DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingSpecial)
@ -3580,9 +3580,9 @@ DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingArgument)
PARAM_UINT(thing); PARAM_UINT(thing);
PARAM_UINT(index); PARAM_UINT(index);
const int result = index < 5 && thing < self->loader->MapThingsConverted.Size() const int argument = index < 5 && thing < self->loader->MapThingsConverted.Size()
? self->loader->MapThingsConverted[thing].args[index] : 0; ? self->loader->MapThingsConverted[thing].args[index] : 0;
ACTION_RETURN_INT(result); ACTION_RETURN_INT(argument);
} }
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingArgument) DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingArgument)

View file

@ -22,16 +22,16 @@ class LevelPostProcessor native play
protected native int GetThingEdNum(uint thing); protected native int GetThingEdNum(uint thing);
protected native void SetThingEdNum(uint thing, int ednum); protected native void SetThingEdNum(uint thing, int ednum);
protected native vector3 GetThingPos(uint thing);
protected native void SetThingXY(uint thing, double x, double y);
protected native void SetThingZ(uint thing, double z);
protected native int GetThingAngle(uint thing); protected native int GetThingAngle(uint thing);
protected native void SetThingAngle(uint thing, int angle); protected native void SetThingAngle(uint thing, int angle);
protected native uint GetThingSkills(uint thing); protected native uint GetThingSkills(uint thing);
protected native void SetThingSkills(uint thing, uint skills); protected native void SetThingSkills(uint thing, uint skills);
protected native vector3 GetThingPos(uint thing);
protected native void SetThingXY(uint thing, double x, double y);
protected native void SetThingZ(uint thing, double z);
protected native uint GetThingFlags(uint thing); protected native uint GetThingFlags(uint thing);
protected native void SetThingFlags(uint thing, uint flags); protected native void SetThingFlags(uint thing, uint flags);