mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-12 13:37:08 +03:00
ClangFormat fixes
This commit is contained in:
parent
328e98229b
commit
303804438a
3 changed files with 463 additions and 472 deletions
|
@ -423,9 +423,9 @@ namespace MWWorld
|
||||||
float moonRiseHourYesterday = moonRiseHourToday - mDailyIncrement;
|
float moonRiseHourYesterday = moonRiseHourToday - mDailyIncrement;
|
||||||
if (moonRiseHourYesterday < 24.0f)
|
if (moonRiseHourYesterday < 24.0f)
|
||||||
{
|
{
|
||||||
// Morrowind offsets the increment by -1 when the previous day's visible point crosses into the next day.
|
// Morrowind offsets the increment by -1 when the previous day's visible point crosses into the next
|
||||||
// The offset lasts from this point until the next 24-day loop starts.
|
// day. The offset lasts from this point until the next 24-day loop starts. To find this point we add
|
||||||
// To find this point we add mDailyIncrement to the previous visible point and check the result.
|
// mDailyIncrement to the previous visible point and check the result.
|
||||||
float moonShadowEarlyFadeAngle1 = mFadeEndAngle - mMoonShadowEarlyFadeAngle;
|
float moonShadowEarlyFadeAngle1 = mFadeEndAngle - mMoonShadowEarlyFadeAngle;
|
||||||
float timeToVisible = moonShadowEarlyFadeAngle1 / rotation(1.0f);
|
float timeToVisible = moonShadowEarlyFadeAngle1 / rotation(1.0f);
|
||||||
float cycleOffset = (((moonRiseHourToday >= 24.0f) || (moonRiseHourYesterday + timeToVisible > 24.0f))
|
float cycleOffset = (((moonRiseHourToday >= 24.0f) || (moonRiseHourYesterday + timeToVisible > 24.0f))
|
||||||
|
@ -491,8 +491,7 @@ namespace MWWorld
|
||||||
// Note that we don't modulo after adding the latest daily increment because other calculations need to
|
// Note that we don't modulo after adding the latest daily increment because other calculations need to
|
||||||
// know if doing so would cause the moon rise to be postponed until the next day (which happens when
|
// know if doing so would cause the moon rise to be postponed until the next day (which happens when
|
||||||
// the moon rise hour is >= 24 in Morrowind).
|
// the moon rise hour is >= 24 in Morrowind).
|
||||||
return mDailyIncrement
|
return mDailyIncrement + std::fmod((gameDay - 1 + startDay - incrementOffset) * mDailyIncrement, 24.0f);
|
||||||
+ std::fmod((gameDay - 1 + startDay - incrementOffset) * mDailyIncrement, 24.0f);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -251,9 +251,8 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MoonModel(const std::string& name);
|
MoonModel(const std::string& name);
|
||||||
MoonModel(const std::string& name, float fadeInStart,
|
MoonModel(const std::string& name, float fadeInStart, float fadeInFinish, float fadeOutStart,
|
||||||
float fadeInFinish, float fadeOutStart, float fadeOutFinish,
|
float fadeOutFinish, float axisOffset, float speed, float dailyIncrement, float fadeStartAngle,
|
||||||
float axisOffset, float speed, float dailyIncrement, float fadeStartAngle,
|
|
||||||
float fadeEndAngle, float moonShadowEarlyFadeAngle);
|
float fadeEndAngle, float moonShadowEarlyFadeAngle);
|
||||||
|
|
||||||
MWRender::MoonState calculateState(const TimeStamp& gameTime) const;
|
MWRender::MoonState calculateState(const TimeStamp& gameTime) const;
|
||||||
|
|
|
@ -65,9 +65,8 @@ namespace MWWorld
|
||||||
timeStampBeforePostLoop += (24.0f * 28 + 23.0f + 59.0f / 60.0f);
|
timeStampBeforePostLoop += (24.0f * 28 + 23.0f + 59.0f / 60.0f);
|
||||||
timeStampAfterPostLoop += (24.0f * 29 + 0.0f + 1.0f / 60.0f);
|
timeStampAfterPostLoop += (24.0f * 29 + 0.0f + 1.0f / 60.0f);
|
||||||
|
|
||||||
MWWorld::MoonModel moon
|
MWWorld::MoonModel moon = MWWorld::MoonModel("", fadeInStart, fadeInFinish, fadeOutStart, fadeOutFinish,
|
||||||
= MWWorld::MoonModel("", fadeInStart, fadeInFinish, fadeOutStart, fadeOutFinish, axisOffset,
|
axisOffset, speed, dailyIncrement, fadeStartAngle, fadeEndAngle, moonShadowEarlyFadeAngle);
|
||||||
speed, dailyIncrement, fadeStartAngle, fadeEndAngle, moonShadowEarlyFadeAngle);
|
|
||||||
|
|
||||||
MWRender::MoonState beforeState = moon.calculateState(timeStampBefore);
|
MWRender::MoonState beforeState = moon.calculateState(timeStampBefore);
|
||||||
MWRender::MoonState afterState = moon.calculateState(timeStampAfter);
|
MWRender::MoonState afterState = moon.calculateState(timeStampAfter);
|
||||||
|
@ -100,9 +99,8 @@ namespace MWWorld
|
||||||
timeStampBeforePostLoop += (24.0f * 31 + 23.0f + 59.0f / 60.0f);
|
timeStampBeforePostLoop += (24.0f * 31 + 23.0f + 59.0f / 60.0f);
|
||||||
timeStampAfterPostLoop += (24.0f * 32 + 0.0f + 1.0f / 60.0f);
|
timeStampAfterPostLoop += (24.0f * 32 + 0.0f + 1.0f / 60.0f);
|
||||||
|
|
||||||
MWWorld::MoonModel moon
|
MWWorld::MoonModel moon = MWWorld::MoonModel("", fadeInStart, fadeInFinish, fadeOutStart, fadeOutFinish,
|
||||||
= MWWorld::MoonModel("", fadeInStart, fadeInFinish, fadeOutStart, fadeOutFinish, axisOffset,
|
axisOffset, speed, dailyIncrement, fadeStartAngle, fadeEndAngle, moonShadowEarlyFadeAngle);
|
||||||
speed, dailyIncrement, fadeStartAngle, fadeEndAngle, moonShadowEarlyFadeAngle);
|
|
||||||
|
|
||||||
MWRender::MoonState beforeState = moon.calculateState(timeStampBefore);
|
MWRender::MoonState beforeState = moon.calculateState(timeStampBefore);
|
||||||
MWRender::MoonState afterState = moon.calculateState(timeStampAfter);
|
MWRender::MoonState afterState = moon.calculateState(timeStampAfter);
|
||||||
|
@ -135,9 +133,8 @@ namespace MWWorld
|
||||||
timeStampBeforePostLoop += (24.0f * 34 + 23.0f + 59.0f / 60.0f);
|
timeStampBeforePostLoop += (24.0f * 34 + 23.0f + 59.0f / 60.0f);
|
||||||
timeStampAfterPostLoop += (24.0f * 35 + 0.0f + 1.0f / 60.0f);
|
timeStampAfterPostLoop += (24.0f * 35 + 0.0f + 1.0f / 60.0f);
|
||||||
|
|
||||||
MWWorld::MoonModel moon
|
MWWorld::MoonModel moon = MWWorld::MoonModel("", fadeInStart, fadeInFinish, fadeOutStart, fadeOutFinish,
|
||||||
= MWWorld::MoonModel("", fadeInStart, fadeInFinish, fadeOutStart, fadeOutFinish, axisOffset,
|
axisOffset, speed, dailyIncrement, fadeStartAngle, fadeEndAngle, moonShadowEarlyFadeAngle);
|
||||||
speed, dailyIncrement, fadeStartAngle, fadeEndAngle, moonShadowEarlyFadeAngle);
|
|
||||||
|
|
||||||
MWRender::MoonState beforeState = moon.calculateState(timeStampBefore);
|
MWRender::MoonState beforeState = moon.calculateState(timeStampBefore);
|
||||||
MWRender::MoonState afterState = moon.calculateState(timeStampAfter);
|
MWRender::MoonState afterState = moon.calculateState(timeStampAfter);
|
||||||
|
@ -170,9 +167,8 @@ namespace MWWorld
|
||||||
timeStampBeforePostLoop += (24.0f * 37 + 23.0f + 59.0f / 60.0f);
|
timeStampBeforePostLoop += (24.0f * 37 + 23.0f + 59.0f / 60.0f);
|
||||||
timeStampAfterPostLoop += (24.0f * 38 + 0.0f + 1.0f / 60.0f);
|
timeStampAfterPostLoop += (24.0f * 38 + 0.0f + 1.0f / 60.0f);
|
||||||
|
|
||||||
MWWorld::MoonModel moon
|
MWWorld::MoonModel moon = MWWorld::MoonModel("", fadeInStart, fadeInFinish, fadeOutStart, fadeOutFinish,
|
||||||
= MWWorld::MoonModel("", fadeInStart, fadeInFinish, fadeOutStart, fadeOutFinish, axisOffset,
|
axisOffset, speed, dailyIncrement, fadeStartAngle, fadeEndAngle, moonShadowEarlyFadeAngle);
|
||||||
speed, dailyIncrement, fadeStartAngle, fadeEndAngle, moonShadowEarlyFadeAngle);
|
|
||||||
|
|
||||||
MWRender::MoonState beforeState = moon.calculateState(timeStampBefore);
|
MWRender::MoonState beforeState = moon.calculateState(timeStampBefore);
|
||||||
MWRender::MoonState afterState = moon.calculateState(timeStampAfter);
|
MWRender::MoonState afterState = moon.calculateState(timeStampAfter);
|
||||||
|
@ -205,9 +201,8 @@ namespace MWWorld
|
||||||
timeStampBeforePostLoop += (24.0f * 41 + 2.0f + 56.0f / 60.0f);
|
timeStampBeforePostLoop += (24.0f * 41 + 2.0f + 56.0f / 60.0f);
|
||||||
timeStampAfterPostLoop += (24.0f * 41 + 2.0f + 58.0f / 60.0f);
|
timeStampAfterPostLoop += (24.0f * 41 + 2.0f + 58.0f / 60.0f);
|
||||||
|
|
||||||
MWWorld::MoonModel moon
|
MWWorld::MoonModel moon = MWWorld::MoonModel("", fadeInStart, fadeInFinish, fadeOutStart, fadeOutFinish,
|
||||||
= MWWorld::MoonModel("", fadeInStart, fadeInFinish, fadeOutStart, fadeOutFinish, axisOffset,
|
axisOffset, speed, dailyIncrement, fadeStartAngle, fadeEndAngle, moonShadowEarlyFadeAngle);
|
||||||
speed, dailyIncrement, fadeStartAngle, fadeEndAngle, moonShadowEarlyFadeAngle);
|
|
||||||
|
|
||||||
MWRender::MoonState beforeState = moon.calculateState(timeStampBefore);
|
MWRender::MoonState beforeState = moon.calculateState(timeStampBefore);
|
||||||
MWRender::MoonState afterState = moon.calculateState(timeStampAfter);
|
MWRender::MoonState afterState = moon.calculateState(timeStampAfter);
|
||||||
|
@ -240,9 +235,8 @@ namespace MWWorld
|
||||||
timeStampBeforePostLoop += (24.0f * 44 + 5.0f + 56.0f / 60.0f);
|
timeStampBeforePostLoop += (24.0f * 44 + 5.0f + 56.0f / 60.0f);
|
||||||
timeStampAfterPostLoop += (24.0f * 44 + 5.0f + 58.0f / 60.0f);
|
timeStampAfterPostLoop += (24.0f * 44 + 5.0f + 58.0f / 60.0f);
|
||||||
|
|
||||||
MWWorld::MoonModel moon
|
MWWorld::MoonModel moon = MWWorld::MoonModel("", fadeInStart, fadeInFinish, fadeOutStart, fadeOutFinish,
|
||||||
= MWWorld::MoonModel("", fadeInStart, fadeInFinish, fadeOutStart, fadeOutFinish, axisOffset,
|
axisOffset, speed, dailyIncrement, fadeStartAngle, fadeEndAngle, moonShadowEarlyFadeAngle);
|
||||||
speed, dailyIncrement, fadeStartAngle, fadeEndAngle, moonShadowEarlyFadeAngle);
|
|
||||||
|
|
||||||
MWRender::MoonState beforeState = moon.calculateState(timeStampBefore);
|
MWRender::MoonState beforeState = moon.calculateState(timeStampBefore);
|
||||||
MWRender::MoonState afterState = moon.calculateState(timeStampAfter);
|
MWRender::MoonState afterState = moon.calculateState(timeStampAfter);
|
||||||
|
@ -275,9 +269,8 @@ namespace MWWorld
|
||||||
timeStampBeforePostLoop += (24.0f * 47 + 8.0f + 56.0f / 60.0f);
|
timeStampBeforePostLoop += (24.0f * 47 + 8.0f + 56.0f / 60.0f);
|
||||||
timeStampAfterPostLoop += (24.0f * 47 + 8.0f + 58.0f / 60.0f);
|
timeStampAfterPostLoop += (24.0f * 47 + 8.0f + 58.0f / 60.0f);
|
||||||
|
|
||||||
MWWorld::MoonModel moon
|
MWWorld::MoonModel moon = MWWorld::MoonModel("", fadeInStart, fadeInFinish, fadeOutStart, fadeOutFinish,
|
||||||
= MWWorld::MoonModel("", fadeInStart, fadeInFinish, fadeOutStart, fadeOutFinish, axisOffset,
|
axisOffset, speed, dailyIncrement, fadeStartAngle, fadeEndAngle, moonShadowEarlyFadeAngle);
|
||||||
speed, dailyIncrement, fadeStartAngle, fadeEndAngle, moonShadowEarlyFadeAngle);
|
|
||||||
|
|
||||||
MWRender::MoonState beforeState = moon.calculateState(timeStampBefore);
|
MWRender::MoonState beforeState = moon.calculateState(timeStampBefore);
|
||||||
MWRender::MoonState afterState = moon.calculateState(timeStampAfter);
|
MWRender::MoonState afterState = moon.calculateState(timeStampAfter);
|
||||||
|
@ -289,7 +282,6 @@ namespace MWWorld
|
||||||
EXPECT_EQ(beforeStatePostLoop.mPhase, static_cast<MWRender::MoonState::Phase>(7));
|
EXPECT_EQ(beforeStatePostLoop.mPhase, static_cast<MWRender::MoonState::Phase>(7));
|
||||||
EXPECT_EQ(afterStatePostLoop.mPhase, static_cast<MWRender::MoonState::Phase>(0));
|
EXPECT_EQ(afterStatePostLoop.mPhase, static_cast<MWRender::MoonState::Phase>(0));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// SECUNDA PHASES
|
// SECUNDA PHASES
|
||||||
|
|
||||||
|
@ -736,4 +728,5 @@ namespace MWWorld
|
||||||
EXPECT_LE(beforeStatePostLoop.mMoonAlpha, 0.0f);
|
EXPECT_LE(beforeStatePostLoop.mMoonAlpha, 0.0f);
|
||||||
EXPECT_GT(afterStatePostLoop.mMoonAlpha, 0.0f);
|
EXPECT_GT(afterStatePostLoop.mMoonAlpha, 0.0f);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue