Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ReleaseAutomaticResources()

void Microsoft.Xna.Framework.Graphics.DeviceResourceManager.ReleaseAutomaticResources ( )
inline

Definition at line 384 of file DeviceResourceManager.cs.

385 {
386 if (pSyncObject == null)
387 {
388 return;
389 }
390 int num = 0;
391 bool lockTaken = false;
392 try
393 {
395 ulong[] array = new ulong[pResourceData.Keys.Count];
397 for (int i = 0; i < (nint)array.LongLength; i++)
398 {
399 ulong key = array[i];
400 ResourceData resourceData = pResourceData[key];
401 switch (resourceData.dwResourceManagementMode)
402 {
403 case 1u:
404 {
406 if (managedObject2.IsAlive && managedObject2.Target is IGraphicsResource graphicsResource)
407 {
408 if (!resourceData.isDisposed)
409 {
410 num = graphicsResource.SaveDataForRecreation();
411 }
412 if (num < 0)
413 {
414 throw GraphicsHelpers.GetExceptionFromResult((uint)num);
415 }
416 }
417 break;
418 }
419 case 0u:
420 {
422 if (managedObject.IsAlive && managedObject.Target is Effect effect)
423 {
424 if (!resourceData.isDisposed)
425 {
426 num = effect.SaveDataForRecreation();
427 }
428 if (num < 0)
429 {
430 throw GraphicsHelpers.GetExceptionFromResult((uint)num);
431 }
432 }
433 break;
434 }
435 }
436 }
437 }
438 finally
439 {
440 if (lockTaken)
441 {
443 }
444 }
445 }
static void Exit(object obj)
static void Enter(object obj)

References System.array, System.Collections.Generic.Dictionary< TKey, TValue >.KeyCollection.CopyTo(), System.Collections.Generic.Dictionary< TKey, TValue >.KeyCollection.Count, System.Threading.Monitor.Enter(), System.Threading.Monitor.Exit(), Microsoft.Xna.Framework.Graphics.GraphicsHelpers.GetExceptionFromResult(), System.key, System.Collections.Generic.Dictionary< TKey, TValue >.Keys, Microsoft.Xna.Framework.Graphics.DeviceResourceManager.pResourceData, and Microsoft.Xna.Framework.Graphics.DeviceResourceManager.pSyncObject.

Referenced by Microsoft.Xna.Framework.Graphics.GraphicsDevice.Reset().