Revision: 38926
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38926
Author:   jesterking
Date:     2011-08-02 10:20:47 +0000 (Tue, 02 Aug 2011)
Log Message:
-----------
Properly disable NDOF code when WITH_INPUT_NDOF is not define.

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_System.cpp
    trunk/blender/intern/ghost/intern/GHOST_System.h
    trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm
    trunk/blender/intern/ghost/intern/GHOST_SystemWin32.cpp

Modified: trunk/blender/intern/ghost/intern/GHOST_System.cpp
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_System.cpp  2011-08-02 09:36:44 UTC 
(rev 38925)
+++ trunk/blender/intern/ghost/intern/GHOST_System.cpp  2011-08-02 10:20:47 UTC 
(rev 38926)
@@ -202,10 +202,12 @@
 {
        bool handled = false;
 
+#ifdef WITH_INPUT_NDOF
        // NDOF Motion event is sent only once per dispatch, so do it now:
        if (m_ndofManager) {
                handled |= m_ndofManager->sendMotionEvent();
        }
+#endif
 
        if (m_eventManager) {
                handled |= m_eventManager->dispatchEvents();
@@ -319,10 +321,12 @@
                delete m_eventManager;
                m_eventManager = 0;
        }
+#ifdef WITH_INPUT_NDOF
        if (m_ndofManager) {
                delete m_ndofManager;
                m_ndofManager = 0;
        }
+#endif
        return GHOST_kSuccess;
 }
 

Modified: trunk/blender/intern/ghost/intern/GHOST_System.h
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_System.h    2011-08-02 09:36:44 UTC 
(rev 38925)
+++ trunk/blender/intern/ghost/intern/GHOST_System.h    2011-08-02 10:20:47 UTC 
(rev 38926)
@@ -249,11 +249,13 @@
         */
        virtual inline GHOST_WindowManager* getWindowManager() const;
 
+#ifdef WITH_INPUT_NDOF
        /**
         * Returns a pointer to our n-degree of freedeom manager.
         * @return A pointer to our n-degree of freedeom manager.
         */
        virtual inline GHOST_NDOFManager* getNDOFManager() const;
+#endif
 
        /**
         * Returns the state of all modifier keys.
@@ -318,8 +320,10 @@
        /** The event manager. */
        GHOST_EventManager* m_eventManager;
 
+#ifdef WITH_INPUT_NDOF
        /** The N-degree of freedom device manager */
        GHOST_NDOFManager* m_ndofManager;
+#endif
        
        /** Prints all the events. */
 #ifdef GHOST_DEBUG
@@ -345,10 +349,12 @@
        return m_windowManager;
 }
 
+#ifdef WITH_INPUT_NDOF
 inline GHOST_NDOFManager* GHOST_System::getNDOFManager() const
 {
        return m_ndofManager;
 }
+#endif
 
 #endif // _GHOST_SYSTEM_H_
 

Modified: trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm      2011-08-02 
09:36:44 UTC (rev 38925)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm      2011-08-02 
10:20:47 UTC (rev 38926)
@@ -597,7 +597,9 @@
     GHOST_TSuccess success = GHOST_System::init();
     if (success) {
 
+#ifdef WITH_INPUT_NDOF
                m_ndofManager = new GHOST_NDOFManagerCocoa(*this);
+#endif
 
                //ProcessSerialNumber psn;
                

Modified: trunk/blender/intern/ghost/intern/GHOST_SystemWin32.cpp
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemWin32.cpp     2011-08-02 
09:36:44 UTC (rev 38925)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemWin32.cpp     2011-08-02 
10:20:47 UTC (rev 38926)
@@ -161,7 +161,9 @@
        // Require COM for GHOST_DropTargetWin32 created in GHOST_WindowWin32.
        OleInitialize(0);
 
+#ifdef WITH_INPUT_NDOF
        m_ndofManager = new GHOST_NDOFManagerWin32(*this);
+#endif
 }
 
 GHOST_SystemWin32::~GHOST_SystemWin32()
@@ -757,6 +759,7 @@
        minmax->ptMinTrackSize.y=240;
 }
 
+#ifdef WITH_INPUT_NDOF
 bool GHOST_SystemWin32::processNDOF(RAWINPUT const& raw)
 {
        bool eventSent = false;
@@ -773,7 +776,7 @@
                if (info.dwType == RIM_TYPEHID)
                        m_ndofManager->setDevice(info.hid.dwVendorId, 
info.hid.dwProductId);
                else
-            puts("<!> not a HID device... mouse/kb perhaps?");
+                   puts("<!> not a HID device... mouse/kb perhaps?");
 
                firstEvent = false;
                }
@@ -846,6 +849,7 @@
                }
        return eventSent;
 }
+#endif // WITH_INPUT_NDOF
 
 LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM 
wParam, LPARAM lParam)
 {
@@ -892,8 +896,10 @@
                                                }
                                                break;
                                        case RIM_TYPEHID:
+#ifdef WITH_INPUT_NDOF
                                                if (system->processNDOF(raw))
                                                        eventHandled = true;
+#endif
                                                break;
                                        }
                                break;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to