NDOF related edits
- fix for building without NDOF on X11 - quiet some warnings
This commit is contained in:
@@ -179,7 +179,7 @@ option(WITH_LZO "Enable fast LZO compression (used for pointcache)" ON
|
||||
option(WITH_LZMA "Enable best LZMA compression, (used for pointcache)" ON)
|
||||
|
||||
# Misc
|
||||
option(WITH_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
|
||||
option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
|
||||
option(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
|
||||
if(UNIX AND NOT APPLE)
|
||||
option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
|
||||
@@ -453,7 +453,7 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (WITH_NDOF)
|
||||
if (WITH_INPUT_NDOF)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
set(NDOF /usr)
|
||||
set(NDOF_INC ${NDOF}/include)
|
||||
@@ -1039,7 +1039,7 @@ elseif(APPLE)
|
||||
set(TIFF_LIBPATH ${TIFF}/lib)
|
||||
endif()
|
||||
|
||||
if (WITH_NDOF)
|
||||
if (WITH_INPUT_NDOF)
|
||||
# linker needs "-weak_framework 3DconnexionClient"
|
||||
endif()
|
||||
|
||||
|
@@ -193,7 +193,7 @@ macro(SETUP_LIBDIRS)
|
||||
if(WITH_MEM_JEMALLOC)
|
||||
link_directories(${JEMALLOC_LIBPATH})
|
||||
endif()
|
||||
if(WITH_NDOF)
|
||||
if(WITH_INPUT_NDOF)
|
||||
link_directories(${NDOF_LIBPATH})
|
||||
endif()
|
||||
|
||||
@@ -317,7 +317,7 @@ macro(setup_liblinks
|
||||
if(WITH_MEM_JEMALLOC)
|
||||
target_link_libraries(${target} ${JEMALLOC_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_NDOF)
|
||||
if(WITH_INPUT_NDOF)
|
||||
target_link_libraries(${target} ${NDOF_LIBRARY})
|
||||
endif()
|
||||
|
||||
|
@@ -97,6 +97,9 @@ if(WITH_GHOST_DEBUG)
|
||||
add_definitions(-DWITH_GHOST_DEBUG)
|
||||
endif()
|
||||
|
||||
if(WITH_INPUT_NDOF)
|
||||
add_definitions(-DWITH_INPUT_NDOF)
|
||||
endif()
|
||||
|
||||
if(WITH_HEADLESS OR WITH_GHOST_SDL)
|
||||
if(WITH_HEADLESS)
|
||||
@@ -158,14 +161,21 @@ elseif(APPLE)
|
||||
intern/GHOST_SystemCocoa.mm
|
||||
intern/GHOST_SystemPathsCocoa.mm
|
||||
intern/GHOST_WindowCocoa.mm
|
||||
intern/GHOST_NDOFManagerCocoa.mm
|
||||
|
||||
intern/GHOST_DisplayManagerCocoa.h
|
||||
intern/GHOST_SystemCocoa.h
|
||||
intern/GHOST_SystemPathsCocoa.h
|
||||
intern/GHOST_WindowCocoa.h
|
||||
)
|
||||
|
||||
if(WITH_INPUT_NDOF)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_NDOFManagerCocoa.mm
|
||||
|
||||
intern/GHOST_NDOFManagerCocoa.h
|
||||
)
|
||||
endif()
|
||||
|
||||
else()
|
||||
list(APPEND SRC
|
||||
intern/GHOST_DisplayManagerCarbon.cpp
|
||||
@@ -199,13 +209,11 @@ elseif(UNIX)
|
||||
intern/GHOST_SystemX11.cpp
|
||||
intern/GHOST_SystemPathsX11.cpp
|
||||
intern/GHOST_WindowX11.cpp
|
||||
intern/GHOST_NDOFManagerX11.cpp
|
||||
|
||||
intern/GHOST_DisplayManagerX11.h
|
||||
intern/GHOST_SystemX11.h
|
||||
intern/GHOST_SystemPathsX11.h
|
||||
intern/GHOST_WindowX11.h
|
||||
intern/GHOST_NDOFManagerX11.h
|
||||
)
|
||||
|
||||
if(NOT WITH_INSTALL_PORTABLE)
|
||||
@@ -219,6 +227,14 @@ elseif(UNIX)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_INPUT_NDOF)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_NDOFManagerX11.cpp
|
||||
|
||||
intern/GHOST_NDOFManagerX11.h
|
||||
)
|
||||
endif()
|
||||
|
||||
elseif(WIN32)
|
||||
if(MSVC)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
|
||||
@@ -234,7 +250,6 @@ elseif(WIN32)
|
||||
intern/GHOST_SystemPathsWin32.cpp
|
||||
intern/GHOST_WindowWin32.cpp
|
||||
intern/GHOST_DropTargetWin32.cpp
|
||||
intern/GHOST_NDOFManagerWin32.cpp
|
||||
|
||||
intern/GHOST_DisplayManagerWin32.h
|
||||
intern/GHOST_DropTargetWin32.h
|
||||
@@ -242,8 +257,16 @@ elseif(WIN32)
|
||||
intern/GHOST_SystemPathsWin32.h
|
||||
intern/GHOST_WindowWin32.h
|
||||
intern/GHOST_TaskbarWin32.h
|
||||
)
|
||||
|
||||
if(WITH_INPUT_NDOF)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_NDOFManagerWin32.cpp
|
||||
|
||||
intern/GHOST_NDOFManagerWin32.h
|
||||
)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
@@ -78,6 +78,9 @@ if env['BF_GHOST_DEBUG']:
|
||||
else:
|
||||
sources.remove('intern' + os.sep + 'GHOST_EventPrinter.cpp')
|
||||
|
||||
if env['WITH_BF_3DMOUSE']:
|
||||
defs.append('WITH_INPUT_NDOF')
|
||||
|
||||
if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'):
|
||||
incs = env['BF_WINTAB_INC'] + ' ' + incs
|
||||
|
||||
|
@@ -46,7 +46,13 @@
|
||||
|
||||
|
||||
GHOST_System::GHOST_System()
|
||||
: m_displayManager(0), m_timerManager(0), m_windowManager(0), m_eventManager(0), m_ndofManager(0)
|
||||
: m_displayManager(0),
|
||||
m_timerManager(0),
|
||||
m_windowManager(0),
|
||||
m_eventManager(0)
|
||||
#ifdef WITH_INPUT_NDOF
|
||||
, m_ndofManager(0)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -167,7 +167,9 @@ init(
|
||||
GHOST_TSuccess success = GHOST_System::init();
|
||||
|
||||
if (success) {
|
||||
#ifdef WITH_INPUT_NDOF
|
||||
m_ndofManager = new GHOST_NDOFManagerX11(*this);
|
||||
#endif
|
||||
m_displayManager = new GHOST_DisplayManagerX11(this);
|
||||
|
||||
if (m_displayManager) {
|
||||
@@ -414,9 +416,11 @@ processEvents(
|
||||
anyProcessed = true;
|
||||
}
|
||||
|
||||
#ifdef WITH_INPUT_NDOF
|
||||
if (dynamic_cast<GHOST_NDOFManagerX11*>(m_ndofManager)->processEvents()) {
|
||||
anyProcessed = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
} while (waitForEvent && !anyProcessed);
|
||||
|
||||
|
@@ -445,7 +445,7 @@ void IMAGE_OT_view_zoom(wmOperatorType *ot)
|
||||
* that explains the negative signs in the code below
|
||||
*/
|
||||
|
||||
static int view_ndof_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
static int view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
|
||||
{
|
||||
SpaceImage *sima= CTX_wm_space_image(C);
|
||||
ARegion *ar= CTX_wm_region(C);
|
||||
|
@@ -968,7 +968,7 @@ void ndof_to_quat(struct wmNDOFMotionData* ndof, float q[4])
|
||||
q[3] = scale * z;
|
||||
}
|
||||
|
||||
static int ndof_orbit_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
static int ndof_orbit_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
|
||||
// -- "orbit" navigation (trackball/turntable)
|
||||
// -- zooming
|
||||
// -- panning in rotationally-locked views
|
||||
@@ -1118,7 +1118,7 @@ void VIEW3D_OT_ndof_orbit(struct wmOperatorType *ot)
|
||||
ot->flag = 0;
|
||||
}
|
||||
|
||||
static int ndof_pan_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
static int ndof_pan_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
|
||||
// -- "pan" navigation
|
||||
// -- zoom or dolly?
|
||||
{
|
||||
|
@@ -1411,7 +1411,7 @@ static void WM_OT_search_menu(wmOperatorType *ot)
|
||||
ot->poll= wm_search_menu_poll;
|
||||
}
|
||||
|
||||
static int wm_ndof_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
|
||||
static int wm_ndof_menu_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event))
|
||||
{
|
||||
uiPupMenuInvoke(C,"VIEW3D_MT_ndof_settings");
|
||||
|
||||
|
Reference in New Issue
Block a user