Core/Misc: Port all the refactors sneaked in master to 3.3.5 include cleanup port

This commit is contained in:
Shauren
2020-09-04 13:38:24 +02:00
parent b20acfe701
commit b231903932
631 changed files with 2966 additions and 3263 deletions

View File

@@ -40,20 +40,20 @@ int CHECK_TREE_PERIOD = 200;
} // namespace
template<> struct HashTrait< GameObjectModel>{
static size_t hashCode(const GameObjectModel& g) { return (size_t)(void*)&g; }
static size_t hashCode(GameObjectModel const& g) { return (size_t)(void*)&g; }
};
template<> struct PositionTrait< GameObjectModel> {
static void getPosition(const GameObjectModel& g, G3D::Vector3& p) { p = g.getPosition(); }
static void getPosition(GameObjectModel const& g, G3D::Vector3& p) { p = g.getPosition(); }
};
template<> struct BoundsTrait< GameObjectModel> {
static void getBounds(const GameObjectModel& g, G3D::AABox& out) { out = g.getBounds();}
static void getBounds2(const GameObjectModel* g, G3D::AABox& out) { out = g->getBounds();}
static void getBounds(GameObjectModel const& g, G3D::AABox& out) { out = g.getBounds();}
static void getBounds2(GameObjectModel const* g, G3D::AABox& out) { out = g->getBounds();}
};
/*
static bool operator == (const GameObjectModel& mdl, const GameObjectModel& mdl2){
static bool operator==(GameObjectModel const& mdl, GameObjectModel const& mdl2){
return &mdl == &mdl2;
}
*/
@@ -71,13 +71,13 @@ struct DynTreeImpl : public ParentTree/*, public Intersectable*/
{
}
void insert(const Model& mdl)
void insert(Model const& mdl)
{
base::insert(mdl);
++unbalanced_times;
}
void remove(const Model& mdl)
void remove(Model const& mdl)
{
base::remove(mdl);
++unbalanced_times;
@@ -114,17 +114,17 @@ DynamicMapTree::~DynamicMapTree()
delete impl;
}
void DynamicMapTree::insert(const GameObjectModel& mdl)
void DynamicMapTree::insert(GameObjectModel const& mdl)
{
impl->insert(mdl);
}
void DynamicMapTree::remove(const GameObjectModel& mdl)
void DynamicMapTree::remove(GameObjectModel const& mdl)
{
impl->remove(mdl);
}
bool DynamicMapTree::contains(const GameObjectModel& mdl) const
bool DynamicMapTree::contains(GameObjectModel const& mdl) const
{
return impl->contains(mdl);
}