mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 16:41:02 +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"
|
#include "InputDevice.h"
|
||||||
|
|
||||||
class Joystick : public QObject, InputDevice {
|
class Joystick : public QObject, public InputDevice {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(QString name READ getName)
|
Q_PROPERTY(QString name READ getName)
|
||||||
|
|
||||||
|
|
|
@ -121,19 +121,21 @@ void SDL2Manager::pluginUpdate(float deltaTime) {
|
||||||
HFBackEvent backEvent(backType);
|
HFBackEvent backEvent(backType);
|
||||||
|
|
||||||
qApp->sendEvent(qApp, &backEvent);
|
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) {
|
} else if (event.type == SDL_CONTROLLERDEVICEADDED) {
|
||||||
SDL_GameController* controller = SDL_GameControllerOpen(event.cdevice.which);
|
SDL_GameController* controller = SDL_GameControllerOpen(event.cdevice.which);
|
||||||
|
|
Loading…
Reference in a new issue