Make the OptimizeQuantizers option apply to the IL build. More cleanup.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2696 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2009-03-20 19:12:04 +00:00
parent 6bacdc0af3
commit 482ea5c0e7
11 changed files with 203 additions and 200 deletions

View File

@ -682,11 +682,13 @@ void CFrame::OnShow_CheatsWindow(wxCommandEvent& WXUNUSED (event))
{
CheatsWindow = new wxCheatsWindow(this, wxDefaultPosition, wxSize(600, 390));
}
void CFrame::OnShow_SDCardWindow(wxCommandEvent& WXUNUSED (event))
{
wxSDCardWindow SDWindow(this);
SDWindow.ShowModal();
}
void CFrame::OnLoadWiiMenu(wxCommandEvent& WXUNUSED (event))
{
BootManager::BootCore(FULL_WII_MENU_DIR);
@ -700,12 +702,12 @@ void CFrame::OnToggleFullscreen(wxCommandEvent& WXUNUSED (event))
UpdateGUI();
}
void CFrame::OnToggleDualCore(wxCommandEvent& WXUNUSED (event))
{
SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore = !SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore;
SConfig::GetInstance().SaveSettings();
}
void CFrame::OnToggleSkipIdle(wxCommandEvent& WXUNUSED (event))
{
SConfig::GetInstance().m_LocalCoreStartupParameter.bSkipIdle = !SConfig::GetInstance().m_LocalCoreStartupParameter.bSkipIdle;
@ -721,7 +723,7 @@ void CFrame::OnLoadState(wxCommandEvent& event)
void CFrame::OnResize(wxSizeEvent& event)
{
DoMoveIcons(); // In FrameWiimote.cpp
DoMoveIcons(); // In FrameWiimote.cpp
event.Skip();
}
@ -737,8 +739,8 @@ void CFrame::OnSaveState(wxCommandEvent& event)
void CFrame::OnToggleToolbar(wxCommandEvent& event)
{
wxToolBarBase* toolBar = GetToolBar();
if (SConfig::GetInstance().m_InterfaceToolbar = event.IsChecked() == true)
SConfig::GetInstance().m_InterfaceToolbar = event.IsChecked();
if (SConfig::GetInstance().m_InterfaceToolbar == true)
{
CFrame::RecreateToolbar();
}
@ -754,7 +756,8 @@ void CFrame::OnToggleToolbar(wxCommandEvent& event)
// Enable and disable the status bar
void CFrame::OnToggleStatusbar(wxCommandEvent& event)
{
if (SConfig::GetInstance().m_InterfaceStatusbar = event.IsChecked() == true)
SConfig::GetInstance().m_InterfaceStatusbar = event.IsChecked();
if (SConfig::GetInstance().m_InterfaceStatusbar == true)
m_pStatusBar->Show();
else
m_pStatusBar->Hide();
@ -770,7 +773,8 @@ void CFrame::OnToggleLogWindow(wxCommandEvent& event)
void CFrame::ToggleLogWindow(bool check)
{
if (SConfig::GetInstance().m_InterfaceLogWindow = check == true)
SConfig::GetInstance().m_InterfaceLogWindow = check;
if (SConfig::GetInstance().m_InterfaceLogWindow)
m_LogWindow->Show();
else
m_LogWindow->Hide();
@ -788,7 +792,8 @@ void CFrame::OnToggleConsole(wxCommandEvent& event)
void CFrame::ToggleConsole(bool check)
{
ConsoleListener *console = LogManager::GetInstance()->getConsoleListener();
if (SConfig::GetInstance().m_InterfaceConsole = check == true)
SConfig::GetInstance().m_InterfaceConsole = check;
if (SConfig::GetInstance().m_InterfaceConsole)
console->Open();
else
console->Close();

View File

@ -27,7 +27,7 @@
#include "Console.h"
// milliseconds between msgQueue flushes to wxTextCtrl
#define UPDATETIME 100
#define UPDATETIME 200
BEGIN_EVENT_TABLE(CLogWindow, wxDialog)
EVT_CLOSE(CLogWindow::OnClose)
@ -44,8 +44,7 @@ END_EVENT_TABLE()
CLogWindow::CLogWindow(wxWindow* parent)
: wxDialog(parent, wxID_ANY, wxT("Log/Console"),
wxPoint(100, 700), wxSize(800, 270),
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER),
Listener("LogWindow")
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
m_logManager = LogManager::GetInstance();
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
@ -351,43 +350,51 @@ void CLogWindow::NotifyUpdate()
void CLogWindow::UpdateLog()
{
if (!msgQueue.size())
return;
m_logTimer->Stop();
wxString collected_text;
// rough estimate.
collected_text.reserve(100 * msgQueue.size());
u32 msgQueueSize = msgQueue.size();
for (u32 i = 0; i < msgQueueSize; i++)
for (unsigned int i = 0; i < msgQueueSize; i++)
{
#ifndef _WIN32
// FIXME This looks horrible on windows: SetForegroundColour changes
// ALL text in the control, and SetDefaultStyle doesn't work at all
// switch (msgQueue.front().first)
// {
// // red
// case ERROR_LEVEL:
// m_log->SetForegroundColour(*wxRED);
// break;
// // yellow
// case WARNING_LEVEL:
// m_log->SetForegroundColour(wxColour(255, 255, 0));
// break;
// // green
// case NOTICE_LEVEL:
// m_log->SetForegroundColour(*wxGREEN);
// break;
// // cyan
// case INFO_LEVEL:
// m_log->SetForegroundColour(*wxCYAN);
// break;
// // light gray
// case DEBUG_LEVEL:
// m_log->SetForegroundColour(wxColour(211, 211, 211));
// break;
// // white
// default:
// m_log->SetForegroundColour(*wxWHITE);
// break;
// }
m_log->AppendText(msgQueue.front().second);
switch (msgQueue.front().first)
{
// red
case ERROR_LEVEL:
m_log->SetForegroundColour(*wxRED);
break;
// yellow
case WARNING_LEVEL:
m_log->SetForegroundColour(wxColour(255, 255, 0));
break;
// green
case NOTICE_LEVEL:
m_log->SetForegroundColour(*wxGREEN);
break;
// cyan
case INFO_LEVEL:
m_log->SetForegroundColour(*wxCYAN);
break;
// light gray
case DEBUG_LEVEL:
m_log->SetForegroundColour(wxColour(211, 211, 211));
break;
// white
default:
m_log->SetForegroundColour(*wxWHITE);
break;
}
#endif
collected_text.Append(msgQueue.front().second);
msgQueue.pop();
}
if (collected_text.size())
m_log->AppendText(collected_text);
m_logTimer->Start(UPDATETIME);
}

View File

@ -40,7 +40,8 @@ class wxTextCtrl;
class wxCheckListBox;
class wxString;
class CLogWindow : public wxDialog,Listener
// Uses multiple inheritance - only sane because LogListener is a pure virtual interface.
class CLogWindow : public wxDialog, LogListener
{
public:
CLogWindow(wxWindow* parent);
@ -77,6 +78,8 @@ private:
void UpdateChecks();
void UpdateLog();
// LogListener
const char *getName() const { return "LogWindow"; }
};
#endif /*LOGWINDOW_H_*/

View File

@ -1,29 +1,48 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include "Common.h"
#include <wx/wx.h>
#include <wx/string.h>
namespace WxUtils {
// Launch a file according to its mime type
void Launch(const char *filename)
{
if (! ::wxLaunchDefaultBrowser(wxString::FromAscii(filename))) {
// WARN_LOG
}
// Launch a file according to its mime type
void Launch(const char *filename)
{
if (! ::wxLaunchDefaultBrowser(wxString::FromAscii(filename))) {
// WARN_LOG
}
// Launch an file explorer window on a certain path
void Explore(const char *path)
{
wxString wxPath = wxString::FromAscii(path);
// Default to file
if (! wxPath.Contains(wxT("://"))) {
wxPath = wxT("file://") + wxPath;
}
if (! ::wxLaunchDefaultBrowser(wxPath)) {
// WARN_LOG
}
}
}
// Launch an file explorer window on a certain path
void Explore(const char *path)
{
wxString wxPath = wxString::FromAscii(path);
// Default to file
if (! wxPath.Contains(wxT("://"))) {
wxPath = wxT("file://") + wxPath;
}
if (! ::wxLaunchDefaultBrowser(wxPath)) {
// WARN_LOG
}
}
} // namespace

View File

@ -1,12 +1,31 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef WXUTILS_H
#define WXUTILS_H
namespace WxUtils {
// Launch a file according to its mime type
void Launch(const char *filename);
// Launch an file explorer window on a certain path
void Explore(const char *path);
// Launch a file according to its mime type
void Launch(const char *filename);
// Launch an file explorer window on a certain path
void Explore(const char *path);
} // NameSpace WxUtils
} // namespace
#endif // WXUTILS