Skip to content

Commit

Permalink
Merge branch 'spelunky-fyi:main' into formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Auto authored Sep 8, 2023
2 parents 28100bf + 69927f3 commit 5dba188
Show file tree
Hide file tree
Showing 18 changed files with 601 additions and 38 deletions.
11 changes: 11 additions & 0 deletions docs/examples/RenderInfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
> For using a custom normal map:
```lua
set_post_entity_spawn(function(ent)
-- Doesn't really make sense with this texture, you can use your custom normal texture id here
ent.rendering_info:set_normal_map_texture(TEXTURE.DATA_TEXTURES_FLOORSTYLED_GOLD_NORMAL_0)
ent.rendering_info.shader = 30 -- Make sure to set the shader to one that uses normal map
end, SPAWN_TYPE.LEVEL_GEN, MASK.FLOOR, ENT_TYPE.FLOORSTYLED_MINEWOOD)
```

> Note: if using set_texture_num, make sure to have used set_second_texture/set_third_texture before, since not doing so can lead to crashes
30 changes: 30 additions & 0 deletions docs/game_data/spel2.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions docs/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,8 @@ def print_lf(lf):
"Camera",
"QuestsInfo",
"PlayerSlot",
"JournalProgressStickerSlot",
"JournalProgressStainSlot"
]
):
cat = "State types"
Expand Down
173 changes: 172 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1981,6 +1981,12 @@
<li>
<a href="#Items" class="toc-h3 toc-link" data-title="Items">Items</a>
</li>
<li>
<a href="#JournalProgressStainSlot" class="toc-h3 toc-link" data-title="JournalProgressStainSlot">JournalProgressStainSlot</a>
</li>
<li>
<a href="#JournalProgressStickerSlot" class="toc-h3 toc-link" data-title="JournalProgressStickerSlot">JournalProgressStickerSlot</a>
</li>
<li>
<a href="#PlayerSlot" class="toc-h3 toc-link" data-title="PlayerSlot">PlayerSlot</a>
</li>
Expand Down Expand Up @@ -8859,6 +8865,19 @@ <h3 id='Quad'>Quad</h3>
</tr>
</tbody></table>
<h3 id='RenderInfo'>RenderInfo</h3>
<blockquote>
<p>For using a custom normal map:</p>
</blockquote>
<div class="highlight"><pre class="highlight lua tab-lua"><code><span class="n">set_post_entity_spawn</span><span class="p">(</span><span class="k">function</span><span class="p">(</span><span class="n">ent</span><span class="p">)</span>
<span class="c1">-- Doesn't really make sense with this texture, you can use your custom normal texture id here</span>
<span class="n">ent</span><span class="p">.</span><span class="n">rendering_info</span><span class="p">:</span><span class="n">set_normal_map_texture</span><span class="p">(</span><span class="n">TEXTURE</span><span class="p">.</span><span class="n">DATA_TEXTURES_FLOORSTYLED_GOLD_NORMAL_0</span><span class="p">)</span>
<span class="n">ent</span><span class="p">.</span><span class="n">rendering_info</span><span class="p">.</span><span class="n">shader</span> <span class="o">=</span> <span class="mi">30</span> <span class="c1">-- Make sure to set the shader to one that uses normal map</span>
<span class="k">end</span><span class="p">,</span> <span class="n">SPAWN_TYPE</span><span class="p">.</span><span class="n">LEVEL_GEN</span><span class="p">,</span> <span class="n">MASK</span><span class="p">.</span><span class="n">FLOOR</span><span class="p">,</span> <span class="n">ENT_TYPE</span><span class="p">.</span><span class="n">FLOORSTYLED_MINEWOOD</span><span class="p">)</span>
</code></pre></div>
<blockquote>
<p>Note: if using set_texture_num, make sure to have used set_second_texture/set_third_texture before, since not doing so can lead to crashes</p>
</blockquote>

<p>Some information used to render the entity, can not be changed, used in <a href="#Entity">Entity</a></p>

<table><thead>
Expand Down Expand Up @@ -8914,11 +8933,46 @@ <h3 id='RenderInfo'>RenderInfo</h3>
<td></td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=texture_num">texture_num</a></td>
<td></td>
</tr>
<tr>
<td>class <a href="#Entity">Entity</a></td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=get_entity">get_entity()</a></td>
<td></td>
</tr>
<tr>
<td>bool</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=set_normal_map_texture">set_normal_map_texture(TEXTURE texture_id)</a></td>
<td>Sets second_texture to the texture specified, then sets third_texture to SHINE_0 and texture_num to 3. You still have to change shader to 30 to render with normal map (same as COG normal maps)</td>
</tr>
<tr>
<td>optional&lt;<a href="#TEXTURE">TEXTURE</a>&gt;</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=get_second_texture">get_second_texture</a></td>
<td></td>
</tr>
<tr>
<td>optional&lt;<a href="#TEXTURE">TEXTURE</a>&gt;</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=get_third_texture">get_third_texture</a></td>
<td></td>
</tr>
<tr>
<td>bool</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=set_second_texture">set_second_texture(TEXTURE texture_id)</a></td>
<td></td>
</tr>
<tr>
<td>bool</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=set_third_texture">set_third_texture(TEXTURE texture_id)</a></td>
<td></td>
</tr>
<tr>
<td>bool</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=set_texture_num">set_texture_num(int texture_id)</a></td>
<td>Set the number of textures that may be used, need to have them set before for it to work</td>
</tr>
<tr>
<td><a href="#Aliases">CallbackId</a></td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=set_pre_virtual">set_pre_virtual(RENDER_INFO_OVERRIDE entry, function fun)</a></td>
<td>Hooks before the virtual function at index <code>entry</code>.</td>
Expand Down Expand Up @@ -14550,6 +14604,93 @@ <h3 id='Items'>Items</h3>
<td></td>
</tr>
</tbody></table>
<h3 id='JournalProgressStainSlot'>JournalProgressStainSlot</h3>
<p>Used in <a href="#StateMemory">StateMemory</a></p>

<table><thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>float</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=x">x</a></td>
<td></td>
</tr>
<tr>
<td>float</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=y">y</a></td>
<td></td>
</tr>
<tr>
<td>float</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=angle">angle</a></td>
<td></td>
</tr>
<tr>
<td>float</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=scale">scale</a></td>
<td></td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=texture_column">texture_column</a></td>
<td></td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=texture_row">texture_row</a></td>
<td></td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=texture_range">texture_range</a></td>
<td></td>
</tr>
</tbody></table>
<h3 id='JournalProgressStickerSlot'>JournalProgressStickerSlot</h3>
<p>Used in <a href="#StateMemory">StateMemory</a></p>

<table><thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=theme">theme</a></td>
<td></td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=grid_position">grid_position</a></td>
<td></td>
</tr>
<tr>
<td><a href="#ENT_TYPE">ENT_TYPE</a></td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=entity_type">entity_type</a></td>
<td></td>
</tr>
<tr>
<td>float</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=x">x</a></td>
<td></td>
</tr>
<tr>
<td>float</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=y">y</a></td>
<td></td>
</tr>
<tr>
<td>float</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=angle">angle</a></td>
<td></td>
</tr>
</tbody></table>
<h3 id='PlayerSlot'>PlayerSlot</h3>
<table><thead>
<tr>
Expand Down Expand Up @@ -15179,6 +15320,36 @@ <h3 id='StateMemory'>StateMemory</h3>
<td></td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=journal_progress_sticker_count">journal_progress_sticker_count</a></td>
<td></td>
</tr>
<tr>
<td>array&lt;<a href="#JournalProgressStickerSlot">JournalProgressStickerSlot</a>, 40&gt;</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=journal_progress_sticker_slots">journal_progress_sticker_slots</a></td>
<td>stickers for notable items and entities in journal progress page</td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=journal_progress_stain_count">journal_progress_stain_count</a></td>
<td></td>
</tr>
<tr>
<td>array&lt;<a href="#JournalProgressStainSlot">JournalProgressStainSlot</a>, 30&gt;</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=journal_progress_stain_slots">journal_progress_stain_slots</a></td>
<td>blood splats and paw prints in journal progress page</td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=journal_progress_theme_count">journal_progress_theme_count</a></td>
<td></td>
</tr>
<tr>
<td>array&lt;int, 9&gt;</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=journal_progress_theme_slots">journal_progress_theme_slots</a></td>
<td>visited themes in journal progress page</td>
</tr>
<tr>
<td><a href="#ThemeInfo">ThemeInfo</a></td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=theme_info">theme_info</a></td>
<td>Points to the current <a href="#ThemeInfo">ThemeInfo</a></td>
Expand Down Expand Up @@ -27697,7 +27868,7 @@ <h2 id='GAME_SETTING'>GAME_SETTING</h2>
</tr>
</thead><tbody>
<tr>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=GAME_SETTING.DAMSEL_STYLE">DAMSEL_STYLE</a></td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=GAME_SETTING.WINDOW_SCALE">WINDOW_SCALE</a></td>
<td>0</td>
<td></td>
</tr>
Expand Down
Loading

0 comments on commit 5dba188

Please sign in to comment.