File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,8 @@ SDL_Haptic *SDL_OpenHaptic(SDL_HapticID instance_id)
160
160
haptic -> next = SDL_haptics ;
161
161
SDL_haptics = haptic ;
162
162
163
+ SDL_SetObjectValid (haptic , SDL_OBJECT_TYPE_HAPTIC , true);
164
+
163
165
// Disable autocenter and set gain to max.
164
166
if (haptic -> supported & SDL_HAPTIC_GAIN ) {
165
167
SDL_SetHapticGain (haptic , 100 );
@@ -168,7 +170,6 @@ SDL_Haptic *SDL_OpenHaptic(SDL_HapticID instance_id)
168
170
SDL_SetHapticAutocenter (haptic , 0 );
169
171
}
170
172
171
- SDL_SetObjectValid (haptic , SDL_OBJECT_TYPE_HAPTIC , true);
172
173
return haptic ;
173
174
}
174
175
@@ -309,6 +310,15 @@ SDL_Haptic *SDL_OpenHapticFromJoystick(SDL_Joystick *joystick)
309
310
SDL_haptics = haptic ;
310
311
311
312
SDL_SetObjectValid (haptic , SDL_OBJECT_TYPE_HAPTIC , true);
313
+
314
+ // Disable autocenter and set gain to max.
315
+ if (haptic -> supported & SDL_HAPTIC_GAIN ) {
316
+ SDL_SetHapticGain (haptic , 100 );
317
+ }
318
+ if (haptic -> supported & SDL_HAPTIC_AUTOCENTER ) {
319
+ SDL_SetHapticAutocenter (haptic , 0 );
320
+ }
321
+
312
322
return haptic ;
313
323
}
314
324
You can’t perform that action at this time.
0 commit comments