From fbd1d5533c06fd5c770643b6616d7abac74abcd7 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Thu, 7 Jun 2012 23:57:02 +0200 Subject: [PATCH] CHANGED: #1471 CWidgetManager no longer depends on CViewPointer. Instead it depends on the new class CViewPointerBase. --HG-- branch : gui-refactoring --- code/ryzom/client/src/contextual_cursor.cpp | 2 +- code/ryzom/client/src/cursor_functions.cpp | 2 +- code/ryzom/client/src/input.cpp | 12 +- .../src/interface_v3/group_container.cpp | 4 +- .../interface_v3/input_handler_manager.cpp | 2 +- .../src/interface_v3/interface_manager.cpp | 2 +- .../src/interface_v3/view_bitmap_combo.cpp | 6 +- .../client/src/interface_v3/view_pointer.cpp | 113 +--------------- .../client/src/interface_v3/view_pointer.h | 37 +----- .../src/interface_v3/view_pointer_base.cpp | 122 ++++++++++++++++++ .../src/interface_v3/view_pointer_base.h | 55 ++++++++ .../src/interface_v3/widget_manager.cpp | 2 +- .../client/src/interface_v3/widget_manager.h | 8 +- code/ryzom/client/src/main_loop.cpp | 2 +- .../ryzom/client/src/motion/modes/ai_mode.cpp | 2 +- .../ryzom/client/src/motion/user_controls.cpp | 4 +- code/ryzom/client/src/r2/tool.cpp | 4 +- 17 files changed, 207 insertions(+), 172 deletions(-) create mode 100644 code/ryzom/client/src/interface_v3/view_pointer_base.cpp create mode 100644 code/ryzom/client/src/interface_v3/view_pointer_base.h diff --git a/code/ryzom/client/src/contextual_cursor.cpp b/code/ryzom/client/src/contextual_cursor.cpp index ded0866e6..f19958ead 100644 --- a/code/ryzom/client/src/contextual_cursor.cpp +++ b/code/ryzom/client/src/contextual_cursor.cpp @@ -143,7 +143,7 @@ bool CContextualCursor::context(const std::string &contextName, float dist, cons CInterfaceManager *IM = CInterfaceManager::getInstance(); if(IM) { - CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); + CViewPointer *cursor = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); if(cursor) { if (!functions.isString) diff --git a/code/ryzom/client/src/cursor_functions.cpp b/code/ryzom/client/src/cursor_functions.cpp index 10942ef3c..7ded55f53 100644 --- a/code/ryzom/client/src/cursor_functions.cpp +++ b/code/ryzom/client/src/cursor_functions.cpp @@ -239,7 +239,7 @@ void checkUnderCursor() return; // Get the cursor instance - CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); + CViewPointer *cursor = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); if(cursor == 0) return; diff --git a/code/ryzom/client/src/input.cpp b/code/ryzom/client/src/input.cpp index 3d67c2455..6427529f8 100644 --- a/code/ryzom/client/src/input.cpp +++ b/code/ryzom/client/src/input.cpp @@ -124,7 +124,7 @@ bool InitMouseWithCursor (bool hardware) { Driver->showCursor(true); - CViewPointer *pointer = CWidgetManager::getInstance()->getPointer(); + CViewPointer *pointer = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); if (pointer) { float x = (float)pointer->getX()/(float)Driver->getWindowWidth(); @@ -145,7 +145,7 @@ bool InitMouseWithCursor (bool hardware) else { CInterfaceManager *pIm = CInterfaceManager::getInstance(); - CViewPointer *vp = CWidgetManager::getInstance()->getPointer(); + CViewPointer *vp = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); Driver->showCursor(false); SetMousePosFirstTime = false; if (vp) @@ -247,7 +247,7 @@ void SetMouseFreeLook () CInterfaceManager *im = CInterfaceManager::getInstance(); if (im) { - CViewPointer *pointer = CWidgetManager::getInstance()->getPointer(); + CViewPointer *pointer = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); if (pointer) pointer->show (false); } @@ -281,7 +281,7 @@ void SetMouseCursor (bool updatePos) if (instance) { // Get the cursor instance - CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); + CViewPointer *cursor = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); if (cursor) { sint32 ix, iy; @@ -319,7 +319,7 @@ void SetMouseCursor (bool updatePos) if (instance) { // Get the cursor instance - CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); + CViewPointer *cursor = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); if (cursor) { cursor->setPointerPos(ix, iy); @@ -342,7 +342,7 @@ void SetMouseCursor (bool updatePos) CInterfaceManager *im = CInterfaceManager::getInstance(); if (im) { - CViewPointer *pointer = CWidgetManager::getInstance()->getPointer(); + CViewPointer *pointer = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); if (pointer) pointer->show (true); } diff --git a/code/ryzom/client/src/interface_v3/group_container.cpp b/code/ryzom/client/src/interface_v3/group_container.cpp index 6f48f5598..989275c2f 100644 --- a/code/ryzom/client/src/interface_v3/group_container.cpp +++ b/code/ryzom/client/src/interface_v3/group_container.cpp @@ -2194,7 +2194,7 @@ void CGroupContainer::draw () // manage rollover - CViewPointer *mousePointer = CWidgetManager::getInstance()->getPointer(); + CViewPointer *mousePointer = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); if (mousePointer) { bool dontFade = false; @@ -3641,7 +3641,7 @@ void CGroupContainer::setOpenable(bool openable) void CGroupContainer::rollOverAlphaUp() { CInterfaceManager *im = CInterfaceManager::getInstance(); - CViewPointer *vp = CWidgetManager::getInstance()->getPointer(); + CViewPointer *vp = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); float speed = im->getAlphaRolloverSpeed(); if (!isIn(vp->getX(), vp->getY())) { diff --git a/code/ryzom/client/src/interface_v3/input_handler_manager.cpp b/code/ryzom/client/src/interface_v3/input_handler_manager.cpp index 9208f9472..6074f98e5 100644 --- a/code/ryzom/client/src/interface_v3/input_handler_manager.cpp +++ b/code/ryzom/client/src/interface_v3/input_handler_manager.cpp @@ -268,7 +268,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event) { - CViewPointer &rIP = *CWidgetManager::getInstance()->getPointer(); + CViewPointer &rIP = *static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); NLGUI::CEventDescriptorMouse eventDesc; diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index 631dea206..961660c13 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -2481,7 +2481,7 @@ uint CInterfaceManager::getDepth (CCtrlBase *ctrl, CInterfaceGroup *pNewCurrentW bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) { bool handled= false; - CViewPointer *_Pointer = CWidgetManager::getInstance()->getPointer(); + CViewPointer *_Pointer = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); if( event.getType() == NLGUI::CEventDescriptor::system ) { diff --git a/code/ryzom/client/src/interface_v3/view_bitmap_combo.cpp b/code/ryzom/client/src/interface_v3/view_bitmap_combo.cpp index 45510d662..34aebfaf8 100644 --- a/code/ryzom/client/src/interface_v3/view_bitmap_combo.cpp +++ b/code/ryzom/client/src/interface_v3/view_bitmap_combo.cpp @@ -361,7 +361,7 @@ void CViewBitmapCombo::draw() && my < py + (sint32) itemh) { overItem = true; - if (CWidgetManager::getInstance()->getPointer()->getButtonState() & NLMISC::leftButton) + if ( static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() )->getButtonState() & NLMISC::leftButton) { textId = getTexId(_TexsPushedId, texIndex); color = getCol(_ColPushed, texIndex); @@ -416,7 +416,7 @@ void CViewBitmapCombo::draw() // if (_CD.Unrolled.getBool()) { - if (overItem && CWidgetManager::getInstance()->getPointer()->getButtonState() & NLMISC::leftButton) + if (overItem && static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() )->getButtonState() & NLMISC::leftButton) { textId = getTexId(_TexsId, selectedTexIndex); color = getCol(_Col, selectedTexIndex); @@ -436,7 +436,7 @@ void CViewBitmapCombo::draw() && my < py + (sint32) itemh ) { - if (CWidgetManager::getInstance()->getPointer()->getButtonState() & NLMISC::leftButton) + if ( static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() )->getButtonState() & NLMISC::leftButton) { textId = getTexId(_TexsPushedId, selectedTexIndex); color = getCol(_ColPushed, selectedTexIndex); diff --git a/code/ryzom/client/src/interface_v3/view_pointer.cpp b/code/ryzom/client/src/interface_v3/view_pointer.cpp index c6065f321..27966ffc3 100644 --- a/code/ryzom/client/src/interface_v3/view_pointer.cpp +++ b/code/ryzom/client/src/interface_v3/view_pointer.cpp @@ -16,10 +16,7 @@ -#include "stdpch.h" - #include "../input.h" -// #include "view_pointer.h" #include "interface_manager.h" #include "nel/gui/view_renderer.h" @@ -45,12 +42,9 @@ NLMISC_REGISTER_OBJECT(CViewBase, CViewPointer, std::string, "pointer"); // -------------------------------------------------------------------------------------------------------------------- CViewPointer::CViewPointer (const TCtorParam ¶m) - : CViewBase(param), + : CViewPointerBase(param), _Buttons(NLMISC::noButton) { - _PointerX = _PointerY = _PointerOldX = _PointerOldY = _PointerDownX = _PointerDownY = 0; - _PointerDown = false; - _PointerVisible = true; _TxIdDefault = -2; _TxIdMoveWindow = -2; _TxIdResizeBRTL = -2; @@ -608,111 +602,6 @@ bool CViewPointer::drawCustom(CCtrlBase* pCB) // +++ SET +++ -// -------------------------------------------------------------------------------------------------------------------- -void CViewPointer::setPointerPos (sint32 x, sint32 y) -{ - if (_PointerDown) - { - if (!_PointerDrag) - { - if (((_PointerX - _PointerDownX) != 0) || - ((_PointerY - _PointerDownY) != 0)) - { - _PointerDrag = true; - } - } - } - - _PointerOldX = getX(); - _PointerOldY = getY(); - - _PointerX = x; - _PointerY = y; -} - -// -------------------------------------------------------------------------------------------------------------------- -void CViewPointer::setPointerDispPos (sint32 x, sint32 y) -{ - setX (x); - setY (y); - updateCoords (); -} - -// -------------------------------------------------------------------------------------------------------------------- -void CViewPointer::resetPointerPos () -{ - _PointerOldX = _PointerX; - _PointerOldY = _PointerY; -} - -// -------------------------------------------------------------------------------------------------------------------- -void CViewPointer::setPointerDown (bool pd) -{ - _PointerDown = pd; - - if (_PointerDown == true) - { - _PointerDownX = _PointerX; - _PointerDownY = _PointerY; - } - - if (_PointerDown == false) - _PointerDrag = false; -} - -// -------------------------------------------------------------------------------------------------------------------- -void CViewPointer::setPointerDownString (const std::string &s) -{ - _PointerDownString = s; -} - -// +++ GET +++ - -// -------------------------------------------------------------------------------------------------------------------- -void CViewPointer::getPointerPos (sint32 &x, sint32 &y) -{ - x = _PointerX; - y = _PointerY; -} - -// -------------------------------------------------------------------------------------------------------------------- -void CViewPointer::getPointerDispPos (sint32 &x, sint32 &y) -{ - x = getX(); - y = getY(); -} - -// -------------------------------------------------------------------------------------------------------------------- -void CViewPointer::getPointerOldPos (sint32 &x, sint32 &y) -{ - x = _PointerOldX; - y = _PointerOldY; -} - -// -------------------------------------------------------------------------------------------------------------------- -void CViewPointer::getPointerDownPos (sint32 &x, sint32 &y) -{ - x = _PointerDownX; - y = _PointerDownY; -} - -// -------------------------------------------------------------------------------------------------------------------- -bool CViewPointer::getPointerDown () -{ - return _PointerDown; -} - -// -------------------------------------------------------------------------------------------------------------------- -bool CViewPointer::getPointerDrag () -{ - return _PointerDrag; -} - -// -------------------------------------------------------------------------------------------------------------------- -std::string CViewPointer::getPointerDownString () -{ - return _PointerDownString; -} // -------------------------------------------------------------------------------------------------------------------- void CViewPointer::setStringMode (bool stringCursor) diff --git a/code/ryzom/client/src/interface_v3/view_pointer.h b/code/ryzom/client/src/interface_v3/view_pointer.h index 42a20b0a0..8002f5e9d 100644 --- a/code/ryzom/client/src/interface_v3/view_pointer.h +++ b/code/ryzom/client/src/interface_v3/view_pointer.h @@ -21,7 +21,7 @@ #include "nel/misc/types_nl.h" #include "nel/misc/events.h" -#include "view_base.h" +#include "view_pointer_base.h" class CGroupContainer; class CCtrlBase; @@ -33,35 +33,16 @@ class CCtrlBase; * \date 2002 */ -class CViewPointer : public CViewBase +class CViewPointer : public CViewPointerBase { friend void SetMouseFreeLook (); friend void SetMouseCursor (bool updateMousePos); public: + DECLARE_UI_CLASS( CViewPointerBase ) CViewPointer (const TCtorParam ¶m); bool parse (xmlNodePtr cur,CInterfaceGroup * parentGroup); void draw (); - // Set the pointer position. - void setPointerPos (sint32 x, sint32 y); - void setPointerDispPos (sint32 x, sint32 y); - - void resetPointerPos (); - void setPointerDown (bool pd); - void setPointerDownString (const std::string &s); - - void getPointerPos (sint32 &x, sint32 &y); - void getPointerDispPos (sint32 &x, sint32 &y); - - void getPointerOldPos (sint32 &x, sint32 &y); - void getPointerDownPos (sint32 &x, sint32 &y); - bool getPointerDown (); - std::string getPointerDownString (); - bool getPointerDrag (); - - /// Is the pointer visible ? - bool show() const {return _PointerVisible;} - // Set cursor mode void setStringMode (bool stringCursor); bool getStringMode() const {return _StringMode;} @@ -135,18 +116,6 @@ private: sint32 _OffsetX; sint32 _OffsetY; - // (x,y) is from the TopLeft corner of the window - sint32 _PointerX; // Current pointer position (raw, before snapping) - sint32 _PointerY; - sint32 _PointerOldX; // Previous frame pointer position - sint32 _PointerOldY; - bool _PointerDown; // Is the pointer down ? - sint32 _PointerDownX; // Pointer down position - sint32 _PointerDownY; - std::string _PointerDownString; // What is under the pointer at the down position - bool _PointerDrag; // Is the pointer down and we have moved ? - bool _PointerVisible; // Is the pointer visible or hidden ? - NLMISC::TMouseButton _Buttons; CGroupContainer *_LastHightLight; diff --git a/code/ryzom/client/src/interface_v3/view_pointer_base.cpp b/code/ryzom/client/src/interface_v3/view_pointer_base.cpp new file mode 100644 index 000000000..e4b124dc3 --- /dev/null +++ b/code/ryzom/client/src/interface_v3/view_pointer_base.cpp @@ -0,0 +1,122 @@ +#include "view_pointer_base.h" + +CViewPointerBase::CViewPointerBase( const CViewBase::TCtorParam ¶m ) : +CViewBase( param ) +{ + _PointerX = _PointerY = _PointerOldX = _PointerOldY = _PointerDownX = _PointerDownY = 0; + _PointerDown = false; + _PointerVisible = true; +} + +CViewPointerBase::~CViewPointerBase() +{ +} + +// -------------------------------------------------------------------------------------------------------------------- +void CViewPointerBase::setPointerPos (sint32 x, sint32 y) +{ + if (_PointerDown) + { + if (!_PointerDrag) + { + if (((_PointerX - _PointerDownX) != 0) || + ((_PointerY - _PointerDownY) != 0)) + { + _PointerDrag = true; + } + } + } + + _PointerOldX = getX(); + _PointerOldY = getY(); + + _PointerX = x; + _PointerY = y; +} + +// -------------------------------------------------------------------------------------------------------------------- +void CViewPointerBase::setPointerDispPos (sint32 x, sint32 y) +{ + setX (x); + setY (y); + updateCoords (); +} + +// -------------------------------------------------------------------------------------------------------------------- +void CViewPointerBase::resetPointerPos () +{ + _PointerOldX = _PointerX; + _PointerOldY = _PointerY; +} + +// -------------------------------------------------------------------------------------------------------------------- +void CViewPointerBase::setPointerDown (bool pd) +{ + _PointerDown = pd; + + if (_PointerDown == true) + { + _PointerDownX = _PointerX; + _PointerDownY = _PointerY; + } + + if (_PointerDown == false) + _PointerDrag = false; +} + +// -------------------------------------------------------------------------------------------------------------------- +void CViewPointerBase::setPointerDownString (const std::string &s) +{ + _PointerDownString = s; +} + +// +++ GET +++ + +// -------------------------------------------------------------------------------------------------------------------- +void CViewPointerBase::getPointerPos (sint32 &x, sint32 &y) +{ + x = _PointerX; + y = _PointerY; +} + +// -------------------------------------------------------------------------------------------------------------------- +void CViewPointerBase::getPointerDispPos (sint32 &x, sint32 &y) +{ + x = getX(); + y = getY(); +} + +// -------------------------------------------------------------------------------------------------------------------- +void CViewPointerBase::getPointerOldPos (sint32 &x, sint32 &y) +{ + x = _PointerOldX; + y = _PointerOldY; +} + +// -------------------------------------------------------------------------------------------------------------------- +void CViewPointerBase::getPointerDownPos (sint32 &x, sint32 &y) +{ + x = _PointerDownX; + y = _PointerDownY; +} + +// -------------------------------------------------------------------------------------------------------------------- +bool CViewPointerBase::getPointerDown () +{ + return _PointerDown; +} + +// -------------------------------------------------------------------------------------------------------------------- +bool CViewPointerBase::getPointerDrag () +{ + return _PointerDrag; +} + +// -------------------------------------------------------------------------------------------------------------------- +std::string CViewPointerBase::getPointerDownString () +{ + return _PointerDownString; +} + + + diff --git a/code/ryzom/client/src/interface_v3/view_pointer_base.h b/code/ryzom/client/src/interface_v3/view_pointer_base.h new file mode 100644 index 000000000..388180804 --- /dev/null +++ b/code/ryzom/client/src/interface_v3/view_pointer_base.h @@ -0,0 +1,55 @@ +#ifndef VIEW_POINTER_BASE_H +#define VIEW_POINTER_BASE_H + +#include "view_base.h" + +class CViewPointerBase : public CViewBase +{ +public: + DECLARE_UI_CLASS( CViewPointerBase ) + + CViewPointerBase( const TCtorParam ¶m ); + virtual ~CViewPointerBase(); + + // Set the pointer position. + void setPointerPos (sint32 x, sint32 y); + void setPointerDispPos (sint32 x, sint32 y); + + void resetPointerPos (); + void setPointerDown (bool pd); + void setPointerDownString (const std::string &s); + + void getPointerPos (sint32 &x, sint32 &y); + void getPointerDispPos (sint32 &x, sint32 &y); + + void getPointerOldPos (sint32 &x, sint32 &y); + void getPointerDownPos (sint32 &x, sint32 &y); + bool getPointerDown (); + std::string getPointerDownString (); + bool getPointerDrag (); + + /// Is the pointer visible ? + bool show() const {return _PointerVisible;} + + void draw(){} + +protected: + // (x,y) is from the TopLeft corner of the window + sint32 _PointerX; // Current pointer position (raw, before snapping) + sint32 _PointerY; + sint32 _PointerOldX; // Previous frame pointer position + sint32 _PointerOldY; + bool _PointerDown; // Is the pointer down ? + sint32 _PointerDownX; // Pointer down position + sint32 _PointerDownY; + std::string _PointerDownString; // What is under the pointer at the down position + bool _PointerDrag; // Is the pointer down and we have moved ? + bool _PointerVisible; // Is the pointer visible or hidden ? + +private: + + +}; + +#endif + diff --git a/code/ryzom/client/src/interface_v3/widget_manager.cpp b/code/ryzom/client/src/interface_v3/widget_manager.cpp index 083e9c355..24ab84f42 100644 --- a/code/ryzom/client/src/interface_v3/widget_manager.cpp +++ b/code/ryzom/client/src/interface_v3/widget_manager.cpp @@ -18,7 +18,7 @@ #include "interface_group.h" #include "group_container.h" #include "group_in_scene.h" -#include "view_pointer.h" +#include "view_pointer_base.h" #include "group_editbox_base.h" #include "ctrl_draggable.h" diff --git a/code/ryzom/client/src/interface_v3/widget_manager.h b/code/ryzom/client/src/interface_v3/widget_manager.h index ba7cdbf6a..998709032 100644 --- a/code/ryzom/client/src/interface_v3/widget_manager.h +++ b/code/ryzom/client/src/interface_v3/widget_manager.h @@ -27,7 +27,7 @@ class CInterfaceElement; class CCtrlBase; class CViewBase; class CInterfaceGroup; -class CViewPointer; +class CViewPointerBase; class IParser { @@ -184,8 +184,8 @@ public: float _DeltaTimeStopingContextHelp; - CViewPointer* getPointer(){ return _Pointer; } - void setPointer( CViewPointer *pointer ){ _Pointer = pointer; } + CViewPointerBase* getPointer(){ return _Pointer; } + void setPointer( CViewPointerBase *pointer ){ _Pointer = pointer; } /** * get the window under a spot @@ -278,7 +278,7 @@ private: std::vector< SModalWndInfo > _ModalStack; static std::string _CtrlLaunchingModalId; NLMISC::CRefPtr< CCtrlBase > curContextHelp; - CViewPointer *_Pointer; + CViewPointerBase *_Pointer; NLMISC::CRefPtr< CInterfaceGroup > _WindowUnder; diff --git a/code/ryzom/client/src/main_loop.cpp b/code/ryzom/client/src/main_loop.cpp index 26329c055..d3cee7381 100644 --- a/code/ryzom/client/src/main_loop.cpp +++ b/code/ryzom/client/src/main_loop.cpp @@ -1738,7 +1738,7 @@ bool mainLoop() if(!CViewRenderer::getInstance()->isMinimized()) { // Get the cursor instance - CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); + CViewPointer *cursor = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); if(cursor) { // Get the pointer position (in pixel) diff --git a/code/ryzom/client/src/motion/modes/ai_mode.cpp b/code/ryzom/client/src/motion/modes/ai_mode.cpp index 775aff68c..1f5caafab 100644 --- a/code/ryzom/client/src/motion/modes/ai_mode.cpp +++ b/code/ryzom/client/src/motion/modes/ai_mode.cpp @@ -150,7 +150,7 @@ void CUserControls::aiMode() IM->enableMouseHandling(false); EventsListener.enableMouseSmoothing(true); // Get the cursor instance and hide. - CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); + CViewPointer *cursor = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); if(cursor) { // Freelook mode. diff --git a/code/ryzom/client/src/motion/user_controls.cpp b/code/ryzom/client/src/motion/user_controls.cpp index 4697a0d5e..6c7d5027a 100644 --- a/code/ryzom/client/src/motion/user_controls.cpp +++ b/code/ryzom/client/src/motion/user_controls.cpp @@ -507,7 +507,7 @@ void CUserControls::freeLook(bool fullMode) // disable interface mouse handling. IM->enableMouseHandling(false); // Get the cursor instance - CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); + CViewPointer *cursor = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); if(cursor) { // Hide the Cursor. @@ -590,7 +590,7 @@ void CUserControls::cameraLook(bool fullMode) // disable interface mouse handling. IM->enableMouseHandling(false); // Get the cursor instance - CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); + CViewPointer *cursor = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); if(cursor) { // Hide the Cursor. diff --git a/code/ryzom/client/src/r2/tool.cpp b/code/ryzom/client/src/r2/tool.cpp index 23706d9f2..9b80311f5 100644 --- a/code/ryzom/client/src/r2/tool.cpp +++ b/code/ryzom/client/src/r2/tool.cpp @@ -155,7 +155,7 @@ uint32 CTool::getScreenHeight() void CTool::getMousePos(sint32 &x, sint32 &y) { //H_AUTO(R2_CTool_getMousePos) - CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); + CViewPointer *cursor = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); if(cursor == NULL) { x = y = -1; @@ -753,7 +753,7 @@ bool CTool::isMouseCaptured() void CTool::setMouseCursor(const char *cursorTexture) { //H_AUTO(R2_CTool_setMouseCursor) - CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); + CViewPointer *cursor = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); if(cursor) { cursor->setCursor(cursorTexture);