From cf9c2f89334f4ae03ac686158d8c03a25bc49b7c Mon Sep 17 00:00:00 2001 From: Misa Date: Wed, 1 Jul 2020 14:45:50 -0700 Subject: [PATCH] Fix deltaframe render glitch when spawning animated double-size entities Their drawframe needs to be incremented by 2 instead of 1, because they're double-sized. Animation type 3 is used by the cloud emitter in The Solution is Dilution, animation type 6 is used by the radar dish in Comms Relay. Animation type 4 is used by the maverick bus in B-B-B-Busted, but it's not noticeable since it spawns offscreen. This bug would cause all of those entities to appear incorrectly for the deltaframes between the tick the room got loaded and the next tick after that. This is noticeable in flibit's tweet showing off my over-30-FPS patch: https://twitter.com/flibitijibibo/status/1273983014930993153 --- desktop_version/src/Entity.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/desktop_version/src/Entity.cpp b/desktop_version/src/Entity.cpp index e85a544e..4c4ff6b0 100644 --- a/desktop_version/src/Entity.cpp +++ b/desktop_version/src/Entity.cpp @@ -2032,14 +2032,16 @@ void entityclass::createentity( float xp, float yp, int t, float vx /*= 0*/, flo case 0: // Simple Loop case 1: // Simple Loop case 2: // Simpler Loop (just two frames) - case 3: // Simpler Loop (just two frames, but double sized) - case 4: // Simpler Loop (just two frames, but double sized) (as above, but slower) case 5: // Simpler Loop (just two frames) (slower) - case 6: // Normal Loop (four frames, double sized) case 7: // Simpler Loop (just two frames) (slower) (with directions!) case 11: // Conveyor right entity.drawframe++; break; + case 3: // Simpler Loop (just two frames, but double sized) + case 4: // Simpler Loop (just two frames, but double sized) (as above, but slower) + case 6: // Normal Loop (four frames, double sized) + entity.drawframe += 2; + break; case 10: // Conveyor left entity.drawframe += 3; break;