mirror of
https://github.com/overte-org/overte.git
synced 2025-04-15 17:20:12 +02:00
sdl2 build error fixed
This commit is contained in:
parent
ce80bff7cb
commit
1083534d83
2 changed files with 15 additions and 13 deletions
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "InputDevice.h"
|
||||
|
||||
class Joystick : public QObject, InputDevice {
|
||||
class Joystick : public QObject, public InputDevice {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QString name READ getName)
|
||||
|
||||
|
|
|
@ -121,19 +121,21 @@ void SDL2Manager::pluginUpdate(float deltaTime) {
|
|||
HFBackEvent backEvent(backType);
|
||||
|
||||
qApp->sendEvent(qApp, &backEvent);
|
||||
} else if (event.cbutton.button == SDL_CONTROLLER_BUTTON_A) {
|
||||
// this will either start or stop a global action event
|
||||
QEvent::Type actionType = (event.type == SDL_CONTROLLERBUTTONDOWN)
|
||||
? HFActionEvent::startType()
|
||||
: HFActionEvent::endType();
|
||||
|
||||
// global action events fire in the center of the screen
|
||||
Application* app = Application::getInstance();
|
||||
PickRay pickRay = app->getCamera()->computePickRay(app->getTrueMouseX(),
|
||||
app->getTrueMouseY());
|
||||
HFActionEvent actionEvent(actionType, pickRay);
|
||||
qApp->sendEvent(qApp, &actionEvent);
|
||||
}
|
||||
// TODO: This will probably end up being deleted
|
||||
//else if (event.cbutton.button == SDL_CONTROLLER_BUTTON_A) {
|
||||
// // this will either start or stop a global action event
|
||||
// QEvent::Type actionType = (event.type == SDL_CONTROLLERBUTTONDOWN)
|
||||
// ? HFActionEvent::startType()
|
||||
// : HFActionEvent::endType();
|
||||
//
|
||||
// // global action events fire in the center of the screen
|
||||
// Application* app = Application::getInstance();
|
||||
// PickRay pickRay = app->getCamera()->computePickRay(app->getTrueMouseX(),
|
||||
// app->getTrueMouseY());
|
||||
// HFActionEvent actionEvent(actionType, pickRay);
|
||||
// qApp->sendEvent(qApp, &actionEvent);
|
||||
//}
|
||||
|
||||
} else if (event.type == SDL_CONTROLLERDEVICEADDED) {
|
||||
SDL_GameController* controller = SDL_GameControllerOpen(event.cdevice.which);
|
||||
|
|
Loading…
Reference in a new issue