From 8aa59f2385a8248a795c68e33560ce57aeb24c1a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 15 Mar 2021 11:35:39 +0100 Subject: [PATCH] - use clamp instead of bit masking to handle out of range interpolation factors for models. --- source/build/src/mdsprite.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/build/src/mdsprite.cpp b/source/build/src/mdsprite.cpp index 8aba8ec76..1ce3b78f2 100644 --- a/source/build/src/mdsprite.cpp +++ b/source/build/src/mdsprite.cpp @@ -646,7 +646,7 @@ static void updateanimation(md2model_t *m, tspriteptr_t tspr, uint8_t lpal) //Printf("not smoothing... cframe %i nframe %i\n", m->cframe, m->nframe); } - m->interpol = ((float)(i&65535))/65536.f; + m->interpol = clamp(i, 0, 65535) / 65536.f; //Printf("interpol %f\n", m->interpol); prep_return: