Revision: 2508
http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2508&view=rev
Author: rorthomas
Date: 2012-05-06 03:47:45 +0000 (Sun, 06 May 2012)
Log Message:
-----------
first!!!11
Modified Paths:
--------------
trunk/source/configurator/configurator.cpp
trunk/source/main/audio/SoundManager.cpp
trunk/source/main/audio/SoundScriptManager.cpp
trunk/source/main/framework/ContentManager.cpp
Modified: trunk/source/configurator/configurator.cpp
===================================================================
--- trunk/source/configurator/configurator.cpp 2012-05-06 03:17:42 UTC (rev
2507)
+++ trunk/source/configurator/configurator.cpp 2012-05-06 03:47:45 UTC (rev
2508)
@@ -1489,9 +1489,7 @@
#ifdef USE_OPENAL
dText = new wxStaticText(advancedPanel, -1, _("Audio device:"),
wxPoint(10,y+3));
- sound=new wxValueChoice(advancedPanel, -1, wxPoint(x_row1, y),
wxSize(280, -1), 0);
- sound->AppendValueItem(wxT("No sound"), _("No sound"));
- sound->AppendValueItem(wxT("Default"), _("Default"));
+ sound = new wxValueChoice(advancedPanel, -1, wxPoint(x_row1, y),
wxSize(280, -1), 0);
sound->SetToolTip(_("Select the appropriate sound source.\nLeaving to
Default should work most of the time."));
Modified: trunk/source/main/audio/SoundManager.cpp
===================================================================
--- trunk/source/main/audio/SoundManager.cpp 2012-05-06 03:17:42 UTC (rev
2507)
+++ trunk/source/main/audio/SoundManager.cpp 2012-05-06 03:47:45 UTC (rev
2508)
@@ -28,6 +28,20 @@
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif // OGRE_PLATFORM_LINUX
+
+int _checkALErrors(int linenum)
+{
+ int err = alGetError();
+ if(err != AL_NO_ERROR)
+ {
+ char buf[4096]="";
+ sprintf(buf, "OpenAL Error: %s (0x%x), @ %d\n",
alGetString(err), err, linenum);
+ LOG(buf);
+ }
+ return err;
+}
+#define checkALErrors() _checkALErrors(__LINE__)
+
using namespace Ogre;
const float SoundManager::MAX_DISTANCE = 500.0f;
@@ -44,20 +58,34 @@
{
String audio_device = SSETTING("AudioDevice", "Default");
- if (audio_device == "No sound") return;
+ if (audio_device == "No Output") return;
LOG("Opening Device: '" + audio_device + "'");
- if(audio_device == "Default") audio_device = "";
- m_sound_device = alcOpenDevice(audio_device.c_str());
-
- if (!m_sound_device)
- {
- ALint error = alGetError();
- LOG("SoundManager: Could not create OpenAL device, error code:
"+TOSTRING(error));
+ const char *alDeviceString = audio_device.c_str();
+ if(audio_device == "Default") alDeviceString = NULL;
+ m_sound_device = alcOpenDevice(alDeviceString);
+ if(checkALErrors())
return;
- }
+ const char *tmp = alGetString(AL_VENDOR);
+ if(tmp) LOG("OpenAL vendor is: " + String(tmp));
+
+ tmp = alGetString(AL_VERSION);
+ if(tmp) LOG("OpenAL version is: " + String(tmp));
+
+ tmp = alGetString(AL_RENDERER);
+ if(tmp) LOG("OpenAL renderer is: " + String(tmp));
+
+ tmp = alGetString(AL_EXTENSIONS);
+ if(tmp) LOG("OpenAL extensions are: " + String(tmp));
+
+ tmp = alcGetString(m_sound_device, ALC_DEVICE_SPECIFIER);
+ if(tmp) LOG("OpenAL device is: " + String(tmp));
+
+ tmp = alcGetString(m_sound_device, ALC_EXTENSIONS);
+ if(tmp) LOG("OpenAL ALC extensions are: " + String(tmp));
+
m_sound_context = alcCreateContext(m_sound_device, NULL);
if (!m_sound_context)
Modified: trunk/source/main/audio/SoundScriptManager.cpp
===================================================================
--- trunk/source/main/audio/SoundScriptManager.cpp 2012-05-06 03:17:42 UTC
(rev 2507)
+++ trunk/source/main/audio/SoundScriptManager.cpp 2012-05-06 03:47:45 UTC
(rev 2508)
@@ -75,7 +75,7 @@
mScriptPatterns.push_back("*.soundscript");
ResourceGroupManager::getSingleton()._registerScriptLoader(this);
- soundsDisabled = (SSETTING("AudioDevice", "Default") == "No sound");
+ soundsDisabled = (SSETTING("AudioDevice", "Default") == "No Output");
}
void SoundScriptManager::trigOnce(Beam *truck, int trig, int linkType, int
linkItemID)
Modified: trunk/source/main/framework/ContentManager.cpp
===================================================================
--- trunk/source/main/framework/ContentManager.cpp 2012-05-06 03:17:42 UTC
(rev 2507)
+++ trunk/source/main/framework/ContentManager.cpp 2012-05-06 03:47:45 UTC
(rev 2508)
@@ -155,7 +155,7 @@
SoundScriptManager::getSingleton().setLoadingBaseSounds(true);
#endif // USE_OPENAL
- if (SSETTING("AudioDevice", "Default") != "No sound")
+ if (SSETTING("AudioDevice", "Default") != "No Output")
loadMainResource("sounds");
if (SSETTING("Sky effects", "Caelum (best looking, slower)") == "Caelum
(best looking, slower)")
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rigsofrods-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel