From 7e046e2649c7e2d5923f13d37e8e2c2585d3e9d5 Mon Sep 17 00:00:00 2001 From: Eli2 Date: Wed, 17 Aug 2016 00:46:47 +0200 Subject: [PATCH] Use ArxDuration --- src/animation/AnimationRender.cpp | 2 +- src/core/TimeTypes.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/animation/AnimationRender.cpp b/src/animation/AnimationRender.cpp index b48bdda896..fc4d8d36c6 100644 --- a/src/animation/AnimationRender.cpp +++ b/src/animation/AnimationRender.cpp @@ -1132,7 +1132,7 @@ static void Cedric_RenderObject(EERIE_3DOBJ * eobj, Skeleton * obj, Entity * io, if(io && (io->sfx_flag & SFX_TYPE_YLSIDE_DEATH) && io->show != SHOW_FLAG_TELEPORTING) { const ArxDuration elapsed = arxtime.now() - io->sfx_time; if(elapsed >= ArxDurationMs(3000) && elapsed < ArxDurationMs(6000)) { - float ratio = (elapsed - 3000) * (1.0f / 3000); + float ratio = toMs(elapsed - ArxDurationMs(3000)) * (1.0f / 3000); glowColor = Color::gray(ratio).toRGB(); glow = true; } diff --git a/src/core/TimeTypes.h b/src/core/TimeTypes.h index 86ae7af2fb..dca4f2069b 100644 --- a/src/core/TimeTypes.h +++ b/src/core/TimeTypes.h @@ -140,12 +140,14 @@ inline ArxInstant operator -(ArxInstant a, ArxDuration b) { return ArxInstant(a.t - b.t); } +#ifndef ARX_REFACTOR_TIMETYPES inline ArxDuration operator +(ArxDuration a, ArxDuration b) { return ArxDuration(a.t + b.t); } inline ArxDuration operator -(ArxDuration a, ArxDuration b) { return ArxDuration(a.t - b.t); } +#endif // FIXME copy-paste