Renamed *FromID() to *ForID()
While it makes sense to get an object pointer from an object ID, you want to get object attributes for an ID, otherwise e.g. GetNameFromID() sounds like it's a name ID, not an object ID. This is also consistent with the function naming convention in SDL2.
This commit is contained in:
1 parent
0cdc60666b
commit
5c875e1183
21 files changed
+215
-215
No files matched your search
+2
-2
@@ -86,7 +86,7 @@ int main(int argc, char **argv)
|
||||
haptics = SDL_GetHaptics(&num_haptics);
|
||||
SDL_Log("%d Haptic devices detected.\n", num_haptics);
|
||||
for (i = 0; i < num_haptics; ++i) {
|
||||
SDL_Log(" %s\n", SDL_GetHapticNameFromID(haptics[i]));
|
||||
SDL_Log(" %s\n", SDL_GetHapticNameForID(haptics[i]));
|
||||
}
|
||||
if (haptics) {
|
||||
if (num_haptics == 0) {
|
||||
@@ -108,7 +108,7 @@ int main(int argc, char **argv)
|
||||
/* Try to find matching device */
|
||||
else {
|
||||
for (i = 0; i < num_haptics; i++) {
|
||||
if (SDL_strstr(SDL_GetHapticNameFromID(haptics[i]), name) != NULL) {
|
||||
if (SDL_strstr(SDL_GetHapticNameForID(haptics[i]), name) != NULL) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -103,13 +103,13 @@ int main(int argc, char *argv[])
|
||||
keepGoing = SDL_FALSE;
|
||||
break;
|
||||
case SDL_EVENT_KEYBOARD_ADDED:
|
||||
SDL_Log("Keyboard '%s' added : %" SDL_PRIu32 "\n", SDL_GetKeyboardNameFromID(event.kdevice.which), event.kdevice.which);
|
||||
SDL_Log("Keyboard '%s' added : %" SDL_PRIu32 "\n", SDL_GetKeyboardNameForID(event.kdevice.which), event.kdevice.which);
|
||||
break;
|
||||
case SDL_EVENT_KEYBOARD_REMOVED:
|
||||
SDL_Log("Keyboard removed: %" SDL_PRIu32 "\n", event.kdevice.which);
|
||||
break;
|
||||
case SDL_EVENT_MOUSE_ADDED:
|
||||
SDL_Log("Mouse '%s' added : %" SDL_PRIu32 "\n", SDL_GetMouseNameFromID(event.mdevice.which), event.mdevice.which);
|
||||
SDL_Log("Mouse '%s' added : %" SDL_PRIu32 "\n", SDL_GetMouseNameForID(event.mdevice.which), event.mdevice.which);
|
||||
break;
|
||||
case SDL_EVENT_MOUSE_REMOVED:
|
||||
SDL_Log("Mouse removed: %" SDL_PRIu32 "\n", event.mdevice.which);
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ int main(int argc, char **argv)
|
||||
/* Try to find matching device */
|
||||
else {
|
||||
for (i = 0; i < num_haptics; i++) {
|
||||
if (SDL_strstr(SDL_GetHapticNameFromID(haptics[i]), name) != NULL) {
|
||||
if (SDL_strstr(SDL_GetHapticNameForID(haptics[i]), name) != NULL) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -91,11 +91,11 @@ int main(int argc, char **argv)
|
||||
for (i = 0; i < num_sensors; ++i) {
|
||||
SDL_Log("Sensor %" SDL_PRIu32 ": %s, type %s, platform type %d\n",
|
||||
sensors[i],
|
||||
SDL_GetSensorNameFromID(sensors[i]),
|
||||
GetSensorTypeString(SDL_GetSensorTypeFromID(sensors[i])),
|
||||
SDL_GetSensorNonPortableTypeFromID(sensors[i]));
|
||||
SDL_GetSensorNameForID(sensors[i]),
|
||||
GetSensorTypeString(SDL_GetSensorTypeForID(sensors[i])),
|
||||
SDL_GetSensorNonPortableTypeForID(sensors[i]));
|
||||
|
||||
if (SDL_GetSensorTypeFromID(sensors[i]) != SDL_SENSOR_UNKNOWN) {
|
||||
if (SDL_GetSensorTypeForID(sensors[i]) != SDL_SENSOR_UNKNOWN) {
|
||||
SDL_Sensor *sensor = SDL_OpenSensor(sensors[i]);
|
||||
if (!sensor) {
|
||||
SDL_Log("Couldn't open sensor %" SDL_PRIu32 ": %s\n", sensors[i], SDL_GetError());
|
||||
|
||||
Reference in new issue
Block a user