From 2e37e6a8d952817c9961d6533b3c1fd1a67d92d2 Mon Sep 17 00:00:00 2001 From: elexis Date: Tue, 11 Apr 2017 01:37:00 +0000 Subject: [PATCH] Remove redundant path name argument from the CinemaManager AddPath function. Differential Revision: https://code.wildfiregames.com/D310 Patch By: Vladislav This was SVN commit r19406. --- source/graphics/CinemaPath.cpp | 2 +- source/graphics/CinemaPath.h | 2 +- source/graphics/MapReader.cpp | 2 +- source/simulation2/components/CCmpCinemaManager.cpp | 8 ++++---- source/simulation2/components/ICmpCinemaManager.h | 3 +-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/source/graphics/CinemaPath.cpp b/source/graphics/CinemaPath.cpp index 02d63c0fcf..9421014e5a 100644 --- a/source/graphics/CinemaPath.cpp +++ b/source/graphics/CinemaPath.cpp @@ -109,7 +109,7 @@ float CCinemaPath::GetElapsedTime() const return m_TimeElapsed; } -CStrW CCinemaPath::GetName() const +const CStrW& CCinemaPath::GetName() const { return m_Name; } diff --git a/source/graphics/CinemaPath.h b/source/graphics/CinemaPath.h index 68f641ee62..4807aecc50 100644 --- a/source/graphics/CinemaPath.h +++ b/source/graphics/CinemaPath.h @@ -90,7 +90,7 @@ public: float GetNodeFraction() const; float GetElapsedTime() const; - CStrW GetName() const; + const CStrW& GetName() const; void SetTimescale(fixed scale); diff --git a/source/graphics/MapReader.cpp b/source/graphics/MapReader.cpp index d393d0bde8..d04e1662d2 100644 --- a/source/graphics/MapReader.cpp +++ b/source/graphics/MapReader.cpp @@ -927,7 +927,7 @@ void CXMLReader::ReadPaths(XMBElement parent) if (!cmpCinemaManager) continue; if (!cmpCinemaManager->HasPath(pathName)) - cmpCinemaManager->AddPath(pathName, path); + cmpCinemaManager->AddPath(path); else LOGWARNING("Path with name '%s' already exists", pathName.ToUTF8()); } diff --git a/source/simulation2/components/CCmpCinemaManager.cpp b/source/simulation2/components/CCmpCinemaManager.cpp index 359290f612..8b0879dc0e 100644 --- a/source/simulation2/components/CCmpCinemaManager.cpp +++ b/source/simulation2/components/CCmpCinemaManager.cpp @@ -153,14 +153,14 @@ public: } } - virtual void AddPath(const CStrW& name, const CCinemaPath& path) + virtual void AddPath(const CCinemaPath& path) { - if (m_Paths.find(name) != m_Paths.end()) + if (m_Paths.find(path.GetName()) != m_Paths.end()) { - LOGWARNING("Path with name '%s' already exists", name.ToUTF8()); + LOGWARNING("Path with name '%s' already exists", path.GetName().ToUTF8()); return; } - m_Paths[name] = path; + m_Paths[path.GetName()] = path; } virtual void AddCinemaPathToQueue(const CStrW& name) diff --git a/source/simulation2/components/ICmpCinemaManager.h b/source/simulation2/components/ICmpCinemaManager.h index 89a8ef3593..a64e0c5130 100644 --- a/source/simulation2/components/ICmpCinemaManager.h +++ b/source/simulation2/components/ICmpCinemaManager.h @@ -33,10 +33,9 @@ class ICmpCinemaManager : public IComponent public: /** * Adds the path to the path list - * @param name path name * @param CCinemaPath path data */ - virtual void AddPath(const CStrW& name, const CCinemaPath& path) = 0; + virtual void AddPath(const CCinemaPath& path) = 0; /** * Adds the path to the playlist