From 297f00aa4ba0cefc2218dc67217dcc45f335e423 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Thu, 23 Nov 2017 22:37:07 -0500 Subject: [PATCH] - fix model rotation some more - a couple compiler warning fixes --- src/gl/models/gl_models.cpp | 6 +++--- src/i_time.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gl/models/gl_models.cpp b/src/gl/models/gl_models.cpp index 989b6d6ab..d170dce01 100644 --- a/src/gl/models/gl_models.cpp +++ b/src/gl/models/gl_models.cpp @@ -76,7 +76,7 @@ void FModelRenderer::RenderModel(float x, float y, float z, FSpriteModelFrame *s float scaleFactorZ = actor->Scale.Y * smf->zscale; float pitch = 0; float roll = 0; - float rotateOffset = 0; + double rotateOffset = 0; float angle = actor->Angles.Yaw.Degrees; // [BB] Workaround for the missing pitch information. @@ -102,8 +102,8 @@ void FModelRenderer::RenderModel(float x, float y, float z, FSpriteModelFrame *s if (smf->flags & MDL_ROTATING) { - const double time = smf->rotationSpeed*GetTimeFloat() / 200.f; - rotateOffset = float((time - xs_FloorToInt(time)) *360.f); + const double time = smf->rotationSpeed*GetTimeFloat() / 200.; + rotateOffset = double((time - xs_FloorToInt(time)) *360.); } // Added MDL_USEACTORPITCH and MDL_USEACTORROLL flags processing. diff --git a/src/i_time.cpp b/src/i_time.cpp index 71c7a8655..2aada4861 100644 --- a/src/i_time.cpp +++ b/src/i_time.cpp @@ -63,7 +63,7 @@ CUSTOM_CVAR(Float, i_timescale, 1.0f, CVAR_NOINITCALL) else { I_FreezeTime(true); - float clampValue = (self < 0.05) ? 0.05 : self; + float clampValue = (self < 0.05) ? 0.05f : self; if (self != clampValue) self = clampValue; TimeScale = self; @@ -74,7 +74,7 @@ CUSTOM_CVAR(Float, i_timescale, 1.0f, CVAR_NOINITCALL) static uint64_t GetClockTimeNS() { using namespace std::chrono; - return (uint64_t)duration_cast(steady_clock::now().time_since_epoch()).count() * TimeScale; + return (uint64_t)((duration_cast(steady_clock::now().time_since_epoch()).count()) * TimeScale); } static uint64_t MSToNS(unsigned int ms)