mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 23:11:58 +00:00
Added Wads.FindLump() to ZScript
https://forum.zdoom.org/viewtopic.php?t=57814
This commit is contained in:
parent
527cc7ecf1
commit
91fda180de
2 changed files with 17 additions and 0 deletions
|
@ -1086,6 +1086,16 @@ int FWadCollection::FindLump (const char *name, int *lastlump, bool anyns)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFINE_ACTION_FUNCTION(_Wads, FindLump)
|
||||||
|
{
|
||||||
|
PARAM_PROLOGUE;
|
||||||
|
PARAM_STRING(name);
|
||||||
|
PARAM_INT_DEF(startlump);
|
||||||
|
PARAM_INT_DEF(ns);
|
||||||
|
const bool isLumpValid = startlump >= 0 && startlump < Wads.GetNumLumps();
|
||||||
|
ACTION_RETURN_INT(isLumpValid ? Wads.FindLump(name, &startlump, 0 != ns) : -1);
|
||||||
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
// W_FindLumpMulti
|
// W_FindLumpMulti
|
||||||
|
|
|
@ -631,7 +631,14 @@ struct Wads
|
||||||
ns_firstskin,
|
ns_firstskin,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum FindLumpNamespace
|
||||||
|
{
|
||||||
|
GlobalNamespace = 0,
|
||||||
|
AnyNamespace = 1,
|
||||||
|
}
|
||||||
|
|
||||||
native static int CheckNumForName(string name, int ns, int wadnum = -1, bool exact = false);
|
native static int CheckNumForName(string name, int ns, int wadnum = -1, bool exact = false);
|
||||||
|
native static int FindLump(string name, int startlump = 0, FindLumpNamespace ns = GlobalNamespace);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct TerrainDef native
|
struct TerrainDef native
|
||||||
|
|
Loading…
Reference in a new issue