From ee7815c06d5b511940b912a4b5c6de75401ddecf Mon Sep 17 00:00:00 2001 From: Vittorio Romeo Date: Sun, 14 Jul 2013 01:37:47 +0200 Subject: Float correctness --- _RELEASE/Packs/VeeEvolution/Scripts/evolutionpatterns.lua | 2 +- src/SSVOpenHexagon/Core/HGUpdate.cpp | 2 +- src/SSVOpenHexagon/Core/HexagonGame.cpp | 4 ++-- src/SSVOpenHexagon/Core/MenuGame.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/_RELEASE/Packs/VeeEvolution/Scripts/evolutionpatterns.lua b/_RELEASE/Packs/VeeEvolution/Scripts/evolutionpatterns.lua index ae817659..c90df9c1 100755 --- a/_RELEASE/Packs/VeeEvolution/Scripts/evolutionpatterns.lua +++ b/_RELEASE/Packs/VeeEvolution/Scripts/evolutionpatterns.lua @@ -23,7 +23,7 @@ end function wallHMCurveAcc(mSide, mCurve, mCurveAcc, mCurveMin, mCurveMax, mCurvePingPong) if sync == true then - mCurve = getLevelValueFloat("rotation_speed") * 10 + mCurve = getLevelValueFloat("rotation_speed") * 10.0 mCurve = mCurve + (math.random(syncRndMin, syncRndMax) / 100.0) end diff --git a/src/SSVOpenHexagon/Core/HGUpdate.cpp b/src/SSVOpenHexagon/Core/HGUpdate.cpp index 1c0c8723..f1deca3b 100755 --- a/src/SSVOpenHexagon/Core/HGUpdate.cpp +++ b/src/SSVOpenHexagon/Core/HGUpdate.cpp @@ -130,7 +130,7 @@ namespace hg } void HexagonGame::updateRotation(float mFrameTime) { - auto nextRotation = abs(getRotationSpeed()) * 10 * mFrameTime; + auto nextRotation = abs(getRotationSpeed()) * 10.f * mFrameTime; if(status.fastSpin > 0) { nextRotation += abs((getSmootherStep(0, levelData.getValueFloat("fast_spin"), status.fastSpin) / 3.5f) * mFrameTime * 17.0f); diff --git a/src/SSVOpenHexagon/Core/HexagonGame.cpp b/src/SSVOpenHexagon/Core/HexagonGame.cpp index 3d0b7dd1..5ad23abb 100755 --- a/src/SSVOpenHexagon/Core/HexagonGame.cpp +++ b/src/SSVOpenHexagon/Core/HexagonGame.cpp @@ -84,7 +84,7 @@ namespace hg runLuaFunction("onLoad"); // Random rotation direction - if(getRnd(0, 100) > 50) setRotationSpeed(getRotationSpeed() * -1); + if(getRnd(0, 100) > 50) setRotationSpeed(getRotationSpeed() * -1.f); // Reset zoom overlayCamera.setView({{getWidth() / 2.f, getHeight() / 2.f}, ssvs::Vec2f(getWidth(), getHeight())}); @@ -120,7 +120,7 @@ namespace hg playSound("levelUp.ogg"); setRotationSpeed(levelData.getRotationSpeed() + levelData.getRotationSpeedIncrement() * getSign(getRotationSpeed())); - setRotationSpeed(levelData.getRotationSpeed() * -1); + setRotationSpeed(levelData.getRotationSpeed() * -1.f); if(status.fastSpin < 0 && abs(getRotationSpeed()) > levelData.getValueFloat("rotation_speed_max")) setRotationSpeed(levelData.getValueFloat("rotation_speed_max") * getSign(getRotationSpeed())); diff --git a/src/SSVOpenHexagon/Core/MenuGame.cpp b/src/SSVOpenHexagon/Core/MenuGame.cpp index 2e27e7f0..754afdfa 100755 --- a/src/SSVOpenHexagon/Core/MenuGame.cpp +++ b/src/SSVOpenHexagon/Core/MenuGame.cpp @@ -335,7 +335,7 @@ namespace hg if(state == States::PROFILE_NEW || state == States::ADD_FRIEND) { for(const auto& c : enteredChars) if(enteredString.size() < 16 && isalnum(c)) { playSound("beep.ogg"); enteredString.append(toStr(c)); } } else if(state == States::PROFILES) { enteredString = getProfileNames()[profileIndex % getProfileNames().size()]; } - else if(state == States::MAIN) { styleData.update(mFrameTime); backgroundCamera.rotate(levelData.getRotationSpeed() * 10 * mFrameTime); } + else if(state == States::MAIN) { styleData.update(mFrameTime); backgroundCamera.rotate(levelData.getRotationSpeed() * 10.f * mFrameTime); } enteredChars.clear(); } -- cgit v1.2.3