Browse Source

Fix a couple of noisy MSVC warnings

pull/2999/head
Gleb Mazovetskiy 5 years ago committed by Anders Jenbo
parent
commit
ff9affa513
  1. 2
      Source/DiabloUI/ui_item.h
  2. 4
      Source/engine/displacement.hpp

2
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;

4
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)]

Loading…
Cancel
Save