added overlay that displays texture formats (thanks to gigaherz!)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@139 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
94a5ab087a
commit
a44e94a594
File diff suppressed because it is too large
Load Diff
|
@ -76,4 +76,6 @@ enum PC_TexFormat
|
||||||
|
|
||||||
PC_TexFormat TexDecoder_Decode(u8 *dst, u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt);
|
PC_TexFormat TexDecoder_Decode(u8 *dst, u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt);
|
||||||
|
|
||||||
#endif
|
void TexDecoder_SetTexFmtOverlayOptions(bool enable, bool center);
|
||||||
|
|
||||||
|
#endif
|
|
@ -9,6 +9,8 @@
|
||||||
|
|
||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
|
|
||||||
|
#include "TextureCache.h"
|
||||||
|
|
||||||
#define NUMWNDRES 6
|
#define NUMWNDRES 6
|
||||||
int g_Res[NUMWNDRES][2] =
|
int g_Res[NUMWNDRES][2] =
|
||||||
{
|
{
|
||||||
|
@ -104,7 +106,10 @@ struct TabAdvanced : public W32Util::Tab
|
||||||
Button_SetCheck(GetDlgItem(hDlg,IDC_WIREFRAME), g_Config.bWireFrame);
|
Button_SetCheck(GetDlgItem(hDlg,IDC_WIREFRAME), g_Config.bWireFrame);
|
||||||
Button_SetCheck(GetDlgItem(hDlg,IDC_TEXDUMP), g_Config.bDumpTextures);
|
Button_SetCheck(GetDlgItem(hDlg,IDC_TEXDUMP), g_Config.bDumpTextures);
|
||||||
Button_SetCheck(GetDlgItem(hDlg,IDC_SHOWSHADERERRORS), g_Config.bShowShaderErrors);
|
Button_SetCheck(GetDlgItem(hDlg,IDC_SHOWSHADERERRORS), g_Config.bShowShaderErrors);
|
||||||
|
|
||||||
|
Button_SetCheck(GetDlgItem(hDlg,IDC_TEXFMT_OVERLAY), g_Config.bTexFmtOverlayEnable);
|
||||||
|
Button_SetCheck(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), g_Config.bTexFmtOverlayCenter);
|
||||||
|
|
||||||
SetWindowText(GetDlgItem(hDlg,IDC_TEXDUMPPATH),g_Config.texDumpPath.c_str());
|
SetWindowText(GetDlgItem(hDlg,IDC_TEXDUMPPATH),g_Config.texDumpPath.c_str());
|
||||||
Edit_LimitText(GetDlgItem(hDlg,IDC_TEXDUMPPATH),255);
|
Edit_LimitText(GetDlgItem(hDlg,IDC_TEXDUMPPATH),255);
|
||||||
}
|
}
|
||||||
|
@ -124,6 +129,9 @@ struct TabAdvanced : public W32Util::Tab
|
||||||
}
|
}
|
||||||
void Apply(HWND hDlg)
|
void Apply(HWND hDlg)
|
||||||
{
|
{
|
||||||
|
g_Config.bTexFmtOverlayEnable = Button_GetCheck(GetDlgItem(hDlg,IDC_TEXFMT_OVERLAY)) ? true : false;
|
||||||
|
g_Config.bTexFmtOverlayCenter = Button_GetCheck(GetDlgItem(hDlg,IDC_TEXFMT_CENTER)) ? true : false;
|
||||||
|
|
||||||
g_Config.bOverlayStats = Button_GetCheck(GetDlgItem(hDlg,IDC_OVERLAYSTATS)) ? true : false;
|
g_Config.bOverlayStats = Button_GetCheck(GetDlgItem(hDlg,IDC_OVERLAYSTATS)) ? true : false;
|
||||||
g_Config.bWireFrame = Button_GetCheck(GetDlgItem(hDlg,IDC_WIREFRAME)) ? true : false;
|
g_Config.bWireFrame = Button_GetCheck(GetDlgItem(hDlg,IDC_WIREFRAME)) ? true : false;
|
||||||
g_Config.bDumpTextures = Button_GetCheck(GetDlgItem(hDlg,IDC_TEXDUMP)) ? true : false;
|
g_Config.bDumpTextures = Button_GetCheck(GetDlgItem(hDlg,IDC_TEXDUMP)) ? true : false;
|
||||||
|
@ -195,6 +203,9 @@ struct TabEnhancements : public W32Util::Tab
|
||||||
|
|
||||||
void DlgSettings_Show(HINSTANCE hInstance, HWND _hParent)
|
void DlgSettings_Show(HINSTANCE hInstance, HWND _hParent)
|
||||||
{
|
{
|
||||||
|
bool tfoe = g_Config.bTexFmtOverlayEnable;
|
||||||
|
bool tfoc = g_Config.bTexFmtOverlayCenter;
|
||||||
|
|
||||||
g_Config.Load();
|
g_Config.Load();
|
||||||
W32Util::PropSheet sheet;
|
W32Util::PropSheet sheet;
|
||||||
sheet.Add(new TabDirect3D,(LPCTSTR)IDD_SETTINGS,"Direct3D");
|
sheet.Add(new TabDirect3D,(LPCTSTR)IDD_SETTINGS,"Direct3D");
|
||||||
|
@ -203,4 +214,10 @@ void DlgSettings_Show(HINSTANCE hInstance, HWND _hParent)
|
||||||
//sheet.Add(new TabDebug,(LPCTSTR)IDD_DEBUGGER,"Debugger");
|
//sheet.Add(new TabDebug,(LPCTSTR)IDD_DEBUGGER,"Debugger");
|
||||||
sheet.Show(hInstance,_hParent,"Graphics Plugin");
|
sheet.Show(hInstance,_hParent,"Graphics Plugin");
|
||||||
g_Config.Save();
|
g_Config.Save();
|
||||||
|
|
||||||
|
if(( tfoe != g_Config.bTexFmtOverlayEnable) ||
|
||||||
|
((g_Config.bTexFmtOverlayEnable) && ( tfoc != g_Config.bTexFmtOverlayCenter)))
|
||||||
|
{
|
||||||
|
TextureCache::Invalidate();
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -27,9 +27,13 @@ void Config::Load()
|
||||||
iniFile.Get("Settings", "ShowShaderErrors", &bShowShaderErrors, 0);
|
iniFile.Get("Settings", "ShowShaderErrors", &bShowShaderErrors, 0);
|
||||||
iniFile.Get("Settings", "Multisample", &iMultisampleMode, 0);
|
iniFile.Get("Settings", "Multisample", &iMultisampleMode, 0);
|
||||||
iniFile.Get("Settings", "TexDumpPath", &texDumpPath, 0);
|
iniFile.Get("Settings", "TexDumpPath", &texDumpPath, 0);
|
||||||
|
|
||||||
|
iniFile.Get("Settings", "TexFmtOverlayEnable", &bTexFmtOverlayEnable, 0);
|
||||||
|
iniFile.Get("Settings", "TexFmtOverlayCenter", &bTexFmtOverlayCenter, 0);
|
||||||
|
|
||||||
iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0);
|
iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0);
|
||||||
iniFile.Get("Enhancements", "ForceMaxAniso", &bForceMaxAniso, 0);
|
iniFile.Get("Enhancements", "ForceMaxAniso", &bForceMaxAniso, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::Save()
|
void Config::Save()
|
||||||
|
@ -52,6 +56,9 @@ void Config::Save()
|
||||||
iniFile.Set("Settings", "Multisample", iMultisampleMode);
|
iniFile.Set("Settings", "Multisample", iMultisampleMode);
|
||||||
iniFile.Set("Settings", "TexDumpPath", texDumpPath);
|
iniFile.Set("Settings", "TexDumpPath", texDumpPath);
|
||||||
|
|
||||||
|
iniFile.Set("Settings", "TexFmtOverlayEnable", bTexFmtOverlayEnable);
|
||||||
|
iniFile.Set("Settings", "TexFmtOverlayCenter", bTexFmtOverlayCenter);
|
||||||
|
|
||||||
iniFile.Set("Enhancements", "ForceFiltering", bForceFiltering);
|
iniFile.Set("Enhancements", "ForceFiltering", bForceFiltering);
|
||||||
iniFile.Set("Enhancements", "ForceMaxAniso", bForceMaxAniso);
|
iniFile.Set("Enhancements", "ForceMaxAniso", bForceMaxAniso);
|
||||||
iniFile.Save("gfx_dx9.ini");
|
iniFile.Save("gfx_dx9.ini");
|
||||||
|
|
|
@ -39,6 +39,9 @@ struct Config
|
||||||
char psProfile[16];
|
char psProfile[16];
|
||||||
char vsProfile[16];
|
char vsProfile[16];
|
||||||
|
|
||||||
|
bool bTexFmtOverlayEnable;
|
||||||
|
bool bTexFmtOverlayCenter;
|
||||||
|
|
||||||
std::string texDumpPath;
|
std::string texDumpPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ void TextureCache::TCacheEntry::Destroy()
|
||||||
void TextureCache::Init()
|
void TextureCache::Init()
|
||||||
{
|
{
|
||||||
temp = (u8*)VirtualAlloc(0,TEMP_SIZE,MEM_COMMIT,PAGE_READWRITE);
|
temp = (u8*)VirtualAlloc(0,TEMP_SIZE,MEM_COMMIT,PAGE_READWRITE);
|
||||||
|
TexDecoder_SetTexFmtOverlayOptions(g_Config.bTexFmtOverlayEnable,g_Config.bTexFmtOverlayCenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextureCache::Invalidate()
|
void TextureCache::Invalidate()
|
||||||
|
@ -37,6 +38,7 @@ void TextureCache::Invalidate()
|
||||||
for (;iter!=textures.end();iter++)
|
for (;iter!=textures.end();iter++)
|
||||||
iter->second.Destroy();
|
iter->second.Destroy();
|
||||||
textures.clear();
|
textures.clear();
|
||||||
|
TexDecoder_SetTexFmtOverlayOptions(g_Config.bTexFmtOverlayEnable,g_Config.bTexFmtOverlayCenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextureCache::Shutdown()
|
void TextureCache::Shutdown()
|
||||||
|
|
|
@ -51,6 +51,9 @@
|
||||||
#define IDC_FORCEFILTERING 1030
|
#define IDC_FORCEFILTERING 1030
|
||||||
#define IDC_BROWSETEXDUMPPATH 1031
|
#define IDC_BROWSETEXDUMPPATH 1031
|
||||||
#define IDC_SHOWSHADERERRORS 1033
|
#define IDC_SHOWSHADERERRORS 1033
|
||||||
|
#define IDC_CHECK3 1034
|
||||||
|
#define IDC_TEXFMT_CENTER 1034
|
||||||
|
#define IDC_TEXFMT_OVERLAY 1035
|
||||||
|
|
||||||
// Next default values for new objects
|
// Next default values for new objects
|
||||||
//
|
//
|
||||||
|
@ -58,7 +61,7 @@
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 106
|
#define _APS_NEXT_RESOURCE_VALUE 106
|
||||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1034
|
#define _APS_NEXT_CONTROL_VALUE 1036
|
||||||
#define _APS_NEXT_SYMED_VALUE 101
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -107,7 +107,7 @@ BEGIN
|
||||||
CONTROL "",IDC_REGISTERSELECT,"SysTabControl32",TCS_BUTTONS,80,52,145,13
|
CONTROL "",IDC_REGISTERSELECT,"SysTabControl32",TCS_BUTTONS,80,52,145,13
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_ADVANCED DIALOGEX 0, 0, 206, 144
|
IDD_ADVANCED DIALOGEX 0, 0, 206, 175
|
||||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
|
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
|
||||||
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
|
@ -122,6 +122,9 @@ BEGIN
|
||||||
PUSHBUTTON "...",IDC_BROWSETEXDUMPPATH,176,116,14,13
|
PUSHBUTTON "...",IDC_BROWSETEXDUMPPATH,176,116,14,13
|
||||||
CONTROL "Show s&hader compilation errors",IDC_SHOWSHADERERRORS,
|
CONTROL "Show s&hader compilation errors",IDC_SHOWSHADERERRORS,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,43,127,9
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,43,127,9
|
||||||
|
GROUPBOX "TexFmt Overlay",IDC_STATIC,7,138,192,30
|
||||||
|
CONTROL "Enable Overlay",IDC_TEXFMT_OVERLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,150,74,10
|
||||||
|
CONTROL "Centered",IDC_TEXFMT_CENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,150,82,10
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_ENHANCEMENTS DIALOGEX 0, 0, 207, 175
|
IDD_ENHANCEMENTS DIALOGEX 0, 0, 207, 175
|
||||||
|
@ -185,8 +188,10 @@ BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 199
|
RIGHTMARGIN, 199
|
||||||
VERTGUIDE, 14
|
VERTGUIDE, 14
|
||||||
|
VERTGUIDE, 110
|
||||||
TOPMARGIN, 7
|
TOPMARGIN, 7
|
||||||
BOTTOMMARGIN, 137
|
BOTTOMMARGIN, 168
|
||||||
|
HORZGUIDE, 150
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_ENHANCEMENTS, DIALOG
|
IDD_ENHANCEMENTS, DIALOG
|
||||||
|
@ -215,4 +220,3 @@ END
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
#endif // not APSTUDIO_INVOKED
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
|
@ -19,10 +19,11 @@
|
||||||
#include "ConfigDlg.h"
|
#include "ConfigDlg.h"
|
||||||
#include "../Globals.h"
|
#include "../Globals.h"
|
||||||
|
|
||||||
|
#include "TextureMngr.h"
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(ConfigDialog,wxDialog)
|
BEGIN_EVENT_TABLE(ConfigDialog,wxDialog)
|
||||||
EVT_CLOSE(ConfigDialog::OnClose)
|
EVT_CLOSE(ConfigDialog::OnClose)
|
||||||
EVT_BUTTON(ID_CLOSE,ConfigDialog::OKClick)
|
EVT_BUTTON(ID_CANCEL,ConfigDialog::OKClick)
|
||||||
EVT_BUTTON(ID_APPLY,ConfigDialog::OKClick)
|
|
||||||
EVT_BUTTON(ID_OK,ConfigDialog::OKClick)
|
EVT_BUTTON(ID_OK,ConfigDialog::OKClick)
|
||||||
EVT_CHECKBOX(ID_FULLSCREEN,ConfigDialog::FullScreenCheck)
|
EVT_CHECKBOX(ID_FULLSCREEN,ConfigDialog::FullScreenCheck)
|
||||||
EVT_CHECKBOX(ID_RENDERTOMAINWINDOW,ConfigDialog::RenderMainCheck)
|
EVT_CHECKBOX(ID_RENDERTOMAINWINDOW,ConfigDialog::RenderMainCheck)
|
||||||
|
@ -33,6 +34,8 @@ BEGIN_EVENT_TABLE(ConfigDialog,wxDialog)
|
||||||
EVT_CHECKBOX(ID_WIREFRAME,ConfigDialog::WireframeCheck)
|
EVT_CHECKBOX(ID_WIREFRAME,ConfigDialog::WireframeCheck)
|
||||||
EVT_CHECKBOX(ID_STATISTICS,ConfigDialog::OverlayCheck)
|
EVT_CHECKBOX(ID_STATISTICS,ConfigDialog::OverlayCheck)
|
||||||
EVT_CHECKBOX(ID_SHADERERRORS,ConfigDialog::ShowShaderErrorsCheck)
|
EVT_CHECKBOX(ID_SHADERERRORS,ConfigDialog::ShowShaderErrorsCheck)
|
||||||
|
EVT_CHECKBOX(ID_TEXFMTOVERLAY,ConfigDialog::TexFmtOverlayChange)
|
||||||
|
EVT_CHECKBOX(ID_TEXFMTCENTER,ConfigDialog::TexFmtOverlayChange)
|
||||||
EVT_CHECKBOX(ID_DUMPTEXTURES,ConfigDialog::DumpTexturesChange)
|
EVT_CHECKBOX(ID_DUMPTEXTURES,ConfigDialog::DumpTexturesChange)
|
||||||
EVT_DIRPICKER_CHANGED(ID_TEXTUREPATH,ConfigDialog::TexturePathChange)
|
EVT_DIRPICKER_CHANGED(ID_TEXTUREPATH,ConfigDialog::TexturePathChange)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
@ -41,7 +44,6 @@ ConfigDialog::ConfigDialog(wxWindow *parent, wxWindowID id, const wxString &titl
|
||||||
: wxDialog(parent, id, title, position, size, style)
|
: wxDialog(parent, id, title, position, size, style)
|
||||||
{
|
{
|
||||||
g_Config.Load();
|
g_Config.Load();
|
||||||
|
|
||||||
CreateGUIControls();
|
CreateGUIControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,17 +65,15 @@ void ConfigDialog::CreateGUIControls()
|
||||||
m_Notebook->AddPage(m_PageAdvanced, wxT("Advanced"));
|
m_Notebook->AddPage(m_PageAdvanced, wxT("Advanced"));
|
||||||
|
|
||||||
//buttons
|
//buttons
|
||||||
m_Close = new wxButton(this, ID_CLOSE, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
m_OK = new wxButton(this, ID_OK, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
m_Apply = new wxButton(this, ID_APPLY, wxT("Apply"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
m_Cancel = new wxButton(this, ID_CANCEL, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
m_OK = new wxButton(this, ID_OK, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
|
||||||
|
|
||||||
//put notebook and buttons in sizers
|
//put notebook and buttons in sizers
|
||||||
wxBoxSizer* sButtons;
|
wxBoxSizer* sButtons;
|
||||||
sButtons = new wxBoxSizer(wxHORIZONTAL);
|
sButtons = new wxBoxSizer(wxHORIZONTAL);
|
||||||
sButtons->Add(0, 0, 1, wxEXPAND, 5);
|
sButtons->Add(0, 0, 1, wxEXPAND, 5);
|
||||||
sButtons->Add(m_Close, 0, wxALL, 5);
|
|
||||||
sButtons->Add(m_Apply, 0, wxALL, 5);
|
|
||||||
sButtons->Add(m_OK, 0, wxALL, 5);
|
sButtons->Add(m_OK, 0, wxALL, 5);
|
||||||
|
sButtons->Add(m_Cancel, 0, wxALL, 5);
|
||||||
|
|
||||||
wxBoxSizer* sMain;
|
wxBoxSizer* sMain;
|
||||||
sMain = new wxBoxSizer(wxVERTICAL);
|
sMain = new wxBoxSizer(wxVERTICAL);
|
||||||
|
@ -106,6 +106,12 @@ void ConfigDialog::CreateGUIControls()
|
||||||
m_Statistics = new wxCheckBox(m_PageAdvanced, ID_STATISTICS, wxT("Overlay some statistics"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
m_Statistics = new wxCheckBox(m_PageAdvanced, ID_STATISTICS, wxT("Overlay some statistics"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
m_Statistics->SetValue(g_Config.bOverlayStats);
|
m_Statistics->SetValue(g_Config.bOverlayStats);
|
||||||
|
|
||||||
|
m_TexFmtOverlay = new wxCheckBox(m_PageAdvanced, ID_TEXFMTOVERLAY, wxT("Overlay texture format"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
|
m_TexFmtOverlay->SetValue(g_Config.bTexFmtOverlayEnable);
|
||||||
|
m_TexFmtCenter = new wxCheckBox(m_PageAdvanced, ID_TEXFMTCENTER, wxT("centered"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
|
m_TexFmtCenter->SetValue(g_Config.bTexFmtOverlayCenter);
|
||||||
|
m_TexFmtCenter->Enable(m_TexFmtOverlay->IsChecked());
|
||||||
|
|
||||||
m_DumpTextures = new wxCheckBox(m_PageAdvanced, ID_DUMPTEXTURES, wxT("Dump textures to:"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
m_DumpTextures = new wxCheckBox(m_PageAdvanced, ID_DUMPTEXTURES, wxT("Dump textures to:"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
m_DumpTextures->SetValue(g_Config.bDumpTextures);
|
m_DumpTextures->SetValue(g_Config.bDumpTextures);
|
||||||
m_TexturePath = new wxDirPickerCtrl(m_PageAdvanced, ID_TEXTUREPATH, wxEmptyString, wxT("Choose a directory to store texture dumps:"), wxDefaultPosition, wxDefaultSize, wxDIRP_USE_TEXTCTRL);
|
m_TexturePath = new wxDirPickerCtrl(m_PageAdvanced, ID_TEXTUREPATH, wxEmptyString, wxT("Choose a directory to store texture dumps:"), wxDefaultPosition, wxDefaultSize, wxDIRP_USE_TEXTCTRL);
|
||||||
|
@ -130,7 +136,7 @@ void ConfigDialog::CreateGUIControls()
|
||||||
//m_ShaderErrors->SetValue(g_Config.bShowShaderErrors);
|
//m_ShaderErrors->SetValue(g_Config.bShowShaderErrors);
|
||||||
m_ShaderErrors->Enable(false);
|
m_ShaderErrors->Enable(false);
|
||||||
|
|
||||||
//Put options in sizers in the notebook
|
//Put options in sizers within the notebook
|
||||||
wxGridBagSizer* sPage1;
|
wxGridBagSizer* sPage1;
|
||||||
sPage1 = new wxGridBagSizer(0, 0);
|
sPage1 = new wxGridBagSizer(0, 0);
|
||||||
sPage1->SetFlexibleDirection(wxBOTH);
|
sPage1->SetFlexibleDirection(wxBOTH);
|
||||||
|
@ -153,13 +159,17 @@ void ConfigDialog::CreateGUIControls()
|
||||||
m_PageEnhancements->SetSizer(sPage2);
|
m_PageEnhancements->SetSizer(sPage2);
|
||||||
sPage2->Layout();
|
sPage2->Layout();
|
||||||
|
|
||||||
wxBoxSizer* sPage3;
|
wxGridBagSizer* sPage3;
|
||||||
sPage3 = new wxBoxSizer(wxVERTICAL);
|
sPage3 = new wxGridBagSizer(0, 0);
|
||||||
sPage3->Add(m_Wireframe, 0, wxALL, 5);
|
sPage3->SetFlexibleDirection(wxBOTH);
|
||||||
sPage3->Add(m_Statistics, 0, wxALL, 5);
|
sPage3->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
|
||||||
sPage3->Add(m_ShaderErrors, 0, wxALL, 5);
|
sPage3->Add(m_Wireframe, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALL, 5);
|
||||||
sPage3->Add(m_DumpTextures, 0, wxALL, 5);
|
sPage3->Add(m_ShaderErrors, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 5);
|
||||||
sPage3->Add(m_TexturePath, 0, 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), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||||
|
sPage3->Add(m_TexturePath, wxGBPosition(4, 1), wxGBSpan(2, 1), wxALL, 5);
|
||||||
m_PageAdvanced->SetSizer(sPage3);
|
m_PageAdvanced->SetSizer(sPage3);
|
||||||
sPage3->Layout();
|
sPage3->Layout();
|
||||||
|
|
||||||
|
@ -169,23 +179,20 @@ void ConfigDialog::CreateGUIControls()
|
||||||
|
|
||||||
void ConfigDialog::OnClose(wxCloseEvent& event)
|
void ConfigDialog::OnClose(wxCloseEvent& event)
|
||||||
{
|
{
|
||||||
g_Config.Save();
|
|
||||||
EndModal(0);
|
EndModal(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigDialog::OKClick(wxCommandEvent& event)
|
void ConfigDialog::OKClick(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
if ((event.GetId() == ID_APPLY) ||
|
switch(event.GetId())
|
||||||
(event.GetId() == ID_OK))
|
|
||||||
{
|
{
|
||||||
|
case ID_CANCEL:
|
||||||
|
Close();
|
||||||
|
break;
|
||||||
|
case ID_OK:
|
||||||
g_Config.Save();
|
g_Config.Save();
|
||||||
}
|
Close();
|
||||||
|
break;
|
||||||
if ((event.GetId() == ID_CLOSE) ||
|
|
||||||
(event.GetId() == ID_OK))
|
|
||||||
{
|
|
||||||
Close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,18 +239,40 @@ void ConfigDialog::WireframeCheck(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
g_Config.bWireFrame = m_Wireframe->IsChecked();
|
g_Config.bWireFrame = m_Wireframe->IsChecked();
|
||||||
}
|
}
|
||||||
void ConfigDialog::OverlayCheck(wxCommandEvent& event)
|
|
||||||
{
|
|
||||||
g_Config.bOverlayStats = m_Statistics->IsChecked();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConfigDialog::ShowShaderErrorsCheck(wxCommandEvent& event)
|
void ConfigDialog::ShowShaderErrorsCheck(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
g_Config.bShowShaderErrors = m_ShaderErrors->IsChecked();
|
g_Config.bShowShaderErrors = m_ShaderErrors->IsChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigDialog::DumpTexturesChange(wxCommandEvent& event)
|
void ConfigDialog::OverlayCheck(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
|
g_Config.bOverlayStats = m_Statistics->IsChecked();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigDialog::TexFmtOverlayChange(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
switch(event.GetId())
|
||||||
|
{
|
||||||
|
case ID_TEXFMTOVERLAY:
|
||||||
|
|
||||||
|
g_Config.bTexFmtOverlayEnable = m_TexFmtOverlay->IsChecked();
|
||||||
|
m_TexFmtCenter->Enable(m_TexFmtOverlay->IsChecked());
|
||||||
|
TextureMngr::Invalidate();
|
||||||
|
if(!g_Config.bTexFmtOverlayEnable)
|
||||||
|
m_TexFmtCenter->SetValue(false);
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
break;
|
||||||
|
case ID_TEXFMTCENTER:
|
||||||
|
g_Config.bTexFmtOverlayCenter = m_TexFmtCenter->IsChecked();
|
||||||
|
TextureMngr::Invalidate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigDialog::DumpTexturesChange(wxCommandEvent& event)
|
||||||
|
{
|
||||||
m_TexturePath->Enable(m_DumpTextures->IsChecked());
|
m_TexturePath->Enable(m_DumpTextures->IsChecked());
|
||||||
g_Config.bDumpTextures = m_DumpTextures->IsChecked();
|
g_Config.bDumpTextures = m_DumpTextures->IsChecked();
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,18 +56,20 @@ class ConfigDialog : public wxDialog
|
||||||
void WireframeCheck(wxCommandEvent& event);
|
void WireframeCheck(wxCommandEvent& event);
|
||||||
void OverlayCheck(wxCommandEvent& event);
|
void OverlayCheck(wxCommandEvent& event);
|
||||||
void ShowShaderErrorsCheck(wxCommandEvent& event);
|
void ShowShaderErrorsCheck(wxCommandEvent& event);
|
||||||
|
void TexFmtOverlayChange(wxCommandEvent& event);
|
||||||
void DumpTexturesChange(wxCommandEvent& event);
|
void DumpTexturesChange(wxCommandEvent& event);
|
||||||
void TexturePathChange(wxFileDirPickerEvent& event);
|
void TexturePathChange(wxFileDirPickerEvent& event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
wxButton *m_Close;
|
wxButton *m_Cancel;
|
||||||
wxButton *m_Apply;
|
|
||||||
wxButton *m_OK;
|
wxButton *m_OK;
|
||||||
wxDirPickerCtrl *m_TexturePath;
|
wxDirPickerCtrl *m_TexturePath;
|
||||||
wxCheckBox *m_ShaderErrors;
|
|
||||||
wxCheckBox *m_Statistics;
|
|
||||||
wxCheckBox *m_DumpTextures;
|
wxCheckBox *m_DumpTextures;
|
||||||
|
wxCheckBox *m_TexFmtCenter;
|
||||||
|
wxCheckBox *m_TexFmtOverlay;
|
||||||
|
wxCheckBox *m_Statistics;
|
||||||
|
wxCheckBox *m_ShaderErrors;
|
||||||
wxCheckBox *m_Wireframe;
|
wxCheckBox *m_Wireframe;
|
||||||
wxCheckBox *m_ForceAnisotropy;
|
wxCheckBox *m_ForceAnisotropy;
|
||||||
wxCheckBox *m_ForceFiltering;
|
wxCheckBox *m_ForceFiltering;
|
||||||
|
@ -86,12 +88,12 @@ class ConfigDialog : public wxDialog
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
////GUI Enum Control ID Start
|
////GUI Enum Control ID Start
|
||||||
ID_CLOSE = 1030,
|
ID_CANCEL = 1030,
|
||||||
ID_APPLY = 1029,
|
|
||||||
ID_OK = 1028,
|
ID_OK = 1028,
|
||||||
ID_TEXTUREPATH = 1026,
|
ID_TEXTUREPATH = 1027,
|
||||||
ID_BROWSE = 1025,
|
ID_SHADERERRORS = 1026,
|
||||||
ID_SHADERERRORS = 1024,
|
ID_TEXFMTCENTER = 1025,
|
||||||
|
ID_TEXFMTOVERLAY = 1024,
|
||||||
ID_STATISTICS = 1023,
|
ID_STATISTICS = 1023,
|
||||||
ID_DUMPTEXTURES = 1022,
|
ID_DUMPTEXTURES = 1022,
|
||||||
ID_WIREFRAME = 1021,
|
ID_WIREFRAME = 1021,
|
||||||
|
|
|
@ -67,6 +67,9 @@ void Config::Load()
|
||||||
strncpy(texDumpPath, s.c_str(), sizeof(texDumpPath)-1);
|
strncpy(texDumpPath, s.c_str(), sizeof(texDumpPath)-1);
|
||||||
texDumpPath[sizeof(texDumpPath)-1] = 0;
|
texDumpPath[sizeof(texDumpPath)-1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iniFile.Get("Settings", "TexFmtOverlayEnable", &bTexFmtOverlayEnable, 0);
|
||||||
|
iniFile.Get("Settings", "TexFmtOverlayCenter", &bTexFmtOverlayCenter, 0);
|
||||||
|
|
||||||
iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0);
|
iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0);
|
||||||
iniFile.Get("Enhancements", "ForceMaxAniso", &bForceMaxAniso, 0);
|
iniFile.Get("Enhancements", "ForceMaxAniso", &bForceMaxAniso, 0);
|
||||||
|
@ -90,6 +93,9 @@ void Config::Save()
|
||||||
iniFile.Set("Settings", "Multisample", iMultisampleMode);
|
iniFile.Set("Settings", "Multisample", iMultisampleMode);
|
||||||
iniFile.Set("Settings", "TexDumpPath", texDumpPath);
|
iniFile.Set("Settings", "TexDumpPath", texDumpPath);
|
||||||
|
|
||||||
|
iniFile.Set("Settings", "TexFmtOverlayEnable", bTexFmtOverlayEnable);
|
||||||
|
iniFile.Set("Settings", "TexFmtOverlayCenter", bTexFmtOverlayCenter);
|
||||||
|
|
||||||
iniFile.Set("Enhancements", "ForceFiltering", bForceFiltering);
|
iniFile.Set("Enhancements", "ForceFiltering", bForceFiltering);
|
||||||
iniFile.Set("Enhancements", "ForceMaxAniso", bForceMaxAniso);
|
iniFile.Set("Enhancements", "ForceMaxAniso", bForceMaxAniso);
|
||||||
iniFile.Save("gfx_opengl.ini");
|
iniFile.Save("gfx_opengl.ini");
|
||||||
|
@ -651,4 +657,4 @@ void SysMessage(const char *fmt, ...)
|
||||||
|
|
||||||
if (msg[strlen(msg)-1] == '\n') msg[strlen(msg)-1] = 0;
|
if (msg[strlen(msg)-1] == '\n') msg[strlen(msg)-1] = 0;
|
||||||
wxMessageBox(wxString::FromAscii(msg));
|
wxMessageBox(wxString::FromAscii(msg));
|
||||||
}
|
}
|
|
@ -176,6 +176,9 @@ struct Config
|
||||||
char psProfile[16];
|
char psProfile[16];
|
||||||
char vsProfile[16];
|
char vsProfile[16];
|
||||||
|
|
||||||
|
bool bTexFmtOverlayEnable;
|
||||||
|
bool bTexFmtOverlayCenter;
|
||||||
|
|
||||||
int iSaveTargetId;
|
int iSaveTargetId;
|
||||||
|
|
||||||
char texDumpPath[280];
|
char texDumpPath[280];
|
||||||
|
@ -342,4 +345,4 @@ public:
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -87,6 +87,7 @@ void TextureMngr::Init()
|
||||||
{
|
{
|
||||||
temp = (u8*)AllocateMemoryPages(TEMP_SIZE);
|
temp = (u8*)AllocateMemoryPages(TEMP_SIZE);
|
||||||
nTex2DEnabled = nTexRECTEnabled = 0;
|
nTex2DEnabled = nTexRECTEnabled = 0;
|
||||||
|
TexDecoder_SetTexFmtOverlayOptions(g_Config.bTexFmtOverlayEnable,g_Config.bTexFmtOverlayCenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextureMngr::Invalidate()
|
void TextureMngr::Invalidate()
|
||||||
|
@ -95,6 +96,7 @@ void TextureMngr::Invalidate()
|
||||||
for (;iter!=textures.end();iter++)
|
for (;iter!=textures.end();iter++)
|
||||||
iter->second.Destroy();
|
iter->second.Destroy();
|
||||||
textures.clear();
|
textures.clear();
|
||||||
|
TexDecoder_SetTexFmtOverlayOptions(g_Config.bTexFmtOverlayEnable,g_Config.bTexFmtOverlayCenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextureMngr::Shutdown()
|
void TextureMngr::Shutdown()
|
||||||
|
@ -585,4 +587,4 @@ void TextureMngr::DisableStage(int stage)
|
||||||
if( !bset ) glActiveTexture(GL_TEXTURE0+stage);
|
if( !bset ) glActiveTexture(GL_TEXTURE0+stage);
|
||||||
glDisable(GL_TEXTURE_RECTANGLE_NV);
|
glDisable(GL_TEXTURE_RECTANGLE_NV);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue