diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-16 20:37:06 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-16 20:37:06 +0200 |
| commit | 6e40ad6aa2eb43066d939f5e1c920b2a8cbf49a1 (patch) | |
| tree | f920e30aa337e2bbd210016bee5ad3826d074508 /shaders | |
| parent | 7f26f8fd7f3171eda4a194d8fd5ffcbba80dd31f (diff) | |
a
Diffstat (limited to 'shaders')
| -rw-r--r-- | shaders/tile-shader.cpp | 2 | ||||
| -rw-r--r-- | shaders/tile-shader.hpp | 8 |
2 files changed, 1 insertions, 9 deletions
diff --git a/shaders/tile-shader.cpp b/shaders/tile-shader.cpp index b0177997..20b2230f 100644 --- a/shaders/tile-shader.cpp +++ b/shaders/tile-shader.cpp @@ -41,7 +41,7 @@ tile_shader& tile_shader::set_camera_offset(Vector2 camera_offset) CORRADE_INTERNAL_ASSERT(std::fabs(camera_offset[0]) <= std::scalbn(1.f, std::numeric_limits<float>::digits)); CORRADE_INTERNAL_ASSERT(std::fabs(camera_offset[1]) <= std::scalbn(1.f, std::numeric_limits<float>::digits)); if (camera_offset != camera_offset_) - setUniform(OffsetUniform, camera_offset_ = camera_offset); + setUniform(OffsetUniform, 2*(camera_offset_ = camera_offset)); return *this; } diff --git a/shaders/tile-shader.hpp b/shaders/tile-shader.hpp index 0e1e4442..c53dfff5 100644 --- a/shaders/tile-shader.hpp +++ b/shaders/tile-shader.hpp @@ -20,8 +20,6 @@ struct tile_shader : GL::AbstractShaderProgram Vector4 tint() const { return tint_; } tile_shader& set_tint(const Vector4& tint); - static constexpr Vector2 project(Vector3 pt); - private: Vector2 scale_, camera_offset_; Vector4 tint_; @@ -29,10 +27,4 @@ private: enum { ScaleUniform = 0, OffsetUniform = 1, TintUniform = 2, }; }; -constexpr Vector2 tile_shader::project(const Vector3 pt) -{ - float x = -pt[1], y = -pt[0], z = pt[2]; - return { x-y, (x+y+z*2)*.75f }; -} - } // namespace floormat |
