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

Commit

Permalink
Fixed building under Visual Studio
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jan 15, 2010
1 parent 6878444 commit 0a28ee8
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 3 deletions.
56 changes: 54 additions & 2 deletions VisualC/SDL/SDL.vcproj
Expand Up @@ -26,7 +26,7 @@
<Tool
Name="VCPreBuildEventTool"
Description="Making sure basic SDL headers are in place..."
CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY"
CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
Expand Down Expand Up @@ -125,7 +125,7 @@
<Tool
Name="VCPreBuildEventTool"
Description="Making sure basic SDL headers are in place..."
CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY"
CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_win32.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_win32.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
Expand Down Expand Up @@ -223,6 +223,14 @@
RelativePath="..\..\include\SDL.h"
>
</File>
<File
RelativePath="..\..\include\SDL_assert.h"
>
</File>
<File
RelativePath="..\..\include\SDL_atomic.h"
>
</File>
<File
RelativePath="..\..\include\SDL_audio.h"
>
Expand All @@ -235,6 +243,10 @@
RelativePath="..\..\include\SDL_config_win32.h"
>
</File>
<File
RelativePath="..\..\include\SDL_copying.h"
>
</File>
<File
RelativePath="..\..\include\SDL_cpuinfo.h"
>
Expand All @@ -251,6 +263,10 @@
RelativePath="..\..\include\SDL_events.h"
>
</File>
<File
RelativePath="..\..\include\SDL_haptic.h"
>
</File>
<File
RelativePath="..\..\include\SDL_joystick.h"
>
Expand Down Expand Up @@ -287,6 +303,10 @@
RelativePath="..\..\include\SDL_opengl.h"
>
</File>
<File
RelativePath="..\..\include\SDL_opengles.h"
>
</File>
<File
RelativePath="..\..\include\SDL_pixels.h"
>
Expand All @@ -303,14 +323,26 @@
RelativePath="..\..\include\SDL_quit.h"
>
</File>
<File
RelativePath="..\..\include\SDL_rect.h"
>
</File>
<File
RelativePath="..\..\include\SDL_rwops.h"
>
</File>
<File
RelativePath="..\..\include\SDL_scancode.h"
>
</File>
<File
RelativePath="..\..\include\SDL_stdinc.h"
>
</File>
<File
RelativePath="..\..\include\SDL_surface.h"
>
</File>
<File
RelativePath="..\..\include\SDL_syswm.h"
>
Expand Down Expand Up @@ -424,6 +456,14 @@
RelativePath="..\..\src\video\SDL_alphamult.h"
>
</File>
<File
RelativePath="..\..\src\SDL_assert.c"
>
</File>
<File
RelativePath="..\..\src\atomic\win32\SDL_atomic.c"
>
</File>
<File
RelativePath="..\..\src\audio\SDL_audio.c"
>
Expand Down Expand Up @@ -452,6 +492,10 @@
RelativePath="..\..\src\audio\SDL_audiotypecvt.c"
>
</File>
<File
RelativePath="..\..\src\video\SDL_blendfillrect.c"
>
</File>
<File
RelativePath="..\..\src\video\SDL_blendline.c"
>
Expand Down Expand Up @@ -560,6 +604,10 @@
RelativePath="..\..\src\video\SDL_drawpoint.c"
>
</File>
<File
RelativePath="..\..\src\video\SDL_drawrect.c"
>
</File>
<File
RelativePath="..\..\src\audio\dummy\SDL_dummyaudio.c"
>
Expand Down Expand Up @@ -624,6 +672,10 @@
RelativePath="..\..\src\stdlib\SDL_getenv.c"
>
</File>
<File
RelativePath="..\..\src\video\SDL_glesfuncs.h"
>
</File>
<File
RelativePath="..\..\src\video\SDL_glfuncs.h"
>
Expand Down
16 changes: 16 additions & 0 deletions VisualC/SDL/SDL_VS2008.vcproj
Expand Up @@ -370,6 +370,10 @@
RelativePath="..\..\include\SDL.h"
>
</File>
<File
RelativePath="..\..\include\SDL_assert.h"
>
</File>
<File
RelativePath="..\..\include\SDL_atomic.h"
>
Expand Down Expand Up @@ -607,6 +611,14 @@
RelativePath="..\..\src\video\SDL_alphamult.h"
>
</File>
<File
RelativePath="..\..\src\SDL_assert.c"
>
</File>
<File
RelativePath="..\..\src\atomic\win32\SDL_atomic.c"
>
</File>
<File
RelativePath="..\..\src\audio\SDL_audio.c"
>
Expand Down Expand Up @@ -815,6 +827,10 @@
RelativePath="..\..\src\stdlib\SDL_getenv.c"
>
</File>
<File
RelativePath="..\..\src\video\SDL_glesfuncs.h"
>
</File>
<File
RelativePath="..\..\src\video\SDL_glfuncs.h"
>
Expand Down
1 change: 1 addition & 0 deletions src/SDL_assert.c
Expand Up @@ -22,6 +22,7 @@

#include "SDL.h"
#include "SDL_assert.h"
#include "video/SDL_sysvideo.h"

#ifdef _WINDOWS
#define WIN32_LEAN_AND_MEAN 1
Expand Down
16 changes: 15 additions & 1 deletion src/video/SDL_drawline.c
Expand Up @@ -28,7 +28,21 @@ SDL_DrawLine1(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color,
SDL_bool draw_end)
{
if (y1 == y2) {
HLINE(Uint8, DRAW_FASTSETPIXEL1, draw_end);
//HLINE(Uint8, DRAW_FASTSETPIXEL1, draw_end);
int length;
int pitch = (dst->pitch / dst->format->BytesPerPixel);
Uint8 *pixel;
if (x1 <= x2) {
pixel = (Uint8 *)dst->pixels + y1 * pitch + x1;
length = draw_end ? (x2-x1+1) : (x2-x1);
} else {
pixel = (Uint8 *)dst->pixels + y1 * pitch + x2;
if (!draw_end) {
++pixel;
}
length = draw_end ? (x1-x2+1) : (x1-x2);
}
SDL_memset(pixel, color, length);
} else if (x1 == x2) {
VLINE(Uint8, DRAW_FASTSETPIXEL1, draw_end);
} else if (ABS(x1 - x2) == ABS(y1 - y2)) {
Expand Down

0 comments on commit 0a28ee8

Please sign in to comment.