Commit e36af0b5 authored by hybrid's avatar hybrid

Some more unicode fixes for Windows systems.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2749 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 275874af
......@@ -151,7 +151,7 @@ bool CD3D8Driver::initDriver(const core::dimension2d<u32>& screenSize,
#if defined( _IRR_XBOX_PLATFORM_)
D3DCREATETYPE d3dCreate = (D3DCREATETYPE) &Direct3DCreate8;
#else
D3DLibrary = LoadLibrary( "d3d8.dll" );
D3DLibrary = LoadLibrary( __TEXT("d3d8.dll") );
if (!D3DLibrary)
{
......
......@@ -163,7 +163,7 @@ bool CD3D9Driver::initDriver(const core::dimension2d<u32>& screenSize,
if (!pID3D)
{
D3DLibrary = LoadLibrary( io::path("d3d9.dll").c_str() );
D3DLibrary = LoadLibrary( __TEXT("d3d9.dll") );
if (!D3DLibrary)
{
......
......@@ -368,7 +368,7 @@ HRESULT CD3D9ShaderMaterialRenderer::stubD3DXAssembleShaderFromFile(LPCSTR pSrcF
#endif
// invoke static linked function
return D3DXAssembleShaderFromFile(pSrcFile, pDefines, pInclude, Flags,
return D3DXAssembleShaderFromFileA(pSrcFile, pDefines, pInclude, Flags,
ppShader, ppErrorMsgs);
#else
{
......@@ -489,7 +489,7 @@ HRESULT CD3D9ShaderMaterialRenderer::stubD3DXCompileShaderFromFile(LPCSTR pSrcFi
#endif
// invoke static linked function
return D3DXCompileShaderFromFile(pSrcFile, pDefines, pInclude, pFunctionName, pProfile, Flags, ppShader, ppErrorMsgs, ppConstantTable);
return D3DXCompileShaderFromFileA(pSrcFile, pDefines, pInclude, pFunctionName, pProfile, Flags, ppShader, ppErrorMsgs, ppConstantTable);
#else
{
// try to load shader functions from the dll and print error if failed.
......
......@@ -346,8 +346,7 @@ void CIrrDeviceConsole::sleep(u32 timeMs, bool pauseTimer)
void CIrrDeviceConsole::setWindowCaption(const wchar_t* text)
{
#ifdef _IRR_WINDOWS_NT_CONSOLE_
core::stringc txt(text);
SetConsoleTitle(txt.c_str());
SetConsoleTitleW(text);
#endif
}
......
......@@ -293,7 +293,7 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
// create the window if we need to and we do not use the null device
if (!CreationParams.WindowId && CreationParams.DriverType != video::EDT_NULL)
{
const c8* ClassName = "CIrrDeviceWin32";
const fschar_t* ClassName = __TEXT("CIrrDeviceWin32");
// Register Class
WNDCLASSEX wcex;
......@@ -311,7 +311,7 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
wcex.hIconSm = 0;
// if there is an icon, load it
wcex.hIcon = (HICON)LoadImage(hInstance, "irrlicht.ico", IMAGE_ICON, 0,0, LR_LOADFROMFILE);
wcex.hIcon = (HICON)LoadImage(hInstance, __TEXT("irrlicht.ico"), IMAGE_ICON, 0,0, LR_LOADFROMFILE);
RegisterClassEx(&wcex);
......@@ -344,7 +344,7 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
// create window
HWnd = CreateWindow( ClassName, "", style, windowLeft, windowTop,
HWnd = CreateWindow( ClassName, __TEXT(""), style, windowLeft, windowTop,
realWidth, realHeight, NULL, NULL, hInstance, NULL);
CreationParams.WindowId = HWnd;
......@@ -854,17 +854,17 @@ void CIrrDeviceWin32::getWindowsVersion(core::stringc& out)
DWORD dwBufLen;
RegOpenKeyEx( HKEY_LOCAL_MACHINE,
"SYSTEM\\CurrentControlSet\\Control\\ProductOptions",
__TEXT("SYSTEM\\CurrentControlSet\\Control\\ProductOptions"),
0, KEY_QUERY_VALUE, &hKey );
RegQueryValueEx( hKey, "ProductType", NULL, NULL,
RegQueryValueEx( hKey, __TEXT("ProductType"), NULL, NULL,
(LPBYTE) szProductType, &dwBufLen);
RegCloseKey( hKey );
if (lstrcmpi( "WINNT", szProductType) == 0 )
if (_strcmpi( "WINNT", szProductType) == 0 )
out.append("Professional ");
if (lstrcmpi( "LANMANNT", szProductType) == 0)
if (_strcmpi( "LANMANNT", szProductType) == 0)
out.append("Server ");
if (lstrcmpi( "SERVERNT", szProductType) == 0)
if (_strcmpi( "SERVERNT", szProductType) == 0)
out.append("Advanced Server ");
}
......
......@@ -132,7 +132,7 @@ bool COSOperator::getProcessorSpeedMHz(u32* MHz) const
HKEY Key;
Error = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0",
__TEXT("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0"),
0, KEY_READ, &Key);
if(Error != ERROR_SUCCESS)
......@@ -140,7 +140,7 @@ bool COSOperator::getProcessorSpeedMHz(u32* MHz) const
DWORD Speed = 0;
DWORD Size = sizeof(Speed);
Error = RegQueryValueEx(Key, "~MHz", NULL, NULL, (LPBYTE)&Speed, &Size);
Error = RegQueryValueEx(Key, __TEXT("~MHz"), NULL, NULL, (LPBYTE)&Speed, &Size);
RegCloseKey(Key);
......
......@@ -77,7 +77,7 @@ bool COpenGLDriver::initDriver(irr::SIrrlichtCreationParameters params, CIrrDevi
if (AntiAlias > 1)
{
// Create a window to test antialiasing support
const c8* ClassName = "GLCIrrDeviceWin32";
const fschar_t* ClassName = __TEXT("GLCIrrDeviceWin32");
HINSTANCE lhInstance = GetModuleHandle(0);
// Register Class
......@@ -116,7 +116,7 @@ bool COpenGLDriver::initDriver(irr::SIrrlichtCreationParameters params, CIrrDevi
const s32 windowLeft = (GetSystemMetrics(SM_CXSCREEN) - realWidth) / 2;
const s32 windowTop = (GetSystemMetrics(SM_CYSCREEN) - realHeight) / 2;
HWND temporary_wnd=CreateWindow(ClassName, "", style, windowLeft, windowTop,
HWND temporary_wnd=CreateWindow(ClassName, __TEXT(""), style, windowLeft, windowTop,
realWidth, realHeight, NULL, NULL, lhInstance, NULL);
if (!temporary_wnd)
......
......@@ -69,8 +69,8 @@ namespace os
tmp += L"\n";
OutputDebugStringW(tmp.c_str());
#else
OutputDebugString(message);
OutputDebugString("\n");
OutputDebugStringA(message);
OutputDebugStringA("\n");
printf("%s\n", message);
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment