Skip to content

Commit

Permalink
Float correctness
Browse files Browse the repository at this point in the history
  • Loading branch information
vittorioromeo committed Jul 13, 2013
1 parent b201192 commit ee7815c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion _RELEASE/Packs/VeeEvolution/Scripts/evolutionpatterns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/SSVOpenHexagon/Core/HGUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/SSVOpenHexagon/Core/HexagonGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ namespace hg
runLuaFunction<void>("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())});
Expand Down Expand Up @@ -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()));
Expand Down
2 changes: 1 addition & 1 deletion src/SSVOpenHexagon/Core/MenuGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit ee7815c

Please sign in to comment.