aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/types
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-03-23 00:28:28 +0100
committer hop311 <hop3114@gmail.com>2024-03-23 00:28:28 +0100
commit79c3462396fd4e1dcb7d1c9a2ef7bad741afa3e3 (patch)
tree4bf3a3318880609d6fdf2e96944bf84cdd2b8cdb /src/openvic-simulation/types
parent020ada6c8f0f1bf4486fd9e76ec29673044794d6 (diff)
GFX objectTypes loading framework + Actor loadinggfx-object
Diffstat (limited to 'src/openvic-simulation/types')
-rw-r--r--src/openvic-simulation/types/fixed_point/FixedPoint.hpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/openvic-simulation/types/fixed_point/FixedPoint.hpp b/src/openvic-simulation/types/fixed_point/FixedPoint.hpp
index 9ad7966..84d2b70 100644
--- a/src/openvic-simulation/types/fixed_point/FixedPoint.hpp
+++ b/src/openvic-simulation/types/fixed_point/FixedPoint.hpp
@@ -341,7 +341,7 @@ namespace OpenVic {
}
// Deterministic
- static constexpr fixed_point_t parse(char const* str, char const* const end, bool* successful = nullptr) {
+ static constexpr fixed_point_t parse(char const* str, char const* end, bool* successful = nullptr) {
if (successful != nullptr) {
*successful = false;
}
@@ -360,6 +360,16 @@ namespace OpenVic {
}
}
+ {
+ const char last_char = *(end - 1);
+ if (last_char == 'f' || last_char == 'F') {
+ --end;
+ if (str == end) {
+ return _0();
+ }
+ }
+ }
+
char const* dot_pointer = str;
while (*dot_pointer != '.' && ++dot_pointer != end) {}