mirror of
https://github.com/joel16/SDL2.git
synced 2024-12-12 13:35:53 +00:00
Fixed building under Visual Studio
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404422
This commit is contained in:
parent
c9bab7f01e
commit
91df94faa9
@ -26,7 +26,7 @@
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
Description="Making sure basic SDL headers are in place..."
|
||||
CommandLine="if exist "$(ProjectDir)\..\..\include\SDL_config.h" goto SDLCONFIGOKAY
echo Copying SDL_config_win32.h to SDL_config.h...
copy "$(ProjectDir)\..\..\include\SDL_config_win32.h" "$(ProjectDir)\..\..\include\SDL_config.h"
:SDLCONFIGOKAY

if exist "$(ProjectDir)\..\..\include\SDL_revision.h" goto SDLREVISIONOKAY
echo Creating stub SDL_revision.h file...
echo #define SDL_REVISION 0 >"$(ProjectDir)\..\..\include\SDL_revision.h"
:SDLREVISIONOKAY"
|
||||
CommandLine="if exist "$(ProjectDir)\..\..\include\SDL_config.h" goto SDLCONFIGOKAY
echo Copying SDL_config_win32.h to SDL_config.h...
copy "$(ProjectDir)\..\..\include\SDL_config_win32.h" "$(ProjectDir)\..\..\include\SDL_config.h"
:SDLCONFIGOKAY

if exist "$(ProjectDir)\..\..\include\SDL_revision.h" goto SDLREVISIONOKAY
echo Creating stub SDL_revision.h file...
echo #define SDL_REVISION 0 >"$(ProjectDir)\..\..\include\SDL_revision.h"
:SDLREVISIONOKAY
"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
@ -125,7 +125,7 @@
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
Description="Making sure basic SDL headers are in place..."
|
||||
CommandLine="if exist "$(ProjectDir)\..\..\include\SDL_config.h" goto SDLCONFIGOKAY
echo Copying SDL_config_win32.h to SDL_config.h...
copy "$(ProjectDir)\..\..\include\SDL_config_win32.h" "$(ProjectDir)\..\..\include\SDL_config.h"
:SDLCONFIGOKAY

if exist "$(ProjectDir)\..\..\include\SDL_revision.h" goto SDLREVISIONOKAY
echo Creating stub SDL_revision.h file...
echo #define SDL_REVISION 0 >"$(ProjectDir)\..\..\include\SDL_revision.h"
:SDLREVISIONOKAY"
|
||||
CommandLine="if exist "$(ProjectDir)\..\..\include\SDL_config.h" goto SDLCONFIGOKAY
echo Copying SDL_config_win32.h to SDL_config.h...
copy "$(ProjectDir)\..\..\include\SDL_config_win32.h" "$(ProjectDir)\..\..\include\SDL_config.h"
:SDLCONFIGOKAY

if exist "$(ProjectDir)\..\..\include\SDL_revision.h" goto SDLREVISIONOKAY
echo Creating stub SDL_revision.h file...
echo #define SDL_REVISION 0 >"$(ProjectDir)\..\..\include\SDL_revision.h"
:SDLREVISIONOKAY
"
|
||||
/>
|
||||
<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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user