src/video/SDL_blit.h
changeset 2262 bee005ace1bf
parent 2261 c20476d7d7b3
child 2263 900c35d8e8fd
     1.1 --- a/src/video/SDL_blit.h	Fri Aug 17 03:22:03 2007 +0000
     1.2 +++ b/src/video/SDL_blit.h	Fri Aug 17 06:21:58 2007 +0000
     1.3 @@ -33,67 +33,74 @@
     1.4  #ifdef __SSE__
     1.5  #include <xmmintrin.h>
     1.6  #endif
     1.7 +#ifdef __SSE2__
     1.8 +#include <emmintrin.h>
     1.9 +#endif
    1.10  
    1.11  #include "SDL_cpuinfo.h"
    1.12  #include "SDL_endian.h"
    1.13  
    1.14 -/* The structure passed to the low level blit functions */
    1.15 -typedef struct
    1.16 -{
    1.17 -    Uint8 *s_pixels;
    1.18 -    int s_width;
    1.19 -    int s_height;
    1.20 -    int s_skip;
    1.21 -    Uint8 *d_pixels;
    1.22 -    int d_width;
    1.23 -    int d_height;
    1.24 -    int d_skip;
    1.25 -    SDL_PixelFormat *src;
    1.26 +/* SDL blit copy flags */
    1.27 +#define SDL_COPY_MODULATE_COLOR     0x0001
    1.28 +#define SDL_COPY_MODULATE_ALPHA     0x0002
    1.29 +#define SDL_COPY_MASK               0x0010
    1.30 +#define SDL_COPY_BLEND              0x0020
    1.31 +#define SDL_COPY_ADD                0x0040
    1.32 +#define SDL_COPY_MOD                0x0080
    1.33 +#define SDL_COPY_COLORKEY           0x0100
    1.34 +#define SDL_COPY_NEAREST            0x0200
    1.35 +
    1.36 +/* SDL blit CPU flags */
    1.37 +#define SDL_CPU_ANY                 0x0000
    1.38 +#define SDL_CPU_MMX                 0x0001
    1.39 +#define SDL_CPU_3DNOW               0x0002
    1.40 +#define SDL_CPU_SSE                 0x0004
    1.41 +#define SDL_CPU_SSE2                0x0008
    1.42 +#define SDL_CPU_ALTIVEC_PREFETCH    0x0010
    1.43 +#define SDL_CPU_ALTIVEC_NOPREFETCH  0x0020
    1.44 +
    1.45 +typedef struct {
    1.46 +    Uint8 *src;
    1.47 +    int src_w, src_h;
    1.48 +    int src_pitch;
    1.49 +    Uint8 *dst;
    1.50 +    int dst_w, dst_h;
    1.51 +    int dst_pitch;
    1.52 +    SDL_PixelFormat *src_fmt;
    1.53 +    SDL_PixelFormat *dst_fmt;
    1.54      Uint8 *table;
    1.55 -    SDL_PixelFormat *dst;
    1.56 -    Uint32 ckey, cmod;
    1.57 +    int flags;
    1.58 +    Uint32 colorkey;
    1.59 +    Uint8 r, g, b, a;
    1.60  } SDL_BlitInfo;
    1.61  
    1.62 -/* The type definition for the low level blit functions */
    1.63 -typedef void (*SDL_loblit) (SDL_BlitInfo * info);
    1.64 +typedef void (SDLCALL * SDL_BlitFunc)(SDL_BlitInfo *info);
    1.65 +
    1.66 +typedef struct {
    1.67 +    Uint32 src_format;
    1.68 +    Uint32 dst_format;
    1.69 +    int flags;
    1.70 +    int cpu;
    1.71 +    SDL_BlitFunc func;
    1.72 +} SDL_BlitFuncEntry;
    1.73  
    1.74  /* Blit mapping definition */
    1.75  typedef struct SDL_BlitMap
    1.76  {
    1.77      SDL_Surface *dst;
    1.78      int identity;
    1.79 -    Uint8 *table;
    1.80      SDL_blit blit;
    1.81      void *data;
    1.82 -    Uint32 ckey;                /* colorkey */
    1.83 -    Uint32 cmod;                /* ARGB modulation */
    1.84 +    SDL_BlitInfo info;
    1.85  
    1.86      /* the version count matches the destination; mismatch indicates
    1.87         an invalid mapping */
    1.88      unsigned int format_version;
    1.89  } SDL_BlitMap;
    1.90  
    1.91 -#define SDL_BLIT_ANY                0x00000000
    1.92 -#define SDL_BLIT_MMX                0x00000001
    1.93 -#define SDL_BLIT_SSE                0x00000002
    1.94 -#define SDL_BLIT_ALTIVEC_PREFETCH   0x00000004
    1.95 -#define SDL_BLIT_ALTIVEC_NOPREFETCH 0x00000008
    1.96 -
    1.97 -typedef struct SDL_BlitEntry
    1.98 -{
    1.99 -    Uint32 features;
   1.100 -    SDL_loblit blit;
   1.101 -} SDL_BlitEntry;
   1.102 -
   1.103  /* Functions found in SDL_blit.c */
   1.104  extern int SDL_CalculateBlit(SDL_Surface * surface);
   1.105  
   1.106 -/* Functions found in SDL_blit_{0,1,N,A}.c */
   1.107 -extern SDL_loblit SDL_CalculateBlit0(SDL_Surface * surface, int complex);
   1.108 -extern SDL_loblit SDL_CalculateBlit1(SDL_Surface * surface, int complex);
   1.109 -extern SDL_loblit SDL_CalculateBlitN(SDL_Surface * surface, int complex);
   1.110 -extern SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface * surface, int complex);
   1.111 -
   1.112  /*
   1.113   * Useful macros for blitting routines
   1.114   */