Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="texture"></param>
        /// <param name="channel"></param>
        /// <returns></returns>
        public static DensityMap Load(Texture texture, MapChannel channel)
        {
            string     key = texture.Name + (int)channel;
            DensityMap m   = null;

            if (!mSelfList.TryGetValue(key, out m))
            {
                m = new DensityMap(texture, channel);
            }
            ++(m.mRefCount);
            return(m);
        }
Beispiel #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="map"></param>
 /// <param name="channel"></param>
 public void SetDensityMap(Texture map, MapChannel channel)
 {
     if (mDensityMap != null)
     {
         mDensityMap.Unload();
         mDensityMap = null;
     }
     if (map != null)
     {
         mDensityMap           = DensityMap.Load(map, channel);
         mDensityMap.MapBounds = mMapBounds;
         mDensityMap.Filter    = mDensityMapFilter;
     }
 }
Beispiel #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="mapFile"></param>
 /// <param name="channel"></param>
 public void SetDensityMap(string mapFile, MapChannel channel)
 {
     if (mDensityMap != null)
     {
         mDensityMap.Unload();
         mDensityMap = null;
     }
     if (mapFile != "")
     {
         mDensityMap           = DensityMap.Load(mapFile, channel);
         mDensityMap.MapBounds = mMapBounds;
         mDensityMap.Filter    = mDensityMapFilter;
     }
 }
Beispiel #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="geom"></param>
 /// <param name="ldr"></param>
 internal GrassLayer(PagedGeometry geom, GrassLoader ldr)
 {
     mGeom              = geom;
     mParent            = ldr;
     mDensity           = 1.0f;
     mMinWidth          = 1.0f;
     mMinHeight         = 1.0f;
     mMaxWidth          = 1.0f;
     mMaxHeight         = 1.0f;
     mRenderTechnique   = GrassTechnique.Quad;
     mFadeTechnique     = FadeTechnique.Alpha;
     mAnimMag           = 1.0f;
     mAnimSpeed         = 1.0f;
     mAnimFreq          = 1.0f;
     mWaveCount         = 0.0f;
     mAnimate           = false;
     mShaderNeedsUpdate = true;
     mDensityMap        = null;
     mDensityMapFilter  = MapFilter.Bilinear;
     mColorMap          = null;
     mColorMapFilter    = MapFilter.Bilinear;
 }
Beispiel #5
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="geom"></param>
 /// <param name="ldr"></param>
 internal GrassLayer(PagedGeometry geom, GrassLoader ldr)
 {
     mGeom = geom;
     mParent = ldr;
     mDensity = 1.0f;
     mMinWidth = 1.0f;
     mMinHeight = 1.0f;
     mMaxWidth = 1.0f;
     mMaxHeight = 1.0f;
     mRenderTechnique = GrassTechnique.Quad;
     mFadeTechnique = FadeTechnique.Alpha;
     mAnimMag = 1.0f;
     mAnimSpeed = 1.0f;
     mAnimFreq = 1.0f;
     mWaveCount = 0.0f;
     mAnimate = false;
     mShaderNeedsUpdate = true;
     mDensityMap = null;
     mDensityMapFilter = MapFilter.Bilinear;
     mColorMap = null;
     mColorMapFilter = MapFilter.Bilinear;
 }
Beispiel #6
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="map"></param>
 /// <param name="channel"></param>
 public void SetDensityMap(Texture map, MapChannel channel)
 {
     if (mDensityMap != null)
     {
         mDensityMap.Unload();
         mDensityMap = null;
     }
     if (map != null)
     {
         mDensityMap = DensityMap.Load(map, channel);
         mDensityMap.MapBounds = mMapBounds;
         mDensityMap.Filter = mDensityMapFilter;
     }
 }
Beispiel #7
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="mapFile"></param>
 /// <param name="channel"></param>
 public void SetDensityMap(string mapFile, MapChannel channel)
 {
     if (mDensityMap != null)
     {
         mDensityMap.Unload();
         mDensityMap = null;
     }
     if (mapFile != "")
     {
         mDensityMap = DensityMap.Load(mapFile, channel);
         mDensityMap.MapBounds = mMapBounds;
         mDensityMap.Filter = mDensityMapFilter;
     }
 }
Beispiel #8
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="texture"></param>
 /// <param name="channel"></param>
 /// <returns></returns>
 public static DensityMap Load(Texture texture, MapChannel channel)
 {
     string key = texture.Name + (int)channel;
     DensityMap m = null;
     if (!mSelfList.TryGetValue(key, out m))
     {
         m = new DensityMap(texture, channel);
     }
     ++(m.mRefCount);
     return m;
 }