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