mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 14:03:26 +02:00
improvments in widgets initialization
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
class Color
|
||||
{
|
||||
public:
|
||||
Color() : m_rgba(0) { }
|
||||
Color() : m_rgba(0xFFFFFFFF) { }
|
||||
Color(uint8 r, uint8 g, uint8 b, uint8 a = 0xFF) : m_r(r), m_g(g), m_b(b), m_a(a) { }
|
||||
Color(const Color& other) : m_rgba(other.m_rgba) { }
|
||||
Color(uint32 rgba) : m_rgba(rgba) { }
|
||||
|
@@ -42,8 +42,15 @@ typedef int8_t int8;
|
||||
typedef std::function<void()> SimpleCallback;
|
||||
typedef std::function<bool()> BooleanCallback;
|
||||
|
||||
#ifndef nullptr
|
||||
#define nullptr NULL
|
||||
#endif
|
||||
// boolean with default value initializer
|
||||
template<bool def>
|
||||
struct boolean {
|
||||
boolean() : v(def) { }
|
||||
operator bool &() { return v; }
|
||||
operator bool const &() const { return v; }
|
||||
bool& operator=(const bool& o) { v = o; return v; }
|
||||
private:
|
||||
bool v;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user