From 7ce7bd15f655d9d9f88be7683bc5167b7c44bc49 Mon Sep 17 00:00:00 2001 From: shevernitskiy Date: Wed, 30 Aug 2023 12:48:14 +0300 Subject: [PATCH] Update docs/dev/Lua API.rst Co-authored-by: Myk --- docs/dev/Lua API.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/dev/Lua API.rst b/docs/dev/Lua API.rst index e4bbd59e2..f002297ad 100644 --- a/docs/dev/Lua API.rst +++ b/docs/dev/Lua API.rst @@ -2600,7 +2600,9 @@ a ``dfhack.penarray`` instance to cache their output. Textures module --------------- -In order for the game to render a particular tile (graphic), it needs to know ``texpos`` - the position in the vector of the registered game textures (also the graphical tile id passed as the tile field in a `Pen `). +In order for the game to render a particular tile (graphic), it needs to know the +``texpos`` - the position in the vector of the registered game textures (also the +graphical tile id passed as the ``tile`` field in a `Pen `). Add your own texture to it and get ``texpos`` is not difficult. But the game periodically deletes textures that are in the vector, and that's the problem. Because the ``texpos`` we got earlier no longer points to our added texture. The ``texture`` module solves this problem. Instead of ``texpos`` directly, it operates on the ``TexposHandle`` entity, which is essentially a reference to ``texpos``.