summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/OnScreenDisplay.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2013-04-24 09:21:54 -0400
committerLioncash <mathew1800@gmail.com>2013-04-24 09:21:54 -0400
commit8da425b008b46ef90d649e55c6c0d4a0bc2b556b (patch)
tree5b5fd33dc0274f35625a179adf0a7f93ebadeece /Source/Core/VideoCommon/Src/OnScreenDisplay.cpp
parentc118c71eace1aef76687beb2e1fa6517498d84ed (diff)
Formatting cleanup for VideoCommon.
Block braces on new lines. Also killed off trailing whitespace and dangling elses. Spaced some things out to make them more readable (only in places where it looked like a bit of a clusterfuck).
Diffstat (limited to 'Source/Core/VideoCommon/Src/OnScreenDisplay.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/OnScreenDisplay.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/Src/OnScreenDisplay.cpp b/Source/Core/VideoCommon/Src/OnScreenDisplay.cpp
index 51d0f7c006..29a3837a9a 100644
--- a/Source/Core/VideoCommon/Src/OnScreenDisplay.cpp
+++ b/Source/Core/VideoCommon/Src/OnScreenDisplay.cpp
@@ -19,7 +19,8 @@ namespace OSD
struct MESSAGE
{
MESSAGE() {}
- MESSAGE(const char* p, u32 dw) {
+ MESSAGE(const char* p, u32 dw)
+ {
strncpy(str, p, 255);
str[255] = '\0';
dwTimeStamp = dw;
@@ -45,8 +46,10 @@ public:
{
m_functionptr(m_data);
}
+
CallbackType Type() { return m_type; }
};
+
std::vector<OSDCALLBACK> m_callbacks;
static std::list<MESSAGE> s_listMsgs;
@@ -57,7 +60,8 @@ void AddMessage(const char* pstr, u32 ms)
void DrawMessages()
{
- if(!SConfig::GetInstance().m_LocalCoreStartupParameter.bOnScreenDisplayMessages) return;
+ if(!SConfig::GetInstance().m_LocalCoreStartupParameter.bOnScreenDisplayMessages)
+ return;
if (s_listMsgs.size() > 0)
{
@@ -71,7 +75,8 @@ void DrawMessages()
if (time_left < 1024)
{
alpha = time_left >> 2;
- if (time_left < 0) alpha = 0;
+ if (time_left < 0)
+ alpha = 0;
}
alpha <<= 24;
@@ -91,8 +96,11 @@ void DrawMessages()
void ClearMessages()
{
std::list<MESSAGE>::iterator it = s_listMsgs.begin();
- while (it != s_listMsgs.end())
+
+ while (it != s_listMsgs.end())
+ {
it = s_listMsgs.erase(it);
+ }
}
// On-Screen Display Callbacks
@@ -104,8 +112,10 @@ void AddCallback(CallbackType OnType, CallbackPtr FuncPtr, u32 UserData)
void DoCallbacks(CallbackType OnType)
{
for (auto it = m_callbacks.begin(); it != m_callbacks.end(); ++it)
+ {
if (it->Type() == OnType)
it->Call();
+ }
}
} // namespace