Skip to content

Commit

Permalink
gsdx-osd: Ensure we set proper data for osd options.
Browse files Browse the repository at this point in the history
Should avoid any potential issues if ini values are wrong for osd.
  • Loading branch information
lightningterror committed Jul 16, 2019
1 parent 56b8612 commit 888897e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions plugins/GSdx/Renderers/Common/GSOsdManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ GSOsdManager::GSOsdManager() : m_atlas_h(0)
, m_onscreen_messages(0)
, m_texture_dirty(true)
{
m_log_enabled = theApp.GetConfigB("osd_log_enabled");
m_log_timeout = std::max(2, std::min(theApp.GetConfigI("osd_log_timeout"), 10));
m_monitor_enabled = theApp.GetConfigB("osd_monitor_enabled");
m_opacity = std::max(0, std::min(theApp.GetConfigI("osd_color_opacity"), 100));
m_max_onscreen_messages = theApp.GetConfigI("osd_max_log_messages");
m_size = theApp.GetConfigI("osd_fontsize");

int r = theApp.GetConfigI("osd_color_r");
int g = theApp.GetConfigI("osd_color_g");
int b = theApp.GetConfigI("osd_color_b");
m_monitor_enabled = theApp.GetConfigB("osd_monitor_enabled");
m_log_enabled = theApp.GetConfigB("osd_log_enabled");
m_size = std::max(1, std::min(theApp.GetConfigI("osd_fontsize"), 100));
m_opacity = std::max(0, std::min(theApp.GetConfigI("osd_color_opacity"), 100));
m_log_timeout = std::max(2, std::min(theApp.GetConfigI("osd_log_timeout"), 10));
m_max_onscreen_messages = std::max(1, std::min(theApp.GetConfigI("osd_max_log_messages"), 20));

int r = std::max(0, std::min(theApp.GetConfigI("osd_color_r"), 255));
int g = std::max(0, std::min(theApp.GetConfigI("osd_color_g"), 255));
int b = std::max(0, std::min(theApp.GetConfigI("osd_color_b"), 255));

m_color = r | (g << 8) | (b << 16) | (255 << 24);

Expand Down

0 comments on commit 888897e

Please sign in to comment.