mirror of
https://github.com/rwengine/openrw.git
synced 2024-10-06 09:07:19 +02:00
Use ClumpPtr for clone
This commit is contained in:
parent
7d894b2da5
commit
d4061540d0
@ -113,10 +113,10 @@ void Clump::recalculateMetrics() {
|
||||
}
|
||||
}
|
||||
|
||||
Clump* Clump::clone() const {
|
||||
ClumpPtr Clump::clone() const {
|
||||
// Clone frame hierarchy
|
||||
auto newroot = rootframe_->cloneHierarchy();
|
||||
auto clump = new Clump;
|
||||
auto clump = std::make_shared<Clump>();
|
||||
clump->setFrame(newroot);
|
||||
|
||||
// This isn't the most optimal implementation, but this code is likely
|
||||
|
@ -278,7 +278,7 @@ public:
|
||||
/**
|
||||
* @return A Copy of the frames and atomics in this clump
|
||||
*/
|
||||
Clump* clone() const;
|
||||
ClumpPtr clone() const;
|
||||
|
||||
private:
|
||||
float boundingRadius;
|
||||
|
@ -32,7 +32,7 @@ CharacterObject::CharacterObject(GameWorld* engine, const glm::vec3& pos,
|
||||
: GameObject(engine, pos, rot, modelinfo)
|
||||
, controller(controller) {
|
||||
auto info = getModelInfo<PedModelInfo>();
|
||||
setClump(ClumpPtr(info->getModel()->clone()));
|
||||
setClump(info->getModel()->clone());
|
||||
if (info->getModel()) {
|
||||
setModel(info->getModel());
|
||||
animator = new Animator(getClump());
|
||||
|
@ -15,7 +15,7 @@ CutsceneObject::CutsceneObject(GameWorld *engine, const glm::vec3 &pos,
|
||||
else {
|
||||
setModel(getModelInfo<ClumpModelInfo>()->getModel());
|
||||
}
|
||||
setClump(ClumpPtr(getModel()->clone()));
|
||||
setClump(getModel()->clone());
|
||||
animator = new Animator(getClump());
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ VehicleObject::VehicleObject(GameWorld* engine, const glm::vec3& pos,
|
||||
}
|
||||
|
||||
setModel(getVehicle()->getModel());
|
||||
setClump(ClumpPtr(getModelInfo<VehicleModelInfo>()->getModel()->clone()));
|
||||
setClump(getModelInfo<VehicleModelInfo>()->getModel()->clone());
|
||||
setupModel();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user