Example #1
0
        /////////////////////////////////////////////////////////////////////////////
        public void Unload()
        {
            if (mMesh != null || mAlphaTexture != null)
            {
                Game.GameManager.GraphicsThread.CallOnThread(
                    () =>
                    {
                        if (mAlphaTexture != null)
                            ADTAlphaHandler.AddFreeTexture(mAlphaTexture);

                        if (mShadowTexture != null)
                            ADTAlphaHandler.AddFreeShadowTexture(mShadowTexture);

                        if (mMesh != null)
                        {
                            mMesh.Dispose();
                            mMesh = null;
                        }
                    },
                    true
                );
            }

            foreach (var inst in mDoodadInstances)
            {
                foreach (var id in inst.Value)
                    Game.GameManager.M2ModelManager.RemoveInstance(inst.Key, id);
            }

            foreach (var id in mConfirmedUniqueID)
            {
                var name = mParent.DoodadNames[mParent.ModelIdentifiers[(int)mParent.ModelDefinitions[(int)id].idMMID]];
                ADTManager.RemoveUniqueMdxId(name, mParent.ModelDefinitions[(int)id].uniqueId);
            }

            mParent = null;
            mFile = null;
            mLayers.Clear();
            mLayers = null;
            AlphaData = null;
            AlphaFloats = null;
        }
Example #2
0
 public ADTChunk(ADTFile parent, Stormlib.MPQFile file, MCIN info)
 {
     mParent = parent;
     mFile = file;
     mInfo = info;
 }
Example #3
0
 public ADTChunk(ADTFile parent, Stormlib.MPQFile file, MCIN info)
 {
     mParent = parent;
     mFile   = file;
     mInfo   = info;
 }