Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
updated gui a little bit
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@488 8ced0084-cf51-0410-be5f-012b33b47a6e
  • Loading branch information
shuffle2 committed Sep 9, 2008
1 parent 7ae9fb0 commit 38ff375
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 25 deletions.
9 changes: 5 additions & 4 deletions Source/Core/DolphinWX/Src/Config.cpp
Expand Up @@ -113,10 +113,11 @@ void SConfig::LoadSettings()
ini.Get("Core", "DSPPlugin", &m_LocalCoreStartupParameter.m_strDSPPlugin, m_DefaultDSPPlugin.c_str());
ini.Get("Core", "PadPlugin", &m_LocalCoreStartupParameter.m_strPadPlugin, m_DefaultPADPlugin.c_str());

ini.Get("Core", "HLEBios", &m_LocalCoreStartupParameter.bHLEBios, true);
ini.Get("Core", "UseDynarec", &m_LocalCoreStartupParameter.bUseJIT, true);
ini.Get("Core", "UseDualCore", &m_LocalCoreStartupParameter.bUseDualCore, false);
ini.Get("Core", "LockThreads", &m_LocalCoreStartupParameter.bLockThreads, true);
ini.Get("Core", "HLEBios", &m_LocalCoreStartupParameter.bHLEBios, true);
ini.Get("Core", "UseDynarec", &m_LocalCoreStartupParameter.bUseJIT, true);
ini.Get("Core", "UseDualCore", &m_LocalCoreStartupParameter.bUseDualCore, false);
ini.Get("Core", "LockThreads", &m_LocalCoreStartupParameter.bLockThreads, true);
ini.Get("Core", "DefaultGCM", &m_LocalCoreStartupParameter.m_strDefaultGCM);
ini.Get("Core", "OptimizeQuantizers", &m_LocalCoreStartupParameter.bOptimizeQuantizers, true);
}
}
23 changes: 16 additions & 7 deletions Source/Core/DolphinWX/Src/Frame.cpp
Expand Up @@ -86,6 +86,7 @@ EVT_MENU(IDM_HELPGOOGLECODE, CFrame::OnHelp)
EVT_MENU(IDM_HELPABOUT, CFrame::OnHelp)
EVT_MENU(wxID_REFRESH, CFrame::OnRefresh)
EVT_MENU(IDM_PLAY, CFrame::OnPlay)
EVT_MENU(IDM_PAUSE, CFrame::OnPlay)
EVT_MENU(IDM_STOP, CFrame::OnStop)
EVT_MENU(IDM_PLUGIN_OPTIONS, CFrame::OnPluginOptions)
EVT_MENU(IDM_CONFIG_GFX_PLUGIN, CFrame::OnPluginGFX)
Expand Down Expand Up @@ -217,7 +218,7 @@ void CFrame::CreateMenu()
pOptionsMenu->Append(IDM_CONFIG_DSP_PLUGIN, _T("&DSP settings"));
pOptionsMenu->Append(IDM_CONFIG_PAD_PLUGIN, _T("&PAD settings"));
pOptionsMenu->AppendSeparator();
pOptionsMenu->Append(IDM_TOGGLE_FULLSCREEN, _T("&Fullscreen"));
pOptionsMenu->Append(IDM_TOGGLE_FULLSCREEN, _T("&Fullscreen\tEsc"));
pOptionsMenu->AppendCheckItem(IDM_TOGGLE_DUALCORE, _T("&Dual-core (unstable!)"));
pOptionsMenu->Check(IDM_TOGGLE_DUALCORE, SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore);
m_pMenuBar->Append(pOptionsMenu, _T("&Options"));
Expand Down Expand Up @@ -254,7 +255,7 @@ void CFrame::PopulateToolbar(wxToolBar* toolBar)
toolBar->AddTool(wxID_REFRESH, _T("Refresh"), m_Bitmaps[Toolbar_Refresh], _T("Refresh"));
toolBar->AddTool(IDM_BROWSE, _T("Browse"), m_Bitmaps[Toolbar_Browse], _T("Browse for an ISO directory..."));
toolBar->AddSeparator();
toolBar->AddTool(IDM_PLAY, _T("Play"), m_Bitmaps[Toolbar_Play], _T("Play"));
m_pToolPlay = toolBar->AddTool(IDM_PLAY, _T("Play"), m_Bitmaps[Toolbar_Play], _T("Play"));
toolBar->SetToolDisabledBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Play_Dis]);
toolBar->AddTool(IDM_STOP, _T("Stop"), m_Bitmaps[Toolbar_Stop], _T("Stop"));
toolBar->SetToolDisabledBitmap(IDM_STOP, m_Bitmaps[Toolbar_Stop_Dis]);
Expand Down Expand Up @@ -575,6 +576,11 @@ void CFrame::UpdateGUI()
GetToolBar()->EnableTool(IDM_STOP, false);
GetToolBar()->EnableTool(IDM_PLAY, false);

m_pToolPlay->SetShortHelp(_T("Play"));
m_pToolPlay->SetLabel(_T("Play"));

m_pMenuItemPlay->SetText(_T("Play"));

m_pMenuItemPlay->Enable(false);
m_pMenuItemStop->Enable(false);
m_pMenuItemLoad->Enable(false);
Expand All @@ -595,21 +601,24 @@ void CFrame::UpdateGUI()

if (Core::GetState() == Core::CORE_RUN)
{
GetToolBar()->SetToolNormalBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Pause]);
GetToolBar()->SetToolShortHelp(IDM_PLAY, _T("Pause"));
m_pToolPlay->SetNormalBitmap(m_Bitmaps[Toolbar_Pause]);
m_pToolPlay->SetShortHelp(_T("Pause"));
m_pToolPlay->SetLabel(_T("Pause"));

m_pMenuItemPlay->SetText(_T("Pause"));
}
else
{
GetToolBar()->SetToolNormalBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Play]);
GetToolBar()->SetToolShortHelp(IDM_PLAY, _T("Play"));
m_pToolPlay->SetNormalBitmap(m_Bitmaps[Toolbar_Play]);
m_pToolPlay->SetShortHelp(_T("Play"));
m_pToolPlay->SetLabel(_T("Play"));

m_pMenuItemPlay->SetText(_T("Play"));
}
}
GetToolBar()->Realize();
}

// gamelistctrl
{
if (Core::GetState() == Core::CORE_UNINITIALIZED)
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/DolphinWX/Src/Frame.h
Expand Up @@ -83,6 +83,8 @@ class CFrame
wxMenuItem* m_pMenuItemLoad;
wxMenuItem* m_pMenuItemSave;

wxToolBarToolBase* m_pToolPlay;

wxBusyInfo* m_pBootProcessDialog;

void UpdateGUI();
Expand Down
11 changes: 11 additions & 0 deletions Source/Core/DolphinWX/Src/GameListCtrl.cpp
Expand Up @@ -46,6 +46,7 @@ EVT_LIST_ITEM_ACTIVATED(LIST_CTRL, CGameListCtrl::OnActivated)
EVT_LIST_COL_END_DRAG(LIST_CTRL, CGameListCtrl::OnColEndDrag)
EVT_MENU(IDM_EDITPATCHFILE, CGameListCtrl::OnEditPatchFile)
EVT_MENU(IDM_OPENCONTAININGFOLDER, CGameListCtrl::OnOpenContainingFolder)
EVT_MENU(IDM_SETDEFAULTGCM, CGameListCtrl::OnSetDefaultGCM)
END_EVENT_TABLE()


Expand Down Expand Up @@ -340,6 +341,7 @@ CGameListCtrl::OnRightClick(wxMouseEvent& event)
std::string menu_text = StringFromFormat("Edit &patch file: %s.ini", unique_id.c_str());
popupMenu.Append(IDM_EDITPATCHFILE, wxString::FromAscii(menu_text.c_str())); //Pretty much everything in wxwidgets is a wxString, try to convert to those first!
popupMenu.Append(IDM_OPENCONTAININGFOLDER, wxString::FromAscii("Open &containing folder"));
popupMenu.Append(IDM_SETDEFAULTGCM, wxString::FromAscii("Set as &default ISO"));
PopupMenu(&popupMenu);
}
}
Expand Down Expand Up @@ -383,6 +385,15 @@ CGameListCtrl::OnOpenContainingFolder(wxCommandEvent& WXUNUSED (event)) {
File::Explore(path);
}

void
CGameListCtrl::OnSetDefaultGCM(wxCommandEvent& WXUNUSED (event)) {
const CISOFile *iso = GetSelectedISO();
if (!iso)
return;
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM = iso->GetFileName();
SConfig::GetInstance().SaveSettings();
}

void
CGameListCtrl::OnEditPatchFile(wxCommandEvent& WXUNUSED (event))
{
Expand Down
1 change: 1 addition & 0 deletions Source/Core/DolphinWX/Src/GameListCtrl.h
Expand Up @@ -67,6 +67,7 @@ class CGameListCtrl : public wxListCtrl
void OnSize(wxSizeEvent& event);
void OnEditPatchFile(wxCommandEvent& event);
void OnOpenContainingFolder(wxCommandEvent& event);
void OnSetDefaultGCM(wxCommandEvent& event);

virtual bool MSWDrawSubItem(wxPaintDC& rPaintDC, int item, int subitem);

Expand Down
2 changes: 2 additions & 0 deletions Source/Core/DolphinWX/Src/Globals.h
Expand Up @@ -43,11 +43,13 @@ enum
IDM_LOADSLOT9,
IDM_LOADSLOT10,
IDM_PLAY,
IDM_PAUSE,
IDM_STOP,
IDM_BROWSE,
IDM_MEMCARD,
IDM_EDITPATCHFILE,
IDM_OPENCONTAININGFOLDER,
IDM_SETDEFAULTGCM,
IDM_PLUGIN_OPTIONS,
IDM_CONFIG_GFX_PLUGIN,
IDM_CONFIG_DSP_PLUGIN,
Expand Down
20 changes: 15 additions & 5 deletions Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp
Expand Up @@ -33,6 +33,7 @@ BEGIN_EVENT_TABLE(ConfigDialog,wxDialog)
EVT_CHECKBOX(ID_FORCEFILTERING,ConfigDialog::ForceFilteringCheck)
EVT_CHECKBOX(ID_FORCEANISOTROPY,ConfigDialog::ForceAnisotropyCheck)
EVT_CHECKBOX(ID_WIREFRAME,ConfigDialog::WireframeCheck)
EVT_CHECKBOX(ID_SHOWFPS,ConfigDialog::ShowFPSCheck)
EVT_CHECKBOX(ID_STATISTICS,ConfigDialog::OverlayCheck)
EVT_CHECKBOX(ID_SHADERERRORS,ConfigDialog::ShowShaderErrorsCheck)
EVT_CHECKBOX(ID_TEXFMTOVERLAY,ConfigDialog::TexFmtOverlayChange)
Expand Down Expand Up @@ -113,6 +114,9 @@ void ConfigDialog::CreateGUIControls()
m_ForceFiltering->SetValue(g_Config.bForceFiltering);

//page3
m_ShowFPS = new wxCheckBox(m_PageAdvanced, ID_SHOWFPS, wxT("Overlay FPS"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_ShowFPS->SetValue(g_Config.bShowFPS);

m_Statistics = new wxCheckBox(m_PageAdvanced, ID_STATISTICS, wxT("Overlay some statistics"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_Statistics->SetValue(g_Config.bOverlayStats);

Expand Down Expand Up @@ -170,11 +174,12 @@ void ConfigDialog::CreateGUIControls()
sPage3->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
sPage3->Add(m_Wireframe, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_ShaderErrors, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_Statistics, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_TexFmtOverlay, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_TexFmtCenter, wxGBPosition(3, 1), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_DumpTextures, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_TexturePath, wxGBPosition(4, 1), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_ShowFPS, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_Statistics, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_TexFmtOverlay, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_TexFmtCenter, wxGBPosition(4, 1), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_DumpTextures, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_TexturePath, wxGBPosition(5, 1), wxGBSpan(1, 1), wxALL, 5);
m_PageAdvanced->SetSizer(sPage3);
sPage3->Layout();

Expand Down Expand Up @@ -261,6 +266,11 @@ void ConfigDialog::ShowShaderErrorsCheck(wxCommandEvent& event)
g_Config.bShowShaderErrors = m_ShaderErrors->IsChecked();
}

void ConfigDialog::ShowFPSCheck(wxCommandEvent& event)
{
g_Config.bShowFPS = m_ShowFPS->IsChecked();
}

void ConfigDialog::OverlayCheck(wxCommandEvent& event)
{
g_Config.bOverlayStats = m_Statistics->IsChecked();
Expand Down
3 changes: 3 additions & 0 deletions Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h
Expand Up @@ -55,6 +55,7 @@ class ConfigDialog : public wxDialog
void ForceFilteringCheck(wxCommandEvent& event);
void ForceAnisotropyCheck(wxCommandEvent& event);
void WireframeCheck(wxCommandEvent& event);
void ShowFPSCheck(wxCommandEvent& event);
void OverlayCheck(wxCommandEvent& event);
void ShowShaderErrorsCheck(wxCommandEvent& event);
void TexFmtOverlayChange(wxCommandEvent& event);
Expand All @@ -70,6 +71,7 @@ class ConfigDialog : public wxDialog
wxCheckBox *m_TexFmtCenter;
wxCheckBox *m_TexFmtOverlay;
wxCheckBox *m_Statistics;
wxCheckBox *m_ShowFPS;
wxCheckBox *m_ShaderErrors;
wxCheckBox *m_Wireframe;
wxCheckBox *m_ForceAnisotropy;
Expand All @@ -95,6 +97,7 @@ class ConfigDialog : public wxDialog
ID_SHADERERRORS,
ID_TEXFMTCENTER,
ID_TEXFMTOVERLAY,
ID_SHOWFPS,
ID_STATISTICS,
ID_DUMPTEXTURES,
ID_WIREFRAME,
Expand Down
18 changes: 9 additions & 9 deletions Source/Plugins/Plugin_VideoOGL/Src/Globals.cpp
Expand Up @@ -52,16 +52,17 @@ void Config::Load()
IniFile iniFile;
iniFile.Load("gfx_opengl.ini");
iniFile.Get("Hardware", "Adapter", &iAdapter, 0);
if (iAdapter == -1)
iAdapter = 0;
iniFile.Get("Hardware", "WindowedRes", &temp, 0);
strcpy(iWindowedRes, temp.c_str());
iniFile.Get("Hardware", "FullscreenRes", &temp, 0);
strcpy(iFSResolution, temp.c_str());
iniFile.Get("Hardware", "Fullscreen", &bFullscreen, 0);
iniFile.Get("Hardware", "RenderToMainframe", &renderToMainframe, 0);
if (iAdapter == -1)
iAdapter = 0;

iniFile.Get("Settings", "OverlayStats", &bOverlayStats, false);
iniFile.Get("Settings", "ShowFPS", &bShowFPS, false);
iniFile.Get("Settings", "OverlayStats", &bOverlayStats, false);
iniFile.Get("Settings", "Postprocess", &iPostprocessEffect, 0);
iniFile.Get("Settings", "DLOptimize", &iCompileDLsLevel, 0);
iniFile.Get("Settings", "DumpTextures", &bDumpTextures, 0);
Expand All @@ -83,8 +84,7 @@ void Config::Load()

iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0);
iniFile.Get("Enhancements", "ForceMaxAniso", &bForceMaxAniso, 0);
iniFile.Get("Enhancements", "StretchToFit", &bStretchToFit, false);
iniFile.Get("Enhancements", "ShowFPS", &bShowFPS, false);
iniFile.Get("Enhancements", "StretchToFit", &bStretchToFit, false);
}

void Config::Save()
Expand All @@ -97,21 +97,21 @@ void Config::Save()
iniFile.Set("Hardware", "Fullscreen", bFullscreen);
iniFile.Set("Hardware", "RenderToMainframe", renderToMainframe);

iniFile.Set("Settings", "OverlayStats", bOverlayStats);
iniFile.Set("Settings", "ShowFPS", bShowFPS);
iniFile.Set("Settings", "OverlayStats", bOverlayStats);
iniFile.Set("Settings", "Postprocess", iPostprocessEffect);
iniFile.Set("Settings", "DLOptimize", iCompileDLsLevel);
iniFile.Set("Settings", "DumpTextures", bDumpTextures);
iniFile.Set("Settings", "ShowShaderErrors", bShowShaderErrors);
iniFile.Set("Settings", "Multisample", iMultisampleMode);
iniFile.Set("Settings", "TexDumpPath", texDumpPath);

iniFile.Set("Settings", "TexFmtOverlayEnable", bTexFmtOverlayEnable);
iniFile.Set("Settings", "TexFmtOverlayCenter", bTexFmtOverlayCenter);

iniFile.Set("Enhancements", "ForceFiltering", bForceFiltering);
iniFile.Set("Enhancements", "ForceMaxAniso", bForceMaxAniso);
iniFile.Set("Enhancements", "StretchToFit", bStretchToFit);
iniFile.Set("Enhancements", "ShowFPS", bShowFPS);
iniFile.Set("Enhancements", "StretchToFit", bStretchToFit);

iniFile.Save("gfx_opengl.ini");
}

Expand Down

0 comments on commit 38ff375

Please sign in to comment.