From 7ae541e63855e42f271706e90b71025fd2d9f95e Mon Sep 17 00:00:00 2001 From: Deve Date: Sun, 9 Aug 2015 13:12:20 +0200 Subject: [PATCH 1/3] Reload selected GP after changing the name. This fixes #2159 --- src/states_screens/grand_prix_editor_screen.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/states_screens/grand_prix_editor_screen.cpp b/src/states_screens/grand_prix_editor_screen.cpp index 5d0184304..0080837a4 100644 --- a/src/states_screens/grand_prix_editor_screen.cpp +++ b/src/states_screens/grand_prix_editor_screen.cpp @@ -291,6 +291,7 @@ void GrandPrixEditorScreen::onNewGPWithName(const stringw& newName) { m_selection->setName(newName); m_selection->writeToFile(); + setSelection(grand_prix_manager->getGrandPrix(m_selection->getId())); } else if (m_action == "new") { From 78cd8efdd4bd0ae3f12d666a0b6c12d8b889de67 Mon Sep 17 00:00:00 2001 From: Deve Date: Sun, 9 Aug 2015 18:54:59 +0200 Subject: [PATCH 2/3] Reset screensaver counter on linux when joystick event was received --- .../source/Irrlicht/CIrrDeviceLinux.cpp | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp b/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp index e29a109f0..e48ac2b1d 100644 --- a/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp +++ b/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp @@ -2081,11 +2081,13 @@ void CIrrDeviceLinux::pollJoysticks() for (u32 j= 0; j< ActiveJoysticks.size(); ++j) { JoystickInfo & info = ActiveJoysticks[j]; + bool event_received = false; #ifdef __FreeBSD__ struct joystick js; if (read(info.fd, &js, sizeof(js)) == sizeof(js)) { + event_received = true; info.persistentData.JoystickEvent.ButtonStates = js.b1 | (js.b2 << 1); /* should be a two-bit field */ info.persistentData.JoystickEvent.Axis[0] = js.x; /* X axis */ info.persistentData.JoystickEvent.Axis[1] = js.y; /* Y axis */ @@ -2098,14 +2100,23 @@ void CIrrDeviceLinux::pollJoysticks() { case JS_EVENT_BUTTON: if (event.value) - info.persistentData.JoystickEvent.ButtonStates |= (1 << event.number); + { + event_received = true; + info.persistentData.JoystickEvent.ButtonStates |= (1 << event.number); + } else - info.persistentData.JoystickEvent.ButtonStates &= ~(1 << event.number); + { + event_received = true; + info.persistentData.JoystickEvent.ButtonStates &= ~(1 << event.number); + } break; case JS_EVENT_AXIS: if (event.number < SEvent::SJoystickEvent::NUMBER_OF_AXES) + { + event_received = true; info.persistentData.JoystickEvent.Axis[event.number] = event.value; + } break; default: @@ -2116,6 +2127,13 @@ void CIrrDeviceLinux::pollJoysticks() // Send an irrlicht joystick event once per ::run() even if no new data were received. (void)postEventFromUser(info.persistentData); + +#ifdef _IRR_COMPILE_WITH_X11_ + if (event_received) + { + XResetScreenSaver(display); + } +#endif } #endif // _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ } From fe1222c5cce5b743ce57262bad8a8382b9c77a14 Mon Sep 17 00:00:00 2001 From: Deve Date: Sun, 9 Aug 2015 20:52:12 +0200 Subject: [PATCH 3/3] Don't add tracks in reversed mode when it's not available. This fixes #2158. --- src/states_screens/edit_gp_screen.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/states_screens/edit_gp_screen.cpp b/src/states_screens/edit_gp_screen.cpp index 8cd5e00f1..1bdffae1c 100644 --- a/src/states_screens/edit_gp_screen.cpp +++ b/src/states_screens/edit_gp_screen.cpp @@ -171,16 +171,19 @@ void EditGPScreen::init() if (edit->getResult()) { + bool reverse = edit->getTrack()->reverseAvailable() ? + edit->getReverse() : false; + if (m_action == "add") { - m_gp->addTrack(edit->getTrack(), edit->getLaps(), edit->getReverse(), - m_selected); + m_gp->addTrack(edit->getTrack(), edit->getLaps(), reverse, + m_selected); setSelected(m_selected + 1); } else if (m_action == "edit") { m_gp->editTrack(m_selected, edit->getTrack(), edit->getLaps(), - edit->getReverse()); + reverse); } setModified(true); }