Updated to build on Windows
authorSam Lantinga <slouken@libsdl.org>
Thu, 25 Dec 2008 05:11:29 +0000
changeset 2918bd518fc76f28
parent 2917 4cecb110195d
child 2919 2f91a3847ae8
Updated to build on Windows
VisualC/SDL/SDL.vcproj
src/video/SDL_bmp.c
src/video/SDL_draw.h
src/video/SDL_renderer_gl.c
src/video/SDL_video.c
src/video/win32/SDL_win32events.c
     1.1 --- a/VisualC/SDL/SDL.vcproj	Thu Dec 25 04:56:44 2008 +0000
     1.2 +++ b/VisualC/SDL/SDL.vcproj	Thu Dec 25 05:11:29 2008 +0000
     1.3 @@ -441,6 +441,18 @@
     1.4  			>
     1.5  		</File>
     1.6  		<File
     1.7 +			RelativePath="..\..\src\video\SDL_blendline.c"
     1.8 +			>
     1.9 +		</File>
    1.10 +		<File
    1.11 +			RelativePath="..\..\src\video\SDL_blendpoint.c"
    1.12 +			>
    1.13 +		</File>
    1.14 +		<File
    1.15 +			RelativePath="..\..\src\video\SDL_blendrect.c"
    1.16 +			>
    1.17 +		</File>
    1.18 +		<File
    1.19  			RelativePath="..\..\src\video\SDL_blit.c"
    1.20  			>
    1.21  		</File>
    1.22 @@ -485,6 +497,10 @@
    1.23  			>
    1.24  		</File>
    1.25  		<File
    1.26 +			RelativePath="..\..\src\video\SDL_blit_slow.h"
    1.27 +			>
    1.28 +		</File>
    1.29 +		<File
    1.30  			RelativePath="..\..\src\video\SDL_bmp.c"
    1.31  			>
    1.32  		</File>
    1.33 @@ -525,6 +541,18 @@
    1.34  			>
    1.35  		</File>
    1.36  		<File
    1.37 +			RelativePath="..\..\src\video\SDL_draw.h"
    1.38 +			>
    1.39 +		</File>
    1.40 +		<File
    1.41 +			RelativePath="..\..\src\video\SDL_drawline.c"
    1.42 +			>
    1.43 +		</File>
    1.44 +		<File
    1.45 +			RelativePath="..\..\src\video\SDL_drawpoint.c"
    1.46 +			>
    1.47 +		</File>
    1.48 +		<File
    1.49  			RelativePath="..\..\src\audio\dummy\SDL_dummyaudio.c"
    1.50  			>
    1.51  		</File>
    1.52 @@ -569,7 +597,7 @@
    1.53  			>
    1.54  		</File>
    1.55  		<File
    1.56 -			RelativePath="..\..\src\video\SDL_fill.c"
    1.57 +			RelativePath="..\..\src\video\SDL_fillrect.c"
    1.58  			>
    1.59  		</File>
    1.60  		<File
     2.1 --- a/src/video/SDL_bmp.c	Thu Dec 25 04:56:44 2008 +0000
     2.2 +++ b/src/video/SDL_bmp.c	Thu Dec 25 05:11:29 2008 +0000
     2.3 @@ -218,7 +218,7 @@
     2.4          if (biClrUsed == 0) {
     2.5              biClrUsed = 1 << biBitCount;
     2.6          }
     2.7 -        if (biClrUsed > palette->ncolors) {
     2.8 +        if ((int)biClrUsed > palette->ncolors) {
     2.9              palette->ncolors = biClrUsed;
    2.10              palette->colors =
    2.11                  (SDL_Color *) SDL_realloc(palette->colors,
    2.12 @@ -229,7 +229,7 @@
    2.13                  was_error = 1;
    2.14                  goto done;
    2.15              }
    2.16 -        } else if (biClrUsed < palette->ncolors) {
    2.17 +        } else if ((int)biClrUsed < palette->ncolors) {
    2.18              palette->ncolors = biClrUsed;
    2.19          }
    2.20          if (biSize == 12) {
     3.1 --- a/src/video/SDL_draw.h	Thu Dec 25 04:56:44 2008 +0000
     3.2 +++ b/src/video/SDL_draw.h	Thu Dec 25 05:11:29 2008 +0000
     3.3 @@ -30,7 +30,7 @@
     3.4  #define DRAW_MUL(_a, _b) (((unsigned)(_a)*(_b))/255)
     3.5  
     3.6  #define DRAW_FASTSETPIXEL(x, y, type, bpp, color) \
     3.7 -    *(type *)(dst->pixels + y * dst->pitch + x * bpp) = (type) color
     3.8 +    *(type *)((Uint8 *)dst->pixels + y * dst->pitch + x * bpp) = (type) color
     3.9  
    3.10  #define DRAW_FASTSETPIXEL1(x, y) DRAW_FASTSETPIXEL(x, y, Uint8, 1, color);
    3.11  #define DRAW_FASTSETPIXEL2(x, y) DRAW_FASTSETPIXEL(x, y, Uint16, 2, color);
    3.12 @@ -74,7 +74,7 @@
    3.13  
    3.14  #define DRAW_SETPIXELXY(x, y, type, bpp, op) \
    3.15  do { \
    3.16 -    type *pixel = (type *)(dst->pixels + y * dst->pitch + x * bpp); \
    3.17 +    type *pixel = (type *)((Uint8 *)dst->pixels + y * dst->pitch + x * bpp); \
    3.18      op; \
    3.19  } while (0)
    3.20  
    3.21 @@ -346,7 +346,6 @@
    3.22  
    3.23  #define FILLRECT(type, op) \
    3.24  do { \
    3.25 -    int w; \
    3.26      int width = dstrect->w; \
    3.27      int height = dstrect->h; \
    3.28      int pitch = (dst->pitch / dst->format->BytesPerPixel); \
     4.1 --- a/src/video/SDL_renderer_gl.c	Thu Dec 25 04:56:44 2008 +0000
     4.2 +++ b/src/video/SDL_renderer_gl.c	Thu Dec 25 05:11:29 2008 +0000
     4.3 @@ -519,9 +519,9 @@
     4.4  {
     4.5      const int have_texture_rects = data->GL_ARB_texture_rectangle_supported;
     4.6      const char *replacement = have_texture_rects ? "RECT" : "2D";
     4.7 -    const size_t replacementlen = strlen(replacement);
     4.8 +    const size_t replacementlen = SDL_strlen(replacement);
     4.9      const char *token = "%TEXTURETARGET%";
    4.10 -    const size_t tokenlen = strlen(token);
    4.11 +    const size_t tokenlen = SDL_strlen(token);
    4.12      char *code = NULL;
    4.13      char *ptr = NULL;
    4.14      GLuint program = 0;
    4.15 @@ -536,9 +536,9 @@
    4.16          return 0;
    4.17  
    4.18      for (ptr = SDL_strstr(code, token); ptr; ptr = SDL_strstr(ptr + 1, token)) {
    4.19 -        memcpy(ptr, replacement, replacementlen);
    4.20 -        memmove(ptr + replacementlen, ptr + tokenlen,
    4.21 -                strlen(ptr + tokenlen) + 1);
    4.22 +        SDL_memcpy(ptr, replacement, replacementlen);
    4.23 +        SDL_memmove(ptr + replacementlen, ptr + tokenlen,
    4.24 +                    SDL_strlen(ptr + tokenlen) + 1);
    4.25      }
    4.26  
    4.27  #if DEBUG_PROGRAM_COMPILE
     5.1 --- a/src/video/SDL_video.c	Thu Dec 25 04:56:44 2008 +0000
     5.2 +++ b/src/video/SDL_video.c	Thu Dec 25 05:11:29 2008 +0000
     5.3 @@ -2075,7 +2075,6 @@
     5.4  {
     5.5      SDL_Renderer *renderer;
     5.6      SDL_Window *window;
     5.7 -    SDL_Rect real_rect;
     5.8  
     5.9      if (!_this) {
    5.10          SDL_UninitializedVideo();
     6.1 --- a/src/video/win32/SDL_win32events.c	Thu Dec 25 04:56:44 2008 +0000
     6.2 +++ b/src/video/win32/SDL_win32events.c	Thu Dec 25 05:11:29 2008 +0000
     6.3 @@ -214,7 +214,6 @@
     6.4      case WM_INPUT:             /* mouse events */
     6.5          {
     6.6              LPBYTE lpb;
     6.7 -            int w, h;
     6.8              const RAWINPUTHEADER *header;
     6.9              int index;
    6.10              int i;