Skip to content

Commit

Permalink
Fix room transitions when using editor
Browse files Browse the repository at this point in the history
  • Loading branch information
tzachshabtay committed Jun 8, 2018
1 parent 929c408 commit 9775372
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class RoomTransitionWorkflow : IRoomTransitionWorkflow
private readonly IAGSRenderPipeline _pipeline;
private readonly IGLUtils _glUtils;
private readonly DummyWindow _dummyWindow;
private readonly IGameSettings _noAspectRatioSettings;
private readonly IGameSettings _noAspectRatioSettings, _settings;
private readonly IAGSGameState _state;
private readonly IDisplayList _displayList;

Expand All @@ -41,6 +41,7 @@ public class RoomTransitionWorkflow : IRoomTransitionWorkflow
_pipeline = pipeline;
_state = state;
_displayList = displayList;
_settings = settings;
_noAspectRatioSettings = new AGSGameSettings(settings.Title, settings.VirtualResolution, preserveAspectRatio: false);
state.OnRoomChangeRequired.SubscribeToAsync(onRoomChangeRequired);
}
Expand Down Expand Up @@ -84,6 +85,7 @@ private async Task onRoomChangeRequired(RoomTransitionEventArgs args)
await waitForRender(() =>
{
if (transition == null || from == null || to == null || _state.Cutscene.IsSkipping) return false;
_glUtils.AdjustResolution(_settings.VirtualResolution.Width, _settings.VirtualResolution.Height);
if (_toTransitionBuffer == null) _toTransitionBuffer = renderToBuffer();
_dummyWindow.GameSubWindow = new Rectangle(0, 0, (int)_window.AppWindowWidth, (int)_window.AppWindowHeight);
_glUtils.RefreshViewport(_noAspectRatioSettings, _dummyWindow, _state.Viewport, false);
Expand Down

0 comments on commit 9775372

Please sign in to comment.