From 17e9a2c8fd86eb8343f4414fd2077452fe2e12f4 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 29 Jan 2008 18:47:33 +0000 Subject: [PATCH] - I think GetScaledWidth/Height rounding should be correct now. SVN r725 (trunk) --- src/r_defs.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/r_defs.h b/src/r_defs.h index 7902032f7..d667b236a 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -688,11 +688,11 @@ public: int GetWidth () { return Width; } int GetHeight () { return Height; } - int GetScaledWidth () { return ((Width<<16) + (xScale>>1)) / xScale; } - int GetScaledHeight () { return ((Height<<16) + (yScale>>1)) / yScale; } + int GetScaledWidth () { int foo = (Width << 17) / xScale; return (foo >> 1) + (foo & 1); } + int GetScaledHeight () { int foo = (Height << 17) / yScale; return (foo >> 1) + (foo & 1); } - int GetScaledLeftOffset () { return ((LeftOffset<<16) + (xScale>>1)) / xScale; } - int GetScaledTopOffset () { return ((TopOffset<<16) + (yScale>>1)) / yScale; } + int GetScaledLeftOffset () { int foo = (LeftOffset << 17) / xScale; return (foo >> 1) + (foo & 1); } + int GetScaledTopOffset () { int foo = (TopOffset << 17) / yScale; return (foo >> 1) + (foo & 1); } virtual void SetFrontSkyLayer();