[Orxonox-commit 3073] r7767 - in code/branches/ois_update: data/gui/scripts src/external/ois/mac src/libraries/core src/orxonox src/orxonox/sound

youngk at orxonox.net youngk at orxonox.net
Wed Dec 15 17:45:16 CET 2010


Author: youngk
Date: 2010-12-15 17:45:16 +0100 (Wed, 15 Dec 2010)
New Revision: 7767

Modified:
   code/branches/ois_update/data/gui/scripts/AudioMenu.lua
   code/branches/ois_update/src/external/ois/mac/MacKeyboard.cpp
   code/branches/ois_update/src/libraries/core/GUIManager.cc
   code/branches/ois_update/src/orxonox/MoodManager.cc
   code/branches/ois_update/src/orxonox/sound/AmbientSound.cc
   code/branches/ois_update/src/orxonox/sound/SoundManager.cc
Log:
Committing a few minor changes to some files. They affect: Keyboard input on the Mac; Introduction of new Moods and debugging of Mac sound.

Modified: code/branches/ois_update/data/gui/scripts/AudioMenu.lua
===================================================================
--- code/branches/ois_update/data/gui/scripts/AudioMenu.lua	2010-12-15 15:13:47 UTC (rev 7766)
+++ code/branches/ois_update/data/gui/scripts/AudioMenu.lua	2010-12-15 16:45:16 UTC (rev 7767)
@@ -31,6 +31,8 @@
     local themeList = {}
     table.insert(themeList, "Default")
     table.insert(themeList, "Drum n' Bass")
+    table.insert(themeList, "8-Bit Style")
+    table.insert(themeList, "Corny Jazz")
     for k,v in pairs(themeList) do
         item = CEGUI.createListboxTextItem(v)
         item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
@@ -38,6 +40,10 @@
     end
     if orxonox.getConfig("MoodManager", "mood_") == "dnb" then
         listboxwindow:setItemSelectState(1,true)
+    elseif orxonox.getConfig("MoodManager", "mood_") == "eightbit" then
+        listboxwindow:setItemSelectState(2,true)
+    elseif orxonox.getConfig("MoodManager", "mood_") == "jazzy" then
+        listboxwindow:setItemSelectState(3,true)
     else
         listboxwindow:setItemSelectState(0,true)
     end
@@ -162,6 +168,10 @@
 function P.AudioThemeListbox_changed(e)
     if listboxwindow:isItemSelected(1) then
         orxonox.config("MoodManager", "mood_", "dnb")
+    elseif listboxwindow:isItemSelected(2) then
+        orxonox.config("MoodManager", "mood_", "eightbit")
+    elseif listboxwindow:isItemSelected(3) then
+        orxonox.config("MoodManager", "mood_", "jazzy")
     else
         orxonox.config("MoodManager", "mood_", "default")
     end

Modified: code/branches/ois_update/src/external/ois/mac/MacKeyboard.cpp
===================================================================
--- code/branches/ois_update/src/external/ois/mac/MacKeyboard.cpp	2010-12-15 15:13:47 UTC (rev 7766)
+++ code/branches/ois_update/src/external/ois/mac/MacKeyboard.cpp	2010-12-15 16:45:16 UTC (rev 7767)
@@ -198,20 +198,12 @@
 	UniChar text[10];
 	char macChar;
 	
-	// @TODO clean this up
 	if (mTextMode == Unicode)
 	{
 		//get string size
 		UInt32 stringsize;
-		//status = GetEventParameter( theEvent, 'kuni', typeUnicodeText, NULL, 0, &stringsize, NULL);
-		//status = GetEventParameter( theEvent, 'kuni', typeUnicodeText, NULL, sizeof(UniChar)*10, NULL, &text );
 		status = GetEventParameter( theEvent, 'kuni', typeUnicodeText, NULL, sizeof(UniChar) * 10, &stringsize, &text );
-		std::cout << "OIS: MacKeyboard::_keyDownCallback(): String length: " << stringsize << std::endl;
 		
-		//wstring unitext;
-		//for (int i=0;i<10;i++) unitext += (wchar_t)text[i];
-		//wcout << "Unicode out: " << unitext << endl;
-		
 		if(stringsize > 0)
 		{
 			// for each unicode char, send an event

Modified: code/branches/ois_update/src/libraries/core/GUIManager.cc
===================================================================
--- code/branches/ois_update/src/libraries/core/GUIManager.cc	2010-12-15 15:13:47 UTC (rev 7766)
+++ code/branches/ois_update/src/libraries/core/GUIManager.cc	2010-12-15 16:45:16 UTC (rev 7767)
@@ -344,6 +344,7 @@
     */
     void GUIManager::buttonPressed(MouseButtonCode::ByEnum id)
     {
+        //guiSystem_->injectMouseButtonDown(convertButton(id));
         this->protectedCall(boost::bind(&CEGUI::System::injectMouseButtonDown, _1, convertButton(id)));
     }
 

Modified: code/branches/ois_update/src/orxonox/MoodManager.cc
===================================================================
--- code/branches/ois_update/src/orxonox/MoodManager.cc	2010-12-15 15:13:47 UTC (rev 7766)
+++ code/branches/ois_update/src/orxonox/MoodManager.cc	2010-12-15 16:45:16 UTC (rev 7767)
@@ -49,12 +49,15 @@
         oldMood_ = MoodManager::defaultMood_;
 
         // Checking for the existence of the folder for the default mood
-        const std::string& path = "ambient/" + MoodManager::defaultMood_ + "/.";
-        if (!Resource::exists(path))
+        const std::string& patha = "ambient/" + MoodManager::defaultMood_ + "/.";
+        if (!Resource::exists(patha))
         {
             // TODO: Non-fatal error handling (non-critical resource missing)
             COUT(2) << "Mood Warning: Folder for default mood (" << MoodManager::defaultMood_ << ") does not exist!" << std::endl;
         }
+        
+        // @TODO
+        // Creating a vector of the available moods to enable easy mood selection by Lua/CEGUI        
     }
 
     void MoodManager::setConfigValues()

Modified: code/branches/ois_update/src/orxonox/sound/AmbientSound.cc
===================================================================
--- code/branches/ois_update/src/orxonox/sound/AmbientSound.cc	2010-12-15 15:13:47 UTC (rev 7766)
+++ code/branches/ois_update/src/orxonox/sound/AmbientSound.cc	2010-12-15 16:45:16 UTC (rev 7767)
@@ -47,7 +47,7 @@
         RegisterObject(AmbientSound);
 
         // Ambient sounds always fade in
-        this->setVolume(0);
+        this->setVolume(0.0f);
         this->registerVariables();
     }
 

Modified: code/branches/ois_update/src/orxonox/sound/SoundManager.cc
===================================================================
--- code/branches/ois_update/src/orxonox/sound/SoundManager.cc	2010-12-15 15:13:47 UTC (rev 7766)
+++ code/branches/ois_update/src/orxonox/sound/SoundManager.cc	2010-12-15 16:45:16 UTC (rev 7767)
@@ -82,8 +82,7 @@
         bool bDisableSound_ = false;
         SetConfigValue(bDisableSound_, false);
         if (bDisableSound_)
-            ThrowException(InitialisationAborted, "Sound: Not loading at all");
-
+            ThrowException(InitialisationAborted, "Sound: Not loading at all");        
         if (!alutInitWithoutContext(NULL, NULL))
             ThrowException(InitialisationFailed, "Sound Error: ALUT initialisation failed: " << alutGetErrorString(alutGetError()));
         Loki::ScopeGuard alutExitGuard = Loki::MakeGuard(&alutExit);
@@ -131,10 +130,10 @@
 
         GameMode::setPlaysSound(true);
         Loki::ScopeGuard resetPlaysSoundGuard = Loki::MakeGuard(&GameMode::setPlaysSound, false);
-
+        
         // Get some information about the sound
         if (const char* version = alGetString(AL_VERSION))
-            COUT(4) << "Sound: --- OpenAL Version: " << version << std::endl;
+            COUT(4) << "Sound: --- OpenAL Version: " << version << std::endl;            
         if (const char* vendor = alGetString(AL_VENDOR))
             COUT(4) << "Sound: --- OpenAL Vendor : " << vendor << std::endl;
         if (const char* types = alutGetMIMETypes(ALUT_LOADER_BUFFER))




More information about the Orxonox-commit mailing list