iw4x-client/src/Components/Modules/Colors.hpp

41 lines
914 B
C++
Raw Normal View History

2015-12-23 08:45:53 -05:00
namespace Components
{
class Colors : public Component
{
public:
Colors();
2016-08-15 10:40:30 -04:00
~Colors();
2016-09-16 05:04:28 -04:00
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
2015-12-23 08:45:53 -05:00
const char* GetName() { return "Colors"; };
2016-08-15 10:40:30 -04:00
#endif
2015-12-23 08:45:53 -05:00
2016-01-01 14:01:19 -05:00
static void Strip(const char* in, char* out, int max);
2016-01-02 09:19:34 -05:00
static std::string Strip(std::string in);
2016-01-01 14:01:19 -05:00
2016-02-06 13:09:41 -05:00
static char Add(uint8_t r, uint8_t g, uint8_t b);
2016-01-01 11:36:47 -05:00
private:
2016-02-07 08:19:55 -05:00
struct HsvColor
{
unsigned char h;
unsigned char s;
unsigned char v;
};
static DWORD HsvToRgb(HsvColor hsv);
2015-12-23 10:56:02 -05:00
static Dvar::Var NewColors;
2016-02-06 13:09:41 -05:00
static void ClientUserinfoChanged();
2016-01-01 11:36:47 -05:00
static char* GetClientName(int localClientNum, int index, char *buf, size_t size);
2016-02-06 13:09:41 -05:00
static void PatchColorLimit(char limit);
2015-12-23 08:45:53 -05:00
2016-02-06 13:09:41 -05:00
static unsigned int ColorIndex(unsigned char);
static void LookupColor(DWORD* color, char index);
static void LookupColorStub();
static char* CleanStrStub(char* string);
static std::vector<DWORD> ColorTable;
2015-12-23 08:45:53 -05:00
};
}