Esempio n. 1
0
        /// <summary>Constructor for a one-shot only image (no mipmapping).</summary>
        internal DXTexturedImage(DXTileSet tileSet, RectangleF imageLocation, RectangleF renderingPositionAndSize)
        {
            this.tileSet       = tileSet;
            this.imageLocation = imageLocation;

            int   mipMapLevel           = 0;
            float horizontalScaleFactor = renderingPositionAndSize.Width / imageLocation.Width;
            float verticalScaleFactor   = renderingPositionAndSize.Height / imageLocation.Height;
            float mipMapFactor          = Math.Max(horizontalScaleFactor, verticalScaleFactor);

            while (mipMapLevel < (int)tileSet.DetailLevel || (mipMapFactor < 0.5f && mipMapLevel < tileSet.MipMapLevelCount - 1))
            {
                ++mipMapLevel;
                mipMapFactor *= 2.0f;
            }

            tesselate(mipMapLevel);
        }
Esempio n. 2
0
 /// <summary>Constructor.</summary>
 internal DXTexturedImage(DXTileSet tileSet, RectangleF imageLocation)
 {
     this.tileSet       = tileSet;
     this.imageLocation = imageLocation;
     tesselate(-1);
 }
Esempio n. 3
0
 internal DXTile(DXTileSet tileSet)
 {
     this.tileSet = tileSet;
     this.texture = null;
 }