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

◆ RecreateResources()

void Microsoft.Xna.Framework.Graphics.DeviceResourceManager.RecreateResources ( _D3DPOOL pool,
[MarshalAs(UnmanagedType.U1)] bool deviceRecreated )
inline

Definition at line 447 of file DeviceResourceManager.cs.

448 {
449 if (pSyncObject == null)
450 {
451 return;
452 }
453 bool lockTaken = false;
454 try
455 {
457 ulong[] array = new ulong[pResourceData.Keys.Count];
460 for (int i = 0; i < (nint)array.LongLength; i++)
461 {
462 ulong key = array[i];
463 ResourceData resourceData = pResourceData[key];
464 if (resourceData.dwResourceManagementMode != (uint)pool)
465 {
466 continue;
467 }
469 if (!managedObject.IsAlive)
470 {
471 continue;
472 }
473 Effect effect = managedObject.Target as Effect;
474 if (effect != null && !effect.isDisposed && !deviceRecreated)
475 {
476 effect.OnResetDevice();
477 continue;
478 }
479 if (managedObject.Target is IGraphicsResource graphicsResource && !resourceData.isDisposed)
480 {
481 if (effect != null)
482 {
483 list.Add(effect);
484 }
485 else
486 {
487 int num = graphicsResource.RecreateAndPopulateObject();
488 if (num < 0)
489 {
490 throw GraphicsHelpers.GetExceptionFromResult((uint)num);
491 }
492 }
493 }
494 if (managedObject.Target is IDynamicGraphicsResource dynamicGraphicsResource)
495 {
497 }
498 }
500 while (enumerator.MoveNext())
501 {
502 int num2 = enumerator.Current.RecreateAndPopulateObject();
503 if (num2 < 0)
504 {
505 throw GraphicsHelpers.GetExceptionFromResult((uint)num2);
506 }
507 }
508 }
509 finally
510 {
511 if (lockTaken)
512 {
514 }
515 }
516 }
void Add(TKey key, TValue value)
static void Exit(object obj)
static void Enter(object obj)

References System.Collections.Generic.Dictionary< TKey, TValue >.Add(), 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(), System.Collections.Generic.Dictionary< TKey, TValue >.GetEnumerator(), Microsoft.Xna.Framework.Graphics.GraphicsHelpers.GetExceptionFromResult(), Microsoft.Xna.Framework.Graphics.GraphicsResource.isDisposed, System.key, System.Collections.Generic.Dictionary< TKey, TValue >.Keys, System.list, Microsoft.Xna.Framework.Graphics.Effect.OnResetDevice(), Microsoft.Xna.Framework.Graphics.DeviceResourceManager.pResourceData, and Microsoft.Xna.Framework.Graphics.DeviceResourceManager.pSyncObject.

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