Scene::GetEventDispatcher()改为返回引用而非指针
This commit is contained in:
@@ -40,9 +40,9 @@ namespace hgl::graph
|
|||||||
SAFE_CLEAR(root_node);
|
SAFE_CLEAR(root_node);
|
||||||
}
|
}
|
||||||
|
|
||||||
io::EventDispatcher *GetEventDispatcher() ///<获取事件分发器
|
io::EventDispatcher &GetEventDispatcher() ///<获取事件分发器
|
||||||
{
|
{
|
||||||
return &event_dispatcher;
|
return event_dispatcher;
|
||||||
}
|
}
|
||||||
};//class Scene
|
};//class Scene
|
||||||
|
|
||||||
|
@@ -132,12 +132,12 @@ namespace hgl::graph
|
|||||||
{
|
{
|
||||||
if(main_scene)
|
if(main_scene)
|
||||||
{
|
{
|
||||||
main_scene->GetEventDispatcher()->RemoveChildDispatcher(self_ep); //从旧的场景中移除事件分发器
|
main_scene->GetEventDispatcher().RemoveChildDispatcher(self_ep); //从旧的场景中移除事件分发器
|
||||||
}
|
}
|
||||||
|
|
||||||
if(new_scene)
|
if(new_scene)
|
||||||
{
|
{
|
||||||
new_scene->GetEventDispatcher()->AddChildDispatcher(self_ep); //添加到新的场景中
|
new_scene->GetEventDispatcher().AddChildDispatcher(self_ep); //添加到新的场景中
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user