Skip to content
Snippets Groups Projects
Commit c966bf2b authored by Sebastian Freitag's avatar Sebastian Freitag
Browse files

Merge branch...

Merge branch 'feature/#299_Check_with_the_cppcheck_developers_why_it_complains_about_passing_shared_ptr_by_value' into 'develop'

Feature/#299 check with the cppcheck developers why it complains about passing shared ptr by value

See merge request VR-Group/Project_Phoenix!104
parents 2b315135 def39f7c
No related branches found
No related tags found
1 merge request!104Feature/#299 check with the cppcheck developers why it complains about passing shared ptr by value
......@@ -86,7 +86,7 @@ std::vector<Entity*> Engine::GetEntities() const {
std::shared_ptr<Scene> Engine::GetScene() const { return scene_; }
void Engine::SetScene(const std::shared_ptr<Scene>& new_scene) {
void Engine::SetScene(std::shared_ptr<Scene> new_scene) {
// detach from current scene
if (scene_ != nullptr) {
scene_->engine_ = nullptr;
......
......@@ -108,7 +108,7 @@ class PHOENIX_EXPORT Engine final : public Loggable {
std::string ToString() const override;
bool IsRunning() const;
void SetScene(const std::shared_ptr<Scene>& new_scene);
void SetScene(std::shared_ptr<Scene> new_scene);
std::shared_ptr<Scene> GetScene() const;
// Parameters to the callback are: (old scene, new scene)
boost::signals2::connection AddSceneChangedCallback(
......
......@@ -85,13 +85,13 @@ void OpenVRControllerSystem::Update(const FrameTimer::TimeInfo&) {
if (left_controller_entity == nullptr) {
// create that controller
left_controller_entity =
AddController(scene, OpenVRControllerBehavior::LEFT);
AddController(scene.get(), OpenVRControllerBehavior::LEFT);
}
left_controller_active = true;
} else if (role == vr::TrackedControllerRole_RightHand) {
if (right_controller_entity == nullptr) {
right_controller_entity =
AddController(scene, OpenVRControllerBehavior::RIGHT);
AddController(scene.get(), OpenVRControllerBehavior::RIGHT);
}
right_controller_active = true;
}
......@@ -107,8 +107,7 @@ void OpenVRControllerSystem::Update(const FrameTimer::TimeInfo&) {
}
Entity* OpenVRControllerSystem::AddController(
const std::shared_ptr<phx::Scene>& scene,
OpenVRControllerBehavior::Side side) {
phx::Scene* scene, OpenVRControllerBehavior::Side side) {
auto& resource_manager = ResourceManager::instance();
std::string side_string =
side == OpenVRControllerBehavior::LEFT ? "left" : "right";
......@@ -132,7 +131,7 @@ Entity* OpenVRControllerSystem::AddController(
}
Entity* OpenVRControllerSystem::AddControllerEntity(
const std::shared_ptr<phx::Scene>& scene, ResourcePointer<Mesh> mesh,
phx::Scene* scene, ResourcePointer<Mesh> mesh,
ResourcePointer<Material> material, OpenVRControllerBehavior::Side side) {
Entity* controller = scene->CreateEntity();
controller->AddComponent<MeshHandle>()->SetMesh(mesh);
......
......@@ -58,11 +58,11 @@ class PHOENIX_EXPORT OpenVRControllerSystem : public System {
OpenVRControllerSystem(Engine* engine, DisplaySystem* display_system);
private:
static Entity* AddControllerEntity(const std::shared_ptr<phx::Scene>& scene,
static Entity* AddControllerEntity(phx::Scene* scene,
ResourcePointer<Mesh> mesh,
ResourcePointer<Material> material,
OpenVRControllerBehavior::Side side);
static Entity* AddController(const std::shared_ptr<phx::Scene>& scene,
static Entity* AddController(phx::Scene* scene,
OpenVRControllerBehavior::Side side);
HMD* hmd_ = nullptr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment