# HG changeset patch # User Matti Hamalainen # Date 1348836350 -10800 # Node ID 372b68c0752a35b0efe471e57ce9ed29cd6f58d6 # Parent b0f1b8544b62a36192c1bc096a02c2f1dd2be5fd# Parent f2f6963080bdfd43821770ecfa5e2ae529a810aa Merged. diff -r b0f1b8544b62 -r 372b68c0752a dmdrawline.h --- a/dmdrawline.h Fri Sep 28 15:45:23 2012 +0300 +++ b/dmdrawline.h Fri Sep 28 15:45:50 2012 +0300 @@ -1,10 +1,5 @@ -#ifdef DM_USE_SIMD -static int DM_DRAWLINE_NAME_ASM (SDL_Surface *screen, int x0, int y0, int x1, int y1, const Uint32 col); -#endif - -#ifdef DM_USE_C -static int DM_DRAWLINE_NAME_C (SDL_Surface *screen, int x0, int y0, int x1, int y1, const Uint32 col) +static int DM_DRAWLINE_NAME (SDL_Surface *screen, int x0, int y0, int x1, int y1, const Uint32 col) { int dx, dy, xstep, ystep; const int qpitch = screen->pitch / DM_DRAWLINE_DST_BYTES; @@ -77,10 +72,7 @@ return 0; } -#endif #undef DM_DRAWLINE_NAME -#undef DM_DRAWLINE_NAME_ASM -#undef DM_DRAWLINE_NAME_C #undef DM_DRAWLINE_DST_BYTES #undef DM_DRAWLINE_DST_TYPE diff -r b0f1b8544b62 -r 372b68c0752a dmline.c --- a/dmline.c Fri Sep 28 15:45:23 2012 +0300 +++ b/dmline.c Fri Sep 28 15:45:50 2012 +0300 @@ -47,25 +47,29 @@ static const DMDrawLineFunc dmDrawLineTable[DMD_NMODES][DMD_NBITDEPTHS] = { /* DMD_NONE */ { dmDrawLine8 , dmDrawLine32 }, +#if 0 /* DMD_TRANSPARENT */ { dmDrawLine8Transparent , dmDrawLine32Transparent }, /* DMD_SATURATE */ { dmDrawLine8Saturate , dmDrawLine32Saturate }, + /* DMD_NONE + AA */ { NULL, NULL }, /* DMD_TRANSP + AA */ { NULL, NULL }, /* DMD_SATURATE + AA */ { dmDrawLine8AASaturate , dmDrawLine32AASaturate }, +#endif }; +static const int ndmDrawLineTable = sizeof(dmDrawLineTable) / sizeof(dmDrawLineTable[0]); + DMDrawLineFunc dmGetDrawLineFunc(SDL_PixelFormat *dst, int mode) { int index; - if (dst == NULL || mode < 0 || - mode >= sizeof(dmDrawLineTable) / sizeof(dmDrawLineTable[0])) + if (dst == NULL || mode < 0 || mode >= ndmDrawLineTable) return NULL; - if ((index = dmBitsPerPixel2Index(src->BitsPerPixel)) < 0) + if ((index = dmBitsPerPixel2Index(dst->BitsPerPixel)) < 0) return NULL; - return dmDrawLineTable[mode] + return dmDrawLineTable[mode][index]; } @@ -78,4 +82,3 @@ return bfunc(screen, x0, y0, x1, y1, col); } - diff -r b0f1b8544b62 -r 372b68c0752a dmlinefunc.h --- a/dmlinefunc.h Fri Sep 28 15:45:23 2012 +0300 +++ b/dmlinefunc.h Fri Sep 28 15:45:50 2012 +0300 @@ -8,23 +8,12 @@ #include "dmdrawline.h" -#define DM_DRAWLINE_NAME dmDrawLine15 -#define DM_DRAWLINE_DST_BYTES 2 -#define DM_DRAWLINE_DST_TYPE Uint16 -#include "dmdrawline.h" - - -#define DM_DRAWLINE_NAME dmDrawLine16 -#define DM_DRAWLINE_DST_BYTES 2 -#define DM_DRAWLINE_DST_TYPE Uint16 -#include "dmdrawline.h" - - #define DM_DRAWLINE_NAME dmDrawLine32 #define DM_DRAWLINE_DST_BYTES 4 #define DM_DRAWLINE_DST_TYPE Uint32 #include "dmdrawline.h" + /* #undef DM_DRAWLINE_INNER #define DM_DRAWLINE_INNER \ diff -r b0f1b8544b62 -r 372b68c0752a vptest.c --- a/vptest.c Fri Sep 28 15:45:23 2012 +0300 +++ b/vptest.c Fri Sep 28 15:45:50 2012 +0300 @@ -206,6 +206,8 @@ SDL_WM_SetCaption("Halleluja", "DMT"); } + Uint32 lcol = dmMapRGB(screen, 255,255,255); + int numFrames = 0, startTime = SDL_GetTicks(), endTime = 0; exitFlag = FALSE; @@ -289,6 +291,10 @@ 128 + sin(f*0.1) * 120.0f); #endif + dmDrawLineAny(screen, 30, 30, 600 + 200 * sin(f), 250 , lcol, DMD_NONE); + dmDrawLineAny(screen, 20, 30, 100 , 250 + 100 * sin(f), lcol, DMD_NONE); + dmDrawLineAny(screen, 100, 100, 100 + cos(f) * 50, 100 + sin(f) * 50, lcol, DMD_NONE); + if (!optBenchmark) { dmDrawTTFText(screen, font, fontcol, 0, 0, "%3.1f FPS",