- Fixed: DrawBar's clipping didn't take the texture offset into account.

SVN r4056 (trunk)
This commit is contained in:
Braden Obrzut 2013-01-30 00:56:24 +00:00
parent 61322cc33b
commit b958215b50

View file

@ -1203,8 +1203,8 @@ public:
h = forceHeight < 0 ? texture->GetScaledHeightDouble() : forceHeight; h = forceHeight < 0 ? texture->GetScaledHeightDouble() : forceHeight;
double dcx = cx == 0 ? 0 : dx + ((double) cx / FRACUNIT) - texture->GetScaledLeftOffsetDouble(); double dcx = cx == 0 ? 0 : dx + ((double) cx / FRACUNIT) - texture->GetScaledLeftOffsetDouble();
double dcy = cy == 0 ? 0 : dy + ((double) cy / FRACUNIT) - texture->GetScaledTopOffsetDouble(); double dcy = cy == 0 ? 0 : dy + ((double) cy / FRACUNIT) - texture->GetScaledTopOffsetDouble();
double dcr = cr == 0 ? INT_MAX : dx + w - ((double) cr / FRACUNIT); double dcr = cr == 0 ? INT_MAX : dx + w - ((double) cr / FRACUNIT) - texture->GetScaledLeftOffsetDouble();
double dcb = cb == 0 ? INT_MAX : dy + h - ((double) cb / FRACUNIT); double dcb = cb == 0 ? INT_MAX : dy + h - ((double) cb / FRACUNIT) - texture->GetScaledTopOffsetDouble();
if(Scaled) if(Scaled)
{ {
@ -1292,10 +1292,10 @@ public:
// Check for clipping // Check for clipping
if(cx != 0 || cy != 0 || cr != 0 || cb != 0) if(cx != 0 || cy != 0 || cr != 0 || cb != 0)
{ {
rcx = cx == 0 ? 0 : rx+(((double) cx/FRACUNIT)*xScale); rcx = cx == 0 ? 0 : rx+(((double) cx/FRACUNIT)*xScale) - texture->GetScaledLeftOffsetDouble();
rcy = cy == 0 ? 0 : ry+(((double) cy/FRACUNIT)*yScale); rcy = cy == 0 ? 0 : ry+(((double) cy/FRACUNIT)*yScale) - texture->GetScaledTopOffsetDouble();
rcr = cr == 0 ? INT_MAX : rx+w-(((double) cr/FRACUNIT)*xScale); rcr = cr == 0 ? INT_MAX : rx+w-(((double) cr/FRACUNIT)*xScale) - texture->GetScaledLeftOffsetDouble();
rcb = cb == 0 ? INT_MAX : ry+h-(((double) cb/FRACUNIT)*yScale); rcb = cb == 0 ? INT_MAX : ry+h-(((double) cb/FRACUNIT)*yScale) - texture->GetScaledTopOffsetDouble();
} }
if(clearDontDraw) if(clearDontDraw)