From 240b44af8ba6afc90605e715b7265d40ba6fb9ec Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Wed, 7 Feb 2018 17:04:49 +0100 Subject: [PATCH] More fixes double promotion --- rwengine/src/data/WeaponData.hpp | 2 +- rwengine/src/engine/Animator.cpp | 3 ++- rwengine/src/engine/SaveGame.cpp | 10 +++++----- rwengine/src/objects/CharacterObject.hpp | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/rwengine/src/data/WeaponData.hpp b/rwengine/src/data/WeaponData.hpp index 4274e485..edee94eb 100644 --- a/rwengine/src/data/WeaponData.hpp +++ b/rwengine/src/data/WeaponData.hpp @@ -31,7 +31,7 @@ struct WeaponData { int modelID; std::uint32_t flags; - int inventorySlot; + std::uint32_t inventorySlot; }; /** diff --git a/rwengine/src/engine/Animator.cpp b/rwengine/src/engine/Animator.cpp index 6440243a..e8c1ac5a 100644 --- a/rwengine/src/engine/Animator.cpp +++ b/rwengine/src/engine/Animator.cpp @@ -1,5 +1,6 @@ #include "engine/Animator.hpp" +#include #include #include @@ -47,7 +48,7 @@ void Animator::tick(float dt) { if (!state.repeat) { animTime = std::min(animTime, state.animation->duration); } else { - animTime = fmod(animTime, state.animation->duration); + animTime = std::fmod(animTime, state.animation->duration); } for (auto& b : state.boneInstances) { diff --git a/rwengine/src/engine/SaveGame.cpp b/rwengine/src/engine/SaveGame.cpp index b944e0f0..c6a53d0e 100644 --- a/rwengine/src/engine/SaveGame.cpp +++ b/rwengine/src/engine/SaveGame.cpp @@ -1210,11 +1210,11 @@ bool SaveGame::loadGame(GameState& state, const std::string& file) { #if RW_DEBUG for (const auto &type : pedTypeData.types) { printf("%08x: %f %f %f %f %f threat %08x avoid %08x\n", type.bitstring_, - type.unknown2, - type.unknown3, - type.unknown4, - type.fleedistance, - type.headingchangerate, + static_cast(type.unknown2), + static_cast(type.unknown3), + static_cast(type.unknown4), + static_cast(type.fleedistance), + static_cast(type.headingchangerate), type.threatflags_, type.avoidflags_); } diff --git a/rwengine/src/objects/CharacterObject.hpp b/rwengine/src/objects/CharacterObject.hpp index 2995b0c8..f2f15b88 100644 --- a/rwengine/src/objects/CharacterObject.hpp +++ b/rwengine/src/objects/CharacterObject.hpp @@ -185,8 +185,8 @@ public: glm::vec3 getLookDirection() const { float theta = m_look.y - glm::half_pi(); - return glm::vec3(sin(-m_look.x) * cos(theta), - cos(-m_look.x) * cos(theta), sin(theta)); + return glm::vec3(std::sin(-m_look.x) * std::cos(theta), + std::cos(-m_look.x) * std::cos(theta), std::sin(theta)); } /**