LumpRead

From Zandronum Wiki
Revision as of 09:27, 4 January 2024 by FusedQyou (talk | contribs) (Update formatting and specifications on failure)
This article documents a Zandronum-specific ACS feature which may not be supported by ZDoom and its other child ports.
This article documents an ACS function which is only available in development builds of Zandronum 3.2 and newer.

int LumpRead (int lump, int pos [, int type]) (development version 3.2-alpha and above only)

Usage

Reads an integer. The value of this integer is based on the type passed.

By default, the type returned is an unsigned 8-bit integer.

Parameters

  • lump: The lump index as returned from LumpOpen.
  • pos: The byte position in the lump to read from.
  • type: The type of integer that should be returned.
    • LUMP_READ_BYTE: Signed 8-bit integer.
    • LUMP_READ_UBYTE: Unsigned 8-bit integer.
    • LUMP_READ_SHORT: Signed 16-bit integer.
    • LUMP_READ_USHORT: Unsigned 16-bit integer.
    • LUMP_READ_INT: Signed 32-bit integer.
    • LUMP_READ_FLOAT: Signed 32-bit float converted to a fixed-point.

Return value

Returns the integer that was read.

Returns 0 if the lump passed is invalid, or when the type passed is invalid, alongside a console message.

Also returns 0 when called on a lump that was not opened with LumpOpen, alongside a console message.

Examples

This article lists no examples, please add one.