Skip to content

Commit

Permalink
added Wads.GetLumpLength.
Browse files Browse the repository at this point in the history
  • Loading branch information
prof-hastig committed Oct 26, 2023
1 parent eeac40f commit a33bfc0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/common/scripting/interface/vmnatives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,13 @@ DEFINE_ACTION_FUNCTION(_Wads, ReadLump)
ACTION_RETURN_STRING(isLumpValid ? GetStringFromLump(lump, false) : FString());
}

DEFINE_ACTION_FUNCTION(_Wads, GetLumpLength)
{
PARAM_PROLOGUE;
PARAM_INT(lump);
ACTION_RETURN_INT(fileSystem.FileLength(lump));
}

//==========================================================================
//
// CVARs
Expand Down
1 change: 1 addition & 0 deletions wadsrc/static/zscript/engine/base.zs
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,7 @@ struct Wads // todo: make FileSystem an alias to 'Wads'
native static int FindLump(string name, int startlump = 0, FindLumpNamespace ns = GlobalNamespace);
native static int FindLumpFullName(string name, int startlump = 0, bool noext = false);
native static string ReadLump(int lump);
native static int GetLumpLength(int lump);

native static int GetNumLumps();
native static string GetLumpName(int lump);
Expand Down

0 comments on commit a33bfc0

Please sign in to comment.