forked from wolfpld/etcpak
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDebug.cpp
More file actions
31 lines (27 loc) · 693 Bytes
/
Debug.cpp
File metadata and controls
31 lines (27 loc) · 693 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <algorithm>
#include <vector>
#include "Debug.hpp"
static std::vector<DebugLog::Callback*> s_callbacks;
void DebugLog::Message( const char* msg )
{
for( auto it = s_callbacks.begin(); it != s_callbacks.end(); ++it )
{
(*it)->OnDebugMessage( msg );
}
}
void DebugLog::AddCallback( Callback* c )
{
const auto it = std::find( s_callbacks.begin(), s_callbacks.end(), c );
if( it == s_callbacks.end() )
{
s_callbacks.push_back( c );
}
}
void DebugLog::RemoveCallback( Callback* c )
{
const auto it = std::find( s_callbacks.begin(), s_callbacks.end(), c );
if( it != s_callbacks.end() )
{
s_callbacks.erase( it );
}
}