Also renames lua/lua.hpp to lua/lua_global.hpp.
The previous name broke version auto-detection in sol2, which involves
calling `__has_include(<lua/lua.hpp>)`.
1. There is no need to store the light table width as it is always 256.
2. Use a fixed-extent `std::span` rather than a pointer for readability.
This should optimize to the exact same code.
In C++, globals initialization order accross translation units is not
defined. Accessing a global via a function ensures that it is initialized.
This will be needed for #7638, which will statically initialize change
handlers after the Options object has been initialized.
Untangles dependencies by splitting up `engine.{h,cpp}` into 3 files:
1. `primitive_render`
2. `ticks` -- only contains `GetAnimationFrame` for now.
3. `GetWidth2` renamed to `CalculateSpriteTileCenterX` and moved to `levels/dun_tile.hpp`.
1. Do not draw foliage with the pause trn.
2. Display the number of steps.
3. If the tile is not walkable (allowed for destination tile), display
the number of steps in yellow.
Stairs can have the same `TileProperties` as floors but do not
always follor the same graphics layout as floors, so we shouldn't
apply optimizations to them.
The only floors affected seem to be:
1. Caves: tile 48 sub-tile 171 frame 461 (TileProperties: None)
2. Hell: tile 46 sub-tile 141 frame 386 (TileProperties: BlocksMissile)
Note that the few broken in pixels in caves are actually incorrectly
attributed to the non-Solid tile, really they should be part of the
solid tile 49.
As there doesn't seem to be a quick and easy way to check if a frame
is part of Stairs, we add a check for BlocksMissile tile property
instead.
This fixes Hell but isn't enough to fix Caves.
To fix Caves, we then add a `BlocksMissile` flag to the broken sub-tile.
`dev.display.grid()` previously tanked the FPS even on my beefy machine.
It is now much faster.
I've also noticed that the grid is glitchy when but this is also the
case before this PR.
During `ReencodeDungeonCels`, extracts floor tile foliage into
a triangle with the floor frame and a separate 16-px tall `TransparentSquare`.
This means that the floor frames are now always triangles and
the foliage can be rendered directly without masking.
Dungeon graphics sizes:
Map | Frames | Foliage frames | Byte size | Before PR | After PR
-----|--------|---------------:|-----------:|----------:|----------:
Town | 3,803 | 41 | 2,317,832 | 2,242,056 | 2,242,190
L1 | 1,119 | 11 | 738,836 | 721,604 | 721,110
L4 | 1,091 | 6 | 603,140 | 584,500 | 584,242
RG99 binary size reduced by ~4 KiB: 2,426,380 bytes -> 2,421,388 bytes