From 39fcea91763d55999c055c7b46d5fc8848a7307d Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Wed, 1 Feb 2017 11:12:13 -0600 Subject: [PATCH] Added INTERPOLATE actor flag, allowing the previously reverted interpolation code to be toggleable. --- src/actor.h | 1 + src/gl/scene/gl_sprite.cpp | 7 +++++-- src/scripting/thingdef_data.cpp | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/actor.h b/src/actor.h index d83446827..aa842b97c 100644 --- a/src/actor.h +++ b/src/actor.h @@ -424,6 +424,7 @@ enum ActorRenderFlag RF_MASKROTATION = 0x00200000, // [MC] Only draw the actor when viewed from a certain angle range. RF_ABSMASKANGLE = 0x00400000, // [MC] The mask rotation does not offset by the actor's angle. RF_ABSMASKPITCH = 0x00800000, // [MC] The mask rotation does not offset by the actor's pitch. + RF_INTERPOLATE = 0x01000000, // [MC] Allow interpolation of the actor's angle, pitch and roll. RF_FORCEYBILLBOARD = 0x10000, // [BB] OpenGL only: draw with y axis billboard, i.e. anchored to the floor (overrides gl_billboard_mode setting) RF_FORCEXYBILLBOARD = 0x20000, // [BB] OpenGL only: draw with xy axis billboard, i.e. unanchored (overrides gl_billboard_mode setting) diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index e4c9f45af..4327043ec 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -737,8 +737,11 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal) int clipres = GLRenderer->mClipPortal->ClipPoint(thingpos); if (clipres == GLPortal::PClip_InFront) return; } - // disabled because almost none of the actual game code is even remotely prepared for this. Sorry for the few cases where it may be desired, but the overall effect is too bad. - Angles = thing->Angles;// InterpolatedAngles(r_TicFracF); + // disabled because almost none of the actual game code is even remotely prepared for this. If desired, use the INTERPOLATE flag. + if (thing->renderflags & RF_INTERPOLATE) + Angles = thing->InterpolatedAngles(r_TicFracF); + else + Angles = thing->Angles; player_t *player = &players[consoleplayer]; FloatRect r; diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index 9fa33314e..44821bd1e 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -326,6 +326,7 @@ static FFlagDef ActorFlagDefs[]= DEFINE_FLAG(RF, ABSMASKPITCH, AActor, renderflags), DEFINE_FLAG(RF, XFLIP, AActor, renderflags), DEFINE_FLAG(RF, YFLIP, AActor, renderflags), + DEFINE_FLAG(RF, INTERPOLATE, AActor, renderflags), // Bounce flags DEFINE_FLAG2(BOUNCE_Walls, BOUNCEONWALLS, AActor, BounceFlags),