changeset 329:a4a6082a9055

Remove radial blur code.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 15 Oct 2012 00:01:42 +0300
parents dd7b1356d726
children af04394e9620
files vptest.c
diffstat 1 files changed, 1 insertions(+), 76 deletions(-) [+]
line wrap: on
line diff
--- a/vptest.c	Sun Oct 14 23:47:33 2012 +0300
+++ b/vptest.c	Mon Oct 15 00:01:42 2012 +0300
@@ -13,7 +13,7 @@
      *optBitmapFilename = "blurri.png";
 BOOL optBenchmark = FALSE;
 int optVFlags = SDL_SWSURFACE | SDL_HWPALETTE;
-int optScrWidth = 640, optScrHeight = 480, optFontSize = 20, optScrDepth = 32;
+int optScrWidth = 640, optScrHeight = 480, optFontSize = 8, optScrDepth = 32;
 int optBenchmarkLen = 20;
 
 DMOptArg optList[] = {
@@ -109,76 +109,6 @@
 }
 
 
-#define DM_RADIAL_BLUR(YC, XC) \
-        DMVector p1 = { xc, yc, 0, 0 }, p2 = { cx, cy, 0, 0 }, v; \
-        dm_vector_sub_r(&v, &p2, &p1); \
-        dm_vector_scale(&v, scale); \
-        dm_vector_add(&v, &p1); \
-        if (v.y YC || v.x XC) continue; \
-        DMRGBA32 *dp = pix + xc, \
-                 *q = ((DMRGBA32 *)img->pixels) + ((int)(v.y) * pitch) + (int)v.x; \
-        dp->r = (q->r + dp->r) / 2; \
-        dp->g = (q->g + dp->g) / 2; \
-        dp->b = (q->b + dp->b) / 2;
-
-/*
-    asm("movq        %2,     %%xmm1\n"		\
-        "movq        %1,     %%xmm2\n"		\
-        "paddusb     %%xmm2, %%xmm1\n"		\
-        "movq        %%xmm1, %0\n"		\
-        : "=m" (*c)				\
-        : "m" (*c), "m" (*px)	\
-        : "memory", "%xmm1", "%xmm2");
-*/
-
-const Uint64 qpmask[2] = { 0xffffffff, 0 };
-const Uint64 *qmask = qpmask;
-
-
-void dmRadialBlur(SDL_Surface *img, int cx, int cy, DMFloat scale)
-{
-    int pitch = img->pitch / sizeof(DMRGBA32);
-    int xc, yc;
-
-    for (yc = cy; yc >= 0; yc--)
-    {
-        DMRGBA32 *pix = ((DMRGBA32 *)img->pixels) + yc * pitch;
-        for (xc = cx + 1; xc < img->w; xc++)
-        {
-            DM_RADIAL_BLUR(< 0, >= img->w)
-        }
-    }
-
-    for (yc = cy; yc >= 0; yc--)
-    {
-        DMRGBA32 *pix = ((DMRGBA32 *)img->pixels) + yc * pitch;
-        for (xc = cx; xc > 0; xc--)
-        {
-            DM_RADIAL_BLUR(< 0, < 0)
-        }    
-    }
-
-    for (yc = cy + 1; yc < img->h; yc++)
-    {
-        DMRGBA32 *pix = ((DMRGBA32 *)img->pixels) + yc * pitch;
-        for (xc = cx; xc > 0; xc--)
-        {
-            DM_RADIAL_BLUR(>= img->h, < 0)
-        }    
-    }
-
-    for (yc = cy + 1; yc < img->h; yc++)
-    {
-        DMRGBA32 *pix = ((DMRGBA32 *)img->pixels) + yc * pitch;
-        for (xc = cx + 1; xc < img->w; xc++)
-        {
-            DM_RADIAL_BLUR(>= img->h, >= img->w)
-        }    
-    }
-}
-
-
-
 int main(int argc, char *argv[])
 {
     SDL_Surface *screen = NULL, *bmap = NULL, *fbmap = NULL, *screen2 = NULL;
@@ -402,9 +332,6 @@
             dmDirectBlitSurface(screen2, screen);
         }
 
-//        dmRadialBlur(screen, 320, 240, 0.010);
-//        dmRadialBlur(screen, 325, 245, 0.016);
-
         dmDraw3DVectorSpriteModel(screen, model, &pos, &mat, fbmap, lcol);
 
         for (np = 1; np <= 5; np++)
@@ -416,8 +343,6 @@
             dmDirectBlitSurface(screen2, screen);
         }
 
-//        dmRadialBlur(screen, 320, 240, 0.010);
-//        dmRadialBlur(screen, 325, 245, 0.016);
 #endif
 
         if (!optBenchmark)