From ae2b6bbd3bf1436a913f77004544bb2d3ab4473d Mon Sep 17 00:00:00 2001 From: Simon Weis Date: Thu, 23 Jan 2025 07:45:22 +0100 Subject: [PATCH] Pull in changes from FGJ2024 --- impl/jamtemplate/common/tilemap/tileson_loader.cpp | 3 +++ impl/jamtemplate/common/vector.cpp | 7 +++++++ impl/jamtemplate/common/vector.hpp | 1 + 3 files changed, 11 insertions(+) diff --git a/impl/jamtemplate/common/tilemap/tileson_loader.cpp b/impl/jamtemplate/common/tilemap/tileson_loader.cpp index 11d1ffed..a1bc62d9 100644 --- a/impl/jamtemplate/common/tilemap/tileson_loader.cpp +++ b/impl/jamtemplate/common/tilemap/tileson_loader.cpp @@ -216,6 +216,9 @@ jt::TilemapCollisions jt::tilemap::TilesonLoader::loadCollisionsFromLayer( if (!blockedProperty) { continue; } + if (!blockedProperty->getValue()) { + continue; + } auto posx = std::get<0>(pos); auto posy = std::get<1>(pos); diff --git a/impl/jamtemplate/common/vector.cpp b/impl/jamtemplate/common/vector.cpp index 23b3d65b..00451ea1 100644 --- a/impl/jamtemplate/common/vector.cpp +++ b/impl/jamtemplate/common/vector.cpp @@ -15,6 +15,13 @@ jt::Vector2f& jt::operator-=(jt::Vector2f& lhs, jt::Vector2f const& rhs) noexcep return lhs; } +jt::Vector2f& jt::operator*=(jt::Vector2f& lhs, float const& rhs) noexcept +{ + lhs.x *= rhs; + lhs.y *= rhs; + return lhs; +} + std::ostream& jt::operator<<(std::ostream& os, jt::Vector2f const& vec) { return os << "(" << vec.x << ", " << vec.y << ")"; diff --git a/impl/jamtemplate/common/vector.hpp b/impl/jamtemplate/common/vector.hpp index 3e84c02e..2db189f8 100644 --- a/impl/jamtemplate/common/vector.hpp +++ b/impl/jamtemplate/common/vector.hpp @@ -39,6 +39,7 @@ constexpr jt::Vector2f operator-(jt::Vector2f const& a, jt::Vector2f const& b) n jt::Vector2f& operator+=(jt::Vector2f& lhs, jt::Vector2f const& rhs) noexcept; jt::Vector2f& operator-=(jt::Vector2f& lhs, jt::Vector2f const& rhs) noexcept; +jt::Vector2f& operator*=(jt::Vector2f& lhs, float const& rhs) noexcept; constexpr jt::Vector2f operator*(float const f, jt::Vector2f const& v) noexcept {