Merge from develop

--HG--
branch : compatibility-develop
hg/compatibility-develop
ulukyn 6 years ago
commit 2c6bfe7d54

@ -55,7 +55,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(RyzomCore CXX C) PROJECT(RyzomCore CXX C)
SET(NL_VERSION_MAJOR 1) SET(NL_VERSION_MAJOR 1)
SET(NL_VERSION_MINOR 0) SET(NL_VERSION_MINOR 0)
SET(NL_VERSION_PATCH 0) SET(NL_VERSION_PATCH 1)
SET(YEAR "2004-${CURRENT_YEAR}") SET(YEAR "2004-${CURRENT_YEAR}")
SET(AUTHOR "Winch Gate and The Ryzom Core Community") SET(AUTHOR "Winch Gate and The Ryzom Core Community")

@ -1247,23 +1247,23 @@ bool CDriverD3D::init (uintptr_t windowIcon, emptyProc exitFunc)
createCursors(); createCursors();
_WindowClass = "NLD3D" + toString(windowIcon); _WindowClass = utf8ToWide("NLD3D" + toString(windowIcon));
// Register a window class // Register a window class
WNDCLASSA wc; WNDCLASSW wc;
memset(&wc,0,sizeof(wc)); memset(&wc,0,sizeof(wc));
wc.style = 0; // CS_HREDRAW | CS_VREDRAW ;//| CS_DBLCLKS; wc.style = 0; // CS_HREDRAW | CS_VREDRAW ;//| CS_DBLCLKS;
wc.lpfnWndProc = (WNDPROC)WndProc; wc.lpfnWndProc = (WNDPROC)WndProc;
wc.cbClsExtra = 0; wc.cbClsExtra = 0;
wc.cbWndExtra = 0; wc.cbWndExtra = 0;
wc.hInstance = GetModuleHandleA(NULL); wc.hInstance = GetModuleHandleW(NULL);
wc.hIcon = (HICON)windowIcon; wc.hIcon = (HICON)windowIcon;
wc.hCursor = _DefaultCursor; wc.hCursor = _DefaultCursor;
wc.hbrBackground = WHITE_BRUSH; wc.hbrBackground = WHITE_BRUSH;
wc.lpszClassName = _WindowClass.c_str(); wc.lpszClassName = _WindowClass.c_str();
wc.lpszMenuName = NULL; wc.lpszMenuName = NULL;
if (!RegisterClassA(&wc)) if (!RegisterClassW(&wc))
{ {
DWORD error = GetLastError(); DWORD error = GetLastError();
if (error != ERROR_CLASS_ALREADY_EXISTS) if (error != ERROR_CLASS_ALREADY_EXISTS)
@ -1416,8 +1416,7 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r
AdjustWindowRect(&WndRect,WndFlags,FALSE); AdjustWindowRect(&WndRect,WndFlags,FALSE);
// Create // Create
ucstring ustr(_WindowClass); _HWnd = CreateWindowW(_WindowClass.c_str(), L"", WndFlags, CW_USEDEFAULT,CW_USEDEFAULT, WndRect.right-WndRect.left,WndRect.bottom-WndRect.top, NULL, NULL,
_HWnd = CreateWindowW((LPCWSTR)ustr.c_str(), L"", WndFlags, CW_USEDEFAULT,CW_USEDEFAULT, WndRect.right-WndRect.left,WndRect.bottom-WndRect.top, NULL, NULL,
GetModuleHandleW(NULL), NULL); GetModuleHandleW(NULL), NULL);
if (!_HWnd) if (!_HWnd)
{ {

@ -2314,7 +2314,7 @@ private:
TShaderDrvInfoPtrList _ShaderDrvInfos; TShaderDrvInfoPtrList _ShaderDrvInfos;
// Windows // Windows
std::string _WindowClass; std::wstring _WindowClass;
HWND _HWnd; HWND _HWnd;
sint32 _WindowX; sint32 _WindowX;
sint32 _WindowY; sint32 _WindowY;

@ -316,7 +316,7 @@ bool CDriverGL::init (uintptr_t windowIcon, emptyProc exitFunc)
wc.lpfnWndProc = (WNDPROC)WndProc; wc.lpfnWndProc = (WNDPROC)WndProc;
wc.cbClsExtra = 0; wc.cbClsExtra = 0;
wc.cbWndExtra = 0; wc.cbWndExtra = 0;
wc.hInstance = GetModuleHandle(NULL); wc.hInstance = GetModuleHandleW(NULL);
wc.hIcon = (HICON)windowIcon; wc.hIcon = (HICON)windowIcon;
wc.hCursor = _DefaultCursor; wc.hCursor = _DefaultCursor;
wc.hbrBackground = WHITE_BRUSH; wc.hbrBackground = WHITE_BRUSH;

@ -20,8 +20,11 @@
#if defined(_MSC_VER) && defined(_DEBUG) #if defined(_MSC_VER) && defined(_DEBUG)
#define _CRTDBG_MAP_ALLOC #define _CRTDBG_MAP_ALLOC
#include <stdlib.h> #include <stdlib.h>
#include <malloc.h>
#include <crtdbg.h> #include <crtdbg.h>
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#elif defined(_MSC_VER)
#include <malloc.h>
#endif #endif
#include <algorithm> #include <algorithm>

Loading…
Cancel
Save