From cdafeef732c1ead7aff885a0898ca0f7a72a8516 Mon Sep 17 00:00:00 2001 From: plagman Date: Sun, 11 Mar 2012 06:52:41 +0000 Subject: [PATCH] polymer: fix animations that loop to frame 0 With VBOs enabled, the virtual pointer to the geometry of frame 0 of a model is always NULL. This was confusing the polymer code responsible for deciding whether to enable smooth animations or not, which meant that any animation that would loop to frame 0 would do it as if animation interpolation was disabled, which looks very choppy. git-svn-id: https://svn.eduke32.com/eduke32@2443 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/polymer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 50574bafe..d252b39a1 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -4387,7 +4387,7 @@ static void polymer_getscratchmaterial(_prmaterial* material) // PR_BIT_ANIM_INTERPOLATION material->frameprogress = 0.0f; - material->nextframedata = NULL; + material->nextframedata = (float*)-1; // PR_BIT_NORMAL_MAP material->normalmap = 0; material->normalbias[0] = material->normalbias[1] = 0.0f; @@ -4523,7 +4523,7 @@ static int32_t polymer_bindmaterial(_prmaterial material, int16_t* lights, // --------- bit validation // PR_BIT_ANIM_INTERPOLATION - if (material.nextframedata) + if (material.nextframedata != ((float*)-1)) programbits |= prprogrambits[PR_BIT_ANIM_INTERPOLATION].bit; // PR_BIT_LIGHTING_PASS