diff options
author | HampusM <hampus@hampusmat.com> | 2022-03-10 19:12:31 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:55 +0200 |
commit | 38f14606c78c119d452f302f17329455e29a9a6f (patch) | |
tree | 03f6dfd9d3576e87260f7cb3bc436ad076b629c5 /src/engine/data/bounds.cpp | |
parent | 09848ad31af6a1c70d64fccee711e231afb5a77f (diff) |
refactor: rename game initializer & move input config
Diffstat (limited to 'src/engine/data/bounds.cpp')
-rw-r--r-- | src/engine/data/bounds.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/engine/data/bounds.cpp b/src/engine/data/bounds.cpp index acd98af..41b6dc0 100644 --- a/src/engine/data/bounds.cpp +++ b/src/engine/data/bounds.cpp @@ -32,11 +32,21 @@ CoordsValidation Bounds::validate_coords(const Vector2 &coords) const noexcept return CoordsValidation::X_HIGH; } + if (static_cast<uint32_t>(coords.get_x()) <= 0) + { + return CoordsValidation::X_LOW; + } + if (static_cast<uint32_t>(coords.get_y()) >= _height) { return CoordsValidation::Y_HIGH; } + if (static_cast<uint32_t>(coords.get_y()) <= 0) + { + return CoordsValidation::Y_LOW; + } + return CoordsValidation::VALID; } |