diff --git a/Compatibility.txt b/Compatibility.txt index 5f17e12c..de4cfaf7 100644 --- a/Compatibility.txt +++ b/Compatibility.txt @@ -35,6 +35,10 @@ Code::Blocks 。 移除函数 attachHWND 以避免潜在的死锁。 函数 setrendermode 无效,默认状态统一为 setrendermode(RENDER_MANUAL) ;仅为兼容性保留。 移除类型 LPCALLBACK_PROC 、LPMSG_KEY_PROC 、LPMSG_MOUSE_PROC 、MSG_KEY_PROC 和 MSG_MOUSE_PROC ,其中 LPCALLBACK_PROC 可用 CALLBACK_PROC* 代替, +typedef 类型名 color_t 从 unsigned int 改为 YCLib 提供的 platform::PixelType 。 +使用 YCLib 提供的 platform::MonoType 表示颜色分量。 +使用 platform::PixelType::Integer 表示颜色对应的整数类型。 +宏 RGBTOBGR 、EGERGB 、EGERGBA 、EGEARGB 、EGEACOLOR 、EGECOLORA 、EGEGET_R 、EGEGET_G 、EGEGET_B 、EGEGET_A 、EGEGRAY 、EGEGRAYA 和 EGEAGRAY 变更为 ege 命名空间内的函数。 向后(源代码)兼容但不保证向前兼容原始实现的接口 ---- @@ -76,7 +80,7 @@ Windows SDK 类型 CHAR 、WCHAR 、LPSTR 、LPCSTR 、LPWSTR 和 LPCWSTR 分别 类 IMAGE :修复复制构造;新增交换、转移构造和统一赋值操作;移除成员初始化检查;封装部分成员保证不可在外部修改;使用 YFramework 的 platform_ex::ScreenBuffer 代替 ::HBITMAP 实现。 CONVERT_IMAGE 和 CONVERT_IMAGE_CONST 宏改用内联函数实现,且当输入除空指针值外返回原值。 命名空间作用域静态函数和对象去除 static 并使用未命名命名空间代替。 -typedef 类型名 color_t 从 unsigned int 改为 YCLib 提供的 platform::PixelType 。 +移除不符合标准的保留名称 _RGBtoHSL 和 _HSLtoRGB 的使用。 实现质量(QoI) ---- diff --git a/EGE/include/ege/color.h b/EGE/include/ege/color.h index ff612945..a0f24d64 100644 --- a/EGE/include/ege/color.h +++ b/EGE/include/ege/color.h @@ -2,17 +2,11 @@ #define Inc_ege_color_h_ #include "ege/def.h" -#include -#include YFM_YCLib_Video - -using PROPID = ::ULONG; +#include "ege/colorbase.h" namespace ege { -using color_t = platform::PixelType; - - struct ege_colpoint { float x; diff --git a/EGE/include/ege/colorbase.h b/EGE/include/ege/colorbase.h index 091de6b7..6879523b 100644 --- a/EGE/include/ege/colorbase.h +++ b/EGE/include/ege/colorbase.h @@ -3,78 +3,89 @@ #include "def.h" #include +#include +#include YFM_YCLib_Video -yconstfn std::uint32_t -RGBTOBGR(std::uint32_t color) +using PROPID = ::ULONG; + +namespace ege +{ + +using color_t = platform::PixelType; + +yconstfn color_t::Trait::IntegerType +RGBTOBGR(platform::MonoType color) { return ((color & 0xFF) << 16) | ((color & 0xFF0000) >> 16) | (color & 0xFF00FF00); } -yconstfn std::uint32_t -EGERGB(std::uint8_t r, std::uint8_t g, std::uint8_t b) +yconstfn color_t::Trait::IntegerType +EGERGB(platform::MonoType r, platform::MonoType g, platform::MonoType b) { return (r << 16) | (g << 8) | b; } -yconstfn std::uint32_t -EGERGBA(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a) +yconstfn color_t::Trait::IntegerType +EGERGBA(platform::MonoType r, platform::MonoType g, platform::MonoType b, + platform::MonoType a) { return EGERGB(r, g, b) | a << 24; } -yconstfn std::uint32_t -EGEARGB(std::uint8_t a, std::uint8_t r, std::uint8_t g, std::uint8_t b) +yconstfn color_t::Trait::IntegerType +EGEARGB(platform::MonoType a, platform::MonoType r, platform::MonoType g, + platform::MonoType b) { return EGERGB(r, g, b) | a << 24; } -yconstfn std::uint32_t -EGEACOLOR(std::uint8_t a, std::uint32_t color) +yconstfn color_t::Trait::IntegerType +EGEACOLOR(platform::MonoType a, color_t::Trait::IntegerType color) { return (color & 0xFFFFFF) | (a << 24); } -yconstfn std::uint32_t -EGECOLORA(std::uint8_t a, std::uint32_t color) +yconstfn color_t::Trait::IntegerType +EGECOLORA(platform::MonoType a, color_t::Trait::IntegerType color) { return (color & 0xFFFFFF) | (a << 24); } -yconstfn std::uint8_t -EGEGET_R(std::uint32_t c) +yconstfn platform::MonoType +EGEGET_R(color_t::Trait::IntegerType c) { return (c >> 16) & 0xFF; } -yconstfn std::uint8_t -EGEGET_G(std::uint32_t c) +yconstfn platform::MonoType +EGEGET_G(color_t::Trait::IntegerType c) { return (c >> 8) & 0xFF; } -yconstfn std::uint8_t -EGEGET_B(std::uint32_t c) +yconstfn platform::MonoType +EGEGET_B(color_t::Trait::IntegerType c) { return c & 0xFF; } -yconstfn std::uint8_t -EGEGET_A(std::uint32_t c) +yconstfn platform::MonoType +EGEGET_A(color_t::Trait::IntegerType c) { return (c >> 24) & 0xFF; } -yconstfn std::uint32_t -EGEGRAY(std::uint32_t gray) +yconstfn color_t::Trait::IntegerType +EGEGRAY(color_t::Trait::IntegerType gray) { return (gray << 16) | (gray << 8) | gray; } -yconstfn std::uint32_t -EGEGRAYA(std::uint32_t gray, std::uint8_t a) +yconstfn color_t::Trait::IntegerType +EGEGRAYA(color_t::Trait::IntegerType gray, platform::MonoType a) { return EGEGRAY(gray) | (a << 24); } -yconstfn std::uint32_t -EGEAGRAY(std::uint8_t a, std::uint32_t gray) +yconstfn color_t::Trait::IntegerType +EGEAGRAY(platform::MonoType a, color_t::Trait::IntegerType gray) { return EGEGRAY(gray) | (a << 24); } @@ -86,5 +97,7 @@ EGEAGRAY(std::uint8_t a, std::uint32_t gray) #define HSLtoRGB hsl2rgb #define HSVtoRGB hsv2rgb +} // namespace ege; + #endif diff --git a/EGE/src/ege/color.cpp b/EGE/src/ege/color.cpp index 29ffae6d..61551ec2 100644 --- a/EGE/src/ege/color.cpp +++ b/EGE/src/ege/color.cpp @@ -5,6 +5,8 @@ namespace ege { +using platform::MonoType; + struct COLORHSL { float h; @@ -21,299 +23,104 @@ struct COLORHSV struct COLORRGB { - unsigned char r; - unsigned char g; - unsigned char b; + MonoType r; + MonoType g; + MonoType b; }; namespace { -COLORHSL -_RGBtoHSL(int _col) -{ - COLORHSL _crCol; - float r, g, b; - float* t, *dp[3]{&r, &g, &b}; - - b = EGEGET_B(_col) / 255.0f; - g = EGEGET_G(_col) / 255.0f; - r = EGEGET_R(_col) / 255.0f; - -#define IFSWAP(a, b) if(*a>*b){t=a;a=b;b=t;} - { - IFSWAP(dp[0], dp[1]); - IFSWAP(dp[1], dp[2]); - IFSWAP(dp[0], dp[1]); - } -#undef IFSWAP - - { - _crCol.l = (*dp[0] + *dp[2]) / 2; - if(_crCol.l < 1e-2f) - { - _crCol.l = 0; - _crCol.h = 0; - _crCol.s = 0; - return _crCol; - } - if(_crCol.l > 0.99) - { - _crCol.l = 1; - _crCol.h = 0; - _crCol.s = 0; - return _crCol; - } - if(fabs(_crCol.l - 0.5) < 1e-2) - { - _crCol.l = 0.5; - } - } -#define BLACKUNFORMAT(c, v) ((c)/((v)*2)) -#define WHITEUNFORMAT(c, v) (1-(1-c)/((1-(v))*2)) - if(_crCol.l == 0.5) - { - ; - } - else if(_crCol.l < 0.5) - { - for(int n = 0; n < 3; ++n) - { - *dp[n] = BLACKUNFORMAT(*dp[n], _crCol.l); - if(*dp[n] > 1) - *dp[n] = 1; - } - } - else - { - for(int n = 0; n < 3; ++n) - { - *dp[n] = WHITEUNFORMAT(*dp[n], _crCol.l); - if(*dp[n] > 1) - *dp[n] = 1; - } - } -#undef BLACKUNFORMAT -#undef WHITEUNFORMAT - { - _crCol.s = *dp[2] * 2 - 1; - if(_crCol.s < 1e-2) - { - _crCol.h = 0; - return _crCol; - } - } -#define SATUNFORMAT(c, s) (((c)-0.5f)/(s)+0.5f) - { - for(int n = 0; n < 3; ++n) - { - *dp[n] = SATUNFORMAT(*dp[n], _crCol.s); - if(*dp[n] > 1) - *dp[n] = 1; - } - } -#undef SATUNFORMAT - { - _crCol.h = *dp[1]; - if((dp[2] == &r) && (dp[1] == &g)) _crCol.h = _crCol.h + 0; - else if((dp[2] == &g) && (dp[1] == &b)) _crCol.h = _crCol.h + 2; - else if((dp[2] == &b) && (dp[1] == &r)) _crCol.h = _crCol.h + 4; - else if((dp[2] == &g) && (dp[1] == &r)) _crCol.h = 2 - _crCol.h; - else if((dp[2] == &b) && (dp[1] == &g)) _crCol.h = 4 - _crCol.h; - else if((dp[2] == &r) && (dp[1] == &b)) _crCol.h = 6 - _crCol.h; - _crCol.h /= 6; - } - return _crCol; -} -int -_HSLtoRGB(float _h, float _s, float _l) -{ - float r, g, b; - - if(_h < 0.0f) - { - _h += (float)(int)(-_h + 1); - } - if(_h >= 1.0f) - { - _h -= (float)(int)(_h); - } - if(_s == 0) - { - r = _l; - g = _l; - b = _l; - } - else - { - float dp[3]; - float xh = _h * 6; - if(xh == 6) xh = 0; - int i = (int)(floor(xh) + 0.1), n; - dp[0] = 1; - dp[2] = 0; - xh -= i; - if(i & 1) - dp[1] = 1 - xh; - else - dp[1] = xh; -#define SATFORMAT(c, s) (((c)-0.5f)*(s)+0.5f) - for(n = 0; n < 3; ++n) - dp[n] = SATFORMAT(dp[n], _s); -#undef SATFORMAT -#define BLACKFORMAT(c, v) ((c)*(v)*2) -#define WHITEFORMAT(c, v) (1-(1-(c))*(1-(v))*2) - if(_l == 0.5f) - ; - else if(_l < 0.5f) - { - if(_l < 0) - _l = 0; - for(n = 0; n < 3; ++n) - dp[n] = BLACKFORMAT(dp[n], _l); - } - else - { - if(_l > 1) - _l = 1; - for(n = 0; n < 3; ++n) - dp[n] = WHITEFORMAT(dp[n], _l); - } -#undef BLACKFORMAT -#undef WHITEFORMAT - { - if(i == 0) - { - r = dp[0]; - g = dp[1]; - b = dp[2]; - } - else if(i == 1) - { - r = dp[1]; - g = dp[0]; - b = dp[2]; - } - else if(i == 2) - { - r = dp[2]; - g = dp[0]; - b = dp[1]; - } - else if(i == 3) - { - r = dp[2]; - g = dp[1]; - b = dp[0]; - } - else if(i == 4) - { - r = dp[1]; - g = dp[2]; - b = dp[0]; - } - else - { - r = dp[0]; - g = dp[2]; - b = dp[1]; - } - } - } - return EGERGB(::DWORD(r * 255), ::DWORD(g * 255), ::DWORD(b * 255)); -} - -void -RGB_TO_HSV(const COLORRGB* input, COLORHSV* output) +COLORHSV +RGB_TO_HSV(const COLORRGB& rgb) { float r, g, b, minRGB, maxRGB, deltaRGB; + COLORHSV output; - output->h = 0; - r = input->r / 255.0f; - g = input->g / 255.0f; - b = input->b / 255.0f; + output.h = 0; + r = rgb.r / 255.0f; + g = rgb.g / 255.0f; + b = rgb.b / 255.0f; minRGB = std::min(r, std::min(g, b)); maxRGB = std::max(r, std::max(g, b)); deltaRGB = maxRGB - minRGB; - output->v = maxRGB; + output.v = maxRGB; if(maxRGB != 0.0f) - output->s = deltaRGB / maxRGB; + output.s = deltaRGB / maxRGB; else - output->s = 0.0f; - if(output->s <= 0.0f) - output->h = -1.0f; + output.s = 0.0f; + if(output.s <= 0.0f) + output.h = -1.0f; else { if(r == maxRGB) - output->h = (g - b) / deltaRGB; + output.h = (g - b) / deltaRGB; else if(g == maxRGB) - output->h = 2.0f + (b - r) / deltaRGB; + output.h = 2.0f + (b - r) / deltaRGB; else if(b == maxRGB) - output->h = 4.0f + (r - g) / deltaRGB; - output->h *= 60.0f; - if(output->h < 0.0f) - output->h += 360.0f; - output->h /= 360.0f; + output.h = 4.0f + (r - g) / deltaRGB; + output.h *= 60.0f; + if(output.h < 0.0f) + output.h += 360.0f; + output.h /= 360.0f; } + return output; } -void -HSV_TO_RGB(COLORHSV* input, COLORRGB* output) +COLORRGB +HSV_TO_RGB(COLORHSV hsv) { float R = 0, G = 0, B = 0; - int k; - float aa, bb, cc, f; - if(input->s <= 0.0) - { - R = G = B = input->v; - } + + if(hsv.s <= 0.0) + return {MonoType(hsv.v * 255), MonoType(hsv.v * 255), + MonoType(hsv.v * 255)}; else { - if(input->h == 1.0) - input->h = 0.0; - input->h *= 6.0; - k = (int)floor(input->h); // ?? - f = input->h - k; - aa = input->v * (1.0f - input->s); - bb = input->v * (1.0f - input->s * f); - cc = input->v * (1.0f - (input->s * (1.0f - f))); + if(hsv.h == 1.0) + hsv.h = 0.0; + hsv.h *= 6.0; + + int k = floor(hsv.h); + float f = hsv.h - k, aa(hsv.v * (1.0f - hsv.s)), + bb(hsv.v * (1.0f - hsv.s * f)), + cc(hsv.v * (1.0f - (hsv.s * (1.0f - f)))); + switch(k) { case 0: - R = input->v; + R = hsv.v; G = cc; B = aa; break; case 1: R = bb; - G = input->v; + G = hsv.v; B = aa; break; case 2: R = aa; - G = input->v; + G = hsv.v; B = cc; break; case 3: R = aa; G = bb; - B = input->v; + B = hsv.v; break; case 4: R = cc; G = aa; - B = input->v; + B = hsv.v; break; case 5: - R = input->v; + R = hsv.v; G = aa; B = bb; break; } } - output->r = (unsigned char)(R * 255); - output->g = (unsigned char)(G * 255); - output->b = (unsigned char)(B * 255); + return {MonoType(R * 255), MonoType(G * 255), MonoType(B * 255)}; } } @@ -336,7 +143,85 @@ rgb2gray(color_t color) void rgb2hsl(color_t rgb, float* H, float* S, float* L) { - COLORHSL hsl = _RGBtoHSL((int)rgb); + COLORHSL hsl = [](std::uint32_t _col) -> COLORHSL{ + COLORHSL cr_col; + float r(EGEGET_R(_col) / 255.0f), g(EGEGET_G(_col) / 255.0f), + b(EGEGET_B(_col) / 255.0f); + float*dp[3]{&r, &g, &b}; + +#define IFSWAP(a, b) \ + if(*a>*b) \ + std::swap(a, b) + IFSWAP(dp[0], dp[1]); + IFSWAP(dp[1], dp[2]); + IFSWAP(dp[0], dp[1]); +#undef IFSWAP + cr_col.l = (*dp[0] + *dp[2]) / 2; + if(cr_col.l < 1e-2f) + { + cr_col.l = 0; + cr_col.h = 0; + cr_col.s = 0; + return cr_col; + } + if(cr_col.l > 0.99) + { + cr_col.l = 1; + cr_col.h = 0; + cr_col.s = 0; + return cr_col; + } + if(fabs(cr_col.l - 0.5) < 1e-2) + cr_col.l = 0.5; + #define BLACKUNFORMAT(c, v) ((c)/((v)*2)) + #define WHITEUNFORMAT(c, v) (1-(1-c)/((1-(v))*2)) + if(cr_col.l == 0.5) + ; + else if(cr_col.l < 0.5) + for(int n = 0; n < 3; ++n) + { + *dp[n] = BLACKUNFORMAT(*dp[n], cr_col.l); + if(*dp[n] > 1) + *dp[n] = 1; + } + else + for(int n = 0; n < 3; ++n) + { + *dp[n] = WHITEUNFORMAT(*dp[n], cr_col.l); + if(*dp[n] > 1) + *dp[n] = 1; + } + #undef BLACKUNFORMAT + #undef WHITEUNFORMAT + cr_col.s = *dp[2] * 2 - 1; + if(cr_col.s < 1e-2) + { + cr_col.h = 0; + return cr_col; + } + #define SATUNFORMAT(c, s) (((c)-0.5f)/(s)+0.5f) + for(int n = 0; n < 3; ++n) + { + *dp[n] = SATUNFORMAT(*dp[n], cr_col.s); + if(*dp[n] > 1) + *dp[n] = 1; + } + #undef SATUNFORMAT + cr_col.h = *dp[1]; + if((dp[2] == &r) && (dp[1] == &g)) cr_col.h = cr_col.h + 0; + else if((dp[2] == &g) && (dp[1] == &b)) + cr_col.h = cr_col.h + 2; + else if((dp[2] == &b) && (dp[1] == &r)) + cr_col.h = cr_col.h + 4; + else if((dp[2] == &g) && (dp[1] == &r)) + cr_col.h = 2 - cr_col.h; + else if((dp[2] == &b) && (dp[1] == &g)) + cr_col.h = 4 - cr_col.h; + else if((dp[2] == &r) && (dp[1] == &b)) + cr_col.h = 6 - cr_col.h; + cr_col.h /= 6; + return cr_col; + }(rgb); *H = hsl.h * 360.0f; *S = hsl.s; @@ -344,21 +229,104 @@ rgb2hsl(color_t rgb, float* H, float* S, float* L) } color_t -hsl2rgb(float H, float S, float L) +hsl2rgb(float _h, float _s, float _l) { - return (color_t)_HSLtoRGB(H / 360.0f, S, L); + float r, g, b; + + _h /= 360.0f; + if(_h < 0.0f) + _h += int(-_h + 1); + if(_h >= 1.0f) + _h -= int(_h); + if(_s == 0) + { + r = _l; + g = _l; + b = _l; + } + else + { + float dp[3]; + float xh = _h * 6; + if(xh == 6) xh = 0; + int i = (int)(floor(xh) + 0.1), n; + dp[0] = 1; + dp[2] = 0; + xh -= i; + if(i & 1) + dp[1] = 1 - xh; + else + dp[1] = xh; +#define SATFORMAT(c, s) (((c)-0.5f)*(s)+0.5f) + for(n = 0; n < 3; ++n) + dp[n] = SATFORMAT(dp[n], _s); +#undef SATFORMAT +#define BLACKFORMAT(c, v) ((c)*(v)*2) +#define WHITEFORMAT(c, v) (1-(1-(c))*(1-(v))*2) + if(_l == 0.5f) + ; + else if(_l < 0.5f) + { + if(_l < 0) + _l = 0; + for(n = 0; n < 3; ++n) + dp[n] = BLACKFORMAT(dp[n], _l); + } + else + { + if(_l > 1) + _l = 1; + for(n = 0; n < 3; ++n) + dp[n] = WHITEFORMAT(dp[n], _l); + } +#undef BLACKFORMAT +#undef WHITEFORMAT + if(i == 0) + { + r = dp[0]; + g = dp[1]; + b = dp[2]; + } + else if(i == 1) + { + r = dp[1]; + g = dp[0]; + b = dp[2]; + } + else if(i == 2) + { + r = dp[2]; + g = dp[0]; + b = dp[1]; + } + else if(i == 3) + { + r = dp[2]; + g = dp[1]; + b = dp[0]; + } + else if(i == 4) + { + r = dp[1]; + g = dp[2]; + b = dp[0]; + } + else + { + r = dp[0]; + g = dp[2]; + b = dp[1]; + } + } + return EGERGB(r * 255, g * 255, b * 255); } void rgb2hsv(color_t rgb, float* H, float* S, float* V) { - COLORRGB crgb; - COLORHSV chsv; + const auto + chsv(RGB_TO_HSV(COLORRGB{EGEGET_R(rgb), EGEGET_G(rgb), EGEGET_B(rgb)})); - crgb.r = (unsigned char)EGEGET_R(rgb); - crgb.g = (unsigned char)EGEGET_G(rgb); - crgb.b = (unsigned char)EGEGET_B(rgb); - RGB_TO_HSV(&crgb, &chsv); *H = chsv.h * 360.0f; *S = chsv.s; *V = chsv.v; @@ -367,14 +335,13 @@ rgb2hsv(color_t rgb, float* H, float* S, float* V) color_t hsv2rgb(float H, float S, float V) { - COLORRGB crgb; - if(H < 0.0f) - H += (float)(int)(-H / 360.0f + 1) * 360.0f; + H += int(-H / 360.0f + 1) * 360.0f; if(H >= 360.0f) - H -= (float)(int)(H / 360.0f) * 360.0f; - COLORHSV chsv{H / 360.0f, S, V}; - HSV_TO_RGB(&chsv, &crgb); + H -= int(H / 360.0f) * 360.0f; + + const auto crgb(HSV_TO_RGB(COLORHSV{H / 360.0f, S, V})); + return EGERGB(crgb.r, crgb.g, crgb.b); } diff --git a/egeclock/egeclock.cpp b/egeclock/egeclock.cpp index 8e956d57..340229e8 100644 --- a/egeclock/egeclock.cpp +++ b/egeclock/egeclock.cpp @@ -25,8 +25,8 @@ void draw() ege::setbkmode(TRANSPARENT); ege::ege_enable_aa(true); - ege::setfillcolor(EGEARGB(0xff, 0x40, 0x40, 0x40)); - ege::setcolor(EGEARGB(0xff, 0x80, 0x00, 0xf0)); + ege::setfillcolor(ege::EGEARGB(0xff, 0x40, 0x40, 0x40)); + ege::setcolor(ege::EGEARGB(0xff, 0x80, 0x00, 0xf0)); ege::ege_fillellipse(center.x - r * 1.2f, center.y - r * 1.2f, r * 1.2f * 2.0f, r * 1.2f * 2.0f); @@ -41,22 +41,22 @@ void draw() time_t t_now; time(&t_now); tm* t = localtime(&t_now); - ege::setcolor(EGEARGB(0xff, 0x0, 0x0, 0xff)); + ege::setcolor(ege::EGEARGB(0xff, 0x0, 0x0, 0xff)); ege::setlinewidth(10.0f); { float h = float(t->tm_hour + t->tm_min / 60.0); ege::ege_point p = getpos(center, float(h * pi2 / 12), r * 0.5f); ege::ege_line(p.x, p.y, center.x, center.y); } - ege::setcolor(EGEARGB(0xff, 0xff, 0x0, 0xff)); + ege::setcolor(ege::EGEARGB(0xff, 0xff, 0x0, 0xff)); ege::setlinewidth(5.0f); { float m = float(t->tm_min + t->tm_sec / 60.0); ege::ege_point p = getpos(center, float(m * pi2 / 60), r * 0.9f); ege::ege_line(p.x, p.y, center.x, center.y); } - ege::setcolor(EGEARGB(0xff, 0xff, 0xff, 0)); - ege::setfillcolor(EGEARGB(0xff, 0xff, 0xff, 0)); + ege::setcolor(ege::EGEARGB(0xff, 0xff, 0xff, 0)); + ege::setfillcolor(ege::EGEARGB(0xff, 0xff, 0xff, 0)); ege::setlinewidth(1.0f); { float s = float(t->tm_sec); @@ -70,7 +70,7 @@ void draw() std::sprintf(str, "%d/%02d/%02d %2d:%02d:%02d", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); - ege::setcolor(EGERGB(0xff, 0xff, 0)); + ege::setcolor(ege::EGERGB(0xff, 0xff, 0)); ege::outtextxy((int)center.x, (int)(center.y + r * 1.4f), str); } }