Changed parameter name for gesture template save functions from "src" to "dst".
--- a/README-gesture.txt Sat Nov 02 11:51:23 2013 +0100
+++ b/README-gesture.txt Sat Nov 02 12:07:21 2013 +0100
@@ -34,9 +34,9 @@
Saving:
-------
-To save a template, call SDL_SaveDollarTemplate(gestureId, src) where gestureId is the id of the gesture you want to save, and src is an SDL_RWops pointer to the file where the gesture will be stored.
+To save a template, call SDL_SaveDollarTemplate(gestureId, dst) where gestureId is the id of the gesture you want to save, and dst is an SDL_RWops pointer to the file where the gesture will be stored.
-To save all currently loaded templates, call SDL_SaveAllDollarTemplates(src) where source is an SDL_RWops pointer to the file where the gesture will be stored.
+To save all currently loaded templates, call SDL_SaveAllDollarTemplates(dst) where dst is an SDL_RWops pointer to the file where the gesture will be stored.
Both functions return the number of gestures successfully saved.
--- a/include/SDL_gesture.h Sat Nov 02 11:51:23 2013 +0100
+++ b/include/SDL_gesture.h Sat Nov 02 12:07:21 2013 +0100
@@ -58,14 +58,14 @@
*
*
*/
-extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *src);
+extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst);
/**
* \brief Save a currently loaded Dollar Gesture template
*
*
*/
-extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *src);
+extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst);
/**
--- a/src/events/SDL_gesture.c Sat Nov 02 11:51:23 2013 +0100
+++ b/src/events/SDL_gesture.c Sat Nov 02 12:07:21 2013 +0100
@@ -116,15 +116,14 @@
}
-static int SaveTemplate(SDL_DollarTemplate *templ, SDL_RWops * src)
+static int SaveTemplate(SDL_DollarTemplate *templ, SDL_RWops *dst)
{
- if (src == NULL) return 0;
-
+ if (dst == NULL) return 0;
/* No Longer storing the Hash, rehash on load */
- /* if(SDL_RWops.write(src,&(templ->hash),sizeof(templ->hash),1) != 1) return 0; */
+ /* if (SDL_RWops.write(dst, &(templ->hash), sizeof(templ->hash), 1) != 1) return 0; */
- if (SDL_RWwrite(src,templ->path,
+ if (SDL_RWwrite(dst, templ->path,
sizeof(templ->path[0]),DOLLARNPOINTS) != DOLLARNPOINTS)
return 0;
@@ -132,26 +131,26 @@
}
-int SDL_SaveAllDollarTemplates(SDL_RWops *src)
+int SDL_SaveAllDollarTemplates(SDL_RWops *dst)
{
int i,j,rtrn = 0;
for (i = 0; i < SDL_numGestureTouches; i++) {
SDL_GestureTouch* touch = &SDL_gestureTouch[i];
for (j = 0; j < touch->numDollarTemplates; j++) {
- rtrn += SaveTemplate(&touch->dollarTemplate[i],src);
+ rtrn += SaveTemplate(&touch->dollarTemplate[i], dst);
}
}
return rtrn;
}
-int SDL_SaveDollarTemplate(SDL_GestureID gestureId, SDL_RWops *src)
+int SDL_SaveDollarTemplate(SDL_GestureID gestureId, SDL_RWops *dst)
{
int i,j;
for (i = 0; i < SDL_numGestureTouches; i++) {
SDL_GestureTouch* touch = &SDL_gestureTouch[i];
for (j = 0; j < touch->numDollarTemplates; j++) {
if (touch->dollarTemplate[i].hash == gestureId) {
- return SaveTemplate(&touch->dollarTemplate[i],src);
+ return SaveTemplate(&touch->dollarTemplate[i], dst);
}
}
}
--- a/test/testgesture.c Sat Nov 02 11:51:23 2013 +0100
+++ b/test/testgesture.c Sat Nov 02 12:07:21 2013 +0100
@@ -205,7 +205,7 @@
SDL_Surface *screen;
SDL_Event event;
SDL_bool quitting = SDL_FALSE;
- SDL_RWops *src;
+ SDL_RWops *stream;
/* Enable standard application logging */
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
@@ -241,14 +241,14 @@
SDL_RecordGesture(-1);
break;
case SDLK_s:
- src = SDL_RWFromFile("gestureSave","w");
- SDL_Log("Wrote %i templates",SDL_SaveAllDollarTemplates(src));
- SDL_RWclose(src);
+ stream = SDL_RWFromFile("gestureSave", "w");
+ SDL_Log("Wrote %i templates", SDL_SaveAllDollarTemplates(stream));
+ SDL_RWclose(stream);
break;
case SDLK_l:
- src = SDL_RWFromFile("gestureSave","r");
- SDL_Log("Loaded: %i",SDL_LoadDollarTemplates(-1,src));
- SDL_RWclose(src);
+ stream = SDL_RWFromFile("gestureSave", "r");
+ SDL_Log("Loaded: %i", SDL_LoadDollarTemplates(-1, stream));
+ SDL_RWclose(stream);
break;
case SDLK_ESCAPE:
quitting = SDL_TRUE;