I noticed this library makes liberal use of unsigned integers, both in their raw form (e.g. std::uint32_t) and as part of tmx::Vector2u.
As a rule, unless you're doing bitwise operations or explicitly need wrapping behavior, unsigned integers should really be avoided. There are manyarticlesonline discussing the reasons why. They provide little to no protection against putting negative values where they don't belong, and instead open the door to a lot of weird bugs. There is a reason why the larger C++ world is slowly moving away from unsigned integers, and even added ssize (signed size) to the standard library in C++20.
It's really annoying trying to use this library with my own code and having to static_cast everything I pass or receive from it. It's doubly annoying when it doesn't come with any built-in conversions between Vector2i and Vector2u (or Vector2f). I skimmed through the source code and found nothing in there that actually requires the use of unsigned integers. They should really all be replaced with regular ints.
I noticed this library makes liberal use of unsigned integers, both in their raw form (e.g. std::uint32_t) and as part of tmx::Vector2u.
As a rule, unless you're doing bitwise operations or explicitly need wrapping behavior, unsigned integers should really be avoided. There are many articles online discussing the reasons why. They provide little to no protection against putting negative values where they don't belong, and instead open the door to a lot of weird bugs. There is a reason why the larger C++ world is slowly moving away from unsigned integers, and even added ssize (signed size) to the standard library in C++20.
It's really annoying trying to use this library with my own code and having to static_cast everything I pass or receive from it. It's doubly annoying when it doesn't come with any built-in conversions between Vector2i and Vector2u (or Vector2f). I skimmed through the source code and found nothing in there that actually requires the use of unsigned integers. They should really all be replaced with regular ints.