changeset 3671:0d6f520c0eb9

Fixed building under Visual Studio
author Sam Lantinga <slouken@libsdl.org>
date Fri, 15 Jan 2010 20:05:49 +0000
parents 62b6a5b99918
children 878d8adf2fde
files VisualC/SDL/SDL.vcproj VisualC/SDL/SDL_VS2008.vcproj src/SDL_assert.c src/video/SDL_drawline.c
diffstat 4 files changed, 86 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/VisualC/SDL/SDL.vcproj	Wed Jan 13 19:29:33 2010 +0000
+++ b/VisualC/SDL/SDL.vcproj	Fri Jan 15 20:05:49 2010 +0000
@@ -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"
@@ -224,6 +224,14 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\include\SDL_assert.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\SDL_atomic.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\include\SDL_audio.h"
 				>
 			</File>
@@ -236,6 +244,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\include\SDL_copying.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\include\SDL_cpuinfo.h"
 				>
 			</File>
@@ -252,6 +264,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\include\SDL_haptic.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\include\SDL_joystick.h"
 				>
 			</File>
@@ -288,6 +304,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\include\SDL_opengles.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\include\SDL_pixels.h"
 				>
 			</File>
@@ -304,14 +324,26 @@
 				>
 			</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"
 				>
 			</File>
@@ -425,6 +457,14 @@
 			>
 		</File>
 		<File
+			RelativePath="..\..\src\SDL_assert.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\atomic\win32\SDL_atomic.c"
+			>
+		</File>
+		<File
 			RelativePath="..\..\src\audio\SDL_audio.c"
 			>
 		</File>
@@ -453,6 +493,10 @@
 			>
 		</File>
 		<File
+			RelativePath="..\..\src\video\SDL_blendfillrect.c"
+			>
+		</File>
+		<File
 			RelativePath="..\..\src\video\SDL_blendline.c"
 			>
 		</File>
@@ -561,6 +605,10 @@
 			>
 		</File>
 		<File
+			RelativePath="..\..\src\video\SDL_drawrect.c"
+			>
+		</File>
+		<File
 			RelativePath="..\..\src\audio\dummy\SDL_dummyaudio.c"
 			>
 		</File>
@@ -625,6 +673,10 @@
 			>
 		</File>
 		<File
+			RelativePath="..\..\src\video\SDL_glesfuncs.h"
+			>
+		</File>
+		<File
 			RelativePath="..\..\src\video\SDL_glfuncs.h"
 			>
 		</File>
--- a/VisualC/SDL/SDL_VS2008.vcproj	Wed Jan 13 19:29:33 2010 +0000
+++ b/VisualC/SDL/SDL_VS2008.vcproj	Fri Jan 15 20:05:49 2010 +0000
@@ -371,6 +371,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\include\SDL_assert.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\include\SDL_atomic.h"
 				>
 			</File>
@@ -608,6 +612,14 @@
 			>
 		</File>
 		<File
+			RelativePath="..\..\src\SDL_assert.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\atomic\win32\SDL_atomic.c"
+			>
+		</File>
+		<File
 			RelativePath="..\..\src\audio\SDL_audio.c"
 			>
 		</File>
@@ -816,6 +828,10 @@
 			>
 		</File>
 		<File
+			RelativePath="..\..\src\video\SDL_glesfuncs.h"
+			>
+		</File>
+		<File
 			RelativePath="..\..\src\video\SDL_glfuncs.h"
 			>
 		</File>
--- a/src/SDL_assert.c	Wed Jan 13 19:29:33 2010 +0000
+++ b/src/SDL_assert.c	Fri Jan 15 20:05:49 2010 +0000
@@ -22,6 +22,7 @@
 
 #include "SDL.h"
 #include "SDL_assert.h"
+#include "video/SDL_sysvideo.h"
 
 #ifdef _WINDOWS
 #define WIN32_LEAN_AND_MEAN 1
--- a/src/video/SDL_drawline.c	Wed Jan 13 19:29:33 2010 +0000
+++ b/src/video/SDL_drawline.c	Fri Jan 15 20:05:49 2010 +0000
@@ -28,7 +28,21 @@
               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)) {