Commit graph

866 commits

Author SHA1 Message Date
Kelsi
ce30cedf4a Deposit all items to bank on right-click when bank is open
All right-clicked inventory items now deposit to bank regardless of
whether they are equippable, usable, or materials.
2026-02-25 14:00:54 -08:00
Kelsi
d61b7b385d Only auto-deposit non-equippable items to bank on right-click
Right-clicking equippable items (inventoryType > 0) while the bank is
open now equips them as normal instead of depositing. Only materials,
quest items, and other non-equippable items auto-deposit to bank.
2026-02-25 13:57:37 -08:00
Kelsi
af7fb4242c Add drag-and-drop support for inventory to bank slots
Bank window slots now act as drop targets when holding an item from
inventory. Empty bank slots highlight green, and clicking drops the
held item via CMSG_SWAP_ITEM. Occupied bank slots accept swaps too.
Works for both main bank slots (39-66) and bank bag slots (67+).
2026-02-25 13:54:47 -08:00
Kelsi
2ab5cf5eb6 Add inventory-to-bank deposit on right-click
When the bank is open, right-clicking a backpack or bag item now
deposits it into the bank via CMSG_AUTOBANK_ITEM instead of trying
to equip/use it. Bank deposit takes priority over vendor sell and
auto-equip actions.
2026-02-25 13:47:42 -08:00
Kelsi
e220ce888d Fix window close hang from blocking worker thread joins
unloadAll() now uses a 500ms deadline with pthread_timedjoin_np to
avoid blocking indefinitely when worker threads are mid-prepareTile
(reading MPQ archives / parsing ADT files). Threads that don't finish
within the deadline are detached so the app can exit promptly.
2026-02-25 13:42:58 -08:00
Kelsi
26a685187e Fix /logout hang caused by blocking worker thread joins
unloadAll() joins worker threads which blocks if they're mid-tile
(prepareTile can take seconds for heavy ADTs). Replace with softReset()
which clears tile data, queues, and water surfaces without stopping
worker threads — workers find empty queues and idle naturally.
2026-02-25 13:37:09 -08:00
Kelsi
872b10fe68 Fix water descriptor pool leak and add water rendering diagnostics
- Add VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT to water material
  descriptor pool so individual sets can be freed when tiles are unloaded
- Free descriptor sets in destroyWaterMesh() instead of leaking them
- Add terrain manager unloadAll() during logout to properly clear stale
  tiles, water surfaces, and queues between sessions
- Add diagnostic logging for water surface loading, material allocation
  failures, and render skip reasons to investigate missing water
2026-02-25 13:26:08 -08:00
Kelsi
94e4a0bdb3 Fix letter-named patch MPQs not loading on case-sensitive filesystems
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Two bugs in loadPatchArchives():
1. isLetterPatch detection was inverted (rfind != 0 is false for all
   "patch-*" entries), making the disable flags non-functional
2. Patch file lookup used exact std::filesystem::exists() which is
   case-sensitive on Linux — Patch-A.MPQ wouldn't match patch-a.mpq

Now scans the data directory once and builds a case-insensitive lookup
map, so any case variant (Patch-A.MPQ, patch-a.mpq, PATCH-A.MPQ) is
found correctly.
2026-02-25 12:18:36 -08:00
Kelsi
956e2c8bb1 Reduce city stutter: lower spawn rate, resync interval, M2 render distance
- MAX_SPAWNS_PER_FRAME 8→3 (each spawn does sync M2 load, 5-50ms each)
- Creature resync scan interval 1s→3s (O(N) entity iteration)
- M2 render distance: add 1000+ instance tier at 500 units, reduce 2000+
  tier from 350→300 units to cap draw call count in dense cities
2026-02-25 12:16:55 -08:00
Kelsi
9c25713b72 Disable login screen music 2026-02-25 12:11:19 -08:00
Kelsi
53405ea322 Fix crash on re-login by clearing all per-session state on logout
logoutToLogin() was only clearing a handful of flags, leaving stale
entity instance maps, pending spawn queues, transport state, mount
state, and charge state from the previous session.  On second login,
these stale GUIDs and instance IDs caused invalid renderer operations
and crashes.

Now clears: creature/player/gameObject instance maps, all pending
spawn queues, transport doodad batches, mount/charge state, player
identity, and renderer world geometry (WMO instances, M2 models,
quest markers).  Also disconnects TransportManager from WMORenderer
before teardown to prevent dangling pointer access.
2026-02-25 12:09:00 -08:00
Kelsi
401cb6928c Disable WMO/M2 camera collision raycasts
Camera collision with WMO walls and M2 doodads caused erratic zoom
and pull-through at doorway transitions. Terrain-only camera floor
clamping is retained.
2026-02-25 12:06:24 -08:00
Kelsi
64879b8aab Overhaul WMO collision: precompute normals, fix floor selection, optimize queries
- Precompute triangle normals in buildCollisionGrid, eliminating per-query
  cross+normalize in getFloorHeight, checkWallCollision, and raycastBoundingBoxes
- Fix floor selection: remove redundant allowAbove (callers already elevate
  probeZ by stepUpBudget), preventing upper-story snap at doorway transitions
- Align wall classification threshold (absNz < 0.35) with runtime skip check,
  eliminating ~30% wasted wall triangle fetches
- Replace O(n log n) sort+unique dedup in range queries with O(n) visited bitset
- Rename wallTriScratch to triScratch_, fix stale threshold comments
2026-02-25 11:56:58 -08:00
Kelsi
35384b2c52 Fix Windows ERROR macro collision in logger 2026-02-25 11:14:53 -08:00
Kelsi
c849f9cdfa chore: update camera controller changes 2026-02-25 10:41:54 -08:00
Kelsi
7557e388fb Fix Booty Bay floor fall-through via M2-aware grounding rescue 2026-02-25 10:26:41 -08:00
Kelsi
bdde5f305a Harden WMO grounding rescue to prevent fall-through 2026-02-25 10:24:54 -08:00
Kelsi
2219ccde51 Optimize city performance and harden WMO grounding 2026-02-25 10:22:05 -08:00
Kelsi
52accfde80 Optimize login music scanning and warden debug formatting 2026-02-25 09:50:33 -08:00
Kelsi
c26353eda1 Reduce release log spam and harden release logging defaults 2026-02-25 09:46:27 -08:00
Kelsi
5966fedc59 Use outbound local IP for logon challenge with safe fallback 2026-02-25 09:37:52 -08:00
Kelsi
fc68c6c6b7 Fix Warden module parse fallback and macOS FMOD integrity aliases 2026-02-25 09:26:34 -08:00
Kelsidavis
1fab17e639 Add Windows build scripts, fix multi-threaded MPQ extraction, and cross-platform temp paths
- Add build.ps1/bat, rebuild.ps1/bat, debug_texture.ps1/bat (Windows equivalents
  of existing bash scripts, using directory junctions for Data link)
- Fix asset extractor: StormLib is not thread-safe even with separate handles per
  thread. Serialize all MPQ reads behind a mutex while keeping CRC computation and
  disk writes parallel. Previously caused 99.8% extraction failures with >1 thread.
- Add SFileHasFile() check during enumeration to skip listfile-only entries
- Add diagnostic logging for extraction failures (first 5 per thread + summary)
- Use std::filesystem::temp_directory_path() instead of hardcoded /tmp/ in
  character_renderer.cpp debug dumps
- Update debug_texture.sh to use $TMPDIR fallback and glob for actual dump filenames
2026-02-25 08:22:45 -08:00
Kelsi
570dec8b88 Fix loading screen graphical artifacts on window resize
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Recreate Vulkan swapchain in LoadingScreen::render() when the dirty flag
is set, so resizing the window during world loading no longer renders
into a stale swapchain with mismatched framebuffers.
2026-02-25 03:45:13 -08:00
Kelsi
4c8fa9f1fe Add Windows and macOS CPU affinity support
- Windows: SetThreadAffinityMask to pin main thread to core 0 and
  exclude workers from core 0
- macOS: thread_policy_set with THREAD_AFFINITY_POLICY tags to hint
  scheduler separation (tag 1 for main, tag 2 for workers)
2026-02-25 03:41:18 -08:00
Kelsi
86505ad377 Merge per-chunk water surfaces, restore incremental tile finalization, and pin main thread CPU affinity
Water deduplication: merge per-chunk water surfaces into per-tile surfaces
to reduce Vulkan descriptor set usage from ~8900 to ~100-200. Uses hybrid
approach — groups with ≤4 chunks stay per-chunk (preserving shore detail),
larger groups merge into 128×128 tile-wide surfaces.

Re-add incremental tile finalization state machine (reverted in 9b90ab0)
to spread GPU uploads across frames and prevent city stuttering.

Pin main thread to CPU core 0 and exclude worker threads from core 0
to reduce scheduling jitter on the render/game loop.
2026-02-25 03:39:45 -08:00
Kelsi
7ca9caa212 Fix Windows ARM64 build: disable x86 asm in StormLib's libtomcrypt
StormLib's bundled libtomcrypt uses x86 inline assembly (bswapl/movl)
gated by __MINGW32__, which is defined on CLANGARM64 too. Pass
-DLTC_NO_BSWAP to force portable C byte-swap fallback.
2026-02-25 03:06:06 -08:00
Kelsi
9b90ab0429 Revert terrain_manager to original finalizeTile to fix water rendering
The incremental advanceFinalization state machine broke water rendering
in ways that couldn't be resolved. Reverted to the original monolithic
finalizeTile approach. The other performance optimizations (bone SSBO
pre-allocation, WMO distance culling, M2 adaptive distance tiers)
are kept.
2026-02-25 02:50:36 -08:00
Kelsi
7dd78e2c0a Fix missing water by finalizing each tile completely per frame
Phase-splitting across frames caused water surfaces to not render
correctly. Changed processReadyTiles to run all phases for each tile
before moving to the next, with time budget checked between tiles.
2026-02-25 02:47:37 -08:00
Kelsi
d47ae2a110 Fix city stuttering with incremental tile finalization and GPU optimizations
Replace monolithic finalizeTile() with a phased state machine that spreads
GPU upload work across multiple frames (TERRAIN→M2→WMO→WATER→AMBIENT→DONE).
Each advanceFinalization() call does one bounded unit of work within the
per-frame time budget, eliminating 50-300ms frame hitches when entering cities.

Additional performance improvements:
- Pre-allocate bone SSBOs at M2 instance creation instead of lazily during
  first render frame, preventing hitches when many skinned characters appear
- Enable WMO distance culling (800 units) with active-group exemption so
  the player's current floor/neighbors are never culled
- Add 4-tier adaptive M2 render distance (250/400/600/1000 based on count)
- Remove dead PendingM2Upload queue code superseded by incremental system

Fix tile re-enqueueing bug: keep tiles in pendingTiles until committed to
loadedTiles (not when moved to finalizingTiles_) so streamTiles() doesn't
re-enqueue tiles mid-finalization. Also handle unloadTile() for tiles in
the finalizingTiles_ deque to prevent orphaned water/M2/WMO resources.
2026-02-25 02:36:23 -08:00
Kelsi
8fe53171eb Fix release packaging and macOS stack overflow crash
- Fix StormLib package name: libstormlib-dev → libstorm-dev (correct
  Ubuntu package name) across all CI workflows and extract_assets.sh
- Build StormLib from source on Windows CI (no MSYS2 package exists),
  ensuring asset_extract.exe is included in release archives
- Update extract_assets.sh/.ps1 to prefer pre-built asset_extract
  binary next to the script (release archives) before trying build dir
- Move ADTTerrain allocations from stack to heap in prepareTile() to
  fix stack overflow on macOS (worker threads default to 512 KB stack,
  two ADTTerrain structs ≈ 560 KB exceeded that)
2026-02-25 01:55:16 -08:00
Kelsi
d045c1215a Fix Warden module parsing and DBC loading for Classic expansion
Warden: copy/skip pair order was reversed — format is [copy][data][skip]
per MaNGOS/TrinityCore, not [skip][copy][data]. All copy sizes read as 0,
causing module load failure and server disconnect.

DBC: when binary DBCs aren't available (no MPQ extraction), fall back to
expansion CSV files even for visual DBCs (CreatureDisplayInfo, CharSections,
ItemDisplayInfo, etc.) instead of failing with "DBC not found".
2026-02-24 04:42:36 -08:00
Kelsi
2a1bd12f5b Fix game objects rendering with player textures
When M2Renderer's descriptor pool was exhausted, batch.materialSet
would be VK_NULL_HANDLE and the bind was skipped, but the draw call
still executed using the previously bound descriptor set from
CharacterRenderer — causing game objects to render with the player's
skin/armor textures. Skip the entire batch instead.
2026-02-23 20:41:06 -08:00
Kelsi
aaab2115d1 Fix all remaining build warnings and eliminate UB in binary parsers
Resolve 57 compiler warnings (unused params/vars, ignored return values,
enum mismatch) and replace undefined-behavior reinterpret_cast with
memcpy in DBC, BLP, and Warden module loaders for ARM64 portability.
2026-02-23 19:58:38 -08:00
Kelsi
997318ae06 Fix all build warnings
- vk_utils.hpp: mark unused 'msg' parameter with [[maybe_unused]]
- world_packets.cpp: write exactMatch field to auction list packet
  (was accepted as parameter but never serialized)
- game_screen.cpp: remove unused bagIcons array and unused info variable
- talent_screen.cpp: remove unused nextRank and pMin variables
2026-02-23 19:16:47 -08:00
Kelsi
06979e5c5c Prevent player snapping to WMO roofs when jumping inside buildings
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Anchor WMO floor probe to last ground Z when airborne so the detection
ceiling doesn't rise with the jump and catch roof/ceiling geometry.
2026-02-23 11:03:18 -08:00
Kelsi
9a1b78bffd Fix character preview facing and add 4x MSAA to preview render target
Character was facing stage-left (yaw 180) instead of toward camera;
corrected default yaw to 90. Added MSAA support to VkRenderTarget with
automatic resolve attachment, and enabled 4x MSAA for the character
preview off-screen pass.
2026-02-23 10:48:26 -08:00
Kelsi
d65b170774 Make shadows follow player movement continuously
Remove freeze-while-moving and idle smoothing logic from shadow
center computation. Texel snapping already prevents shimmer, so
the shadow projection can track the player directly each frame.
2026-02-23 08:47:38 -08:00
Kelsi
0a1e240831 Fix WMO shadow receiving and enable shadows by default
Remove isInterior restriction from WMO shadow sampling so city
buildings (flagged as interior groups) correctly receive shadows.
Apply shadow to interior-lit surfaces. Enable shadows by default
and persist the setting across sessions.
2026-02-23 08:40:23 -08:00
Kelsi Rae Davis
c3ed915649
Merge pull request #4 from Kittnz/vulkan_win
Make this compatible to build on MSVS 2022
2026-02-23 08:38:37 -08:00
Kelsi
b70f08d14f Add proportional zoom and reduced default max zoom with extended toggle
Zoom speed now scales with distance for fine control near the character.
Default max zoom out reduced from 50 to 33 units. New "Extended Camera
Zoom" toggle in Gameplay settings restores the full 50-unit range.
2026-02-23 08:09:27 -08:00
Kelsi
5cfb0817ed Fix sun quad visibility, minimap opacity, audio scaling, and rename music toggle
- Tighten celestial glow falloff and edge fade to eliminate visible quad boundary
- Add opacity support to minimap display shader, synced with UI opacity setting
- Fix audio double/triple-scaling by removing redundant master volume multiplications
- Rename "Original Soundtrack" toggle to "Enable WoWee Music"
- Add About tab with developer info and GitHub link
2026-02-23 08:01:20 -08:00
Kelsi
a250c20d84 Fix audio volume double/triple-scaling and add About tab
Audio was being scaled by master volume multiple times: once via
ma_engine_set_volume, again per-sound in AudioEngine, and again
via pre-multiplication in the UI. Removed redundant master volume
multiplications so each channel volume is independent and master
applies once through the engine. Added About tab to settings with
developer info and GitHub link.
2026-02-23 07:51:10 -08:00
Kelsi
83d7f26f33 Fix visible square behind sun by switching celestial to additive blending
Alpha blending caused faint quad edges to be visible against the sky
gradient. Additive blending correctly adds glow light without the
outline artifact. Edge fade starts earlier and discard threshold raised.
2026-02-23 07:40:51 -08:00
Kelsi
59f487c941 Fix foot splash particles being cleared immediately when wading
Ripples were cleared every frame the player wasn't swimming, which
destroyed foot splash particles the same frame they were spawned.
Now particles expire naturally via their lifetime.
2026-02-23 07:37:01 -08:00
Kelsi
a7102ab742 Fix foliage DXT black fringe, insect depth occlusion, and ambient creature animation
- Replace dark edge RGB on alpha-tested foliage with mip-4 average color
  proportional to alpha (low alpha = low trust in original RGB)
- Raise foliage alpha cutoff to 0.4 and remove dither band for cleaner edges
- Disable depth test on insect particles so they don't vanish behind foliage
- Exempt dragonflies/butterflies/moths from foliage animation freeze
2026-02-23 07:34:29 -08:00
kittnz
9dd15ef922 Make this compatible to build with MSVS 2022 2026-02-23 16:30:49 +01:00
Kelsi
01c08b93b0 Exempt ambient creatures from foliage animation freeze
Fireflies, dragonflies, butterflies, and moths no longer get
disableAnimation/foliage classification so their bone animation
and particles run normally.
2026-02-23 07:21:45 -08:00
Kelsi
4db97e37b7 Add ambient insect particles near water vegetation, fix firefly particles, and improve water foam
- Spawn dark point-sprite insects buzzing around cattails/reeds/kelp/seaweed
- Fix firefly M2 particles: exempt from alpha dampening and forced gravity
- Make water shoreline/crest foam more irregular with UV warping and bluer tint
2026-02-23 07:18:44 -08:00
Kelsi
c35b40391f Add water footstep splashes and reduce lake wave amplitude
- Play WaterFootstep splash sounds when wading in shallow water
- Spawn foot splash particles at water surface on each water footstep
- Reduce inland water wave amplitude from 0.18 to 0.08 for calmer lakes
2026-02-23 06:58:46 -08:00