Added alternative finger tracking method. Still prefer IPHONE_TOUCH_EFFICIENT_DANGEROUS.
This commit is contained in:
parent
22a37911dd
commit
987edb15b3
10 changed files with 122 additions and 13 deletions
|
@ -1,11 +1,18 @@
|
||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
|
<<<<<<< local
|
||||||
|
Version="8.00"
|
||||||
|
=======
|
||||||
Version="9.00"
|
Version="9.00"
|
||||||
|
>>>>>>> other
|
||||||
Name="SDL"
|
Name="SDL"
|
||||||
ProjectGUID="{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
|
ProjectGUID="{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
|
||||||
RootNamespace="SDL"
|
RootNamespace="SDL"
|
||||||
|
<<<<<<< local
|
||||||
|
=======
|
||||||
TargetFrameworkVersion="131072"
|
TargetFrameworkVersion="131072"
|
||||||
|
>>>>>>> other
|
||||||
>
|
>
|
||||||
<Platforms>
|
<Platforms>
|
||||||
<Platform
|
<Platform
|
||||||
|
@ -77,21 +84,36 @@
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
|
<<<<<<< local
|
||||||
|
AdditionalOptions="/MACHINE:I386"
|
||||||
|
=======
|
||||||
AdditionalOptions="/MACHINE:I386
msvcrt.lib"
|
AdditionalOptions="/MACHINE:I386
msvcrt.lib"
|
||||||
|
>>>>>>> other
|
||||||
AdditionalDependencies="msimg32.lib winmm.lib"
|
AdditionalDependencies="msimg32.lib winmm.lib"
|
||||||
OutputFile=".\Debug/SDL.dll"
|
OutputFile=".\Debug/SDL.dll"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
|
<<<<<<< local
|
||||||
|
IgnoreAllDefaultLibraries="true"
|
||||||
|
=======
|
||||||
IgnoreAllDefaultLibraries="false"
|
IgnoreAllDefaultLibraries="false"
|
||||||
IgnoreDefaultLibraryNames=""
|
IgnoreDefaultLibraryNames=""
|
||||||
|
>>>>>>> other
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
ProgramDatabaseFile=".\Debug/SDL.pdb"
|
ProgramDatabaseFile=".\Debug/SDL.pdb"
|
||||||
|
<<<<<<< local
|
||||||
|
SubSystem="2"
|
||||||
|
=======
|
||||||
SubSystem="0"
|
SubSystem="0"
|
||||||
RandomizedBaseAddress="1"
|
RandomizedBaseAddress="1"
|
||||||
DataExecutionPrevention="0"
|
DataExecutionPrevention="0"
|
||||||
|
>>>>>>> other
|
||||||
ImportLibrary=".\Debug/SDL.lib"
|
ImportLibrary=".\Debug/SDL.lib"
|
||||||
|
<<<<<<< local
|
||||||
|
=======
|
||||||
Profile="true"
|
Profile="true"
|
||||||
CLRThreadAttribute="0"
|
CLRThreadAttribute="0"
|
||||||
|
>>>>>>> other
|
||||||
CLRUnmanagedCodeCheck="false"
|
CLRUnmanagedCodeCheck="false"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
|
@ -113,6 +135,12 @@
|
||||||
Name="VCAppVerifierTool"
|
Name="VCAppVerifierTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
|
<<<<<<< local
|
||||||
|
Name="VCWebDeploymentTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
=======
|
||||||
|
>>>>>>> other
|
||||||
Name="VCPostBuildEventTool"
|
Name="VCPostBuildEventTool"
|
||||||
/>
|
/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
|
@ -188,8 +216,11 @@
|
||||||
IgnoreAllDefaultLibraries="true"
|
IgnoreAllDefaultLibraries="true"
|
||||||
ProgramDatabaseFile=".\Release/SDL.pdb"
|
ProgramDatabaseFile=".\Release/SDL.pdb"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
|
<<<<<<< local
|
||||||
|
=======
|
||||||
RandomizedBaseAddress="1"
|
RandomizedBaseAddress="1"
|
||||||
DataExecutionPrevention="0"
|
DataExecutionPrevention="0"
|
||||||
|
>>>>>>> other
|
||||||
ImportLibrary=".\Release/SDL.lib"
|
ImportLibrary=".\Release/SDL.lib"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
|
@ -211,6 +242,12 @@
|
||||||
Name="VCAppVerifierTool"
|
Name="VCAppVerifierTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
|
<<<<<<< local
|
||||||
|
Name="VCWebDeploymentTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
=======
|
||||||
|
>>>>>>> other
|
||||||
Name="VCPostBuildEventTool"
|
Name="VCPostBuildEventTool"
|
||||||
/>
|
/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
|
@ -943,6 +980,8 @@
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
|
<<<<<<< local
|
||||||
|
=======
|
||||||
RelativePath="..\..\src\events\SDL_touch.c"
|
RelativePath="..\..\src\events\SDL_touch.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
@ -951,6 +990,7 @@
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
|
>>>>>>> other
|
||||||
RelativePath="..\..\src\video\SDL_video.c"
|
RelativePath="..\..\src\video\SDL_video.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
|
|
@ -1,10 +1,17 @@
|
||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
|
<<<<<<< local
|
||||||
|
Version="8.00"
|
||||||
|
=======
|
||||||
Version="9.00"
|
Version="9.00"
|
||||||
|
>>>>>>> other
|
||||||
Name="SDLmain"
|
Name="SDLmain"
|
||||||
ProjectGUID="{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
|
ProjectGUID="{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
|
||||||
|
<<<<<<< local
|
||||||
|
=======
|
||||||
TargetFrameworkVersion="131072"
|
TargetFrameworkVersion="131072"
|
||||||
|
>>>>>>> other
|
||||||
>
|
>
|
||||||
<Platforms>
|
<Platforms>
|
||||||
<Platform
|
<Platform
|
||||||
|
@ -26,7 +33,11 @@
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreBuildEventTool"
|
Name="VCPreBuildEventTool"
|
||||||
Description="Making sure basic SDL headers are in place..."
|
Description="Making sure basic SDL headers are in place..."
|
||||||
|
<<<<<<< local
|
||||||
|
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
"
|
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
"
|
||||||
|
>>>>>>> other
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"
|
Name="VCCustomBuildTool"
|
||||||
|
@ -99,7 +110,11 @@
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreBuildEventTool"
|
Name="VCPreBuildEventTool"
|
||||||
Description="Making sure basic SDL headers are in place..."
|
Description="Making sure basic SDL headers are in place..."
|
||||||
|
<<<<<<< local
|
||||||
|
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
"
|
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
"
|
||||||
|
>>>>>>> other
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"
|
Name="VCCustomBuildTool"
|
||||||
|
@ -172,7 +187,11 @@
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreBuildEventTool"
|
Name="VCPreBuildEventTool"
|
||||||
Description="Making sure basic SDL headers are in place..."
|
Description="Making sure basic SDL headers are in place..."
|
||||||
|
<<<<<<< local
|
||||||
|
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
"
|
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
"
|
||||||
|
>>>>>>> other
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"
|
Name="VCCustomBuildTool"
|
||||||
|
|
|
@ -105,6 +105,7 @@ typedef enum
|
||||||
SDL_MULTIGESTURE,
|
SDL_MULTIGESTURE,
|
||||||
|
|
||||||
/* Clipboard events */
|
/* Clipboard events */
|
||||||
|
|
||||||
SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */
|
SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */
|
||||||
|
|
||||||
/* Obsolete events */
|
/* Obsolete events */
|
||||||
|
|
|
@ -13,8 +13,7 @@
|
||||||
Lesser General Public License for more details.
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
You should have received a copy of the GNU Lesser General Public
|
||||||
License along with this library; if not, write to the Free Software
|
License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
|
|
||||||
Sam Lantinga
|
Sam Lantinga
|
||||||
slouken@libsdl.org
|
slouken@libsdl.org
|
||||||
|
@ -24,10 +23,8 @@
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
#include "SDL_events.h"
|
#include "SDL_events.h"
|
||||||
|
|
||||||
#if SDL_IPHONE_MULTIPLE_MICE
|
#ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS
|
||||||
#define MAX_SIMULTANEOUS_TOUCHES 5
|
#define MAX_SIMULTANEOUS_TOUCHES 5
|
||||||
#else
|
|
||||||
#define MAX_SIMULTANEOUS_TOUCHES 1
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
|
@ -39,6 +36,9 @@
|
||||||
|
|
||||||
#if FIXED_MULTITOUCH
|
#if FIXED_MULTITOUCH
|
||||||
int touchId;
|
int touchId;
|
||||||
|
#ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS
|
||||||
|
UITouch *finger[MAX_SIMULTANEOUS_TOUCHES];
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SDL_IPHONE_KEYBOARD
|
#if SDL_IPHONE_KEYBOARD
|
||||||
|
|
|
@ -91,9 +91,30 @@
|
||||||
#if FIXED_MULTITOUCH
|
#if FIXED_MULTITOUCH
|
||||||
while(touch) {
|
while(touch) {
|
||||||
CGPoint locationInView = [touch locationInView: self];
|
CGPoint locationInView = [touch locationInView: self];
|
||||||
SDL_SendFingerDown(touchId,(int)touch,
|
|
||||||
|
|
||||||
|
#ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
|
||||||
|
//FIXME: TODO: Using touch as the fingerId is potentially dangerous
|
||||||
|
//It is also much more efficient than storing the UITouch pointer
|
||||||
|
//and comparing it to the incoming event.
|
||||||
|
SDL_SendFingerDown(touchId,(long)touch,
|
||||||
SDL_TRUE,locationInView.x,locationInView.y,
|
SDL_TRUE,locationInView.x,locationInView.y,
|
||||||
1);
|
1);
|
||||||
|
#else
|
||||||
|
int i;
|
||||||
|
for(i = 0;i < MAX_SIMULTANEOUS_TOUCHES;i++) {
|
||||||
|
if(finger[i] == NULL) {
|
||||||
|
finger[i] = touch;
|
||||||
|
SDL_SendFingerDown(touchId,i,
|
||||||
|
SDL_TRUE,locationInView.x,locationInView.y,
|
||||||
|
1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
touch = (UITouch*)[enumerator nextObject];
|
touch = (UITouch*)[enumerator nextObject];
|
||||||
}
|
}
|
||||||
|
@ -113,9 +134,23 @@
|
||||||
#if FIXED_MULTITOUCH
|
#if FIXED_MULTITOUCH
|
||||||
while(touch) {
|
while(touch) {
|
||||||
CGPoint locationInView = [touch locationInView: self];
|
CGPoint locationInView = [touch locationInView: self];
|
||||||
SDL_SendFingerDown(touchId,(int)touch,
|
|
||||||
|
|
||||||
|
#ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
|
||||||
|
SDL_SendFingerDown(touchId,(long)touch,
|
||||||
SDL_FALSE,locationInView.x,locationInView.y,
|
SDL_FALSE,locationInView.x,locationInView.y,
|
||||||
1);
|
1);
|
||||||
|
#else
|
||||||
|
int i;
|
||||||
|
for(i = 0;i < MAX_SIMULTANEOUS_TOUCHES;i++) {
|
||||||
|
if(finger[i] == touch) {
|
||||||
|
SDL_SendFingerDown(touchId,i,
|
||||||
|
SDL_FALSE,locationInView.x,locationInView.y,
|
||||||
|
1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
touch = (UITouch*)[enumerator nextObject];
|
touch = (UITouch*)[enumerator nextObject];
|
||||||
}
|
}
|
||||||
|
@ -146,9 +181,23 @@
|
||||||
#if FIXED_MULTITOUCH
|
#if FIXED_MULTITOUCH
|
||||||
while(touch) {
|
while(touch) {
|
||||||
CGPoint locationInView = [touch locationInView: self];
|
CGPoint locationInView = [touch locationInView: self];
|
||||||
SDL_SendTouchMotion(touchId,(int)touch,
|
|
||||||
SDL_FALSE,locationInView.x,locationInView.y,
|
|
||||||
1);
|
#ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
|
||||||
|
SDL_SendTouchMotion(touchId,(long)touch,
|
||||||
|
SDL_FALSE,locationInView.x,locationInView.y,
|
||||||
|
1);
|
||||||
|
#else
|
||||||
|
int i;
|
||||||
|
for(i = 0;i < MAX_SIMULTANEOUS_TOUCHES;i++) {
|
||||||
|
if(finger[i] == touch) {
|
||||||
|
SDL_SendTouchMotion(touchId,i,
|
||||||
|
SDL_FALSE,locationInView.x,locationInView.y,
|
||||||
|
1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
touch = (UITouch*)[enumerator nextObject];
|
touch = (UITouch*)[enumerator nextObject];
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#define BPP 4
|
#define BPP 4
|
||||||
#define DEPTH 32
|
#define DEPTH 32
|
||||||
|
|
||||||
#define MAXFINGERS 3
|
#define MAXFINGERS 5
|
||||||
|
|
||||||
#define DOLLARNPOINTS 64
|
#define DOLLARNPOINTS 64
|
||||||
#define DOLLARSIZE 256
|
#define DOLLARSIZE 256
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -12,7 +12,7 @@
|
||||||
#define DEPTH 32
|
#define DEPTH 32
|
||||||
|
|
||||||
|
|
||||||
#define MAX_FINGERS 2
|
#define MAX_FINGERS 5
|
||||||
|
|
||||||
int mousx,mousy;
|
int mousx,mousy;
|
||||||
int keystat[512];
|
int keystat[512];
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#define BPP 4
|
#define BPP 4
|
||||||
#define DEPTH 32
|
#define DEPTH 32
|
||||||
|
|
||||||
#define MAXFINGERS 3
|
#define MAXFINGERS 5
|
||||||
|
|
||||||
int mousx,mousy;
|
int mousx,mousy;
|
||||||
int keystat[512];
|
int keystat[512];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue