Skip to content

Commit

Permalink
UPBGE: Fix NDOF input event issues.
Browse files Browse the repository at this point in the history
Previously pressing or releasing any keys was exiting the game engine.
The issue was the cause of the WITH_NDOF_INPUT macro not set in
the parts using GHOST when the user compiled with NDOF.
Without this macro all the values was moveed after GHOST_kEventNDOFMotion
and GHOST_kEventNDOFButton in GHOST_Types.h.
This move replace the GHOST_kEventKeyDown sended by the GHOST_kEventQuit
handled.

To fix the problem, the macro WITH_NDOF_INPUT is added in the Device/
part when it is wanted.

In the same time the wrong fix 19f48ee
is reverted.
  • Loading branch information
panzergame committed Sep 24, 2016
1 parent 0877a00 commit 2d335a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions source/gameengine/Device/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,8 @@ if(WITH_SDL)
add_definitions(-DWITH_SDL)
endif()

if(WITH_INPUT_NDOF)
add_definitions(-DWITH_INPUT_NDOF)
endif()

blender_add_lib(ge_device "${SRC}" "${INC}" "${INC_SYS}")
4 changes: 3 additions & 1 deletion source/gameengine/Launcher/LA_Launcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,9 @@ bool LA_Launcher::EngineNextFrame()
m_inputDevice->ConvertEvent((SCA_IInputDevice::SCA_EnumInputs)m_ketsjiEngine->GetExitKey(), 0, 0);
m_exitRequested = KX_EXIT_REQUEST_BLENDER_ESC;
}
else if (m_inputDevice->GetInput(SCA_IInputDevice::WINQUIT).Find(SCA_InputEvent::ACTIVE)) {
else if (m_inputDevice->GetInput(SCA_IInputDevice::WINCLOSE).Find(SCA_InputEvent::ACTIVE) ||
m_inputDevice->GetInput(SCA_IInputDevice::WINQUIT).Find(SCA_InputEvent::ACTIVE))
{
m_inputDevice->ConvertEvent(SCA_IInputDevice::WINCLOSE, 0, 0);
m_inputDevice->ConvertEvent(SCA_IInputDevice::WINQUIT, 0, 0);
m_exitRequested = KX_EXIT_REQUEST_OUTSIDE;
Expand Down

0 comments on commit 2d335a1

Please sign in to comment.