Browse Source

Do not define UNICODE, as GLFW assumes multi-char mode. Rather call the wide char Windows functions explicitly.

Lasse Öörni 14 years ago
parent
commit
fd1c3385ca
3 changed files with 4 additions and 5 deletions
  1. 0 1
      CMakeLists.txt
  2. 2 2
      Engine/Graphics/Direct3D9/D3D9Graphics.cpp
  3. 2 2
      Engine/IO/FileSystem.cpp

+ 0 - 1
CMakeLists.txt

@@ -38,7 +38,6 @@ endif ()
 # Compiler-specific options
 # Compiler-specific options
 if (MSVC)
 if (MSVC)
     add_definitions (-D_CRT_SECURE_NO_WARNINGS)
     add_definitions (-D_CRT_SECURE_NO_WARNINGS)
-    add_definitions (-DUNICODE -D_UNICODE)
     set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
     set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
     set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /MT /fp:fast /Zi /GS-")
     set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /MT /fp:fast /Zi /GS-")
     set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELWITHDEBINFO} /GL")
     set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELWITHDEBINFO} /GL")

+ 2 - 2
Engine/Graphics/Direct3D9/D3D9Graphics.cpp

@@ -1881,7 +1881,7 @@ unsigned Graphics::GetDepthStencilFormat()
 
 
 bool Graphics::OpenWindow(int width, int height)
 bool Graphics::OpenWindow(int width, int height)
 {
 {
-    WNDCLASS wc;
+    WNDCLASSW wc;
     wc.style         = CS_HREDRAW | CS_VREDRAW;
     wc.style         = CS_HREDRAW | CS_VREDRAW;
     wc.lpfnWndProc   = wndProc;
     wc.lpfnWndProc   = wndProc;
     wc.cbClsExtra    = 0;
     wc.cbClsExtra    = 0;
@@ -1893,7 +1893,7 @@ bool Graphics::OpenWindow(int width, int height)
     wc.lpszMenuName  = 0;
     wc.lpszMenuName  = 0;
     wc.lpszClassName = L"D3DWindow";
     wc.lpszClassName = L"D3DWindow";
     
     
-    RegisterClass(&wc);
+    RegisterClassW(&wc);
     
     
     RECT rect = {0, 0, width, height};
     RECT rect = {0, 0, width, height};
     AdjustWindowRect(&rect, windowStyle, false);
     AdjustWindowRect(&rect, windowStyle, false);

+ 2 - 2
Engine/IO/FileSystem.cpp

@@ -324,7 +324,7 @@ bool FileSystem::DirExists(const String& pathName)
     String fixedName = GetNativePath(RemoveTrailingSlash(pathName));
     String fixedName = GetNativePath(RemoveTrailingSlash(pathName));
     
     
     #ifdef WIN32
     #ifdef WIN32
-    DWORD attributes = GetFileAttributes(WString(fixedName).CString());
+    DWORD attributes = GetFileAttributesW(WString(fixedName).CString());
     if (attributes == INVALID_FILE_ATTRIBUTES || !(attributes & FILE_ATTRIBUTE_DIRECTORY))
     if (attributes == INVALID_FILE_ATTRIBUTES || !(attributes & FILE_ATTRIBUTE_DIRECTORY))
         return false;
         return false;
     #else
     #else
@@ -427,7 +427,7 @@ void FileSystem::ScanDirInternal(Vector<String>& result, String path, const Stri
                     result.Push(deltaPath + fileName);
                     result.Push(deltaPath + fileName);
             }
             }
         } 
         } 
-        while (FindNextFile(handle, &info));
+        while (FindNextFileW(handle, &info));
         
         
         FindClose(handle);
         FindClose(handle);
     }
     }