示例#1
0
 public void Draw(GLEx g, int minX, int minY, int maxX, int maxY)
 {
     if (!visible)
     {
         return;
     }
     lock (values)
     {
         batch.Begin();
         if (alpha > 0 && alpha < 1)
         {
             batch.SetAlpha(alpha);
         }
         for (int i = 0; i < count; i++)
         {
             LTextureObject tex2d = this.values[i];
             if (tex2d == null || !tex2d.visible)
             {
                 continue;
             }
             nx = minX + tex2d.x;
             ny = minY + tex2d.y;
             if (nx + tex2d.width < minX || nx > maxX ||
                 ny + tex2d.height < minY || ny > maxY)
             {
                 continue;
             }
             LTexture texture = tex2d.texture;
             if (texture == null)
             {
                 continue;
             }
             if (tex2d.width != 0 && tex2d.height != 0)
             {
                 batch.Draw(texture, tex2d.x, tex2d.y, tex2d.width,
                            tex2d.height);
             }
             else
             {
                 batch.Draw(texture, tex2d.x, tex2d.y);
             }
         }
         if (alpha > 0 && alpha < 1)
         {
             batch.ResetColor();
         }
         batch.End();
     }
 }
示例#2
0
        public LTextureObject Remove(int i)
        {
            if ((i >= this.count) || (i < 0))
            {
                throw new IndexOutOfRangeException("Referenced " + i + ", size = "
                                                   + this.count.ToString());
            }
            LTextureObject ret = this.values[i];

            if (i < this.count - 1)
            {
                System.Array.Copy((Array)(this.values), i + 1, (Array)(this.values), i, this.count - i
                                  - 1);
            }
            this.count -= 1;
            return(ret);
        }
示例#3
0
 public int Add(LTextureObject tex2d)
 {
     if (this.count == this.values.Length)
     {
         LTextureObject[] oldValue = this.values;
         if (this.autoExpand)
         {
             this.values = new LTextureObject[(oldValue.Length << 1) + 1];
         }
         else
         {
             this.values = new LTextureObject[oldValue.Length + 1];
         }
         System.Array.Copy((Array)(oldValue), 0, (Array)(this.values), 0, oldValue.Length);
     }
     this.values[this.count] = tex2d;
     return(this.count++);
 }
示例#4
0
 public LTextureObject[] ToArray(LTextureObject[] dest)
 {
     System.Array.Copy((Array)(this.values), 0, (Array)(dest), 0, this.count);
     return dest;
 }
示例#5
0
 public void AddAll(LTextureObject[] t)
 {
     Capacity(this.count + t.Length);
     System.Array.Copy((Array)(t), 0, (Array)(this.values), this.count, t.Length);
     this.count += t.Length;
 }
示例#6
0
 public int Add(LTextureObject tex2d)
 {
     if (this.count == this.values.Length)
     {
         LTextureObject[] oldValue = this.values;
         if (this.autoExpand)
             this.values = new LTextureObject[(oldValue.Length << 1) + 1];
         else
         {
             this.values = new LTextureObject[oldValue.Length + 1];
         }
         System.Array.Copy((Array)(oldValue), 0, (Array)(this.values), 0, oldValue.Length);
     }
     this.values[this.count] = tex2d;
     return this.count++;
 }