From ff9affa5137f8731465b42ae45342d414363ef32 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Thu, 30 Sep 2021 16:08:39 +0100 Subject: [PATCH] Fix a couple of noisy MSVC warnings --- Source/DiabloUI/ui_item.h | 2 +- Source/engine/displacement.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/DiabloUI/ui_item.h b/Source/DiabloUI/ui_item.h index 6b3de9f54..6a3c01091 100644 --- a/Source/DiabloUI/ui_item.h +++ b/Source/DiabloUI/ui_item.h @@ -363,7 +363,7 @@ public: return tmp; } - int indexAt(Sint16 y) const + [[nodiscard]] size_t indexAt(Sint16 y) const { ASSERT(y >= m_rect.y); const size_t index = (y - m_rect.y) / m_height; diff --git a/Source/engine/displacement.hpp b/Source/engine/displacement.hpp index 9f0c0b5d5..9bc3824c9 100644 --- a/Source/engine/displacement.hpp +++ b/Source/engine/displacement.hpp @@ -106,8 +106,8 @@ struct Displacement { /** * @brief Returns a new Displacement object in screen coordinates. * - * Transforming from world space to screen space involves a rotation of -135° and scaling to fit within a 64x32 pixel tile (since Diablo uses isometric projection) - * 32 and 16 are used as the x/y scaling factors being half the relevant max dimension, the rotation matrix is [[-, +], [-, -]] as sin(-135°) = cos(-135°) = ~-0.7. + * Transforming from world space to screen space involves a rotation of -135° and scaling to fit within a 64x32 pixel tile (since Diablo uses isometric projection) + * 32 and 16 are used as the x/y scaling factors being half the relevant max dimension, the rotation matrix is [[-, +], [-, -]] as sin(-135°) = cos(-135°) = ~-0.7. * * [-32, 32] [dx] = [-32dx + 32dy] = [ 32dy - 32dx ] = [ 32(dy - dx)] * [-16, -16] [dy] = [-16dx + -16dy] = [-(16dy + 16dx)] = [-16(dy + dx)]