A_ClearOverlays

From ZDoom Wiki
Jump to navigation Jump to search

int A_ClearOverlays [(int start, int stop, bool safety)]

Usage

Removes a range of layers between [start,stop]. If no value or 0 is used for both, it will clear all but the hardcoded layers. Returns the number of layers cleared that were active between the range.

The following is a list of internal layers used by engine (These are NOT flags or constants for use!):

  • PSP_STRIFEHANDS (-1) - Used by A_ItBurnsItBurns in Strife.
  • PSP_WEAPON (1) - Used by the actual weapon.
  • PSP_FLASH (1000) - Used by the Flash state (see A_GunFlash).
  • PSP_TARGETCENTER (2147483645)
  • PSP_TARGETLEFT (2147483646)
  • PSP_TARGETRIGHT (2147483647) - The absolute highest layer number.

It is recommended that all new overlays should use layers 2 on up, or -2 on down to avoid any potential problems with compatibility.

Parameters

  • start - The low end of the range to clear through. If 0 including stop, clears all current overlays except hardcoded ones.
  • stop - The high end of the range to clear through. If 0 including start, clears all current overlays except hardcoded ones.
  • safety - Enabled by default, the hardcoded layers above are protected from wiping as this may cause problems with switching away from weapons, as there is no active layer to allow switching with. Use extreme caution when disabling.

Examples

Nuvolachalk.png Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contributions are greatly appreciated.

See Also