Ejemplo n.º 1
0
 public static unsafe void SolidRect(int Color, int X, int Y, int Width, int Height, Clipper c)
 {
     if ((Width > 0) && (Height > 0))
     {
         float num = -0.5f + X;
         float num2 = -0.5f + Y;
         CustomVertex.TransformedColoredTextured[] vertices = GeoPool(4);
         vertices[0].Color = vertices[1].Color = vertices[2].Color = vertices[3].Color = GetQuadColor(Color);
         vertices[0].X = vertices[1].X = num + Width;
         vertices[0].Y = vertices[2].Y = num2 + Height;
         vertices[1].Y = vertices[3].Y = num2;
         vertices[2].X = vertices[3].X = num;
         if (c.Clip(X, Y, Width, Height, vertices))
         {
             fixed (CustomVertex.TransformedColoredTextured* texturedRef = vertices)
             {
                 PushQuad(texturedRef);
             }
         }
     }
 }
Ejemplo n.º 2
0
 public void DrawClipped(int X, int Y, Clipper Clipper)
 {
     if (Clipper == null)
     {
         this.Draw(X, Y, m_BadClipperPool);
     }
     else if (this.m_Surface != null)
     {
         CustomVertex.TransformedColoredTextured[] poolClipped = m_PoolClipped;
         if (Clipper.Clip(X, Y, this.Width, this.Height, poolClipped))
         {
             poolClipped[0].Color = poolClipped[1].Color = poolClipped[2].Color = poolClipped[3].Color = Renderer.GetQuadColor(0xffffff);
             if (this.m_Flip)
             {
                 poolClipped[3].Tu = poolClipped[2].Tu = 1f - poolClipped[3].Tu;
                 poolClipped[1].Tu = poolClipped[0].Tu = 1f - poolClipped[1].Tu;
             }
             poolClipped[0].Tu *= this.m_MaxTU;
             poolClipped[1].Tu *= this.m_MaxTU;
             poolClipped[2].Tu *= this.m_MaxTU;
             poolClipped[3].Tu *= this.m_MaxTU;
             poolClipped[0].Tv *= this.m_MaxTV;
             poolClipped[1].Tv *= this.m_MaxTV;
             poolClipped[2].Tv *= this.m_MaxTV;
             poolClipped[3].Tv *= this.m_MaxTV;
             Renderer.SetTexture(this);
             Renderer.DrawQuadPrecalc(poolClipped);
         }
     }
 }