示例#1
0
 public virtual void Dispose()
 {
     if (data != null)
     {
         data.Dispose();
         data = null;
     }
 }
示例#2
0
 public void Set(LTexture.Mask d, int x, int y, int w, int h)
 {
     this.data = d;
     if (rect == null)
     {
         this.rect = new RectBox(x, y, w, h);
     }
     else
     {
         this.rect.SetBounds(x, y, w, h);
     }
 }
示例#3
0
        public static LTexture.Mask CreateMask(uint[] pixels, int w, int h)
        {
            int width  = w;
            int height = h;

            LTexture.Mask d    = new LTexture.Mask(width, height);
            bool[][]      mask = (bool[][])CollectionUtils.XNA_CreateJaggedArray(typeof(bool), height, width);
            for (int y = 0; y < height; y++)
            {
                for (int x = 0; x < width; x++)
                {
                    mask[y][x] = (pixels[x + w * y] & LSystem.TRANSPARENT) == LSystem.TRANSPARENT;
                }
            }
            d.SetData(mask);
            return(d);
        }
示例#4
0
 public CollisionMask(LTexture.Mask d)
 {
     Set(d, 0, 0, d.GetWidth(), d.GetHeight());
 }