forked from Mirrorlandia_minetest/irrlicht
Merging r6194 from trunk to ogl-es branch.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6195 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
3a54e8d6b8
commit
08a2846a93
@ -1067,20 +1067,28 @@ void CIrrDeviceMacOSX::sleep(u32 timeMs, bool pauseTimer=false)
|
|||||||
|
|
||||||
void CIrrDeviceMacOSX::setWindowCaption(const wchar_t* text)
|
void CIrrDeviceMacOSX::setWindowCaption(const wchar_t* text)
|
||||||
{
|
{
|
||||||
size_t size;
|
|
||||||
char title[1024];
|
|
||||||
|
|
||||||
if (Window != NULL)
|
if (Window != NULL)
|
||||||
{
|
{
|
||||||
size = wcstombs(title,text,1024);
|
if ( text )
|
||||||
title[1023] = 0;
|
{
|
||||||
#ifdef __MAC_10_6
|
size_t numBytes = wcslen(text) * sizeof(wchar_t);
|
||||||
NSString* name = [NSString stringWithCString:title encoding:NSUTF8StringEncoding];
|
|
||||||
|
#ifdef __BIG_ENDIAN__
|
||||||
|
NSStringEncoding encode = sizeof(wchar_t) == 4 ? NSUTF32BigEndianStringEncoding : NSUTF16BigEndianStringEncoding;
|
||||||
#else
|
#else
|
||||||
NSString* name = [NSString stringWithCString:title length:size];
|
NSStringEncoding encode = sizeof(wchar_t) == 4 ? NSUTF32LittleEndianStringEncoding : NSUTF16LittleEndianStringEncoding;
|
||||||
#endif
|
#endif
|
||||||
[Window setTitle:name];
|
NSString* name = [[NSString alloc] initWithBytes:text length:numBytes encoding:encode];
|
||||||
[name release];
|
if ( name )
|
||||||
|
{
|
||||||
|
[Window setTitle:name];
|
||||||
|
[name release];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[Window setTitle:@""];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user