protected void _GenerateDuplicateClipMap(int worldViewIndex) { // if this is the first world view we've been asked to draw, use the base clip map if (_clipMaps.Count == 0 && _baseClipMap != null) { _clipMaps[worldViewIndex] = _baseClipMap; return; } // assert that we have a base clip map Assert.Fatal(_baseClipMap != null, "ClipMapEffect - No clip map set!"); // create a copy of the base clip map ClipMap newClipMap = new ClipMap(); newClipMap.Initialize(_baseClipMap.ImageCache.GetCopyOfInstance(), _baseClipMap.TextureSize, _baseClipMap.ClipMapSize); _clipMaps[worldViewIndex] = newClipMap; }
public override void Dispose() { _IsDisposed = true; TorqueEventManager.SilenceEvents<bool>(GFXDevice.Instance.DeviceCreated, OnDeviceCreated); TorqueEventManager.SilenceEvents<bool>(GFXDevice.Instance.DeviceReset, OnDeviceCreated); _textures[0] = null; _textures[1] = null; _textures[2] = null; _textures[3] = null; _textures = null; _levelData = null; _worldMatrixParameter = null; _lightPositionParameter = null; _lightDiffuseParameter = null; _lightAmbientParameter = null; _lightAttenuationParameter = null; _lightCountParameter = null; _worldViewProjectionParameter = null; _mapInfoParameter = null; _diffuseMap1Parameter = null; _diffuseMap2Parameter = null; _diffuseMap3Parameter = null; _diffuseMap4Parameter = null; _baseClipMap = null; _clipMaps.Clear(); _clipMaps = null; base.Dispose(); }