Chunk.cpp/h:
- thread_local occluder table via std::array<bool,256> IIFE; queries
isSolidRender() for all 255 tile types instead of only stone/dirt/bedrock
- Null-check getChunkAt() early-out with correct COMPILED/NOTSKYLIT/EMPTY flags
- Defer Region + TileRenderer construction past empty-check to skip 9 chunk
lookups and 128KB memset for empty chunks (common post-teleport)
- Replace Win32 TLS API (TlsAlloc/TlsSetValue/TlsGetValue) + new/delete
with static thread_local array for per-thread tileIds storage
LevelRenderer.cpp:
- Rewrite updateDirtyChunks nearest-chunk search as linear ClipChunk scan;
dirty-flag checked before any distance work, batch-clear empty dirty chunks
upfront via isRenderChunkEmpty to shrink dirty set across frames
- const on all distance/flag locals
Region.h/cpp:
- Stack buffer flatChunks_stack[16] for common render-chunk regions (4x4),
std::unique_ptr<LevelChunk*[]> heap fallback for large pathfinding regions;
eliminates per-rebuild heap alloc/free on the hot path
- Deleted copy/move ops; std::fill_n for null-init; static constexpr constant
TileRenderer.h/cpp:
- static thread_local cache array replaces per-instance new/delete
- Remove dead getLightColorCount, cacheOwned, conditional delete[]
- static constexpr cache size; defaulted destructor
Level.cpp: Region constructed directly on stack (no copy)
stdafx.h: added <array>
* Fixed boats falling and a TP glitch #266
* Replaced every C-style cast with C++ ones
* Replaced every C-style cast with C++ ones
* Fixed boats falling and a TP glitch #266
* Updated NULL to nullptr and fixing some type issues
* Modernized and fixed a few bugs
- Replaced most instances of `NULL` with `nullptr`.
- Replaced most `shared_ptr(new ...)` with `make_shared`.
- Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances.
* Fixing more conflicts
* Replace int loops with size_t and start work on overrides
* Add safety checks and fix a issue with vector going OOR
Tesselator.h: Branchless min/max in Bounds via Min/Max; const ref on addBounds
Tesselator.cpp: clamp for color clamping; Min/Max initializer lists in packCompactQuad min/max finding and du/dv clamping
Chunk.cpp: bool[256] lookup table for occluder tile IDs in occlusion culling; [[unlikely]] hints on rebuild inner loop early-outs
LevelRenderer.cpp: __restrict + local caching in frustum clip(); [[likely]]/[[unlikely]] on chunk render loop continues
- Skip frustum culling for the entity the player is currently riding, preventing the horse from disappearing when looking up (fixes a bug reported on Discord)
- Fix HorseRenderer::bindTexture() to delegate to base class for single textures (fire atlas, enchant glint), only using bindTextureLayers() for multi-layer horse textures
Co-authored-by: MCbabel <MCbabel@users.noreply.github.com>
This code was not tested and breaks in Release builds, reverting to restore
functionality of the nightly. All in-game menus do not work and generating
a world crashes.
This reverts commit a9be52c41a.
* Fixed boats falling and a TP glitch #266
* Replaced every C-style cast with C++ ones
* Replaced every C-style cast with C++ ones
* Fixed boats falling and a TP glitch #266
* Updated NULL to nullptr and fixing some type issues
* Modernized and fixed a few bugs
- Replaced most instances of `NULL` with `nullptr`.
- Replaced most `shared_ptr(new ...)` with `make_shared`.
- Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances.
* Fixing more conflicts
* Replace int loops with size_t and start work on overrides
* FOV option without debug menu
Now located in Graphics section.
Based on the FOV thing from discord idk
* language
* render distance option for graphics menu
* oop
* swf files on media
* revert changes on language selector
* nvm it was actually easy to fix
* forgot this
* Final probably
Fixed visual bug and made the chunk updates depend to your view distance.