From bcc68d6684ec2e8b9ce7a37986027fc55f7ae562 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Thu, 19 Aug 2021 17:40:58 +0200 Subject: [PATCH] Allow queue of a redraw after gpose. --- Penumbra.Api/RedrawType.cs | 2 ++ Penumbra/Interop/ActorRefresher.cs | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/Penumbra.Api/RedrawType.cs b/Penumbra.Api/RedrawType.cs index 372f8063..55bb227b 100644 --- a/Penumbra.Api/RedrawType.cs +++ b/Penumbra.Api/RedrawType.cs @@ -8,5 +8,7 @@ namespace Penumbra.Api Unload, RedrawWithoutSettings, RedrawWithSettings, + AfterGPoseWithSettings, + AfterGPoseWithoutSettings, } } \ No newline at end of file diff --git a/Penumbra/Interop/ActorRefresher.cs b/Penumbra/Interop/ActorRefresher.cs index 1fd1bccb..d901c651 100644 --- a/Penumbra/Interop/ActorRefresher.cs +++ b/Penumbra/Interop/ActorRefresher.cs @@ -246,6 +246,21 @@ namespace Penumbra.Interop WriteInvisible( actor, idx ); ++_currentFrame; + break; + case RedrawType.AfterGPoseWithSettings: + case RedrawType.AfterGPoseWithoutSettings: + if( _inGPose ) + { + _actorIds.Enqueue( ( _currentActorId, _currentActorName!, _currentActorRedrawType ) ); + _currentFrame = 0; + } + else + { + _currentActorRedrawType = _currentActorRedrawType == RedrawType.AfterGPoseWithSettings + ? RedrawType.WithSettings + : RedrawType.WithoutSettings; + } + break; default: throw new InvalidEnumArgumentException(); }