]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix sign errors in shadows
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 25 Jan 2010 15:04:25 +0000 (15:04 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 25 Jan 2010 15:04:25 +0000 (15:04 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9851 d7cf8633-e32d-0410-b094-e92efae38249

ft2.c

diff --git a/ft2.c b/ft2.c
index 1809d366eead9df4913be574a88a392c392957ca..1e976a8b338971a8a473a390262e0a578f95d7ae 100644 (file)
--- a/ft2.c
+++ b/ft2.c
@@ -549,7 +549,7 @@ void Font_Postprocess_Update(ft2_font_t *fnt, int bpp, int w, int h)
        {
                float sum = 0;
                for(x = -POSTPROCESS_MAXRADIUS; x <= POSTPROCESS_MAXRADIUS; ++x)
-                       sum += (gausstable[POSTPROCESS_MAXRADIUS+x] = (pp.blur > 0 ? exp(-(pow(x - pp.shadowz, 2))/(pp.blur*pp.blur * 2)) : (floor(x - pp.shadowz + 0.5) == 0)));
+                       sum += (gausstable[POSTPROCESS_MAXRADIUS+x] = (pp.blur > 0 ? exp(-(pow(x + pp.shadowz, 2))/(pp.blur*pp.blur * 2)) : (floor(x + pp.shadowz + 0.5) == 0)));
                for(x = -POSTPROCESS_MAXRADIUS; x <= POSTPROCESS_MAXRADIUS; ++x)
                        pp.gausstable[POSTPROCESS_MAXRADIUS+x] = floor(gausstable[POSTPROCESS_MAXRADIUS+x] / sum * 255 + 0.5);
        }
@@ -558,7 +558,7 @@ void Font_Postprocess_Update(ft2_font_t *fnt, int bpp, int w, int h)
                for(y = -POSTPROCESS_MAXRADIUS; y <= POSTPROCESS_MAXRADIUS; ++y)
                        for(x = -POSTPROCESS_MAXRADIUS; x <= POSTPROCESS_MAXRADIUS; ++x)
                        {
-                               float d = pp.outline + 1 - sqrt(pow(x - pp.shadowx, 2) + pow(y - pp.shadowy, 2));
+                               float d = pp.outline + 1 - sqrt(pow(x + pp.shadowx, 2) + pow(y + pp.shadowy, 2));
                                pp.circlematrix[POSTPROCESS_MAXRADIUS+y][POSTPROCESS_MAXRADIUS+x] = (d >= 1) ? 255 : (d <= 0) ? 0 : floor(d * 255 + 0.5);
                        }
        }