@@ -28,6 +28,11 @@ protected override void Dispose(bool disposing)
2828 base . Dispose ( disposing ) ;
2929 }
3030
31+ public static bool IgnoreSizeChanges = false ;
32+
33+ public static Rectangle LastBounds = Rectangle . Empty ;
34+ private static Rectangle lastActualBounds = Rectangle . Empty ;
35+
3136 public static ColorConfig Colors = new ColorConfig ( ) ;
3237
3338 public static Form WinForm ;
@@ -175,19 +180,19 @@ public static void ApplyPresentationParameters(int width, int height, SurfaceFor
175180 graphics . IsFullScreen = fullscreen ;
176181 graphics . SynchronizeWithVerticalRetrace = vsync ;
177182
178- // if (GFX.MSAA > 0)
179- // {
180- // graphics.PreferMultiSampling = true;
181- // graphics.GraphicsDevice.PresentationParameters.MultiSampleCount = GFX.MSAA;
182- // }
183- // else
184- // {
185- // graphics.PreferMultiSampling = false;
186- // graphics.GraphicsDevice.PresentationParameters.MultiSampleCount = 1;
187- // }
183+ if ( GFX . MSAA > 0 )
184+ {
185+ graphics . PreferMultiSampling = true ;
186+ graphics . GraphicsDevice . PresentationParameters . MultiSampleCount = GFX . MSAA ;
187+ }
188+ else
189+ {
190+ graphics . PreferMultiSampling = false ;
191+ graphics . GraphicsDevice . PresentationParameters . MultiSampleCount = 1 ;
192+ }
188193
189- graphics . PreferMultiSampling = false ;
190- graphics . GraphicsDevice . PresentationParameters . MultiSampleCount = 1 ;
194+ // graphics.PreferMultiSampling = false;
195+ // graphics.GraphicsDevice.PresentationParameters.MultiSampleCount = 1;
191196
192197 graphics . ApplyChanges ( ) ;
193198 }
@@ -307,21 +312,27 @@ private void Main_Activated(object sender, EventArgs e)
307312 UpdateActiveState ( ) ;
308313 }
309314
310- private Rectangle prevClientBounds = Rectangle . Empty ;
311315 private void Window_ClientSizeChanged ( object sender , EventArgs e )
312316 {
317+ if ( IgnoreSizeChanges )
318+ return ;
319+
313320 RequestHideOSD = RequestHideOSD_MAX ;
314321 UpdateActiveState ( ) ;
315322
316- TAE_EDITOR ? . HandleWindowResize ( prevClientBounds , Window . ClientBounds ) ;
323+ TAE_EDITOR ? . HandleWindowResize ( lastActualBounds , Window . ClientBounds ) ;
317324
318- prevClientBounds = Window . ClientBounds ;
325+ if ( Window . ClientBounds . Width > 0 && Window . ClientBounds . Height > 0 )
326+ LastBounds = Window . ClientBounds ;
327+ lastActualBounds = Window . ClientBounds ;
319328 }
320329
321330 public void RebuildRenderTarget ( )
322331 {
323332 if ( TimeBeforeNextRenderTargetUpdate <= 0 )
324333 {
334+ GFX . ClampAntialiasingOptions ( ) ;
335+
325336 int msaa = GFX . MSAA ;
326337 int ssaa = GFX . SSAA ;
327338
@@ -914,7 +925,7 @@ protected override void Draw(GameTime gameTime)
914925
915926 GFX . Device . SetRenderTarget ( SceneRenderTarget ) ;
916927
917- GFX . Device . Clear ( Color . Transparent ) ;
928+ GFX . Device . Clear ( Colors . MainColorViewportBackground ) ;
918929
919930 GFX . Device . Viewport = new Viewport ( 0 , 0 , SceneRenderTarget . Width , SceneRenderTarget . Height ) ;
920931
0 commit comments