feat(world-map): remove kVOffset hack, ZMP hover, textured player arrow

- Remove the -0.15 vertical offset (kVOffset) from coordinate_projection,
  coordinate_display, and zone_highlight_layer; continent UV math is now
  identical to zone UV math
- Switch world_map_facade aspect ratio to MAP_W/MAP_H (1002×668) and crop
  the FBO image with MAP_U_MAX/MAP_V_MAX instead of stretching the full
  1024×768 FBO
- Account for ImGui title bar height (GetFrameHeight) in window sizing and
  zone highlight screen-space rect coordinates
- Add ZMP 128×128 grid pixel-accurate hover detection in zone_highlight_layer;
  falls back to AABB when ZMP data is unavailable
- Upgrade PlayerMarkerLayer with full Vulkan lifecycle (initialize,
  clearTexture, destructor); loads MinimapArrow.blp and renders a rotated
  32×32 textured quad via AddImageQuad; red triangle retained as fallback
- Expose arrowRotation_ / arrowDS_ accessors on Minimap; clean up arrow DS
  and texture in Minimap::shutdown()
- Wire PlayerMarkerLayer::initialize() into WorldMapFacade::initialize()
- Update coordinate-projection test: continent and zone UV are now equal

Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
This commit is contained in:
Pavel Okhlopkov 2026-04-12 20:02:50 +03:00
parent ada019e0d4
commit 97c95941f4
9 changed files with 218 additions and 54 deletions

View file

@ -10,6 +10,8 @@
#include "pipeline/blp_loader.hpp"
#include "core/coordinates.hpp"
#include "core/logger.hpp"
#include <imgui.h>
#include <backends/imgui_impl_vulkan.h>
#include <glm/gtc/matrix_transform.hpp>
#include <array>
#include <sstream>
@ -234,6 +236,9 @@ void Minimap::shutdown() {
if (noDataTexture) { noDataTexture->destroy(device, alloc); noDataTexture.reset(); }
if (compositeTarget) { compositeTarget->destroy(device, alloc); compositeTarget.reset(); }
if (arrowDS_) { ImGui_ImplVulkan_RemoveTexture(arrowDS_); arrowDS_ = VK_NULL_HANDLE; }
if (arrowTexture_) { arrowTexture_->destroy(device, alloc); arrowTexture_.reset(); }
vkCtx = nullptr;
}
@ -543,6 +548,7 @@ void Minimap::render(VkCommandBuffer cmd, const Camera& playerCamera,
push.rect = glm::vec4(x, y, pixelW, pixelH);
push.playerUV = glm::vec2(playerU, playerV);
push.rotation = rotation;
arrowRotation_ = arrowRotation;
push.arrowRotation = arrowRotation;
push.zoomRadius = zoomRadius;
push.squareShape = squareShape ? 1 : 0;