Commit dc0f95c4 authored by Andreas Schiffler's avatar Andreas Schiffler

Update VS2010 project to add new files; update new files so code builds on Win32/Win64

parent 9412167e
...@@ -110,7 +110,7 @@ echo #define SDL_REVISION 0 >"$(ProjectDir)\..\..\include\SDL_revision.h" ...@@ -110,7 +110,7 @@ echo #define SDL_REVISION 0 >"$(ProjectDir)\..\..\include\SDL_revision.h"
<Culture>0x0409</Culture> <Culture>0x0409</Culture>
</ResourceCompile> </ResourceCompile>
<Link> <Link>
<AdditionalDependencies>msvcrt.lib;msimg32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>msvcrt.lib;msimg32.lib;version.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(IntDir)SDL.dll</OutputFile> <OutputFile>$(IntDir)SDL.dll</OutputFile>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
...@@ -274,6 +274,9 @@ echo #define SDL_REVISION 0 &gt;"$(ProjectDir)\..\..\include\SDL_revision.h" ...@@ -274,6 +274,9 @@ echo #define SDL_REVISION 0 &gt;"$(ProjectDir)\..\..\include\SDL_revision.h"
<ClInclude Include="..\..\src\events\blank_cursor.h" /> <ClInclude Include="..\..\src\events\blank_cursor.h" />
<ClInclude Include="..\..\src\events\default_cursor.h" /> <ClInclude Include="..\..\src\events\default_cursor.h" />
<ClInclude Include="..\..\src\audio\windx5\directx.h" /> <ClInclude Include="..\..\src\audio\windx5\directx.h" />
<ClInclude Include="..\..\src\events\SDL_clipboardevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_gesture_c.h" />
<ClInclude Include="..\..\src\events\SDL_touch_c.h" />
<ClInclude Include="..\..\src\libm\math.h" /> <ClInclude Include="..\..\src\libm\math.h" />
<ClInclude Include="..\..\src\libm\math_private.h" /> <ClInclude Include="..\..\src\libm\math_private.h" />
<ClInclude Include="..\..\src\video\mmx.h" /> <ClInclude Include="..\..\src\video\mmx.h" />
...@@ -326,6 +329,7 @@ echo #define SDL_REVISION 0 &gt;"$(ProjectDir)\..\..\include\SDL_revision.h" ...@@ -326,6 +329,7 @@ echo #define SDL_REVISION 0 &gt;"$(ProjectDir)\..\..\include\SDL_revision.h"
<ClInclude Include="..\..\src\timer\SDL_timer_c.h" /> <ClInclude Include="..\..\src\timer\SDL_timer_c.h" />
<ClInclude Include="..\..\src\video\win32\SDL_vkeys.h" /> <ClInclude Include="..\..\src\video\win32\SDL_vkeys.h" />
<ClInclude Include="..\..\src\audio\SDL_wave.h" /> <ClInclude Include="..\..\src\audio\SDL_wave.h" />
<ClInclude Include="..\..\src\video\win32\SDL_win32clipboard.h" />
<ClInclude Include="..\..\src\video\win32\SDL_win32events.h" /> <ClInclude Include="..\..\src\video\win32\SDL_win32events.h" />
<ClInclude Include="..\..\src\video\win32\SDL_win32gamma.h" /> <ClInclude Include="..\..\src\video\win32\SDL_win32gamma.h" />
<ClInclude Include="..\..\src\video\win32\SDL_win32keyboard.h" /> <ClInclude Include="..\..\src\video\win32\SDL_win32keyboard.h" />
...@@ -340,6 +344,9 @@ echo #define SDL_REVISION 0 &gt;"$(ProjectDir)\..\..\include\SDL_revision.h" ...@@ -340,6 +344,9 @@ echo #define SDL_REVISION 0 &gt;"$(ProjectDir)\..\..\include\SDL_revision.h"
<ClInclude Include="..\..\src\video\win32\wmmsg.h" /> <ClInclude Include="..\..\src\video\win32\wmmsg.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\src\events\SDL_clipboardevents.c" />
<ClCompile Include="..\..\src\events\SDL_gesture.c" />
<ClCompile Include="..\..\src\events\SDL_touch.c" />
<ClCompile Include="..\..\src\libm\e_log.c" /> <ClCompile Include="..\..\src\libm\e_log.c" />
<ClCompile Include="..\..\src\libm\e_pow.c" /> <ClCompile Include="..\..\src\libm\e_pow.c" />
<ClCompile Include="..\..\src\libm\e_rem_pio2.c" /> <ClCompile Include="..\..\src\libm\e_rem_pio2.c" />
...@@ -431,6 +438,7 @@ echo #define SDL_REVISION 0 &gt;"$(ProjectDir)\..\..\include\SDL_revision.h" ...@@ -431,6 +438,7 @@ echo #define SDL_REVISION 0 &gt;"$(ProjectDir)\..\..\include\SDL_revision.h"
<ClCompile Include="..\..\src\timer\SDL_timer.c" /> <ClCompile Include="..\..\src\timer\SDL_timer.c" />
<ClCompile Include="..\..\src\video\SDL_video.c" /> <ClCompile Include="..\..\src\video\SDL_video.c" />
<ClCompile Include="..\..\src\audio\SDL_wave.c" /> <ClCompile Include="..\..\src\audio\SDL_wave.c" />
<ClCompile Include="..\..\src\video\win32\SDL_win32clipboard.c" />
<ClCompile Include="..\..\src\video\win32\SDL_win32events.c" /> <ClCompile Include="..\..\src\video\win32\SDL_win32events.c" />
<ClCompile Include="..\..\src\video\win32\SDL_win32gamma.c" /> <ClCompile Include="..\..\src\video\win32\SDL_win32gamma.c" />
<ClCompile Include="..\..\src\video\win32\SDL_win32keyboard.c" /> <ClCompile Include="..\..\src\video\win32\SDL_win32keyboard.c" />
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include "SDL_audiomem.h" #include "SDL_audiomem.h"
#include "SDL_sysaudio.h" #include "SDL_sysaudio.h"
#define _THIS SDL_AudioDevice *this #define _THIS SDL_AudioDevice *_this
static SDL_AudioDriver current_audio; static SDL_AudioDriver current_audio;
static SDL_AudioDevice *open_devices[16]; static SDL_AudioDevice *open_devices[16];
...@@ -321,8 +321,9 @@ SDL_StreamDeinit(SDL_AudioStreamer * stream) ...@@ -321,8 +321,9 @@ SDL_StreamDeinit(SDL_AudioStreamer * stream)
} }
} }
#if defined(ANDROID)
#include <android/log.h> #include <android/log.h>
#endif
/* The general mixing thread function */ /* The general mixing thread function */
int SDLCALL int SDLCALL
...@@ -891,7 +892,7 @@ open_audio_device(const char *devname, int iscapture, ...@@ -891,7 +892,7 @@ open_audio_device(const char *devname, int iscapture,
device->opened = 1; device->opened = 1;
/* Allocate a fake audio memory buffer */ /* Allocate a fake audio memory buffer */
device->fake_stream = SDL_AllocAudioMem(device->spec.size); device->fake_stream = (Uint8 *)SDL_AllocAudioMem(device->spec.size);
if (device->fake_stream == NULL) { if (device->fake_stream == NULL) {
close_audio_device(device); close_audio_device(device);
SDL_OutOfMemory(); SDL_OutOfMemory();
......
This diff is collapsed.
...@@ -313,6 +313,11 @@ SDL_SendFingerDown(SDL_TouchID id, SDL_FingerID fingerid, SDL_bool down, ...@@ -313,6 +313,11 @@ SDL_SendFingerDown(SDL_TouchID id, SDL_FingerID fingerid, SDL_bool down,
float xin, float yin, float pressurein) float xin, float yin, float pressurein)
{ {
int posted; int posted;
Uint16 x;
Uint16 y;
Uint16 pressure;
SDL_Finger *finger;
SDL_Touch* touch = SDL_GetTouch(id); SDL_Touch* touch = SDL_GetTouch(id);
if(!touch) { if(!touch) {
...@@ -321,11 +326,11 @@ SDL_SendFingerDown(SDL_TouchID id, SDL_FingerID fingerid, SDL_bool down, ...@@ -321,11 +326,11 @@ SDL_SendFingerDown(SDL_TouchID id, SDL_FingerID fingerid, SDL_bool down,
//scale to Integer coordinates //scale to Integer coordinates
Uint16 x = (xin+touch->x_min)*(touch->xres)/(touch->native_xres); x = (Uint16)((xin+touch->x_min)*(touch->xres)/(touch->native_xres));
Uint16 y = (yin+touch->y_min)*(touch->yres)/(touch->native_yres); y = (Uint16)((yin+touch->y_min)*(touch->yres)/(touch->native_yres));
Uint16 pressure = (yin+touch->pressure_min)*(touch->pressureres)/(touch->native_pressureres); pressure = (Uint16)((yin+touch->pressure_min)*(touch->pressureres)/(touch->native_pressureres));
SDL_Finger *finger = SDL_GetFinger(touch,fingerid); finger = SDL_GetFinger(touch,fingerid);
if(down) { if(down) {
if(finger == NULL) { if(finger == NULL) {
SDL_Finger nf; SDL_Finger nf;
...@@ -393,15 +398,18 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, int relative, ...@@ -393,15 +398,18 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, int relative,
int posted; int posted;
Sint16 xrel, yrel; Sint16 xrel, yrel;
float x_max = 0, y_max = 0; float x_max = 0, y_max = 0;
Uint16 x;
Uint16 y;
Uint16 pressure;
if (!touch) { if (!touch) {
return SDL_TouchNotFoundError(id); return SDL_TouchNotFoundError(id);
} }
//scale to Integer coordinates //scale to Integer coordinates
Uint16 x = (xin+touch->x_min)*(touch->xres)/(touch->native_xres); x = (Uint16)((xin+touch->x_min)*(touch->xres)/(touch->native_xres));
Uint16 y = (yin+touch->y_min)*(touch->yres)/(touch->native_yres); y = (Uint16)((yin+touch->y_min)*(touch->yres)/(touch->native_yres));
Uint16 pressure = (yin+touch->pressure_min)*(touch->pressureres)/(touch->native_pressureres); pressure = (Uint16)((yin+touch->pressure_min)*(touch->pressureres)/(touch->native_pressureres));
if(touch->flush_motion) { if(touch->flush_motion) {
return 0; return 0;
} }
...@@ -544,9 +552,9 @@ SDL_GetTouchName(SDL_TouchID id) ...@@ -544,9 +552,9 @@ SDL_GetTouchName(SDL_TouchID id)
} }
int SDL_TouchNotFoundError(SDL_TouchID id) { int SDL_TouchNotFoundError(SDL_TouchID id) {
int i;
printf("ERROR: Cannot send touch on non-existent device with id: %li make sure SDL_AddTouch has been called\n",id); printf("ERROR: Cannot send touch on non-existent device with id: %li make sure SDL_AddTouch has been called\n",id);
printf("ERROR: There are %i touches installed with Id's:\n",SDL_num_touch); printf("ERROR: There are %i touches installed with Id's:\n",SDL_num_touch);
int i;
for(i=0;i < SDL_num_touch;i++) { for(i=0;i < SDL_num_touch;i++) {
printf("ERROR: %li\n",SDL_touchPads[i]->id); printf("ERROR: %li\n",SDL_touchPads[i]->id);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment