@@ -40,7 +40,7 @@ std::shared_ptr<ControllerButtonMapping> ButtonMappingFactory::CreateButtonMappi
40
40
return nullptr ;
41
41
}
42
42
43
- return std::make_shared<SDLButtonToButtonMapping>(static_cast <ShipDeviceType>(shipDeviceIndex), portIndex,
43
+ return std::make_shared<SDLButtonToButtonMapping>(portIndex,
44
44
bitmask, sdlControllerButton);
45
45
}
46
46
@@ -59,7 +59,7 @@ std::shared_ptr<ControllerButtonMapping> ButtonMappingFactory::CreateButtonMappi
59
59
return nullptr ;
60
60
}
61
61
62
- return std::make_shared<SDLAxisDirectionToButtonMapping>(static_cast <ShipDeviceType>(shipDeviceIndex),
62
+ return std::make_shared<SDLAxisDirectionToButtonMapping>(
63
63
portIndex, bitmask, sdlControllerAxis, axisDirection);
64
64
}
65
65
@@ -161,58 +161,58 @@ ButtonMappingFactory::CreateDefaultSDLButtonMappings(uint8_t portIndex,
161
161
switch (bitmask) {
162
162
case BTN_A:
163
163
mappings.push_back (
164
- std::make_shared<SDLButtonToButtonMapping>(ShipDeviceType::SDLGamepad, portIndex, BTN_A, SDL_CONTROLLER_BUTTON_A));
164
+ std::make_shared<SDLButtonToButtonMapping>(portIndex, BTN_A, SDL_CONTROLLER_BUTTON_A));
165
165
break ;
166
166
case BTN_B:
167
167
mappings.push_back (
168
- std::make_shared<SDLButtonToButtonMapping>(ShipDeviceType::SDLGamepad, portIndex, BTN_B, SDL_CONTROLLER_BUTTON_B));
168
+ std::make_shared<SDLButtonToButtonMapping>(portIndex, BTN_B, SDL_CONTROLLER_BUTTON_B));
169
169
break ;
170
170
case BTN_L:
171
- mappings.push_back (std::make_shared<SDLButtonToButtonMapping>(ShipDeviceType::SDLGamepad, portIndex, BTN_L,
171
+ mappings.push_back (std::make_shared<SDLButtonToButtonMapping>( portIndex, BTN_L,
172
172
SDL_CONTROLLER_BUTTON_LEFTSHOULDER));
173
173
break ;
174
174
case BTN_R:
175
- mappings.push_back (std::make_shared<SDLAxisDirectionToButtonMapping>(ShipDeviceType::SDLGamepad, portIndex, BTN_R,
175
+ mappings.push_back (std::make_shared<SDLAxisDirectionToButtonMapping>( portIndex, BTN_R,
176
176
SDL_CONTROLLER_AXIS_TRIGGERRIGHT, 1 ));
177
177
break ;
178
178
case BTN_Z:
179
- mappings.push_back (std::make_shared<SDLAxisDirectionToButtonMapping>(ShipDeviceType::SDLGamepad, portIndex, BTN_Z,
179
+ mappings.push_back (std::make_shared<SDLAxisDirectionToButtonMapping>( portIndex, BTN_Z,
180
180
SDL_CONTROLLER_AXIS_TRIGGERLEFT, 1 ));
181
181
break ;
182
182
case BTN_START:
183
- mappings.push_back (std::make_shared<SDLButtonToButtonMapping>(ShipDeviceType::SDLGamepad, portIndex, BTN_START,
183
+ mappings.push_back (std::make_shared<SDLButtonToButtonMapping>( portIndex, BTN_START,
184
184
SDL_CONTROLLER_BUTTON_START));
185
185
break ;
186
186
case BTN_CUP:
187
- mappings.push_back (std::make_shared<SDLAxisDirectionToButtonMapping>(ShipDeviceType::SDLGamepad, portIndex, BTN_CUP,
187
+ mappings.push_back (std::make_shared<SDLAxisDirectionToButtonMapping>( portIndex, BTN_CUP,
188
188
SDL_CONTROLLER_AXIS_RIGHTY, -1 ));
189
189
break ;
190
190
case BTN_CDOWN:
191
- mappings.push_back (std::make_shared<SDLAxisDirectionToButtonMapping>(ShipDeviceType::SDLGamepad, portIndex, BTN_CDOWN,
191
+ mappings.push_back (std::make_shared<SDLAxisDirectionToButtonMapping>( portIndex, BTN_CDOWN,
192
192
SDL_CONTROLLER_AXIS_RIGHTY, 1 ));
193
193
break ;
194
194
case BTN_CLEFT:
195
- mappings.push_back (std::make_shared<SDLAxisDirectionToButtonMapping>(ShipDeviceType::SDLGamepad, portIndex, BTN_CLEFT,
195
+ mappings.push_back (std::make_shared<SDLAxisDirectionToButtonMapping>( portIndex, BTN_CLEFT,
196
196
SDL_CONTROLLER_AXIS_RIGHTX, -1 ));
197
197
break ;
198
198
case BTN_CRIGHT:
199
- mappings.push_back (std::make_shared<SDLAxisDirectionToButtonMapping>(ShipDeviceType::SDLGamepad, portIndex, BTN_CRIGHT,
199
+ mappings.push_back (std::make_shared<SDLAxisDirectionToButtonMapping>( portIndex, BTN_CRIGHT,
200
200
SDL_CONTROLLER_AXIS_RIGHTX, 1 ));
201
201
break ;
202
202
case BTN_DUP:
203
- mappings.push_back (std::make_shared<SDLButtonToButtonMapping>(ShipDeviceType::SDLGamepad, portIndex, BTN_DUP,
203
+ mappings.push_back (std::make_shared<SDLButtonToButtonMapping>( portIndex, BTN_DUP,
204
204
SDL_CONTROLLER_BUTTON_DPAD_UP));
205
205
break ;
206
206
case BTN_DDOWN:
207
- mappings.push_back (std::make_shared<SDLButtonToButtonMapping>(ShipDeviceType::SDLGamepad, portIndex, BTN_DDOWN,
207
+ mappings.push_back (std::make_shared<SDLButtonToButtonMapping>( portIndex, BTN_DDOWN,
208
208
SDL_CONTROLLER_BUTTON_DPAD_DOWN));
209
209
break ;
210
210
case BTN_DLEFT:
211
- mappings.push_back (std::make_shared<SDLButtonToButtonMapping>(ShipDeviceType::SDLGamepad, portIndex, BTN_DLEFT,
211
+ mappings.push_back (std::make_shared<SDLButtonToButtonMapping>( portIndex, BTN_DLEFT,
212
212
SDL_CONTROLLER_BUTTON_DPAD_LEFT));
213
213
break ;
214
214
case BTN_DRIGHT:
215
- mappings.push_back (std::make_shared<SDLButtonToButtonMapping>(ShipDeviceType::SDLGamepad, portIndex, BTN_DRIGHT,
215
+ mappings.push_back (std::make_shared<SDLButtonToButtonMapping>( portIndex, BTN_DRIGHT,
216
216
SDL_CONTROLLER_BUTTON_DPAD_RIGHT));
217
217
break ;
218
218
}
@@ -246,7 +246,7 @@ ButtonMappingFactory::CreateButtonMappingFromSDLInput(uint8_t portIndex, CONTROL
246
246
for (auto [lusIndex, controller] : sdlControllers) {
247
247
for (int32_t button = SDL_CONTROLLER_BUTTON_A; button < SDL_CONTROLLER_BUTTON_MAX; button++) {
248
248
if (SDL_GameControllerGetButton (controller, static_cast <SDL_GameControllerButton>(button))) {
249
- mapping = std::make_shared<SDLButtonToButtonMapping>(lusIndex, portIndex, bitmask, button);
249
+ mapping = std::make_shared<SDLButtonToButtonMapping>(portIndex, bitmask, button);
250
250
break ;
251
251
}
252
252
}
@@ -270,7 +270,7 @@ ButtonMappingFactory::CreateButtonMappingFromSDLInput(uint8_t portIndex, CONTROL
270
270
}
271
271
272
272
mapping =
273
- std::make_shared<SDLAxisDirectionToButtonMapping>(lusIndex, portIndex, bitmask, axis, axisDirection);
273
+ std::make_shared<SDLAxisDirectionToButtonMapping>(portIndex, bitmask, axis, axisDirection);
274
274
break ;
275
275
}
276
276
}
0 commit comments