Skip to content

TextureXList

Type

TextureXList

The TextureXList type is a list of composite textures (CTexture), which can be in various formats.

Constants

Name Value Description
FORMAT_NORMAL 0 Doom TEXTUREx format
FORMAT_STRIFE11 1 Strife TEXTUREx format
FORMAT_NAMELESS 2 Doom Alpha nameless format
FORMAT_TEXTURES 3 ZDoom TEXTURES format
FORMAT_JAGUAR 4 Jaguar Doom TEXTUREx format

Properties

Property Type Description
textures CTexture[] All textures in the list
format integer The format of this list (see FORMAT_ constants)
formatString string The name of the list format

Constructors

TextureXList.new()

Creates a new, empty list with format set to FORMAT_NORMAL.


TextureXList.new(format)

Creates a new, empty list of the given format.

Parameters

  • format (integer): The format of the list (see FORMAT_ constants)

Functions

Overview

General

Texture(name) -> CTexture TextureIndex(name) -> integer ConvertToTEXTURES() -> boolean FindErrors() -> boolean

Texture List Modification

AddTexture(name, [extended], [position]) -> CTexture RemoveTexture(position) SwapTextures(position1, position2) Clear() RemovePatch(patch)

Read/Write

ReadTEXTUREXData(entry, patchTable, additive) -> boolean WriteTEXTUREXData(entry, patchTable) -> boolean ReadTEXTURESData(entry) -> boolean WriteTEXTURESData(entry) -> boolean


Texture

Gets the texture in the list matching name.

Parameters

  • name (string): The name of the texture to get

Returns

  • CTexture: The first texture found in the list with name, or nil if not found

TextureIndex

Gets the index of the texture in the list matching name.

Parameters

  • name (string): The name of the texture

Returns

  • integer: The index of the first texture found in the list with name, or -1 if not found

ConvertToTEXTURES

Converts all textures in the list to extended format.

Returns

  • boolean: true on success, false if the list was already in TEXTURES format

Notes

This will set format to FORMAT_TEXTURES.


FindErrors

Finds and logs any errors in the texture list.

Returns

  • boolean: true if any errors were found

AddTexture

Adds a new texture to the list.

Parameters

  • name (string): The name of the new texture
  • [extended] (boolean): If true, the new texture will be in ZDoom TEXTURES format. Default is false
  • [position] (integer): The position the new texture should be added in the list. Default is 0, which will add to the end of the list

Returns


RemoveTexture

Removes the texture at position in the list.

Parameters

  • position (integer): The position of the texture to remove

SwapTextures

Swaps the textures at position1 and position2 in the list.

Parameters

  • position1 (integer): The position of the first texture to swap
  • position2 (integer): The position of the second texture to swap

Clear

Removes all textures from the list.


RemovePatch

Removes patch from all textures in the list.

Parameters

  • patch (string): The name of the patch to be removed

ReadTEXTUREXData

Reads a Doom-format TEXTUREx entry.

Parameters

  • entry (ArchiveEntry): The entry to read the data from
  • patchTable (PatchTable): The patch table (PNAMES) to use for patch names
  • additive (boolean): If true, textures are added to the current list, otherwise all textures are cleared first

Returns

  • boolean: true on success

Notes

This will set format to the type of list that was loaded.


WriteTEXTUREXData

Writes the list in Doom TEXTUREx format to entry.

Parameters

  • entry (ArchiveEntry): The entry to write the data to
  • patchTable (PatchTable): The patch table (PNAMES) to use for patch names

Returns

  • boolean: true on success

ReadTEXTURESData

Reads ZDoom TEXTURES data from entry.

Parameters

Returns

  • boolean: true on success

WriteTEXTURESData

Writes the list in ZDoom TEXURES format to entry.

Parameters

Returns

  • boolean: true on success