ReadLump

From ZDoom Wiki
Jump to navigation Jump to search

Wads

native static string ReadLump(int lump)

Usage

Reads the lump at the given index and returns its full contents as a text string. The index must be obtained with FindLump.

Parameters

  • int lump
The index of the lump obtained with FindLump.

Return values

  • String — returns the contents of the lump as a string.

Examples

This example shows how to find all currently loaded TEXTURES lumps and push their contents into a dynamic array:

array<String> allTexturesContents;
// Find a lump named TEXTURES:
int lump = Wads.FindLump("TEXTURES", 0);
// Keep searching until there are no more
// lumps with this name to be found:
while (lump != -1)
{
    String lumpContents = Wads.ReadLump(lump);
    allTexturesContents.Push(lumpContents);
    // Find the next TEXTURES lump if present:
    lump = Wads.FindLump("TEXTURES", lump + 1);
}

See also