mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 06:29:56 +00:00
Move parseTextKey and parseTimeSignature to unnamed namespace
This commit is contained in:
parent
6e97deb3f7
commit
616b033c36
2 changed files with 19 additions and 20 deletions
|
@ -23,6 +23,25 @@
|
|||
|
||||
namespace Resource
|
||||
{
|
||||
namespace
|
||||
{
|
||||
std::string parseTextKey(const std::string& line)
|
||||
{
|
||||
const std::size_t spacePos = line.find_last_of(' ');
|
||||
if (spacePos != std::string::npos)
|
||||
return line.substr(0, spacePos);
|
||||
return {};
|
||||
}
|
||||
|
||||
double parseTimeSignature(std::string_view line)
|
||||
{
|
||||
size_t spacePos = line.find_last_of(' ');
|
||||
double time = 0.0;
|
||||
if (spacePos != std::string::npos && spacePos + 1 < line.size())
|
||||
time = Misc::StringUtils::toNumeric<double>(line.substr(spacePos + 1), time);
|
||||
return time;
|
||||
}
|
||||
}
|
||||
|
||||
RetrieveAnimationsVisitor::RetrieveAnimationsVisitor(SceneUtil::KeyframeHolder& target,
|
||||
osg::ref_ptr<osgAnimation::BasicAnimationManager> animationManager, const std::string& normalized,
|
||||
|
@ -179,23 +198,6 @@ namespace Resource
|
|||
traverse(node);
|
||||
}
|
||||
|
||||
std::string RetrieveAnimationsVisitor::parseTextKey(const std::string& line)
|
||||
{
|
||||
size_t spacePos = line.find_last_of(' ');
|
||||
if (spacePos != std::string::npos)
|
||||
return line.substr(0, spacePos);
|
||||
return "";
|
||||
}
|
||||
|
||||
double RetrieveAnimationsVisitor::parseTimeSignature(const std::string& line)
|
||||
{
|
||||
size_t spacePos = line.find_last_of(' ');
|
||||
double time = 0.0;
|
||||
if (spacePos != std::string::npos && spacePos + 1 < line.size())
|
||||
time = Misc::StringUtils::toNumeric<double>(line.substr(spacePos + 1), time);
|
||||
return time;
|
||||
}
|
||||
|
||||
KeyframeManager::KeyframeManager(const VFS::Manager* vfs, SceneManager* sceneManager, double expiryDelay,
|
||||
const ToUTF8::StatelessUtf8Encoder* encoder)
|
||||
: ResourceManager(vfs, expiryDelay)
|
||||
|
|
|
@ -33,9 +33,6 @@ namespace Resource
|
|||
virtual void apply(osg::Node& node) override;
|
||||
|
||||
private:
|
||||
std::string parseTextKey(const std::string& line);
|
||||
double parseTimeSignature(const std::string& line);
|
||||
|
||||
SceneUtil::KeyframeHolder& mTarget;
|
||||
osg::ref_ptr<osgAnimation::BasicAnimationManager> mAnimationManager;
|
||||
VFS::Path::Normalized mPath;
|
||||
|
|
Loading…
Reference in a new issue