Browse Source

Merge pull request #44 from djeada/feature/improved_selection_ring

Feature/improved selection ring
Adam Djellouli 2 months ago
parent
commit
b9e014fd03
3 changed files with 3 additions and 2 deletions
  1. 1 1
      render/draw_queue.h
  2. 1 1
      render/entity/archer_renderer.cpp
  3. 1 0
      render/gl/backend.cpp

+ 1 - 1
render/draw_queue.h

@@ -223,7 +223,7 @@ private:
   }
   }
 
 
   uint64_t computeSortKey(const DrawCmd &cmd) const {
   uint64_t computeSortKey(const DrawCmd &cmd) const {
-    static constexpr uint8_t kTypeOrder[] = {0, 1, 2, 3, 4, 8, 6, 7, 5};
+    static constexpr uint8_t kTypeOrder[] = {0, 4, 7, 6, 5, 8, 2, 3, 1};
 
 
     const std::size_t typeIndex = cmd.index();
     const std::size_t typeIndex = cmd.index();
     constexpr std::size_t typeCount =
     constexpr std::size_t typeCount =

+ 1 - 1
render/entity/archer_renderer.cpp

@@ -410,7 +410,7 @@ static inline void drawSelectionFX(const DrawContext &p, ISubmitter &out) {
   if (p.selected || p.hovered) {
   if (p.selected || p.hovered) {
     QMatrix4x4 ringM;
     QMatrix4x4 ringM;
     QVector3D pos = p.model.column(3).toVector3D();
     QVector3D pos = p.model.column(3).toVector3D();
-    ringM.translate(pos.x(), 0.15f, pos.z());
+    ringM.translate(pos.x(), pos.y() + 0.05f, pos.z());
     ringM.scale(0.5f, 1.0f, 0.5f);
     ringM.scale(0.5f, 1.0f, 0.5f);
     if (p.selected)
     if (p.selected)
       out.selectionRing(ringM, 0.6f, 0.25f, QVector3D(0.2f, 0.8f, 0.2f));
       out.selectionRing(ringM, 0.6f, 0.25f, QVector3D(0.2f, 0.8f, 0.2f));

+ 1 - 0
render/gl/backend.cpp

@@ -514,6 +514,7 @@ void Backend::execute(const DrawQueue &queue, const Camera &cam) {
       m_basicShader->setUniform(m_basicUniforms.color, sc.color);
       m_basicShader->setUniform(m_basicUniforms.color, sc.color);
 
 
       DepthMaskScope depthMask(false);
       DepthMaskScope depthMask(false);
+      DepthTestScope depthTest(false);
       PolygonOffsetScope poly(-1.0f, -1.0f);
       PolygonOffsetScope poly(-1.0f, -1.0f);
       BlendScope blend(true);
       BlendScope blend(true);