# HG changeset patch # User sheepluva # Date 1412265854 -7200 # Node ID d8830bd7cb24e5ee9e3a9aa4bfdb9698dc4f16bd # Parent e3cdbba077328e1e4d8719957c4e21bb0966ecdc another small rendering tweak/fix diff -r e3cdbba07732 -r d8830bd7cb24 hedgewars/uRender.pas --- a/hedgewars/uRender.pas Thu Oct 02 13:44:54 2014 +0200 +++ b/hedgewars/uRender.pas Thu Oct 02 18:04:14 2014 +0200 @@ -849,10 +849,29 @@ var ft, fb, fl, fr: GLfloat; hw, hh, nx, ny: LongInt; begin - -// note: not taking scale into account -if isAreaOffscreen(X, Y, w, h) then - exit; +// visibility check only under trivial conditions +if (Scale <= 1) then + begin + if Angle <> 0 then + begin + if (OffsetX = 0) and (OffsetY = 0) then + begin + // sized doubled because the sprite might occupy up to 1.4 * of it's + // original size in each dimension, because it is rotated + if isDxAreaOffscreen(X - w, 2 * w) <> 0 then + exit; + if isDYAreaOffscreen(Y - h, 2 * h) <> 0 then + exit; + end; + end + else + begin + if isDxAreaOffscreen(X + dir * trunc(OffsetX) - w div 2, w) <> 0 then + exit; + if isDYAreaOffscreen(Y + trunc(OffsetY) - h div 2, h) <> 0 then + exit; + end; + end; { // do not draw anything outside the visible screen space (first check fixes some sprite drawing, e.g. hedgehogs)