Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fixed building under Visual Studio

  • Loading branch information
slouken committed Jan 15, 2010
1 parent 6878444 commit 0a28ee8f92031f262f7ee88285dbc47f00936629
Showing with 86 additions and 3 deletions.
  1. +54 −2 VisualC/SDL/SDL.vcproj
  2. +16 −0 VisualC/SDL/SDL_VS2008.vcproj
  3. +1 −0 src/SDL_assert.c
  4. +15 −1 src/video/SDL_drawline.c
@@ -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"
@@ -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"
@@ -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"
>
@@ -235,6 +243,10 @@
RelativePath="..\..\include\SDL_config_win32.h"
>
</File>
<File
RelativePath="..\..\include\SDL_copying.h"
>
</File>
<File
RelativePath="..\..\include\SDL_cpuinfo.h"
>
@@ -251,6 +263,10 @@
RelativePath="..\..\include\SDL_events.h"
>
</File>
<File
RelativePath="..\..\include\SDL_haptic.h"
>
</File>
<File
RelativePath="..\..\include\SDL_joystick.h"
>
@@ -287,6 +303,10 @@
RelativePath="..\..\include\SDL_opengl.h"
>
</File>
<File
RelativePath="..\..\include\SDL_opengles.h"
>
</File>
<File
RelativePath="..\..\include\SDL_pixels.h"
>
@@ -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"
>
@@ -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"
>
@@ -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"
>
@@ -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"
>
@@ -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"
>
@@ -370,6 +370,10 @@
RelativePath="..\..\include\SDL.h"
>
</File>
<File
RelativePath="..\..\include\SDL_assert.h"
>
</File>
<File
RelativePath="..\..\include\SDL_atomic.h"
>
@@ -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"
>
@@ -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"
>
@@ -22,6 +22,7 @@

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

#ifdef _WINDOWS
#define WIN32_LEAN_AND_MEAN 1
@@ -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)) {

0 comments on commit 0a28ee8

Please sign in to comment.