public void DrawMaterial(float x, float y, float width, float height, idMaterial material, Vector4 color, float scaleX = 1.0f, float scaleY = 1.0f)
{
idE.RenderSystem.Color = color;
float s0, s1, t0, t1;
//
// handle negative scales as well
if(scaleX < 0)
{
width *= -1;
scaleX *= -1;
}
if(scaleY < 0)
{
height *= -1;
scaleY *= -1;
}
//
if(width < 0)
{
// flip about vertical
width = -width;
s0 = 1 * scaleX;
s1 = 0;
}
else
{
s0 = 0;
s1 = 1 * scaleX;
}
if(height < 0)
{
// flip about horizontal
height = -height;
t0 = 1 * scaleY;
t1 = 0;
}
else
{
t0 = 0;
t1 = 1 * scaleY;
}
if(ClipCoordinates(ref x, ref y, ref width, ref height, ref s0, ref t0, ref s1, ref t1) == true)
{
return;
}
AdjustCoordinates(ref x, ref y, ref width, ref height);
DrawStretchPicture(x, y, width, height, s0, t0, s1, t1, material);
}