[Orxonox-commit 5175] r9840 - code/branches/wiimote/src/libraries/core/input

georgr at orxonox.net georgr at orxonox.net
Mon Dec 2 14:38:52 CET 2013


Author: georgr
Date: 2013-12-02 14:38:52 +0100 (Mon, 02 Dec 2013)
New Revision: 9840

Modified:
   code/branches/wiimote/src/libraries/core/input/InputManager.cc
Log:
made two things static to fix everything

Modified: code/branches/wiimote/src/libraries/core/input/InputManager.cc
===================================================================
--- code/branches/wiimote/src/libraries/core/input/InputManager.cc	2013-12-02 13:16:36 UTC (rev 9839)
+++ code/branches/wiimote/src/libraries/core/input/InputManager.cc	2013-12-02 13:38:52 UTC (rev 9840)
@@ -227,13 +227,15 @@
     void InputManager::loadWiiMote()
     {
 
-    	CWii wii; // Defaults to 4 remotes
+
+
+    	static CWii wii; // Defaults to 4 remotes; static because else it will get deleted during InternalReload
     	std::vector< ::CWiimote>::iterator i;
     	int reloadWiimotes = 0;
     	int index;
 
     	// Find and connect to the wiimotes
-    	std::vector<CWiimote>& wiimotes = wii.FindAndConnect(10);
+    	static std::vector<CWiimote>& wiimotes = wii.FindAndConnect(10); //CWiimotes are kept in here in case of InternalReload calls
     	if (!wiimotes.size())
     	{
     		cout << "No wiimotes found." << endl;




More information about the Orxonox-commit mailing list