Skip to content

Commit

Permalink
GSdx: Minor update to GS Settings Dialog
Browse files Browse the repository at this point in the history
Update a few parts of the GS Shader dialog to reflect the improvements
from the OSD dialog code.
  • Loading branch information
FlatOutPS2 authored and turtleli committed Jan 10, 2017
1 parent da57014 commit 6a7c38f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 28 deletions.
48 changes: 23 additions & 25 deletions plugins/GSdx/GSSettingsDlg.cpp
Expand Up @@ -486,9 +486,9 @@ void GSShaderDlg::OnInit()


//Shade Boost //Shade Boost
CheckDlgButton(m_hWnd, IDC_SHADEBOOST, theApp.GetConfigB("ShadeBoost")); CheckDlgButton(m_hWnd, IDC_SHADEBOOST, theApp.GetConfigB("ShadeBoost"));
contrast = theApp.GetConfigI("ShadeBoost_Contrast"); m_contrast = theApp.GetConfigI("ShadeBoost_Contrast");
brightness = theApp.GetConfigI("ShadeBoost_Brightness"); m_brightness = theApp.GetConfigI("ShadeBoost_Brightness");
saturation = theApp.GetConfigI("ShadeBoost_Saturation"); m_saturation = theApp.GetConfigI("ShadeBoost_Saturation");


// External FX shader // External FX shader
CheckDlgButton(m_hWnd, IDC_SHADER_FX, theApp.GetConfigB("shaderfx")); CheckDlgButton(m_hWnd, IDC_SHADER_FX, theApp.GetConfigB("shaderfx"));
Expand All @@ -511,17 +511,17 @@ void GSShaderDlg::UpdateControls()
SendMessage(GetDlgItem(m_hWnd, IDC_BRIGHTNESS_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(0, 100)); SendMessage(GetDlgItem(m_hWnd, IDC_BRIGHTNESS_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(0, 100));
SendMessage(GetDlgItem(m_hWnd, IDC_CONTRAST_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(0, 100)); SendMessage(GetDlgItem(m_hWnd, IDC_CONTRAST_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(0, 100));


SendMessage(GetDlgItem(m_hWnd, IDC_SATURATION_SLIDER), TBM_SETPOS, TRUE, saturation); SendMessage(GetDlgItem(m_hWnd, IDC_SATURATION_SLIDER), TBM_SETPOS, TRUE, m_saturation);
SendMessage(GetDlgItem(m_hWnd, IDC_BRIGHTNESS_SLIDER), TBM_SETPOS, TRUE, brightness); SendMessage(GetDlgItem(m_hWnd, IDC_BRIGHTNESS_SLIDER), TBM_SETPOS, TRUE, m_brightness);
SendMessage(GetDlgItem(m_hWnd, IDC_CONTRAST_SLIDER), TBM_SETPOS, TRUE, contrast); SendMessage(GetDlgItem(m_hWnd, IDC_CONTRAST_SLIDER), TBM_SETPOS, TRUE, m_contrast);


char text[8] = {0}; char text[8] = {0};


sprintf(text, "%d", saturation); sprintf(text, "%d", m_saturation);
SetDlgItemText(m_hWnd, IDC_SATURATION_TEXT, text); SetDlgItemText(m_hWnd, IDC_SATURATION_TEXT, text);
sprintf(text, "%d", brightness); sprintf(text, "%d", m_brightness);
SetDlgItemText(m_hWnd, IDC_BRIGHTNESS_TEXT, text); SetDlgItemText(m_hWnd, IDC_BRIGHTNESS_TEXT, text);
sprintf(text, "%d", contrast); sprintf(text, "%d", m_contrast);
SetDlgItemText(m_hWnd, IDC_CONTRAST_TEXT, text); SetDlgItemText(m_hWnd, IDC_CONTRAST_TEXT, text);


// Shader Settings // Shader Settings
Expand Down Expand Up @@ -551,27 +551,27 @@ bool GSShaderDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
{ {
char text[8] = {0}; char text[8] = {0};


saturation = SendMessage(GetDlgItem(m_hWnd, IDC_SATURATION_SLIDER),TBM_GETPOS,0,0); m_saturation = SendMessage(GetDlgItem(m_hWnd, IDC_SATURATION_SLIDER),TBM_GETPOS,0,0);


sprintf(text, "%d", saturation); sprintf(text, "%d", m_saturation);
SetDlgItemText(m_hWnd, IDC_SATURATION_TEXT, text); SetDlgItemText(m_hWnd, IDC_SATURATION_TEXT, text);
} }
else if((HWND)lParam == GetDlgItem(m_hWnd, IDC_BRIGHTNESS_SLIDER)) else if((HWND)lParam == GetDlgItem(m_hWnd, IDC_BRIGHTNESS_SLIDER))
{ {
char text[8] = {0}; char text[8] = {0};


brightness = SendMessage(GetDlgItem(m_hWnd, IDC_BRIGHTNESS_SLIDER),TBM_GETPOS,0,0); m_brightness = SendMessage(GetDlgItem(m_hWnd, IDC_BRIGHTNESS_SLIDER),TBM_GETPOS,0,0);


sprintf(text, "%d", brightness); sprintf(text, "%d", m_brightness);
SetDlgItemText(m_hWnd, IDC_BRIGHTNESS_TEXT, text); SetDlgItemText(m_hWnd, IDC_BRIGHTNESS_TEXT, text);
} }
else if((HWND)lParam == GetDlgItem(m_hWnd, IDC_CONTRAST_SLIDER)) else if((HWND)lParam == GetDlgItem(m_hWnd, IDC_CONTRAST_SLIDER))
{ {
char text[8] = {0}; char text[8] = {0};


contrast = SendMessage(GetDlgItem(m_hWnd, IDC_CONTRAST_SLIDER),TBM_GETPOS,0,0); m_contrast = SendMessage(GetDlgItem(m_hWnd, IDC_CONTRAST_SLIDER),TBM_GETPOS,0,0);


sprintf(text, "%d", contrast); sprintf(text, "%d", m_contrast);
SetDlgItemText(m_hWnd, IDC_CONTRAST_TEXT, text); SetDlgItemText(m_hWnd, IDC_CONTRAST_TEXT, text);
} }
} break; } break;
Expand All @@ -592,9 +592,9 @@ bool GSShaderDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
} }
// Shade Boost // Shade Boost
theApp.SetConfig("ShadeBoost", (int)IsDlgButtonChecked(m_hWnd, IDC_SHADEBOOST)); theApp.SetConfig("ShadeBoost", (int)IsDlgButtonChecked(m_hWnd, IDC_SHADEBOOST));
theApp.SetConfig("ShadeBoost_Contrast", contrast); theApp.SetConfig("ShadeBoost_Contrast", m_contrast);
theApp.SetConfig("ShadeBoost_Brightness", brightness); theApp.SetConfig("ShadeBoost_Brightness", m_brightness);
theApp.SetConfig("ShadeBoost_Saturation", saturation); theApp.SetConfig("ShadeBoost_Saturation", m_saturation);


// FXAA shader // FXAA shader
theApp.SetConfig("Fxaa", (int)IsDlgButtonChecked(m_hWnd, IDC_FXAA)); theApp.SetConfig("Fxaa", (int)IsDlgButtonChecked(m_hWnd, IDC_FXAA));
Expand All @@ -606,14 +606,12 @@ bool GSShaderDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
int shader_fx_length = (int)SendMessage(GetDlgItem(m_hWnd, IDC_SHADER_FX_EDIT), WM_GETTEXTLENGTH, 0, 0); int shader_fx_length = (int)SendMessage(GetDlgItem(m_hWnd, IDC_SHADER_FX_EDIT), WM_GETTEXTLENGTH, 0, 0);
int shader_fx_conf_length = (int)SendMessage(GetDlgItem(m_hWnd, IDC_SHADER_FX_CONF_EDIT), WM_GETTEXTLENGTH, 0, 0); int shader_fx_conf_length = (int)SendMessage(GetDlgItem(m_hWnd, IDC_SHADER_FX_CONF_EDIT), WM_GETTEXTLENGTH, 0, 0);
int length = std::max(shader_fx_length, shader_fx_conf_length) + 1; int length = std::max(shader_fx_length, shader_fx_conf_length) + 1;
char *buffer = new char[length]; std::unique_ptr<char[]> buffer(new char[length]);



SendMessage(GetDlgItem(m_hWnd, IDC_SHADER_FX_EDIT), WM_GETTEXT, (WPARAM)length, (LPARAM)buffer); SendMessage(GetDlgItem(m_hWnd, IDC_SHADER_FX_EDIT), WM_GETTEXT, (WPARAM)length, (LPARAM)buffer.get());
theApp.SetConfig("shaderfx_glsl", buffer); // Not really glsl only ;) theApp.SetConfig("shaderfx_glsl", buffer.get()); // Not really glsl only ;)
SendMessage(GetDlgItem(m_hWnd, IDC_SHADER_FX_CONF_EDIT), WM_GETTEXT, (WPARAM)length, (LPARAM)buffer); SendMessage(GetDlgItem(m_hWnd, IDC_SHADER_FX_CONF_EDIT), WM_GETTEXT, (WPARAM)length, (LPARAM)buffer.get());
theApp.SetConfig("shaderfx_conf", buffer); theApp.SetConfig("shaderfx_conf", buffer.get());
delete[] buffer;


EndDialog(m_hWnd, id); EndDialog(m_hWnd, id);
} break; } break;
Expand Down
6 changes: 3 additions & 3 deletions plugins/GSdx/GSSettingsDlg.h
Expand Up @@ -26,9 +26,9 @@


class GSShaderDlg : public GSDialog class GSShaderDlg : public GSDialog
{ {
int saturation; int m_saturation;
int brightness; int m_brightness;
int contrast; int m_contrast;


void UpdateControls(); void UpdateControls();


Expand Down

0 comments on commit 6a7c38f

Please sign in to comment.