Skip to content

Commit

Permalink
gsdx-osd: Switch to opacity
Browse files Browse the repository at this point in the history
Switch to using opacity since this is how most software works.
Transparency is simply confusing to the average user.

Linux/Windows GUI to be updated in later commits.
  • Loading branch information
tadanokojin authored and lightningterror committed Dec 20, 2018
1 parent d624927 commit 038ae8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions plugins/GSdx/Renderers/Common/GSOsdManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ 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_osd_transparency = std::max(0, std::min(theApp.GetConfigI("osd_transparency"), 100));
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");

Expand Down Expand Up @@ -337,7 +337,7 @@ float GSOsdManager::StringSize(const std::u32string msg) {

size_t GSOsdManager::GeneratePrimitives(GSVertexPT1* dst, size_t count) {
size_t drawn = 0;
float transparency = 1.0f - m_osd_transparency / 100.0f;
float opacity = m_opacity * 0.01f;

if(m_log_enabled) {
float offset = 0;
Expand Down Expand Up @@ -365,7 +365,7 @@ size_t GSOsdManager::GeneratePrimitives(GSVertexPT1* dst, size_t count) {

y += offset += ((m_size+2) * (2.0f/m_real_size.y)) * ratio;
uint32 color = it->color;
((uint8 *)&color)[3] = (uint8)(((uint8 *)&color)[3] * (1.0f - ratio) * transparency);
((uint8 *)&color)[3] = (uint8)(((uint8 *)&color)[3] * (1.0f - ratio) * opacity);
RenderString(dst, it->msg, x, y, color);
dst += it->msg.size() * 6;
drawn += it->msg.size() * 6;
Expand Down Expand Up @@ -399,7 +399,7 @@ size_t GSOsdManager::GeneratePrimitives(GSVertexPT1* dst, size_t count) {
float y = -1.0f + ((m_size+2)*(2.0f/m_real_size.y)) * line++;

uint32 color = pair.second.second;
((uint8 *)&color)[3] = (uint8)(((uint8 *)&color)[3] * transparency);
((uint8 *)&color)[3] = (uint8)(((uint8 *)&color)[3] * opacity);

// Render the key
RenderString(dst, pair.first, x, y, color);
Expand Down
2 changes: 1 addition & 1 deletion plugins/GSdx/Renderers/Common/GSOsdManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class GSOsdManager {
bool m_log_enabled;
int m_log_speed;
bool m_monitor_enabled;
int m_osd_transparency;
int m_opacity;
int m_max_onscreen_messages;

public:
Expand Down

0 comments on commit 038ae8c

Please sign in to comment.