A compile fix for Linux/OSX in InfoWindow.cpp and also get OSX to stop crashing from loading the audio backend. It's a pretty bad way to do it, but I couldn't find another way. Now to figure out why SMS looks horrible in OSX

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3074 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Sonicadvance1 2009-04-25 16:47:45 +00:00
parent 989e2590a2
commit 264737fede
6 changed files with 28 additions and 6 deletions

View File

@ -1,5 +1,4 @@
#include "AudioCommon.h" #include "AudioCommon.h"
AudioCommonConfig ac_Config; AudioCommonConfig ac_Config;
// Load from given file // Load from given file
@ -8,6 +7,10 @@ void AudioCommonConfig::Load(IniFile &file) {
file.Get("Config", "EnableThrottle", &m_EnableThrottle, true); file.Get("Config", "EnableThrottle", &m_EnableThrottle, true);
#ifdef _WIN32 #ifdef _WIN32
file.Get("Config", "Backend", &sBackend, "DSound"); file.Get("Config", "Backend", &sBackend, "DSound");
#elif defined(__APPLE__)
std::string temp;
file.Get("Config", "Backend", &temp, "AOSound");
strncpy(sBackend, temp.c_str(), 128);
#else #else
file.Get("Config", "Backend", &sBackend, "AOSound"); file.Get("Config", "Backend", &sBackend, "AOSound");
#endif #endif
@ -17,7 +20,7 @@ void AudioCommonConfig::Load(IniFile &file) {
void AudioCommonConfig::Set(IniFile &file) { void AudioCommonConfig::Set(IniFile &file) {
file.Set("Config", "EnableDTKMusic", m_EnableDTKMusic); file.Set("Config", "EnableDTKMusic", m_EnableDTKMusic);
file.Set("Config", "EnableThrottle", m_EnableThrottle); file.Set("Config", "EnableThrottle", m_EnableThrottle);
file.Set("Config", "Backend", sBackend.c_str()); file.Set("Config", "Backend", sBackend);
} }
// Update according to the values (stream/mixer) // Update according to the values (stream/mixer)

View File

@ -9,12 +9,15 @@
#define BACKEND_AOSOUND "AOSound" #define BACKEND_AOSOUND "AOSound"
#define BACKEND_OPENAL "OpenAL" #define BACKEND_OPENAL "OpenAL"
#define BACKEND_NULL "NullSound" #define BACKEND_NULL "NullSound"
struct AudioCommonConfig struct AudioCommonConfig
{ {
bool m_EnableDTKMusic; bool m_EnableDTKMusic;
bool m_EnableThrottle; bool m_EnableThrottle;
#ifdef __APPLE__
char sBackend[128];
#else
std::string sBackend; std::string sBackend;
#endif
// Load from given file // Load from given file
void Load(IniFile &file); void Load(IniFile &file);

View File

@ -417,7 +417,7 @@ void IniFile::Set(const char* sectionName, const char* key, bool newValue)
bool IniFile::Get(const char* sectionName, const char* key, std::string* value, const char* defaultValue) bool IniFile::Get(const char* sectionName, const char* key, std::string* value, const char* defaultValue)
{ {
Section* section = GetSection(sectionName); Section* section = GetSection(sectionName);
if (!section) if (!section)
{ {
if (defaultValue) if (defaultValue)

View File

@ -65,7 +65,7 @@ void wxInfoWindow::Init_ChildControls()
m_Tab_Log = new wxPanel(m_Notebook_Main, ID_TAB_LOG, wxDefaultPosition, wxDefaultSize); m_Tab_Log = new wxPanel(m_Notebook_Main, ID_TAB_LOG, wxDefaultPosition, wxDefaultSize);
m_TextCtrl_Log = new wxTextCtrl(m_Tab_Log, m_TextCtrl_Log = new wxTextCtrl(m_Tab_Log,
ID_TEXTCTRL_LOG, ID_TEXTCTRL_LOG,
wxT( wxString::FromAscii(std::string(
//Dolphin revision number //Dolphin revision number
std::string("Dolphin Revision: ") + SVN_REV_STR +"\n"+ std::string("Dolphin Revision: ") + SVN_REV_STR +"\n"+
@ -80,7 +80,7 @@ void wxInfoWindow::Init_ChildControls()
//CPU Info //CPU Info
std::string("Processor Information:\n")+cpu_info.Summarize()+"\n\n" std::string("Processor Information:\n")+cpu_info.Summarize()+"\n\n"
), ).c_str()),
wxDefaultPosition, wxSize(100, 600), wxDefaultPosition, wxSize(100, 600),
wxTE_MULTILINE | wxTE_READONLY | wxTE_DONTWRAP); wxTE_MULTILINE | wxTE_READONLY | wxTE_DONTWRAP);

View File

@ -81,7 +81,11 @@ void ConfigDialog::AddBackend(const char* backend)
{ {
m_BackendSelection->Append(wxString::FromAscii(backend)); m_BackendSelection->Append(wxString::FromAscii(backend));
// Update value // Update value
#ifdef __APPLE__
m_BackendSelection->SetValue(wxString::FromAscii(ac_Config.sBackend));
#else
m_BackendSelection->SetValue(wxString::FromAscii(ac_Config.sBackend.c_str())); m_BackendSelection->SetValue(wxString::FromAscii(ac_Config.sBackend.c_str()));
#endif
} }
ConfigDialog::~ConfigDialog() ConfigDialog::~ConfigDialog()
@ -93,7 +97,11 @@ void ConfigDialog::SettingsChanged(wxCommandEvent& event)
g_Config.m_EnableHLEAudio = m_buttonEnableHLEAudio->GetValue(); g_Config.m_EnableHLEAudio = m_buttonEnableHLEAudio->GetValue();
ac_Config.m_EnableDTKMusic = m_buttonEnableDTKMusic->GetValue(); ac_Config.m_EnableDTKMusic = m_buttonEnableDTKMusic->GetValue();
ac_Config.m_EnableThrottle = m_buttonEnableThrottle->GetValue(); ac_Config.m_EnableThrottle = m_buttonEnableThrottle->GetValue();
#ifdef __APPLE__
strncpy(ac_Config.sBackend, m_BackendSelection->GetValue().mb_str(), 128);
#else
ac_Config.sBackend = m_BackendSelection->GetValue().mb_str(); ac_Config.sBackend = m_BackendSelection->GetValue().mb_str();
#endif
g_Config.Save(); g_Config.Save();
if (event.GetId() == wxID_OK) if (event.GetId() == wxID_OK)

View File

@ -76,7 +76,11 @@ void DSPConfigDialogLLE::AddBackend(const char* backend)
{ {
m_BackendSelection->Append(wxString::FromAscii(backend)); m_BackendSelection->Append(wxString::FromAscii(backend));
// Update value // Update value
#ifdef __APPLE__
m_BackendSelection->SetValue(wxString::FromAscii(ac_Config.sBackend));
#else
m_BackendSelection->SetValue(wxString::FromAscii(ac_Config.sBackend.c_str())); m_BackendSelection->SetValue(wxString::FromAscii(ac_Config.sBackend.c_str()));
#endif
} }
DSPConfigDialogLLE::~DSPConfigDialogLLE() DSPConfigDialogLLE::~DSPConfigDialogLLE()
@ -87,7 +91,11 @@ void DSPConfigDialogLLE::SettingsChanged(wxCommandEvent& event)
{ {
ac_Config.m_EnableDTKMusic = m_buttonEnableDTKMusic->GetValue(); ac_Config.m_EnableDTKMusic = m_buttonEnableDTKMusic->GetValue();
ac_Config.m_EnableThrottle = m_buttonEnableThrottle->GetValue(); ac_Config.m_EnableThrottle = m_buttonEnableThrottle->GetValue();
#ifdef __APPLE__
strncpy(ac_Config.sBackend, m_BackendSelection->GetValue().mb_str(), 128);
#else
ac_Config.sBackend = m_BackendSelection->GetValue().mb_str(); ac_Config.sBackend = m_BackendSelection->GetValue().mb_str();
#endif
ac_Config.Update(); ac_Config.Update();
g_Config.Save(); g_Config.Save();