diff --git a/src/gl/models/gl_models.cpp b/src/gl/models/gl_models.cpp index 9bd76dd16..454b31d4c 100644 --- a/src/gl/models/gl_models.cpp +++ b/src/gl/models/gl_models.cpp @@ -146,11 +146,6 @@ void FGLModelRenderer::DrawElements(int numIndices, size_t offset) glDrawElements(GL_TRIANGLES, numIndices, GL_UNSIGNED_INT, (void*)(intptr_t)offset); } -double FGLModelRenderer::GetTimeFloat() -{ - return (double)I_msTime() * (double)TICRATE / 1000.; -} - //=========================================================================== // // Uses a hardware buffer if either single frame (i.e. no interpolation needed) diff --git a/src/gl/models/gl_models.h b/src/gl/models/gl_models.h index de3fdfe7e..f9458890a 100644 --- a/src/gl/models/gl_models.h +++ b/src/gl/models/gl_models.h @@ -48,7 +48,6 @@ public: void SetMaterial(FTexture *skin, bool clampNoFilter, int translation) override; void DrawArrays(int start, int count) override; void DrawElements(int numIndices, size_t offset) override; - double GetTimeFloat() override; }; void gl_RenderModel(GLSprite * spr, int mli); diff --git a/src/polyrenderer/scene/poly_model.cpp b/src/polyrenderer/scene/poly_model.cpp index 2e057709b..bb0c3fb52 100644 --- a/src/polyrenderer/scene/poly_model.cpp +++ b/src/polyrenderer/scene/poly_model.cpp @@ -181,11 +181,6 @@ void PolyModelRenderer::DrawElements(int numIndices, size_t offset) args.DrawElements(Thread->DrawQueue, VertexBuffer, IndexBuffer + offset / sizeof(unsigned int), numIndices); } -double PolyModelRenderer::GetTimeFloat() -{ - return (double)I_msTime() * (double)TICRATE / 1000.; -} - ///////////////////////////////////////////////////////////////////////////// PolyModelVertexBuffer::PolyModelVertexBuffer(bool needindex, bool singleframe) diff --git a/src/polyrenderer/scene/poly_model.h b/src/polyrenderer/scene/poly_model.h index f5a9bd779..cc12f9e6e 100644 --- a/src/polyrenderer/scene/poly_model.h +++ b/src/polyrenderer/scene/poly_model.h @@ -46,7 +46,6 @@ public: void SetMaterial(FTexture *skin, bool clampNoFilter, int translation) override; void DrawArrays(int start, int count) override; void DrawElements(int numIndices, size_t offset) override; - double GetTimeFloat() override; void SetTransform(); diff --git a/src/r_data/models/models.cpp b/src/r_data/models/models.cpp index 65b588f24..b49be91c3 100644 --- a/src/r_data/models/models.cpp +++ b/src/r_data/models/models.cpp @@ -39,6 +39,7 @@ #include "g_levellocals.h" #include "r_utility.h" #include "r_data/models/models.h" +#include "i_time.h" #ifdef _MSC_VER #pragma warning(disable:4244) // warning C4244: conversion from 'double' to 'float', possible loss of data @@ -277,6 +278,11 @@ void FModelRenderer::RenderFrameModels(const FSpriteModelFrame *smf, } } +double FModelRenderer::GetTimeFloat() +{ + return (double)I_msTime() * (double)TICRATE / 1000.; +} + ///////////////////////////////////////////////////////////////////////////// void gl_LoadModels() diff --git a/src/r_data/models/models.h b/src/r_data/models/models.h index e6786a721..91d3d14d6 100644 --- a/src/r_data/models/models.h +++ b/src/r_data/models/models.h @@ -72,10 +72,9 @@ public: virtual void DrawArrays(int start, int count) = 0; virtual void DrawElements(int numIndices, size_t offset) = 0; - virtual double GetTimeFloat() = 0; - private: void RenderFrameModels(const FSpriteModelFrame *smf, const FState *curState, const int curTics, const PClass *ti, Matrix3x4 *normaltransform, int translation); + static double GetTimeFloat(); }; struct FModelVertex diff --git a/src/swrenderer/things/r_model.cpp b/src/swrenderer/things/r_model.cpp index a07cd0682..84f4de39d 100644 --- a/src/swrenderer/things/r_model.cpp +++ b/src/swrenderer/things/r_model.cpp @@ -239,11 +239,6 @@ namespace swrenderer args.DrawElements(Thread->DrawQueue, VertexBuffer, IndexBuffer + offset / sizeof(unsigned int), numIndices); } - double SWModelRenderer::GetTimeFloat() - { - return (double)I_msTime() * (double)TICRATE / 1000.; - } - ///////////////////////////////////////////////////////////////////////////// SWModelVertexBuffer::SWModelVertexBuffer(bool needindex, bool singleframe) diff --git a/src/swrenderer/things/r_model.h b/src/swrenderer/things/r_model.h index 7006ca8dd..5d8f7b688 100644 --- a/src/swrenderer/things/r_model.h +++ b/src/swrenderer/things/r_model.h @@ -66,7 +66,6 @@ namespace swrenderer void SetMaterial(FTexture *skin, bool clampNoFilter, int translation) override; void DrawArrays(int start, int count) override; void DrawElements(int numIndices, size_t offset) override; - double GetTimeFloat() override; void SetTransform();