PNAMES

PNAMES is a lump which corresponds with TEXTUREx lumps to define a texture. Patch entries in TEXTUREx entries point to a PNAMES entry by a zero-based index number.

Vanilla Doom only loads one PNAMES, one TEXTURE1 and one TEXTURE2 lumps. ZDoom allows cumulative loading; however only one PNAMES lump per archive will be read. Each TEXTUREx lump will refer to the latest PNAMES lump in the same archive, or an archive loaded previously in the loading order. (So for example, loading a single archive containing only a PNAMES lump will not affect the IWAD textures, although it would in a port keeping the vanilla model of texture loading.)

Specification

The lump starts with an integer header declaring the number of patches that follow. Each patch is simply declared as a string of eight characters. Shorter names are zero-terminated. The total lump size is therefore equal to (num_patches * 8) + 4.

Header
BytesData typeDescription
0-3Unsigned 32-bit integerNumber of entries
Entry
BytesData typeDescription
x+0-x+8Char[8]Patch name

Beware that certain tools not written in a C family of computer languages, such as XWE, do not understand null-termination and can corrupt the PNAMES lump if there are garbage characters after the null byte, as could happen (and be normally allowed by Doom) with tools written in a C-style language such as SLumpEd.

For this reason, it is advised to make sure that all bytes not used for a short patch name be nulled. Modern editors, such as SLADE 3, make sure to avoid the problem.

See also

This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.