Skip to content

Commit

Permalink
- extended level post-processing with special string arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Nov 10, 2019
1 parent 00ff408 commit 82c2488
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/maploader/maploader.cpp
Expand Up @@ -3585,6 +3585,16 @@ DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingArgument)
ACTION_RETURN_INT(argument);
}

DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingStringArgument)
{
PARAM_SELF_PROLOGUE(DLevelPostProcessor);
PARAM_UINT(thing);

const FName argument = thing < self->loader->MapThingsConverted.Size()
? self->loader->MapThingsConverted[thing].arg0str : NAME_None;
ACTION_RETURN_INT(argument);
}

DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingArgument)
{
PARAM_SELF_PROLOGUE(DLevelPostProcessor);
Expand All @@ -3599,6 +3609,19 @@ DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingArgument)
return 0;
}

DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingStringArgument)
{
PARAM_SELF_PROLOGUE(DLevelPostProcessor);
PARAM_UINT(thing);
PARAM_INT(value);

if (thing < self->loader->MapThingsConverted.Size())
{
self->loader->MapThingsConverted[thing].arg0str = ENamedName(value);
}
return 0;
}

DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingID)
{
PARAM_SELF_PROLOGUE(DLevelPostProcessor);
Expand Down
2 changes: 2 additions & 0 deletions wadsrc/static/zscript/level_postprocessor.zs
Expand Up @@ -42,7 +42,9 @@ class LevelPostProcessor native play
protected native void SetThingSpecial(uint thing, int special);

protected native int GetThingArgument(uint thing, uint index);
protected native Name GetThingStringArgument(uint thing);
protected native void SetThingArgument(uint thing, uint index, int value);
protected native void SetThingStringArgument(uint thing, Name value);

protected native void SetVertex(uint vertex, double x, double y);
protected native void SetLineSectorRef(uint line, uint side, uint sector);
Expand Down

0 comments on commit 82c2488

Please sign in to comment.