added ToAnsiString functions at Windows platform.

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2022-06-15 16:05:54 +08:00
parent 58c8f1db90
commit 45e8725f36
3 changed files with 11 additions and 4 deletions

View File

@ -285,8 +285,15 @@ namespace hgl
{
return to_u8(ws.c_str(),ws.Length());
}
#if HGL_OS == HGL_OS_Windows
AnsiString ToAnsiString(const CharSet &cs,const UTF16String &str);
inline AnsiString ToAnsiString(const UTF16String &str)
{
const CharSet cs((uint16)0);
return ToAnsiString(cs,str);
}
inline OSString ToOSString(const u8char *str){return to_u16(str);}
inline OSString ToOSString(const UTF8String &str){return to_u16(str.c_str(), (int)(str.Length()));}

View File

@ -44,7 +44,7 @@ namespace hgl
}
/**
* C指针风格字符串设置当前字符串内容(str需要delete[])
* C指针风格字符串设置当前字符串内容(str会被复制一份delete[])
* @param str len<00
* @param len str以0为结尾
*/

View File

@ -25,12 +25,12 @@ namespace hgl
b=nb;
return;
}
r+=(nr-r)*pos;
g+=(ng-g)*pos;
b+=(nb-b)*pos;
}
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
void Color3f::Grey(float v1,float v2,float v3)
{
float lum=RGB2Lum(v1,v2,v3);