Files
sfall/tiles-and-paths/index.html
T

13 lines
26 KiB
HTML
Raw Normal View History

2026-04-01 14:29:07 +00:00
<!DOCTYPE html> <html lang="en-US"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <link rel="stylesheet" href="/sfall/assets/css/just-the-docs-default.css"> <link rel="stylesheet" href="/sfall/assets/css/just-the-docs-head-nav.css" id="jtd-head-nav-stylesheet"> <style id="jtd-nav-activation"> .site-nav > ul.nav-list:first-child > li:not(:nth-child(30)) > a, .site-nav > ul.nav-list:first-child > li > ul > li a { background-image: none; } .site-nav > ul.nav-list:not(:first-child) a, .site-nav li.external a { background-image: none; } .site-nav > ul.nav-list:first-child > li:nth-child(30) > a { font-weight: 600; text-decoration: none; }.site-nav > ul.nav-list:first-child > li:nth-child(30) > button svg { transform: rotate(-90deg); }.site-nav > ul.nav-list:first-child > li.nav-list-item:nth-child(30) > ul.nav-list { display: block; } </style> <script src="/sfall/assets/js/vendor/lunr.min.js"></script> <script src="/sfall/assets/js/just-the-docs.js"></script> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" href="/sfall/favicon.ico" type="image/x-icon"> <!-- Begin Jekyll SEO tag v2.8.0 --> <title>Tiles and paths | sfall</title> <meta name="generator" content="Jekyll v3.9.2" /> <meta property="og:title" content="Tiles and paths" /> <meta property="og:locale" content="en_US" /> <meta name="description" content="Sfall documentation" /> <meta property="og:description" content="Sfall documentation" /> <link rel="canonical" href="/sfall/tiles-and-paths/" /> <meta property="og:url" content="/sfall/tiles-and-paths/" /> <meta property="og:site_name" content="sfall" /> <meta property="og:type" content="website" /> <meta name="twitter:card" content="summary" /> <meta property="twitter:title" content="Tiles and paths" /> <script type="application/ld+json"> {"@context":"https://schema.org","@type":"WebPage","description":"Sfall documentation","headline":"Tiles and paths","url":"/sfall/tiles-and-paths/"}</script> <!-- End Jekyll SEO tag --> <link rel="apple-touch-icon" sizes="180x180" href="/assets/favicon/apple-touch-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon/favicon-16x16.png"> <link rel="manifest" href="/assets/favicon/site.webmanifest"> <link rel="mask-icon" href="/assets/favicon/safari-pinned-tab.svg" color="#5bbad5"> <meta name="msapplication-TileColor" content="#da532c"> <meta name="msapplication-config" content="/assets/favicon/browserconfig.xml"> <meta name="theme-color" content="#ffffff"> </head> <body> <a class="skip-to-main" href="#main-content">Skip to main content</a> <svg xmlns="http://www.w3.org/2000/svg" class="d-none"> <symbol id="svg-link" viewBox="0 0 24 24"> <title>Link</title> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"> <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path> </svg> </symbol> <symbol id="svg-menu" viewBox="0 0 24 24"> <title>Menu</title> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"> <line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line> </svg> </symbol> <symbol id="svg-arrow-right" viewBox="0 0 24 24"> <title>Expand</title> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"> <polyline points="9 18 15 12 9 6"></polyline> </svg> </symbol> <!-- Feather. MIT License: https://github.com/feathericons/feather/blob/master/LICENSE --> <symbol id="s
</code></pre></div></div> <ul> <li>Returns FID information about the square under the given tile at elevation 0</li> <li>Pass elevation as 4-bit number in bits 25-28 to access other elevations</li> <li>Pass result mode in bits 29-32: 0 - ground FID, 1 - roof FID, 2 - raw data.</li> </ul><hr /> <h3 class="d-inline-block" id="get_tile_ground_fid"> <a href="#get_tile_ground_fid" class="anchor-heading" aria-labelledby="get_tile_ground_fid"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>get_tile_ground_fid</strong> </h3> <p class="label label-green">sfall.h</p> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">int</span> <span class="n">get_tile_ground_fid</span><span class="p">(</span><span class="kt">int</span> <span class="n">tileNum</span><span class="p">,</span> <span class="kt">int</span> <span class="n">elevation</span><span class="p">)</span>
2026-04-23 14:38:24 +00:00
</code></pre></div></div> <p>Returns FID of a ground tile at the given tile number and elevation.</p><hr /> <h3 class="d-inline-block" id="get_tile_roof_fid"> <a href="#get_tile_roof_fid" class="anchor-heading" aria-labelledby="get_tile_roof_fid"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>get_tile_roof_fid</strong> </h3> <p class="label label-green">sfall.h</p> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">int</span> <span class="n">get_tile_roof_fid</span><span class="p">(</span><span class="kt">int</span> <span class="n">tileNum</span><span class="p">,</span> <span class="kt">int</span> <span class="n">elevation</span><span class="p">)</span>
</code></pre></div></div> <p>Returns FID of a roof tile at the given tile number and elevation. Note that FID of 1 is used when there is no actual roof.</p><hr /> <h3 id="obj_blocking_line"> <a href="#obj_blocking_line" class="anchor-heading" aria-labelledby="obj_blocking_line"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>obj_blocking_line</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">ObjectPtr</span> <span class="n">obj_blocking_line</span><span class="p">(</span><span class="n">ObjectPtr</span> <span class="n">objFrom</span><span class="p">,</span> <span class="kt">int</span> <span class="n">tileTo</span><span class="p">,</span> <span class="kt">int</span> <span class="n">blockingType</span><span class="p">)</span>
</code></pre></div></div> <p>Returns the first object which blocks direct linear path from <code class="language-plaintext highlighter-rouge">objFrom</code> to <code class="language-plaintext highlighter-rouge">tileTo</code> using selected blocking function (see <code class="language-plaintext highlighter-rouge">BLOCKING_TYPE_*</code> constants in <strong>sfall.h</strong>).</p> <ul> <li>If path is clear (no blocker was encountered by selected function) - returns 0.</li> <li><code class="language-plaintext highlighter-rouge">objFrom</code> is always excluded from calculations, but is required to be a valid object.</li> </ul><hr /> <h3 id="obj_blocking_tile"> <a href="#obj_blocking_tile" class="anchor-heading" aria-labelledby="obj_blocking_tile"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>obj_blocking_tile</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">ObjectPtr</span> <span class="n">obj_blocking_tile</span><span class="p">(</span><span class="kt">int</span> <span class="n">tileNum</span><span class="p">,</span> <span class="kt">int</span> <span class="n">elevation</span><span class="p">,</span> <span class="kt">int</span> <span class="n">blockingType</span><span class="p">)</span>
</code></pre></div></div> <p>Returns the first object blocking the given tile using the given blocking function, or 0 if the tile is clear.</p><hr /> <h3 id="path_find_to"> <a href="#path_find_to" class="anchor-heading" aria-labelledby="path_find_to"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>path_find_to</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">array</span> <span class="n">path_find_to</span><span class="p">(</span><span class="n">ObjectPtr</span> <span class="n">objFrom</span><span class="p">,</span> <span class="kt">int</span> <span class="n">tileTo</span><span class="p">,</span> <span class="kt">int</span> <span class="n">blockingType</span><span class="p">)</span>
</code></pre></div></div> <p>Returns the shortest path to a given tile using the given blocking function as an array of tile directions (0..5) to move on each step.</p> <ul> <li>Array length equals to a number of steps.</li> <li>Empty array means that specified target cannot be reached.</li> </ul><hr /> <h3 class="d-inline-block" id="tile_by_position"> <a href="#tile_by_position" class="anchor-heading" aria-labelledby="tile_by_position"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>tile_by_position</strong> </h3> <p class="label label-green">sfall.h</p> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">int</span> <span class="n">tile_by_position</span><span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">,</span> <span class="kt">int</span> <span class="n">y</span><span class="p">)</span>
2021-06-01 04:05:32 +00:00
</code></pre></div></div> <ul> <li>returns the tile number at the x, y position relative to the top-left corner of the screen</li> <li>if the position is outside of the range of tiles, it will return -1</li> </ul><hr /> <h3 id="tile_get_objs"> <a href="#tile_get_objs" class="anchor-heading" aria-labelledby="tile_get_objs"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>tile_get_objs</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">array</span> <span class="n">tile_get_objs</span><span class="p">(</span><span class="kt">int</span> <span class="n">tileNum</span><span class="p">,</span> <span class="kt">int</span> <span class="n">elevation</span><span class="p">)</span>
2026-04-23 14:38:24 +00:00
</code></pre></div></div> <p>Returns an array of all objects at the given tile.</p> <ul> <li>It will include any hidden, dead or system objects (like cursor), so make sure to check properly when iterating.</li> </ul><hr /> <h3 id="tile_light"> <a href="#tile_light" class="anchor-heading" aria-labelledby="tile_light"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>tile_light</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">int</span> <span class="n">tile_light</span><span class="p">(</span><span class="kt">int</span> <span class="n">elevation</span><span class="p">,</span> <span class="kt">int</span> <span class="n">tileNum</span><span class="p">)</span>
2026-03-26 04:12:44 +00:00
</code></pre></div></div> <p>Returns light intensity at the given tile in the range of 0 to 65536.</p><hr /> <h3 id="tile_refresh_display"> <a href="#tile_refresh_display" class="anchor-heading" aria-labelledby="tile_refresh_display"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>tile_refresh_display</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">void</span> <span class="n">tile_refresh_display</span>
2021-06-01 04:05:32 +00:00
</code></pre></div></div> <p>Redraws the game scene (tiles, walls, objects, etc.).</p><hr /> <h3 id="tile_under_cursor"> <a href="#tile_under_cursor" class="anchor-heading" aria-labelledby="tile_under_cursor"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>tile_under_cursor</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">int</span> <span class="n">tile_under_cursor</span>
2026-01-27 07:17:52 +00:00
</code></pre></div></div> </main> <hr> <footer> <div class="d-md-none mt-4 fs-2"> This site uses <a href="https://github.com/just-the-docs/just-the-docs">Just the Docs</a>, a documentation theme for Jekyll. </div> </footer> </div> </div> <div class="search-overlay"></div> </div> </body> </html>