From 9f09f4d08005a0b92e8dd0b1f4231bf76d3d7830 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Fri, 8 Jun 2012 00:28:47 +0200 Subject: [PATCH] CHANGED: #1471 CWidgetManager no longer depends on CGroupInScene. --- code/ryzom/client/src/interface_v3/group_in_scene.cpp | 2 +- code/ryzom/client/src/interface_v3/group_in_scene.h | 6 ------ code/ryzom/client/src/interface_v3/group_modal.cpp | 2 -- code/ryzom/client/src/interface_v3/interface_group.cpp | 2 ++ code/ryzom/client/src/interface_v3/interface_group.h | 8 ++++++++ code/ryzom/client/src/interface_v3/widget_manager.cpp | 9 +++++---- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/group_in_scene.cpp b/code/ryzom/client/src/interface_v3/group_in_scene.cpp index 2e468acd9..9970d6227 100644 --- a/code/ryzom/client/src/interface_v3/group_in_scene.cpp +++ b/code/ryzom/client/src/interface_v3/group_in_scene.cpp @@ -59,7 +59,7 @@ CGroupInScene::CGroupInScene(const TCtorParam ¶m) Position= CVector::Null; _ProjCenter= CVector::Null; - _DepthForZSort= 0.f; + _IsGroupInScene = true; } // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/group_in_scene.h b/code/ryzom/client/src/interface_v3/group_in_scene.h index 76c0f03e7..ad2139d98 100644 --- a/code/ryzom/client/src/interface_v3/group_in_scene.h +++ b/code/ryzom/client/src/interface_v3/group_in_scene.h @@ -66,9 +66,6 @@ public: sint32 getOffsetY() const { return _OffsetY; } void setOffsetY(sint32 dmh) { _OffsetY = dmh; } - // Return the current Depth, with no ZBias applied. - float getDepthForZSort() const { return _DepthForZSort; } - // set/return the ZBias for this group in scene (default 0) void setZBias(float zbias) {_ZBias= zbias;} float getZBias() const {return _ZBias;} @@ -80,9 +77,6 @@ protected: // Projected Position memorized. x/y is in window coordinate, while z in is world/camera coordinate NLMISC::CVector _ProjCenter; - // Projected Depth with no ZBias applied - float _DepthForZSort; - // Offset sint32 _OffsetX, _OffsetY; diff --git a/code/ryzom/client/src/interface_v3/group_modal.cpp b/code/ryzom/client/src/interface_v3/group_modal.cpp index 78aad5ed4..611544b01 100644 --- a/code/ryzom/client/src/interface_v3/group_modal.cpp +++ b/code/ryzom/client/src/interface_v3/group_modal.cpp @@ -16,8 +16,6 @@ -#include "stdpch.h" - #include "group_modal.h" #include "interface_manager.h" #include "interface_element.h" diff --git a/code/ryzom/client/src/interface_v3/interface_group.cpp b/code/ryzom/client/src/interface_v3/interface_group.cpp index 83cb0ca35..bb0b0bbbf 100644 --- a/code/ryzom/client/src/interface_v3/interface_group.cpp +++ b/code/ryzom/client/src/interface_v3/interface_group.cpp @@ -55,6 +55,7 @@ CInterfaceGroup::CInterfaceGroup(const TCtorParam ¶m) : CCtrlBase(param) _UseCursor = true; _IsGroupContainer = false; _IsGroupScrollText = false; + _IsGroupInScene = false; _AHOnActive = NULL; _AHOnDeactive = NULL; _AHOnLeftClick = NULL; @@ -63,6 +64,7 @@ CInterfaceGroup::CInterfaceGroup(const TCtorParam ¶m) : CCtrlBase(param) _AHOnEscape = NULL; _NeedFrameUpdatePos= false; _LUAEnvTableCreated= false; + _DepthForZSort= 0.f; #ifdef AJM_DEBUG_TRACK_INTERFACE_GROUPS CInterfaceManager::getInstance()->DebugTrackGroupsCreated( this ); diff --git a/code/ryzom/client/src/interface_v3/interface_group.h b/code/ryzom/client/src/interface_v3/interface_group.h index 3b3a59e84..5e1b1f716 100644 --- a/code/ryzom/client/src/interface_v3/interface_group.h +++ b/code/ryzom/client/src/interface_v3/interface_group.h @@ -249,6 +249,7 @@ public: // quick way to know if the group is a CGroupContainer bool isGroupContainer() const { return _IsGroupContainer; } bool isGroupScrollText() const{ return _IsGroupScrollText; } + bool isGroupInScene() const{ return _IsGroupInScene; } CInterfaceGroup* getEnclosingContainer(); @@ -305,6 +306,9 @@ public: virtual CInterfaceElement *clone(); virtual void serial(NLMISC::IStream &f); + // Return the current Depth, with no ZBias applied. + float getDepthForZSort() const { return _DepthForZSort; } + protected: void makeNewClip (sint32 &oldClipX, sint32 &oldClipY, sint32 &oldClipW, sint32 &oldClipH); @@ -347,11 +351,15 @@ protected: bool _UseCursor : 1; bool _IsGroupContainer : 1; // faster than a virual call bool _IsGroupScrollText : 1; + bool _IsGroupInScene : 1; bool _NeedFrameUpdatePos : 1; // typically For CGroupInScene sint32 _ResizeFromChildWMargin; sint32 _ResizeFromChildHMargin; sint32 _GroupSizeRef; + // Projected Depth with no ZBias applied + float _DepthForZSort; + // handler for activation IActionHandler *_AHOnActive; CStringShared _AHOnActiveParams; diff --git a/code/ryzom/client/src/interface_v3/widget_manager.cpp b/code/ryzom/client/src/interface_v3/widget_manager.cpp index 24ab84f42..01b10580b 100644 --- a/code/ryzom/client/src/interface_v3/widget_manager.cpp +++ b/code/ryzom/client/src/interface_v3/widget_manager.cpp @@ -17,9 +17,10 @@ #include "widget_manager.h" #include "interface_group.h" #include "group_container.h" -#include "group_in_scene.h" -#include "view_pointer_base.h" +#include "group_modal.h" +#include "nel/gui/view_renderer.h" +#include "view_pointer_base.h" #include "group_editbox_base.h" #include "ctrl_draggable.h" @@ -38,7 +39,7 @@ void CWidgetManager::SMasterGroup::addWindow(CInterfaceGroup *pIG, uint8 nPrio) // Priority WIN_PRIORITY_WORLD_SPACE is only for CGroupInScene ! // Add this group in another priority list - nlassert ((nPrio!=WIN_PRIORITY_MAX) || (dynamic_cast(pIG)!=NULL)); + nlassert ((nPrio!=WIN_PRIORITY_MAX) || pIG->isGroupInScene() ); for (uint8 i = 0; i < WIN_PRIORITY_MAX; ++i) { @@ -239,7 +240,7 @@ void CWidgetManager::SMasterGroup::sortWorldSpaceGroup () sortTable.push_back (CElementToSort ()); CElementToSort &elm = sortTable.back(); elm.pIG = *it; - elm.Distance = (static_cast(*it))->getDepthForZSort(); + elm.Distance = (*it)->getDepthForZSort(); it++; }