GSdx-osd: Remove/purge OSD Indicator code.

The code was never working properly ( tested by @tadanokojin ) so let's
clean up and remove it. If someone actually wishes to maintain it then
they can re add it and update the code to a functional stage.
This commit is contained in:
lightningterror 2018-11-18 06:32:07 +01:00
parent a092806d38
commit 292e7a6573
7 changed files with 13 additions and 58 deletions

View File

@ -387,7 +387,6 @@ void GSdxApp::Init()
m_default_configuration["osd_fontname"] = "/usr/share/fonts/truetype/freefont/FreeSerif.ttf";
#endif
m_default_configuration["osd_fontsize"] = "28";
m_default_configuration["osd_indicator_enabled"] = "0";
m_default_configuration["osd_log_enabled"] = "1";
m_default_configuration["osd_log_speed"] = "4";
m_default_configuration["osd_monitor_enabled"] = "0";

View File

@ -227,7 +227,6 @@ BEGIN
EDITTEXT IDC_OSD_MAX_LOG_EDIT,116,86,84,14,ES_RIGHT | ES_AUTOHSCROLL
CONTROL "", IDC_OSD_MAX_LOG,"msctls_updown32", UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,116,86,11,14
CONTROL "Enable Monitor",IDC_OSD_MONITOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,103,65,10
//CONTROL "Enable Indicator",IDC_OSD_INDICATOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,116,103,65,10 // Currently not implemented
DEFPUSHBUTTON "OK",IDOK,52,120,50,14
DEFPUSHBUTTON "Cancel",IDCANCEL,108,120,50,14
END

View File

@ -61,7 +61,6 @@ GSOsdManager::GSOsdManager() : m_atlas_h(0)
m_log_enabled = theApp.GetConfigB("osd_log_enabled");
m_log_speed = std::max(2, std::min(theApp.GetConfigI("osd_log_speed"), 10));
m_monitor_enabled = theApp.GetConfigB("osd_monitor_enabled");
m_indicator_enabled = theApp.GetConfigB("osd_indicator_enabled");
m_osd_transparency = std::max(0, std::min(theApp.GetConfigI("osd_transparency"), 100));
m_max_onscreen_messages = theApp.GetConfigI("osd_max_log_messages");
m_size = theApp.GetConfigI("osd_fontsize");
@ -229,13 +228,6 @@ void GSOsdManager::Monitor(const char *key, const char *value, uint32 color) {
}
}
void GSOsdManager::Indicate(const std::string key, bool on) {
if(!m_indicator_enabled)
return;
m_indicator[key].on = on;
}
void GSOsdManager::RenderGlyph(GSVertexPT1* dst, const glyph_info g, float x, float y, uint32 color) {
float x2 = x + g.bl * (2.0f/m_real_size.x);
float y2 = -y - g.bt * (2.0f/m_real_size.y);
@ -322,10 +314,6 @@ size_t GSOsdManager::Size() {
}
}
if(m_indicator_enabled) {
sum += m_indicator.size();
}
return sum * 6;
}
@ -428,20 +416,6 @@ size_t GSOsdManager::GeneratePrimitives(GSVertexPT1* dst, size_t count) {
}
}
if(m_indicator_enabled) {
for(const auto pair : m_indicator) {
float alpha = 1.0;
if(!pair.second.on) {
alpha = 0.25;
}
uint32 color = pair.second.color;
((uint8 *)&color)[3] = (uint8)(((uint8 *)&color)[3] * alpha * transparency);
RenderGlyph(dst, pair.second.glyph, pair.second.x, pair.second.y, color);
dst += 6;
drawn += 6;
}
}
return drawn;
}

View File

@ -65,14 +65,6 @@ class GSOsdManager {
std::map<std::u32string, std::pair<std::u32string, uint32>> m_monitor;
struct indicator_info {
glyph_info glyph;
uint32 color;
bool on;
float x, y;
};
std::map<std::string, indicator_info> m_indicator;
void AddGlyph(char32_t codepoint);
void RenderGlyph(GSVertexPT1* dst, const glyph_info g, float x, float y, uint32 color);
void RenderString(GSVertexPT1* dst, const std::u32string msg, float x, float y, uint32 color);
@ -81,7 +73,6 @@ class GSOsdManager {
bool m_log_enabled;
int m_log_speed;
bool m_monitor_enabled;
bool m_indicator_enabled;
int m_osd_transparency;
int m_max_onscreen_messages;
@ -100,7 +91,6 @@ class GSOsdManager {
void Log(const char *utf8, uint32 color);
void Monitor(const char *key, const char *value, uint32 color);
void Indicate(const std::string key, bool on);
GSVector2i m_real_size;
size_t Size();

View File

@ -573,7 +573,6 @@ void populate_osd_table(GtkWidget* osd_table)
GtkWidget* max_messages_label = left_label("Maximum Onscreen Log Messages:");
GtkWidget* max_messages_spin = CreateSpinButton(1, 20, "osd_max_log_messages");
GtkWidget* monitor_check = CreateCheckBox("Enable Monitor", "osd_monitor_enabled");
GtkWidget* indicator_check = CreateCheckBox("Enable Indicator", "osd_indicator_enabled");
AddTooltip(log_check, IDC_OSD_LOG);
AddTooltip(monitor_check, IDC_OSD_MONITOR);
@ -585,7 +584,7 @@ void populate_osd_table(GtkWidget* osd_table)
InsertWidgetInTable(osd_table , log_check);
InsertWidgetInTable(osd_table , log_speed_label , log_speed_text);
InsertWidgetInTable(osd_table , max_messages_label , max_messages_spin);
InsertWidgetInTable(osd_table , monitor_check , indicator_check);
InsertWidgetInTable(osd_table , monitor_check);
}
GtkWidget* ScrollMe(GtkWidget* w)

View File

@ -900,12 +900,8 @@ GSOSDDlg::GSOSDDlg() :
void GSOSDDlg::OnInit()
{
// OSD Indicator is greyed out because it's currently an empty shell.
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_INDICATOR), false);
CheckDlgButton(m_hWnd, IDC_OSD_LOG, theApp.GetConfigB("osd_log_enabled"));
CheckDlgButton(m_hWnd, IDC_OSD_MONITOR, theApp.GetConfigB("osd_monitor_enabled"));
CheckDlgButton(m_hWnd, IDC_OSD_INDICATOR, theApp.GetConfigB("osd_indicator_enabled"));
m_transparency = theApp.GetConfigI("osd_transparency");
SendMessage(GetDlgItem(m_hWnd, IDC_OSD_TRANSPARENCY_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(0, 100));
@ -977,7 +973,6 @@ bool GSOSDDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
theApp.SetConfig("osd_log_enabled", (int)IsDlgButtonChecked(m_hWnd, IDC_OSD_LOG));
theApp.SetConfig("osd_monitor_enabled", (int)IsDlgButtonChecked(m_hWnd, IDC_OSD_MONITOR));
theApp.SetConfig("osd_indicator_enabled", (int)IsDlgButtonChecked(m_hWnd, IDC_OSD_INDICATOR));
theApp.SetConfig("osd_transparency", m_transparency);

View File

@ -129,19 +129,18 @@
// OSD:
#define IDC_OSD_LOG 2170
#define IDC_OSD_MONITOR 2171
#define IDC_OSD_INDICATOR 2172
#define IDC_OSD_FONT_BUTTON 2173
#define IDC_OSD_FONT_EDIT 2174
#define IDC_OSD_SPEED 2175
#define IDC_OSD_SPEED_EDIT 2176
#define IDC_OSD_SPEED_TEXT 2177
#define IDC_OSD_SIZE 2178
#define IDC_OSD_SIZE_EDIT 2179
#define IDC_OSD_TRANSPARENCY_SLIDER 2180
#define IDC_OSD_TRANSPARENCY_TEXT 2181
#define IDC_OSD_MAX_LOG 2182
#define IDC_OSD_MAX_LOG_EDIT 2183
#define IDC_OSD_MAX_LOG_TEXT 2184
#define IDC_OSD_FONT_BUTTON 2172
#define IDC_OSD_FONT_EDIT 2173
#define IDC_OSD_SPEED 2174
#define IDC_OSD_SPEED_EDIT 2175
#define IDC_OSD_SPEED_TEXT 2176
#define IDC_OSD_SIZE 2177
#define IDC_OSD_SIZE_EDIT 2178
#define IDC_OSD_TRANSPARENCY_SLIDER 2179
#define IDC_OSD_TRANSPARENCY_TEXT 2180
#define IDC_OSD_MAX_LOG 2181
#define IDC_OSD_MAX_LOG_EDIT 2182
#define IDC_OSD_MAX_LOG_TEXT 2183
// OpenGL Advanced Settings:
#define IDC_GEOMETRY_SHADER_OVERRIDE 2190
#define IDC_GEOMETRY_SHADER_TEXT 2191