Changed parameter name for gesture template save functions from "src" to "dst".
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
diff --git a/README-gesture.txt b/README-gesture.txt
index 4d0a8d6..c2cad7b 100644
--- a/README-gesture.txt
+++ b/README-gesture.txt
@@ -34,9 +34,9 @@ Most programs will want to define an appropriate error threshold and check to be
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.
diff --git a/include/SDL_gesture.h b/include/SDL_gesture.h
index 21f10ea..015fe02 100644
--- a/include/SDL_gesture.h
+++ b/include/SDL_gesture.h
@@ -58,14 +58,14 @@ extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId);
*
*
*/
-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);
/**
diff --git a/src/events/SDL_gesture.c b/src/events/SDL_gesture.c
index d59fde2..c50092c 100644
--- a/src/events/SDL_gesture.c
+++ b/src/events/SDL_gesture.c
@@ -116,15 +116,14 @@ static unsigned long SDL_HashDollar(SDL_FloatPoint* points)
}
-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 @@ static int SaveTemplate(SDL_DollarTemplate *templ, SDL_RWops * src)
}
-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);
}
}
}
diff --git a/test/testgesture.c b/test/testgesture.c
index 016506e..89008fb 100644
--- a/test/testgesture.c
+++ b/test/testgesture.c
@@ -205,7 +205,7 @@ int main(int argc, char* argv[])
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 @@ int main(int argc, char* argv[])
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;