added Wads.GetLumpLength.

This commit is contained in:
Professor Hastig 2023-10-26 11:41:45 +02:00 committed by Rachael Alexanderson
parent 77e5fd3081
commit 4d88e82e32
2 changed files with 8 additions and 0 deletions

View file

@ -848,6 +848,13 @@ DEFINE_ACTION_FUNCTION(_Wads, ReadLump)
ACTION_RETURN_STRING(isLumpValid ? GetStringFromLump(lump, false) : FString()); 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 // CVARs

View file

@ -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 FindLump(string name, int startlump = 0, FindLumpNamespace ns = GlobalNamespace);
native static int FindLumpFullName(string name, int startlump = 0, bool noext = false); native static int FindLumpFullName(string name, int startlump = 0, bool noext = false);
native static string ReadLump(int lump); native static string ReadLump(int lump);
native static int GetLumpLength(int lump);
native static int GetNumLumps(); native static int GetNumLumps();
native static string GetLumpName(int lump); native static string GetLumpName(int lump);