mirror of
https://github.com/Maschell/SDL2_Playground.git
synced 2024-12-24 12:21:48 +01:00
Add the mouse for non-win32 devices if they are not a wiiu
This commit is contained in:
parent
0dab74fd80
commit
7d38366aa0
@ -85,7 +85,7 @@ void ControllerManager::processEvent(SDL_JoystickID joystickId, int32_t channel,
|
||||
channel = joystickToChannel[joystickId];
|
||||
}
|
||||
}
|
||||
if (channel != -1 && controllerList.contains(static_cast<const GuiTrigger::eChannels>(channel))) {
|
||||
if (channel != -1 && controllerList.count(static_cast<const GuiTrigger::eChannels>(channel)) > 0) {
|
||||
controllerList[static_cast<GuiTrigger::eChannels>(channel)]->update(e, screenWidth, screenHeight);
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,8 @@ int main(int argc, char *args[]) {
|
||||
auto * controllerM = new ControllerManager(system->getWidth(), system->getHeight());
|
||||
|
||||
|
||||
#if defined _WIN32
|
||||
#ifndef __WIIU__
|
||||
// On non-Wii-U devices we expect a mouse.
|
||||
controllerM->attachController(GuiTrigger::CHANNEL_1, new SDLControllerMouse(GuiTrigger::CHANNEL_1));
|
||||
DEBUG_FUNCTION_LINE("Added mouse");
|
||||
#endif
|
||||
|
@ -81,7 +81,7 @@ MainWindow::MainWindow(int32_t w, int32_t h, Renderer* renderer) : GuiFrame(w, h
|
||||
DEBUG_FUNCTION_LINE("Failed to add image");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
button = new GuiButton(image5->getWidth(), image5->getHeight());
|
||||
|
||||
this->setAlignment(ALIGN_TOP_LEFT);
|
||||
|
Loading…
Reference in New Issue
Block a user