Updated to build on Windows
authorSam Lantinga <slouken@libsdl.org>
Thu, 25 Dec 2008 05:11:29 +0000
changeset 2918 bd518fc76f28
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
--- a/VisualC/SDL/SDL.vcproj	Thu Dec 25 04:56:44 2008 +0000
+++ b/VisualC/SDL/SDL.vcproj	Thu Dec 25 05:11:29 2008 +0000
@@ -441,6 +441,18 @@
 			>
 		</File>
 		<File
+			RelativePath="..\..\src\video\SDL_blendline.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_blendpoint.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_blendrect.c"
+			>
+		</File>
+		<File
 			RelativePath="..\..\src\video\SDL_blit.c"
 			>
 		</File>
@@ -485,6 +497,10 @@
 			>
 		</File>
 		<File
+			RelativePath="..\..\src\video\SDL_blit_slow.h"
+			>
+		</File>
+		<File
 			RelativePath="..\..\src\video\SDL_bmp.c"
 			>
 		</File>
@@ -525,6 +541,18 @@
 			>
 		</File>
 		<File
+			RelativePath="..\..\src\video\SDL_draw.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_drawline.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\video\SDL_drawpoint.c"
+			>
+		</File>
+		<File
 			RelativePath="..\..\src\audio\dummy\SDL_dummyaudio.c"
 			>
 		</File>
@@ -569,7 +597,7 @@
 			>
 		</File>
 		<File
-			RelativePath="..\..\src\video\SDL_fill.c"
+			RelativePath="..\..\src\video\SDL_fillrect.c"
 			>
 		</File>
 		<File
--- a/src/video/SDL_bmp.c	Thu Dec 25 04:56:44 2008 +0000
+++ b/src/video/SDL_bmp.c	Thu Dec 25 05:11:29 2008 +0000
@@ -218,7 +218,7 @@
         if (biClrUsed == 0) {
             biClrUsed = 1 << biBitCount;
         }
-        if (biClrUsed > palette->ncolors) {
+        if ((int)biClrUsed > palette->ncolors) {
             palette->ncolors = biClrUsed;
             palette->colors =
                 (SDL_Color *) SDL_realloc(palette->colors,
@@ -229,7 +229,7 @@
                 was_error = 1;
                 goto done;
             }
-        } else if (biClrUsed < palette->ncolors) {
+        } else if ((int)biClrUsed < palette->ncolors) {
             palette->ncolors = biClrUsed;
         }
         if (biSize == 12) {
--- a/src/video/SDL_draw.h	Thu Dec 25 04:56:44 2008 +0000
+++ b/src/video/SDL_draw.h	Thu Dec 25 05:11:29 2008 +0000
@@ -30,7 +30,7 @@
 #define DRAW_MUL(_a, _b) (((unsigned)(_a)*(_b))/255)
 
 #define DRAW_FASTSETPIXEL(x, y, type, bpp, color) \
-    *(type *)(dst->pixels + y * dst->pitch + x * bpp) = (type) color
+    *(type *)((Uint8 *)dst->pixels + y * dst->pitch + x * bpp) = (type) color
 
 #define DRAW_FASTSETPIXEL1(x, y) DRAW_FASTSETPIXEL(x, y, Uint8, 1, color);
 #define DRAW_FASTSETPIXEL2(x, y) DRAW_FASTSETPIXEL(x, y, Uint16, 2, color);
@@ -74,7 +74,7 @@
 
 #define DRAW_SETPIXELXY(x, y, type, bpp, op) \
 do { \
-    type *pixel = (type *)(dst->pixels + y * dst->pitch + x * bpp); \
+    type *pixel = (type *)((Uint8 *)dst->pixels + y * dst->pitch + x * bpp); \
     op; \
 } while (0)
 
@@ -346,7 +346,6 @@
 
 #define FILLRECT(type, op) \
 do { \
-    int w; \
     int width = dstrect->w; \
     int height = dstrect->h; \
     int pitch = (dst->pitch / dst->format->BytesPerPixel); \
--- a/src/video/SDL_renderer_gl.c	Thu Dec 25 04:56:44 2008 +0000
+++ b/src/video/SDL_renderer_gl.c	Thu Dec 25 05:11:29 2008 +0000
@@ -519,9 +519,9 @@
 {
     const int have_texture_rects = data->GL_ARB_texture_rectangle_supported;
     const char *replacement = have_texture_rects ? "RECT" : "2D";
-    const size_t replacementlen = strlen(replacement);
+    const size_t replacementlen = SDL_strlen(replacement);
     const char *token = "%TEXTURETARGET%";
-    const size_t tokenlen = strlen(token);
+    const size_t tokenlen = SDL_strlen(token);
     char *code = NULL;
     char *ptr = NULL;
     GLuint program = 0;
@@ -536,9 +536,9 @@
         return 0;
 
     for (ptr = SDL_strstr(code, token); ptr; ptr = SDL_strstr(ptr + 1, token)) {
-        memcpy(ptr, replacement, replacementlen);
-        memmove(ptr + replacementlen, ptr + tokenlen,
-                strlen(ptr + tokenlen) + 1);
+        SDL_memcpy(ptr, replacement, replacementlen);
+        SDL_memmove(ptr + replacementlen, ptr + tokenlen,
+                    SDL_strlen(ptr + tokenlen) + 1);
     }
 
 #if DEBUG_PROGRAM_COMPILE
--- a/src/video/SDL_video.c	Thu Dec 25 04:56:44 2008 +0000
+++ b/src/video/SDL_video.c	Thu Dec 25 05:11:29 2008 +0000
@@ -2075,7 +2075,6 @@
 {
     SDL_Renderer *renderer;
     SDL_Window *window;
-    SDL_Rect real_rect;
 
     if (!_this) {
         SDL_UninitializedVideo();
--- a/src/video/win32/SDL_win32events.c	Thu Dec 25 04:56:44 2008 +0000
+++ b/src/video/win32/SDL_win32events.c	Thu Dec 25 05:11:29 2008 +0000
@@ -214,7 +214,6 @@
     case WM_INPUT:             /* mouse events */
         {
             LPBYTE lpb;
-            int w, h;
             const RAWINPUTHEADER *header;
             int index;
             int i;