Skip to content

Commit 6f3032d

Browse files
MajorCookeRicardoLuis0
authored andcommitted
Exported:
* GetLumpContainer * GetContainerName * GetLumpFullPath for WADS struct, useful for debugging custom-made parsers and identifying where problems may arise. All credit goes to Jay for the code.
1 parent da6730d commit 6f3032d

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/common/scripting/interface/vmnatives.cpp

+21
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,27 @@ DEFINE_ACTION_FUNCTION(_Wads, GetLumpFullName)
853853
ACTION_RETURN_STRING(fileSystem.GetFileFullName(lump));
854854
}
855855

856+
DEFINE_ACTION_FUNCTION(_Wads, GetLumpContainer)
857+
{
858+
PARAM_PROLOGUE;
859+
PARAM_INT(lump);
860+
ACTION_RETURN_INT(fileSystem.GetFileContainer(lump));
861+
}
862+
863+
DEFINE_ACTION_FUNCTION(_Wads, GetContainerName)
864+
{
865+
PARAM_PROLOGUE;
866+
PARAM_INT(lump);
867+
ACTION_RETURN_STRING(fileSystem.GetResourceFileName(lump));
868+
}
869+
870+
DEFINE_ACTION_FUNCTION(_Wads, GetLumpFullPath)
871+
{
872+
PARAM_PROLOGUE;
873+
PARAM_INT(lump);
874+
ACTION_RETURN_STRING(fileSystem.GetFileFullPath(lump));
875+
}
876+
856877
DEFINE_ACTION_FUNCTION(_Wads, GetLumpNamespace)
857878
{
858879
PARAM_PROLOGUE;

wadsrc/static/zscript/engine/base.zs

+3
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,9 @@ struct Wads // todo: make FileSystem an alias to 'Wads'
898898
native static string GetLumpName(int lump);
899899
native static string GetLumpFullName(int lump);
900900
native static int GetLumpNamespace(int lump);
901+
native static int GetLumpContainer(int lump);
902+
native static string GetContainerName(int lump);
903+
native static string GetLumpFullPath(int lump);
901904
}
902905

903906
enum EmptyTokenType

0 commit comments

Comments
 (0)