private static void UpdateTextureArray() { if (m_textureArrayDirty) { var arrayManager = MyManagers.FileArrayTextures; arrayManager.DisposeTex(ref m_textureArray); m_textureArray = null; var texts = GetTextureArrayFileList(); if (texts.Length > 0) { if (!arrayManager.CheckConsistency(texts)) { CleanUpTextures(); texts = GetTextureArrayFileList(); } if (texts.Length > 0) { m_textureArray = arrayManager.CreateFromFiles("gpuParticles", texts, MyFileTextureEnum.GPUPARTICLES, "", false); } } m_textureArrayDirty = false; } }
private static void DoneDevice() { var arrayManager = MyManagers.FileArrayTextures; arrayManager.DisposeTex(ref m_textureArray); m_textureArray = null; m_textureArrayDirty = false; }
public void Init(string name, MyFileTextureEnum type, byte[] errorBytePattern, Format formatBytePattern) { m_name = name; m_type = type; m_arrayTexture = null; m_dirtyFlag = false; m_numRefs = 1; m_errorBytePattern = errorBytePattern; m_formatBytePattern = formatBytePattern; }
public void OnUnloadData() { MyFileArrayTexture[] array = new MyFileArrayTexture[m_texturesOnAutoDisposal.Count]; m_texturesOnAutoDisposal.CopyTo(array); foreach (var myTex in array) { IFileArrayTexture tex = myTex; DisposeTex(ref tex); } m_texturesOnAutoDisposal.Clear(); }
public void Update() { if (!m_dirtyFlag) { return; } m_dirtyFlag = false; if (m_arrayTexture != null) { MyManagers.FileArrayTextures.DisposeTex(ref m_arrayTexture); } if (m_filepaths.Count != 0) { m_arrayTexture = MyManagers.FileArrayTextures.CreateFromFiles(m_name, m_filepaths.ToArray(), m_type, m_errorBytePattern, m_formatBytePattern, false); } }
public void DisposeTex(ref IFileArrayTexture texture) { if (texture == null) { return; } MyFileArrayTexture textureInternal = (MyFileArrayTexture)texture; if (m_isDeviceInit) { textureInternal.OnDeviceEnd(); } m_fileTextureArrays.Deallocate(textureInternal); texture = null; }
public void DisposeTex(ref IFileArrayTexture texture) { if (texture == null) { return; } MyFileArrayTexture textureInternal = (MyFileArrayTexture)texture; if (m_isDeviceInit) { textureInternal.OnDeviceEnd(); } if (m_texturesOnAutoDisposal.Contains(textureInternal)) { m_texturesOnAutoDisposal.Remove(textureInternal); } m_fileTextureArrays.Deallocate(textureInternal); texture = null; }
public void Update() { if (!m_dirtyFlag) { return; } m_dirtyFlag = false; var previousArrayTexture = m_arrayTexture; if (m_filepaths.Count == 0) { m_arrayTexture = null; } else { m_arrayTexture = MyManagers.FileArrayTextures.CreateFromFiles(m_name, m_filepaths.ToArray(), m_type, m_errorBytePattern, m_formatBytePattern, false, previousArrayTexture as MyFileArrayTexture); } MyManagers.FileArrayTextures.DisposeTex(ref previousArrayTexture); }
public void DisposeTex(ref IFileArrayTexture texture) { if (texture == null) return; MyFileArrayTexture textureInternal = (MyFileArrayTexture) texture; if (m_isDeviceInit) textureInternal.OnDeviceEnd(); if (m_texturesOnAutoDisposal.Contains(textureInternal)) m_texturesOnAutoDisposal.Remove(textureInternal); m_fileTextureArrays.Deallocate(textureInternal); texture = null; }
private static void UpdateTextureArray() { if (m_textureArrayDirty) { var arrayManager = MyManagers.FileArrayTextures; arrayManager.DisposeTex(ref m_textureArray); m_textureArray = null; var texts = GetTextureArrayFileList(); if (texts.Length > 0) { if (!arrayManager.CheckConsistency(texts)) { CleanUpTextures(); texts = GetTextureArrayFileList(); } if (texts.Length > 0) m_textureArray = arrayManager.CreateFromFiles("gpuParticles", texts, MyFileTextureEnum.GPUPARTICLES, "", false); } m_textureArrayDirty = false; } }
public void DisposeTex(ref IFileArrayTexture texture) { if (texture == null) return; MyFileArrayTexture textureInternal = (MyFileArrayTexture) texture; if (m_isDeviceInit) textureInternal.OnDeviceEnd(); m_fileTextureArrays.Deallocate(textureInternal); texture = null; }
public void Update() { if (!m_dirtyFlag) return; m_dirtyFlag = false; if (m_arrayTexture != null) MyManagers.FileArrayTextures.DisposeTex(ref m_arrayTexture); if (m_filepaths.Count != 0) m_arrayTexture = MyManagers.FileArrayTextures.CreateFromFiles(m_name, m_filepaths.ToArray(), m_type, m_errorBytePattern, m_formatBytePattern, false); }