src/video/SDL_stretch.c
changeset 1985 8055185ae4ed
parent 1895 c121d94672cb
child 2828 7e5ff6cd05bf
     1.1 --- a/src/video/SDL_stretch.c	Thu Aug 24 12:49:59 2006 +0000
     1.2 +++ b/src/video/SDL_stretch.c	Mon Aug 28 03:17:39 2006 +0000
     1.3 @@ -121,30 +121,33 @@
     1.4  
     1.5  #else
     1.6  
     1.7 -#define DEFINE_COPY_ROW(name, type)			\
     1.8 -void name(type *src, int src_w, type *dst, int dst_w)	\
     1.9 -{							\
    1.10 -	int i;						\
    1.11 -	int pos, inc;					\
    1.12 -	type pixel = 0;					\
    1.13 -							\
    1.14 -	pos = 0x10000;					\
    1.15 -	inc = (src_w << 16) / dst_w;			\
    1.16 -	for ( i=dst_w; i>0; --i ) {			\
    1.17 -		while ( pos >= 0x10000L ) {		\
    1.18 -			pixel = *src++;			\
    1.19 -			pos -= 0x10000L;		\
    1.20 -		}					\
    1.21 -		*dst++ = pixel;				\
    1.22 -		pos += inc;				\
    1.23 -	}						\
    1.24 +#define DEFINE_COPY_ROW(name, type)                     \
    1.25 +void name(type *src, int src_w, type *dst, int dst_w)   \
    1.26 +{                                                       \
    1.27 +    int i;                                              \
    1.28 +    int pos, inc;                                       \
    1.29 +    type pixel = 0;                                     \
    1.30 +                                                        \
    1.31 +    pos = 0x10000;                                      \
    1.32 +    inc = (src_w << 16) / dst_w;                        \
    1.33 +    for ( i=dst_w; i>0; --i ) {                         \
    1.34 +        while ( pos >= 0x10000L ) {                     \
    1.35 +            pixel = *src++;                             \
    1.36 +            pos -= 0x10000L;                            \
    1.37 +        }                                               \
    1.38 +        *dst++ = pixel;                                 \
    1.39 +        pos += inc;                                     \
    1.40 +    }                                                   \
    1.41  }
    1.42 +/* *INDENT-OFF* */
    1.43  DEFINE_COPY_ROW(copy_row1, Uint8)
    1.44 -    DEFINE_COPY_ROW(copy_row2, Uint16) DEFINE_COPY_ROW(copy_row4, Uint32)
    1.45 +DEFINE_COPY_ROW(copy_row2, Uint16)
    1.46 +DEFINE_COPY_ROW(copy_row4, Uint32)
    1.47 +/* *INDENT-ON* */
    1.48  #endif /* USE_ASM_STRETCH */
    1.49  /* The ASM code doesn't handle 24-bpp stretch blits */
    1.50 -     void
    1.51 -     copy_row3(Uint8 * src, int src_w, Uint8 * dst, int dst_w)
    1.52 +void
    1.53 +copy_row3(Uint8 * src, int src_w, Uint8 * dst, int dst_w)
    1.54  {
    1.55      int i;
    1.56      int pos, inc;
    1.57 @@ -278,14 +281,20 @@
    1.58  #ifdef __GNUC__
    1.59            __asm__ __volatile__("call *%4": "=&D"(u1), "=&S"(u2): "0"(dstp), "1"(srcp), "r"(copy_row):"memory");
    1.60  #elif defined(_MSC_VER) || defined(__WATCOMC__)
    1.61 +            /* *INDENT-OFF* */
    1.62              {
    1.63                  void *code = copy_row;
    1.64                  __asm {
    1.65 -                push edi
    1.66 -                        push esi
    1.67 -                        mov edi, dstp
    1.68 -                        mov esi, srcp call dword ptr code pop esi pop edi}
    1.69 +                    push edi
    1.70 +                    push esi
    1.71 +                    mov edi, dstp
    1.72 +                    mov esi, srcp
    1.73 +                    call dword ptr code
    1.74 +                    pop esi
    1.75 +                    pop edi
    1.76 +                }
    1.77              }
    1.78 +            /* *INDENT-ON* */
    1.79  #else
    1.80  #error Need inline assembly for this compiler
    1.81  #endif