From 107646d95d1ee8a10b68d6313fc98c69c665debb Mon Sep 17 00:00:00 2001 From: KISHAN GRIMOUT Date: Wed, 9 Jul 2014 13:41:43 +0200 Subject: [PATCH 1/3] fix windows 64bit build in mem_displayer.cpp --- code/nel/src/misc/mem_displayer.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/code/nel/src/misc/mem_displayer.cpp b/code/nel/src/misc/mem_displayer.cpp index fbc0c0236..6857bff64 100644 --- a/code/nel/src/misc/mem_displayer.cpp +++ b/code/nel/src/misc/mem_displayer.cpp @@ -282,12 +282,20 @@ static void displayCallStack (CLog *log) STACKFRAME callStack; ::ZeroMemory (&callStack, sizeof(callStack)); + +#ifdef NL_OS_WIN64 + callStack.AddrPC.Offset = context.Rip; + callStack.AddrStack.Offset = context.Rsp; + callStack.AddrFrame.Offset = context.Rbp; +#else + callStack.AddrPC.Offset = context.Eip; + callStack.AddrStack.Offset = context.Esp; + callStack.AddrFrame.Offset = context.Ebp; +#endif + callStack.AddrPC.Mode = AddrModeFlat; - callStack.AddrPC.Offset = context.Eip; callStack.AddrStack.Mode = AddrModeFlat; - callStack.AddrStack.Offset = context.Esp; callStack.AddrFrame.Mode = AddrModeFlat; - callStack.AddrFrame.Offset = context.Ebp; for (uint32 i = 0; ; i++) { From 246d931bee043edf885469a0c3a154152be3db2e Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 9 Jul 2014 16:59:55 +0200 Subject: [PATCH 2/3] Formatting: Use tabs --- code/nel/src/misc/mem_displayer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/nel/src/misc/mem_displayer.cpp b/code/nel/src/misc/mem_displayer.cpp index 6857bff64..49431097d 100644 --- a/code/nel/src/misc/mem_displayer.cpp +++ b/code/nel/src/misc/mem_displayer.cpp @@ -284,13 +284,13 @@ static void displayCallStack (CLog *log) ::ZeroMemory (&callStack, sizeof(callStack)); #ifdef NL_OS_WIN64 - callStack.AddrPC.Offset = context.Rip; - callStack.AddrStack.Offset = context.Rsp; - callStack.AddrFrame.Offset = context.Rbp; + callStack.AddrPC.Offset = context.Rip; + callStack.AddrStack.Offset = context.Rsp; + callStack.AddrFrame.Offset = context.Rbp; #else - callStack.AddrPC.Offset = context.Eip; - callStack.AddrStack.Offset = context.Esp; - callStack.AddrFrame.Offset = context.Ebp; + callStack.AddrPC.Offset = context.Eip; + callStack.AddrStack.Offset = context.Esp; + callStack.AddrFrame.Offset = context.Ebp; #endif callStack.AddrPC.Mode = AddrModeFlat; From e729a9d0359b7bef587a399db7ca16bb662651fb Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 9 Jul 2014 12:31:22 +0200 Subject: [PATCH 3/3] Fix #162: Center ingame mouse cursor after login --- code/nel/include/nel/gui/view_pointer_base.h | 4 +++- code/nel/src/gui/view_pointer_base.cpp | 2 +- code/ryzom/client/src/input.cpp | 8 +++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/code/nel/include/nel/gui/view_pointer_base.h b/code/nel/include/nel/gui/view_pointer_base.h index f18f29239..e772d934f 100644 --- a/code/nel/include/nel/gui/view_pointer_base.h +++ b/code/nel/include/nel/gui/view_pointer_base.h @@ -53,12 +53,14 @@ namespace NLGUI bool show() const {return _PointerVisible;} void draw(){} - + /// set button state void setButtonState(NLMISC::TMouseButton state) { _Buttons = state; } /// get buttons state NLMISC::TMouseButton getButtonState() const { return _Buttons; } + static const sint32 InvalidCoord = 0x80000000; + protected: // (x,y) is from the TopLeft corner of the window sint32 _PointerX; // Current pointer position (raw, before snapping) diff --git a/code/nel/src/gui/view_pointer_base.cpp b/code/nel/src/gui/view_pointer_base.cpp index 045329d35..e29af7858 100644 --- a/code/nel/src/gui/view_pointer_base.cpp +++ b/code/nel/src/gui/view_pointer_base.cpp @@ -25,7 +25,7 @@ namespace NLGUI CViewBase( param ), _Buttons( NLMISC::noButton ) { - _PointerX = _PointerY = _PointerOldX = _PointerOldY = _PointerDownX = _PointerDownY = 0; + _PointerX = _PointerY = _PointerOldX = _PointerOldY = _PointerDownX = _PointerDownY = InvalidCoord; _PointerDown = false; _PointerVisible = true; } diff --git a/code/ryzom/client/src/input.cpp b/code/ryzom/client/src/input.cpp index e67df8af2..eff4e2bc9 100644 --- a/code/ryzom/client/src/input.cpp +++ b/code/ryzom/client/src/input.cpp @@ -263,7 +263,6 @@ bool IsMouseFreeLook() return MouseFreeLook; } - // ********************************************************************************* // Use this method to toggle the mouse (freelook -> cursor) void SetMouseCursor (bool updatePos) @@ -287,8 +286,11 @@ void SetMouseCursor (bool updatePos) { sint32 ix, iy; cursor->getPointerPos (ix, iy); - x = (float)ix / (float)width; - y = (float)iy / (float)height; + if (ix != CViewPointer::InvalidCoord && iy != CViewPointer::InvalidCoord) + { + x = (float)ix / (float)width; + y = (float)iy / (float)height; + } } }