diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-08-02 09:52:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-08-02 09:52:27 +0400 |
commit | fcd7d2b486f2435907423188ffdfe2840c966b0b (patch) | |
tree | 58414c67c39fea1e654ce2380fbbb2488716b0b5 | |
parent | 8f3016098d726ec82b7f778d1e0a0d58f3da74cb (diff) |
NDOF related edits
- fix for building without NDOF on X11
- quiet some warnings
-rw-r--r-- | CMakeLists.txt | 6 | ||||
-rw-r--r-- | build_files/cmake/macros.cmake | 4 | ||||
-rw-r--r-- | intern/ghost/CMakeLists.txt | 35 | ||||
-rw-r--r-- | intern/ghost/SConscript | 3 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_System.cpp | 8 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemX11.cpp | 4 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 2 |
9 files changed, 52 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ac6d67cd1c..fe86aaf9b26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 3de9db6dac9..c53f52b7bae 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -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() diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt index b69dff607e8..86829c892ed 100644 --- a/intern/ghost/CMakeLists.txt +++ b/intern/ghost/CMakeLists.txt @@ -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 - intern/GHOST_NDOFManagerCocoa.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 - intern/GHOST_NDOFManagerWin32.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}") diff --git a/intern/ghost/SConscript b/intern/ghost/SConscript index 3dec748ce31..d65eb0caab6 100644 --- a/intern/ghost/SConscript +++ b/intern/ghost/SConscript @@ -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 diff --git a/intern/ghost/intern/GHOST_System.cpp b/intern/ghost/intern/GHOST_System.cpp index 792adba7ce3..f601031f2b6 100644 --- a/intern/ghost/intern/GHOST_System.cpp +++ b/intern/ghost/intern/GHOST_System.cpp @@ -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 { } diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index 517c3a1ebac..105f71b514f 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -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); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 204d5dfb1b1..a7c90bb0aed 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -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); diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 94224698063..09e703d6ce0 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.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? { diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index d813fd913ab..d9c3300fcef 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -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"); |