Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Updated to build on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Dec 25, 2008
1 parent 914bcdb commit 92cac75
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 13 deletions.
30 changes: 29 additions & 1 deletion VisualC/SDL/SDL.vcproj
Expand Up @@ -440,6 +440,18 @@
RelativePath="..\..\src\audio\SDL_audiotypecvt.c"
>
</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"
>
Expand Down Expand Up @@ -484,6 +496,10 @@
RelativePath="..\..\src\video\SDL_blit_slow.c"
>
</File>
<File
RelativePath="..\..\src\video\SDL_blit_slow.h"
>
</File>
<File
RelativePath="..\..\src\video\SDL_bmp.c"
>
Expand Down Expand Up @@ -524,6 +540,18 @@
RelativePath="..\..\src\audio\disk\SDL_diskaudio.h"
>
</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"
>
Expand Down Expand Up @@ -569,7 +597,7 @@
>
</File>
<File
RelativePath="..\..\src\video\SDL_fill.c"
RelativePath="..\..\src\video\SDL_fillrect.c"
>
</File>
<File
Expand Down
4 changes: 2 additions & 2 deletions src/video/SDL_bmp.c
Expand Up @@ -218,7 +218,7 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)
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,
Expand All @@ -229,7 +229,7 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)
was_error = 1;
goto done;
}
} else if (biClrUsed < palette->ncolors) {
} else if ((int)biClrUsed < palette->ncolors) {
palette->ncolors = biClrUsed;
}
if (biSize == 12) {
Expand Down
5 changes: 2 additions & 3 deletions src/video/SDL_draw.h
Expand Up @@ -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);
Expand Down Expand Up @@ -74,7 +74,7 @@ do { \

#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)

Expand Down Expand Up @@ -346,7 +346,6 @@ do { \

#define FILLRECT(type, op) \
do { \
int w; \
int width = dstrect->w; \
int height = dstrect->h; \
int pitch = (dst->pitch / dst->format->BytesPerPixel); \
Expand Down
10 changes: 5 additions & 5 deletions src/video/SDL_renderer_gl.c
Expand Up @@ -519,9 +519,9 @@ compile_shader(GL_RenderData * data, GLenum shader_type, const char *_code)
{
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;
Expand All @@ -536,9 +536,9 @@ compile_shader(GL_RenderData * data, GLenum shader_type, const char *_code)
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
Expand Down
1 change: 0 additions & 1 deletion src/video/SDL_video.c
Expand Up @@ -2075,7 +2075,6 @@ SDL_RenderPoint(int x, int y)
{
SDL_Renderer *renderer;
SDL_Window *window;
SDL_Rect real_rect;

if (!_this) {
SDL_UninitializedVideo();
Expand Down
1 change: 0 additions & 1 deletion src/video/win32/SDL_win32events.c
Expand Up @@ -214,7 +214,6 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_INPUT: /* mouse events */
{
LPBYTE lpb;
int w, h;
const RAWINPUTHEADER *header;
int index;
int i;
Expand Down

0 comments on commit 92cac75

Please sign in to comment.