re-enable the ogl "debugger" (doesn't do much - and i don't have any plans for it - just wanted to dump shaders easily).
ogl config and debugger GUIs are handled much more nicely now. same with dsp lle git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3647 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
3b4f534abd
commit
7076c36988
|
@ -38,7 +38,8 @@
|
|||
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
#include "DSPConfigDlgLLE.h"
|
||||
#include "Debugger/Debugger.h" // For the DSPDebuggerLLE class
|
||||
DSPConfigDialogLLE* m_ConfigFrame = NULL;
|
||||
#include "Debugger/Debugger.h"
|
||||
DSPDebuggerLLE* m_DebuggerFrame = NULL;
|
||||
#endif
|
||||
|
||||
|
@ -49,9 +50,9 @@ SoundStream *soundStream = NULL;
|
|||
|
||||
bool bIsRunning = false;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// UGLY WxW stuff, TODO fix up
|
||||
// wxWidgets: Create the wxApp
|
||||
#ifdef _WIN32
|
||||
HINSTANCE g_hInstance;
|
||||
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
class wxDLLApp : public wxApp
|
||||
{
|
||||
|
@ -60,46 +61,55 @@ class wxDLLApp : public wxApp
|
|||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
IMPLEMENT_APP_NO_MAIN(wxDLLApp)
|
||||
IMPLEMENT_APP_NO_MAIN(wxDLLApp)
|
||||
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
|
||||
#endif
|
||||
|
||||
// DllMain
|
||||
#ifdef _WIN32
|
||||
HINSTANCE g_hInstance = NULL;
|
||||
|
||||
BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle
|
||||
DWORD dwReason, // reason called
|
||||
LPVOID lpvReserved) // reserved
|
||||
BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle
|
||||
DWORD dwReason, // reason called
|
||||
LPVOID lpvReserved) // reserved
|
||||
{
|
||||
switch (dwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
{
|
||||
|
||||
// more stuff wx needs
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
wxSetInstance((HINSTANCE)hinstDLL);
|
||||
int argc = 0;
|
||||
char **argv = NULL;
|
||||
wxEntryStart(argc, argv);
|
||||
|
||||
// This is for ?
|
||||
if ( !wxTheApp || !wxTheApp->CallOnInit() )
|
||||
if (!wxTheApp || !wxTheApp->CallOnInit())
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
wxEntryCleanup(); // use this or get a crash
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
wxEntryCleanup();
|
||||
#endif
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
g_hInstance = hinstDLL;
|
||||
return(TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
wxWindow* GetParentedWxWindow(HWND Parent)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
wxSetInstance((HINSTANCE)g_hInstance);
|
||||
#endif
|
||||
wxWindow *win = new wxWindow();
|
||||
#ifdef _WIN32
|
||||
win->SetHWND((WXHWND)Parent);
|
||||
win->AdoptAttributesFromHWND();
|
||||
#endif
|
||||
return win;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -126,27 +136,25 @@ void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
|
|||
LogManager::SetInstance((LogManager *)globals->logManager);
|
||||
}
|
||||
|
||||
void DllAbout(HWND _hParent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void DllConfig(HWND _hParent)
|
||||
{
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
// (shuffle2) TODO: reparent dlg with DolphinApp
|
||||
DSPConfigDialogLLE dlg(NULL);
|
||||
if (!m_ConfigFrame)
|
||||
m_ConfigFrame = new DSPConfigDialogLLE(GetParentedWxWindow(_hParent));
|
||||
|
||||
// add backends
|
||||
std::vector<std::string> backends = AudioCommon::GetSoundBackends();
|
||||
|
||||
for (std::vector<std::string>::const_iterator iter = backends.begin();
|
||||
iter != backends.end(); ++iter) {
|
||||
dlg.AddBackend((*iter).c_str());
|
||||
m_ConfigFrame->AddBackend((*iter).c_str());
|
||||
}
|
||||
|
||||
// Show the window
|
||||
dlg.ShowModal();
|
||||
// Only allow one open at a time
|
||||
if (!m_ConfigFrame->IsShown())
|
||||
m_ConfigFrame->ShowModal();
|
||||
else
|
||||
m_ConfigFrame->Hide();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -160,7 +168,7 @@ void DllDebugger(HWND _hParent, bool Show)
|
|||
{
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
if (!m_DebuggerFrame)
|
||||
m_DebuggerFrame = new DSPDebuggerLLE(NULL);
|
||||
m_DebuggerFrame = new DSPDebuggerLLE(GetParentedWxWindow(_hParent));
|
||||
|
||||
if (Show)
|
||||
m_DebuggerFrame->Show();
|
||||
|
|
|
@ -24,33 +24,31 @@
|
|||
|
||||
extern int g_Preset;
|
||||
|
||||
BEGIN_EVENT_TABLE(CDebugger,wxDialog)
|
||||
EVT_CLOSE(CDebugger::OnClose)
|
||||
EVT_CHECKBOX(ID_SAVETOFILE,CDebugger::GeneralSettings)
|
||||
EVT_CHECKBOX(ID_SHOWCONSOLE,CDebugger::GeneralSettings)
|
||||
EVT_CHECKBOX(ID_INFOLOG,CDebugger::GeneralSettings)
|
||||
EVT_CHECKBOX(ID_PRIMLOG,CDebugger::GeneralSettings)
|
||||
EVT_CHECKBOX(ID_SAVETEXTURES,CDebugger::GeneralSettings)
|
||||
EVT_CHECKBOX(ID_SAVETARGETS,CDebugger::GeneralSettings)
|
||||
EVT_CHECKBOX(ID_SAVESHADERS,CDebugger::GeneralSettings)
|
||||
BEGIN_EVENT_TABLE(GFXDebuggerOGL,wxDialog)
|
||||
EVT_CLOSE(GFXDebuggerOGL::OnClose)
|
||||
EVT_CHECKBOX(ID_SAVETOFILE,GFXDebuggerOGL::GeneralSettings)
|
||||
EVT_CHECKBOX(ID_INFOLOG,GFXDebuggerOGL::GeneralSettings)
|
||||
EVT_CHECKBOX(ID_PRIMLOG,GFXDebuggerOGL::GeneralSettings)
|
||||
EVT_CHECKBOX(ID_SAVETEXTURES,GFXDebuggerOGL::GeneralSettings)
|
||||
EVT_CHECKBOX(ID_SAVETARGETS,GFXDebuggerOGL::GeneralSettings)
|
||||
EVT_CHECKBOX(ID_SAVESHADERS,GFXDebuggerOGL::GeneralSettings)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
CDebugger::CDebugger(wxWindow *parent, wxWindowID id, const wxString &title,
|
||||
GFXDebuggerOGL::GFXDebuggerOGL(wxWindow *parent, wxWindowID id, const wxString &title,
|
||||
const wxPoint &position, const wxSize& size, long style)
|
||||
: wxDialog(parent, id, title, position, size, style)
|
||||
{
|
||||
CreateGUIControls();
|
||||
|
||||
LoadSettings();
|
||||
DoShowConsole();
|
||||
}
|
||||
|
||||
CDebugger::~CDebugger()
|
||||
GFXDebuggerOGL::~GFXDebuggerOGL()
|
||||
{
|
||||
SaveSettings();
|
||||
}
|
||||
|
||||
void CDebugger::OnClose(wxCloseEvent& event)
|
||||
void GFXDebuggerOGL::OnClose(wxCloseEvent& event)
|
||||
{
|
||||
// save the window position when we hide the window
|
||||
SaveSettings();
|
||||
|
@ -58,16 +56,7 @@ void CDebugger::OnClose(wxCloseEvent& event)
|
|||
event.Skip(); // This means wxDialog's Destroy is used
|
||||
}
|
||||
|
||||
void CDebugger::DoShowConsole()
|
||||
{
|
||||
ConsoleListener* console = LogManager::GetInstance()->getConsoleListener();
|
||||
if (m_Check[1]->IsChecked() && console->IsOpen())
|
||||
console->Open();
|
||||
else
|
||||
console->Close();
|
||||
}
|
||||
|
||||
void CDebugger::SaveSettings() const
|
||||
void GFXDebuggerOGL::SaveSettings() const
|
||||
{
|
||||
IniFile file;
|
||||
file.Load(DEBUGGER_CONFIG_FILE);
|
||||
|
@ -86,7 +75,6 @@ void CDebugger::SaveSettings() const
|
|||
}
|
||||
|
||||
file.Set("VideoWindow", "WriteToFile", m_Check[0]->IsChecked());
|
||||
file.Set("VideoWindow", "Console", m_Check[1]->IsChecked());
|
||||
|
||||
g_Config.iLog = bInfoLog ? CONF_LOG : 0;
|
||||
g_Config.iLog |= bPrimLog ? CONF_PRIMLOG : 0;
|
||||
|
@ -99,36 +87,32 @@ void CDebugger::SaveSettings() const
|
|||
file.Save(DEBUGGER_CONFIG_FILE);
|
||||
}
|
||||
|
||||
void CDebugger::LoadSettings()
|
||||
void GFXDebuggerOGL::LoadSettings()
|
||||
{
|
||||
IniFile file;
|
||||
file.Load(DEBUGGER_CONFIG_FILE);
|
||||
|
||||
int x,y,w,h;
|
||||
int x = 100, y = 100, w = 100, h = 100;
|
||||
file.Get("VideoWindow", "x", &x, GetPosition().x);
|
||||
file.Get("VideoWindow", "y", &y, GetPosition().y);
|
||||
file.Get("VideoWindow", "w", &w, GetSize().GetWidth());
|
||||
file.Get("VideoWindow", "h", &h, GetSize().GetHeight());
|
||||
SetSize(x, y, w, h);
|
||||
|
||||
bool Console;
|
||||
file.Get("VideoWindow", "Console", &Console, m_Check[1]->IsChecked());
|
||||
m_Check[1]->SetValue(Console);
|
||||
|
||||
file.Get("VideoWindow", "ConfBits", &g_Config.iLog, 0);
|
||||
bInfoLog = (g_Config.iLog & CONF_LOG) ? true : false;
|
||||
bPrimLog = (g_Config.iLog & CONF_PRIMLOG) ? true : false;
|
||||
bSaveTextures = (g_Config.iLog & CONF_SAVETEXTURES) ? true : false;
|
||||
bSaveTargets = (g_Config.iLog & CONF_SAVETARGETS) ? true : false;
|
||||
bSaveShaders = (g_Config.iLog & CONF_SAVESHADERS) ? true : false;
|
||||
m_Check[2]->SetValue(bInfoLog);
|
||||
m_Check[3]->SetValue(bPrimLog);
|
||||
m_Check[4]->SetValue(bSaveTextures);
|
||||
m_Check[5]->SetValue(bSaveTargets);
|
||||
m_Check[6]->SetValue(bSaveShaders);
|
||||
m_Check[1]->SetValue(bInfoLog);
|
||||
m_Check[2]->SetValue(bPrimLog);
|
||||
m_Check[3]->SetValue(bSaveTextures);
|
||||
m_Check[4]->SetValue(bSaveTargets);
|
||||
m_Check[5]->SetValue(bSaveShaders);
|
||||
}
|
||||
|
||||
void CDebugger::CreateGUIControls()
|
||||
void GFXDebuggerOGL::CreateGUIControls()
|
||||
{
|
||||
// Basic settings
|
||||
SetIcon(wxNullIcon);
|
||||
|
@ -140,12 +124,11 @@ void CDebugger::CreateGUIControls()
|
|||
// Options
|
||||
wxStaticBoxSizer *sOptions = new wxStaticBoxSizer(wxVERTICAL, m_MainPanel, wxT("Options"));
|
||||
m_Check[0] = new wxCheckBox(m_MainPanel, ID_SAVETOFILE, wxT("Save to file"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[1] = new wxCheckBox(m_MainPanel, ID_SHOWCONSOLE, wxT("Show console"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[2] = new wxCheckBox(m_MainPanel, ID_INFOLOG, wxT("Info log"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[3] = new wxCheckBox(m_MainPanel, ID_PRIMLOG, wxT("Primary log"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[4] = new wxCheckBox(m_MainPanel, ID_SAVETEXTURES, wxT("Save Textures"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[5] = new wxCheckBox(m_MainPanel, ID_SAVETARGETS, wxT("Save Targets"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[6] = new wxCheckBox(m_MainPanel, ID_SAVESHADERS, wxT("Save Shaders"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[1] = new wxCheckBox(m_MainPanel, ID_INFOLOG, wxT("Info log"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[2] = new wxCheckBox(m_MainPanel, ID_PRIMLOG, wxT("Primary log"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[3] = new wxCheckBox(m_MainPanel, ID_SAVETEXTURES, wxT("Save Textures"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[4] = new wxCheckBox(m_MainPanel, ID_SAVETARGETS, wxT("Save Targets"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[5] = new wxCheckBox(m_MainPanel, ID_SAVESHADERS, wxT("Save Shaders"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
|
||||
for (int i = 0; i < NUM_OPTIONS-ID_SAVETOFILE; ++i)
|
||||
sOptions->Add(m_Check[i], 0, 0, 5);
|
||||
|
@ -159,13 +142,10 @@ void CDebugger::CreateGUIControls()
|
|||
}
|
||||
|
||||
// General settings
|
||||
void CDebugger::GeneralSettings(wxCommandEvent& event)
|
||||
void GFXDebuggerOGL::GeneralSettings(wxCommandEvent& event)
|
||||
{
|
||||
switch (event.GetId())
|
||||
{
|
||||
case ID_SHOWCONSOLE:
|
||||
DoShowConsole();
|
||||
break;
|
||||
case ID_INFOLOG:
|
||||
bInfoLog = event.IsChecked();
|
||||
break;
|
||||
|
|
|
@ -25,24 +25,20 @@
|
|||
|
||||
class IniFile;
|
||||
|
||||
class CDebugger : public wxDialog
|
||||
class GFXDebuggerOGL : public wxDialog
|
||||
{
|
||||
public:
|
||||
CDebugger(wxWindow *parent,
|
||||
GFXDebuggerOGL(wxWindow *parent,
|
||||
wxWindowID id = 1,
|
||||
const wxString &title = wxT("OGL Debugguer"),
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN | wxNO_FULL_REPAINT_ON_RESIZE);
|
||||
|
||||
virtual ~CDebugger();
|
||||
virtual ~GFXDebuggerOGL();
|
||||
|
||||
void SaveSettings() const;
|
||||
void LoadSettings();
|
||||
void DoShowConsole();
|
||||
void DoShow();
|
||||
|
||||
void GeneralSettings(wxCommandEvent& event);
|
||||
|
||||
bool bInfoLog;
|
||||
bool bPrimLog;
|
||||
|
@ -55,14 +51,13 @@ private:
|
|||
|
||||
wxPanel *m_MainPanel;
|
||||
|
||||
wxCheckBox *m_Check[7];
|
||||
wxCheckBox *m_Check[6];
|
||||
|
||||
// WARNING: Make sure these are not also elsewhere
|
||||
enum
|
||||
{
|
||||
ID_MAINPANEL = 2000,
|
||||
ID_SAVETOFILE,
|
||||
ID_SHOWCONSOLE,
|
||||
ID_INFOLOG,
|
||||
ID_PRIMLOG,
|
||||
ID_SAVETEXTURES,
|
||||
|
@ -71,9 +66,10 @@ private:
|
|||
NUM_OPTIONS
|
||||
};
|
||||
|
||||
void OnShow(wxShowEvent& event);
|
||||
void OnClose(wxCloseEvent& event);
|
||||
void CreateGUIControls();
|
||||
void CreateGUIControls();
|
||||
|
||||
void GeneralSettings(wxCommandEvent& event);
|
||||
};
|
||||
|
||||
#endif // _CDEBUGGER_H_
|
||||
|
|
|
@ -31,59 +31,59 @@
|
|||
#include "VertexShaderManager.h"
|
||||
#include "../PostProcessing.h"
|
||||
|
||||
BEGIN_EVENT_TABLE(ConfigDialog,wxDialog)
|
||||
EVT_CLOSE(ConfigDialog::OnClose)
|
||||
EVT_BUTTON(ID_CLOSE, ConfigDialog::CloseClick)
|
||||
EVT_BUTTON(ID_ABOUTOGL, ConfigDialog::AboutClick)
|
||||
EVT_CHECKBOX(ID_FULLSCREEN, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_VSYNC, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_RENDERTOMAINWINDOW, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_COMBOBOX(ID_FULLSCREENCB, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_COMBOBOX(ID_WINDOWRESOLUTIONCB, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHOICE(ID_MAXANISOTROPY, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHOICE(ID_MSAAMODECB, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_NATIVERESOLUTION, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_2X_RESOLUTION, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_USEXFB, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_FORCEFILTERING, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_AUTOSCALE, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_KEEPAR_4_3, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_KEEPAR_16_9, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_CROP, ConfigDialog::GeneralSettingsChanged)
|
||||
BEGIN_EVENT_TABLE(GFXConfigDialogOGL,wxDialog)
|
||||
EVT_CLOSE(GFXConfigDialogOGL::OnClose)
|
||||
EVT_BUTTON(ID_CLOSE, GFXConfigDialogOGL::CloseClick)
|
||||
EVT_BUTTON(ID_ABOUTOGL, GFXConfigDialogOGL::AboutClick)
|
||||
EVT_CHECKBOX(ID_FULLSCREEN, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_VSYNC, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_RENDERTOMAINWINDOW, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
EVT_COMBOBOX(ID_FULLSCREENCB, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
EVT_COMBOBOX(ID_WINDOWRESOLUTIONCB, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
EVT_CHOICE(ID_MAXANISOTROPY, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
EVT_CHOICE(ID_MSAAMODECB, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_NATIVERESOLUTION, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_2X_RESOLUTION, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_USEXFB, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_FORCEFILTERING, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_AUTOSCALE, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_KEEPAR_4_3, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_KEEPAR_16_9, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_CROP, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
#ifndef _WIN32
|
||||
EVT_CHECKBOX(ID_HIDECURSOR, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_HIDECURSOR, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
#endif
|
||||
EVT_CHECKBOX(ID_WIREFRAME, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_SHOWFPS, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_STATISTICS, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_BLENDSTATS, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_PROJSTATS, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_SHOWEFBCOPYREGIONS, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_SHADERERRORS, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_TEXFMTOVERLAY, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_TEXFMTCENTER, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DUMPTEXTURES, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_HIRESTEXTURES, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DUMPEFBTARGET, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DUMPFRAMES, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_FREELOOK, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DISABLELIGHTING, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DISABLETEXTURING, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DISABLEFOG, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_EFBCOPYDISABLEHOTKEY, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_HACK, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_SAFETEXTURECACHE,ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DSTALPHAPASS,ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_CHECKBOX_DISABLECOPYEFB, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_RADIOBUTTON(ID_RADIO_COPYEFBTORAM, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_RADIOBUTTON(ID_RADIO_COPYEFBTOGL, ConfigDialog::AdvancedSettingsChanged)
|
||||
EVT_CHOICE(ID_PHACKVALUE, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_CHOICE(ID_POSTSHADER, ConfigDialog::GeneralSettingsChanged)
|
||||
EVT_BUTTON(ID_RELOADSHADER, ConfigDialog::ReloadShaderClick)
|
||||
EVT_BUTTON(ID_EDITSHADER, ConfigDialog::EditShaderClick)
|
||||
EVT_CHECKBOX(ID_WIREFRAME, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_SHOWFPS, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_STATISTICS, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_BLENDSTATS, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_PROJSTATS, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_SHOWEFBCOPYREGIONS, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_SHADERERRORS, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_TEXFMTOVERLAY, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_TEXFMTCENTER, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DUMPTEXTURES, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_HIRESTEXTURES, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DUMPEFBTARGET, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DUMPFRAMES, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_FREELOOK, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DISABLELIGHTING, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DISABLETEXTURING, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DISABLEFOG, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_EFBCOPYDISABLEHOTKEY, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_HACK, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_SAFETEXTURECACHE,GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DSTALPHAPASS,GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_CHECKBOX_DISABLECOPYEFB, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_RADIOBUTTON(ID_RADIO_COPYEFBTORAM, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_RADIOBUTTON(ID_RADIO_COPYEFBTOGL, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHOICE(ID_PHACKVALUE, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
EVT_CHOICE(ID_POSTSHADER, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
EVT_BUTTON(ID_RELOADSHADER, GFXConfigDialogOGL::ReloadShaderClick)
|
||||
EVT_BUTTON(ID_EDITSHADER, GFXConfigDialogOGL::EditShaderClick)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
ConfigDialog::ConfigDialog(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
|
||||
GFXConfigDialogOGL::GFXConfigDialogOGL(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
|
||||
: wxDialog(parent, id, title, position, size, style)
|
||||
{
|
||||
g_Config.Load();
|
||||
|
@ -94,11 +94,11 @@ ConfigDialog::ConfigDialog(wxWindow *parent, wxWindowID id, const wxString &titl
|
|||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Close and unload the window
|
||||
// ---------------
|
||||
ConfigDialog::~ConfigDialog()
|
||||
GFXConfigDialogOGL::~GFXConfigDialogOGL()
|
||||
{
|
||||
INFO_LOG(CONSOLE, "ConfigDialog Closed");
|
||||
INFO_LOG(CONSOLE, "GFXConfigDialogOGL Closed");
|
||||
}
|
||||
void ConfigDialog::OnClose(wxCloseEvent& event)
|
||||
void GFXConfigDialogOGL::OnClose(wxCloseEvent& event)
|
||||
{
|
||||
g_Config.Save();
|
||||
|
||||
|
@ -116,7 +116,7 @@ void ConfigDialog::OnClose(wxCloseEvent& event)
|
|||
event.Skip();
|
||||
}
|
||||
|
||||
void ConfigDialog::CloseClick(wxCommandEvent& WXUNUSED (event))
|
||||
void GFXConfigDialogOGL::CloseClick(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
INFO_LOG(CONSOLE, "CloseClick");
|
||||
|
||||
|
@ -131,12 +131,12 @@ void ConfigDialog::CloseClick(wxCommandEvent& WXUNUSED (event))
|
|||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Add avaliable resolutions and other settings
|
||||
// ---------------
|
||||
void ConfigDialog::AddFSReso(char *reso)
|
||||
void GFXConfigDialogOGL::AddFSReso(char *reso)
|
||||
{
|
||||
arrayStringFor_FullscreenCB.Add(wxString::FromAscii(reso));
|
||||
}
|
||||
|
||||
void ConfigDialog::AddWindowReso(char *reso)
|
||||
void GFXConfigDialogOGL::AddWindowReso(char *reso)
|
||||
{
|
||||
arrayStringFor_WindowResolutionCB.Add(wxString::FromAscii(reso));
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ void ConfigDialog::AddWindowReso(char *reso)
|
|||
///////////////////////////////////////
|
||||
|
||||
|
||||
void ConfigDialog::CreateGUIControls()
|
||||
void GFXConfigDialogOGL::CreateGUIControls()
|
||||
{
|
||||
// Notebook
|
||||
m_Notebook = new wxNotebook(this, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize);
|
||||
|
@ -511,7 +511,7 @@ void ConfigDialog::CreateGUIControls()
|
|||
}
|
||||
|
||||
|
||||
void ConfigDialog::AboutClick(wxCommandEvent& WXUNUSED (event))
|
||||
void GFXConfigDialogOGL::AboutClick(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
wxMessageBox(_T("Dolphin OpenGL Plugin\nBy zerofrog(@gmail.com)\n\n"
|
||||
"A card supporting Vertex/Pixel Shader 2.0 or higher, framebuffer objects, "
|
||||
|
@ -519,12 +519,12 @@ void ConfigDialog::AboutClick(wxCommandEvent& WXUNUSED (event))
|
|||
_T("Dolphin OGL"), wxOK, this);
|
||||
}
|
||||
|
||||
void ConfigDialog::ReloadShaderClick(wxCommandEvent& WXUNUSED (event))
|
||||
void GFXConfigDialogOGL::ReloadShaderClick(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
PostProcessing::ReloadShader();
|
||||
}
|
||||
|
||||
void ConfigDialog::EditShaderClick(wxCommandEvent& WXUNUSED (event))
|
||||
void GFXConfigDialogOGL::EditShaderClick(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
if (m_PostShaderCB->GetStringSelection() == wxT("(off)"))
|
||||
return;
|
||||
|
@ -551,7 +551,7 @@ void ConfigDialog::EditShaderClick(wxCommandEvent& WXUNUSED (event))
|
|||
}
|
||||
}
|
||||
|
||||
void ConfigDialog::GeneralSettingsChanged(wxCommandEvent& event)
|
||||
void GFXConfigDialogOGL::GeneralSettingsChanged(wxCommandEvent& event)
|
||||
{
|
||||
switch (event.GetId())
|
||||
{
|
||||
|
@ -633,7 +633,7 @@ void ConfigDialog::GeneralSettingsChanged(wxCommandEvent& event)
|
|||
}
|
||||
|
||||
|
||||
void ConfigDialog::AdvancedSettingsChanged(wxCommandEvent& event)
|
||||
void GFXConfigDialogOGL::AdvancedSettingsChanged(wxCommandEvent& event)
|
||||
{
|
||||
switch (event.GetId())
|
||||
{
|
||||
|
@ -726,7 +726,7 @@ void ConfigDialog::AdvancedSettingsChanged(wxCommandEvent& event)
|
|||
}
|
||||
|
||||
|
||||
void ConfigDialog::UpdateGUI()
|
||||
void GFXConfigDialogOGL::UpdateGUI()
|
||||
{
|
||||
// This is only used together with the aspect ratio options
|
||||
m_Crop->Enable(g_Config.bKeepAR43 || g_Config.bKeepAR169);
|
||||
|
|
|
@ -47,15 +47,15 @@ enum
|
|||
};
|
||||
|
||||
|
||||
class ConfigDialog : public wxDialog
|
||||
class GFXConfigDialogOGL : public wxDialog
|
||||
{
|
||||
public:
|
||||
ConfigDialog(wxWindow *parent, wxWindowID id = 1,
|
||||
GFXConfigDialogOGL(wxWindow *parent, wxWindowID id = 1,
|
||||
const wxString &title = wxT("OpenGL Plugin Configuration"),
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE);
|
||||
virtual ~ConfigDialog();
|
||||
virtual ~GFXConfigDialogOGL();
|
||||
void CloseClick(wxCommandEvent& event);
|
||||
|
||||
void AddFSReso(char *reso);
|
||||
|
|
|
@ -32,8 +32,6 @@
|
|||
|
||||
#include "StringUtil.h"
|
||||
|
||||
//void OpenConsole();
|
||||
//void CloseConsole();
|
||||
|
||||
HINSTANCE g_hInstance;
|
||||
|
||||
|
@ -85,7 +83,6 @@ BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
void DoDllDebugger();
|
||||
extern bool gShowDebugger;
|
||||
int OSDChoice = 0, OSDTime = 0, OSDInternalW = 0, OSDInternalH = 0;
|
||||
|
||||
|
|
|
@ -61,6 +61,9 @@ Make AA apply instantly during gameplay if possible
|
|||
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
#include "GUI/ConfigDlg.h"
|
||||
GFXConfigDialogOGL *m_ConfigFrame = NULL;
|
||||
#include "Debugger/Debugger.h"
|
||||
GFXDebuggerOGL *m_DebuggerFrame = NULL;
|
||||
#endif
|
||||
|
||||
#include "Config.h"
|
||||
|
@ -101,18 +104,6 @@ static volatile EFBAccessType s_AccessEFBType;
|
|||
static Common::Event s_AccessEFBDone;
|
||||
static Common::CriticalSection s_criticalEFB;
|
||||
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
void DllDebugger(HWND _hParent, bool Show)
|
||||
{
|
||||
// TODO: Debugger needs recoding, right now its useless
|
||||
}
|
||||
|
||||
void DoDllDebugger(){}
|
||||
#else
|
||||
void DllDebugger(HWND _hParent, bool Show) { }
|
||||
void DoDllDebugger() { }
|
||||
#endif
|
||||
|
||||
|
||||
void GetDllInfo (PLUGIN_INFO* _PluginInfo)
|
||||
{
|
||||
|
@ -135,41 +126,50 @@ void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
|
|||
LogManager::SetInstance((LogManager *)globals->logManager);
|
||||
}
|
||||
|
||||
// This is used for the fuctions right below here, in DllConfig()
|
||||
#if defined(HAVE_WX) && HAVE_WX && defined _WIN32
|
||||
// This is used for the functions right below here which use wxwidgets
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
#ifdef _WIN32
|
||||
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
|
||||
extern HINSTANCE g_hInstance;
|
||||
#endif
|
||||
|
||||
wxWindow* GetParentedWxWindow(HWND Parent)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
wxSetInstance((HINSTANCE)g_hInstance);
|
||||
#endif
|
||||
wxWindow *win = new wxWindow();
|
||||
#ifdef _WIN32
|
||||
win->SetHWND((WXHWND)Parent);
|
||||
win->AdoptAttributesFromHWND();
|
||||
#endif
|
||||
return win;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
void DllDebugger(HWND _hParent, bool Show)
|
||||
{
|
||||
if (!m_DebuggerFrame)
|
||||
m_DebuggerFrame = new GFXDebuggerOGL(GetParentedWxWindow(_hParent));
|
||||
|
||||
if (Show)
|
||||
m_DebuggerFrame->ShowModal();
|
||||
else
|
||||
m_DebuggerFrame->Hide();
|
||||
}
|
||||
#else
|
||||
void DllDebugger(HWND _hParent, bool Show) { }
|
||||
#endif
|
||||
|
||||
void DllConfig(HWND _hParent)
|
||||
{
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
// This is needed because now we use wxEntryCleanup() when closing the configuration window
|
||||
// if (!wxTheApp || !wxTheApp->CallOnInit())
|
||||
// {
|
||||
#ifdef _WIN32
|
||||
wxSetInstance((HINSTANCE)g_hInstance);
|
||||
#endif
|
||||
// int argc = 0;
|
||||
// char **argv = NULL;
|
||||
// wxEntryStart(argc, argv);
|
||||
if (!m_ConfigFrame)
|
||||
m_ConfigFrame = new GFXConfigDialogOGL(GetParentedWxWindow(_hParent));
|
||||
|
||||
// }
|
||||
|
||||
wxWindow *win = new wxWindow();
|
||||
#ifdef _WIN32
|
||||
win->SetHWND((WXHWND)_hParent);
|
||||
win->AdoptAttributesFromHWND();
|
||||
#endif
|
||||
ConfigDialog *config_dialog = new ConfigDialog(win);
|
||||
#if defined(_WIN32)
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
//Console::Open();
|
||||
|
||||
#if defined(_WIN32) && defined(HAVE_WX) && HAVE_WX
|
||||
|
||||
// Search for avaliable resolutions
|
||||
|
||||
DWORD iModeNum = 0;
|
||||
|
@ -199,15 +199,13 @@ void DllConfig(HWND _hParent)
|
|||
{
|
||||
resos.push_back(strBuffer);
|
||||
i++;
|
||||
config_dialog->AddFSReso(szBuffer);
|
||||
config_dialog->AddWindowReso(szBuffer);
|
||||
m_ConfigFrame->AddFSReso(szBuffer);
|
||||
m_ConfigFrame->AddWindowReso(szBuffer);
|
||||
}
|
||||
ZeroMemory(&dmi, sizeof(dmi));
|
||||
}
|
||||
|
||||
|
||||
#elif defined(HAVE_X11) && HAVE_X11 && defined(HAVE_XXF86VM) &&\
|
||||
HAVE_XXF86VM && defined(HAVE_WX) && HAVE_WX
|
||||
#elif defined(HAVE_X11) && HAVE_X11 && defined(HAVE_XXF86VM) && HAVE_XXF86VM
|
||||
|
||||
int glxMajorVersion, glxMinorVersion;
|
||||
int vidModeMajorVersion, vidModeMinorVersion;
|
||||
|
@ -231,15 +229,16 @@ void DllConfig(HWND _hParent)
|
|||
{
|
||||
char temp[32];
|
||||
sprintf(temp,"%dx%d", modes[i]->hdisplay, modes[i]->vdisplay);
|
||||
config_dialog->AddFSReso(temp);
|
||||
config_dialog->AddWindowReso(temp);//Add same to Window ones, since they should be nearly all that's needed
|
||||
m_ConfigFrame->AddFSReso(temp);
|
||||
m_ConfigFrame->AddWindowReso(temp);//Add same to Window ones, since they should be nearly all that's needed
|
||||
px = modes[i]->hdisplay;//Used to remove repeating from different screen depths
|
||||
py = modes[i]->vdisplay;
|
||||
}
|
||||
}
|
||||
}
|
||||
XFree(modes);
|
||||
#elif defined(HAVE_COCOA) && HAVE_COCOA && defined(HAVE_WX) && HAVE_WX
|
||||
|
||||
#elif defined(HAVE_COCOA) && HAVE_COCOA
|
||||
|
||||
CFArrayRef modes;
|
||||
CFRange range;
|
||||
|
@ -272,27 +271,31 @@ void DllConfig(HWND _hParent)
|
|||
{
|
||||
char temp[32];
|
||||
sprintf(temp,"%dx%d", modeWidth, modeHeight);
|
||||
config_dialog->AddFSReso(temp);
|
||||
config_dialog->AddWindowReso(temp);//Add same to Window ones, since they should be nearly all that's needed
|
||||
m_ConfigFrame->AddFSReso(temp);
|
||||
m_ConfigFrame->AddWindowReso(temp);//Add same to Window ones, since they should be nearly all that's needed
|
||||
px = modeWidth;
|
||||
py = modeHeight;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// Check if at least one resolution was found. If we don't and the resolution array is empty
|
||||
// CreateGUIControls() will crash because the array is empty.
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
if (config_dialog->arrayStringFor_FullscreenCB.size() == 0)
|
||||
if (m_ConfigFrame->arrayStringFor_FullscreenCB.size() == 0)
|
||||
{
|
||||
config_dialog->AddFSReso("<No resolutions found>");
|
||||
config_dialog->AddWindowReso("<No resolutions found>");
|
||||
m_ConfigFrame->AddFSReso("<No resolutions found>");
|
||||
m_ConfigFrame->AddWindowReso("<No resolutions found>");
|
||||
}
|
||||
|
||||
config_dialog->CreateGUIControls();
|
||||
// Hm, why does this code show it modally?
|
||||
config_dialog->ShowModal();
|
||||
#endif
|
||||
// Only allow one open at a time
|
||||
if (!m_ConfigFrame->IsShown())
|
||||
{
|
||||
m_ConfigFrame->CreateGUIControls();
|
||||
m_ConfigFrame->ShowModal();
|
||||
}
|
||||
else
|
||||
m_ConfigFrame->Hide();
|
||||
#endif
|
||||
}
|
||||
|
||||
void Initialize(void *init)
|
||||
|
|
Loading…
Reference in New Issue