mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 06:59:55 +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 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,
|
RetrieveAnimationsVisitor::RetrieveAnimationsVisitor(SceneUtil::KeyframeHolder& target,
|
||||||
osg::ref_ptr<osgAnimation::BasicAnimationManager> animationManager, const std::string& normalized,
|
osg::ref_ptr<osgAnimation::BasicAnimationManager> animationManager, const std::string& normalized,
|
||||||
|
@ -179,23 +198,6 @@ namespace Resource
|
||||||
traverse(node);
|
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,
|
KeyframeManager::KeyframeManager(const VFS::Manager* vfs, SceneManager* sceneManager, double expiryDelay,
|
||||||
const ToUTF8::StatelessUtf8Encoder* encoder)
|
const ToUTF8::StatelessUtf8Encoder* encoder)
|
||||||
: ResourceManager(vfs, expiryDelay)
|
: ResourceManager(vfs, expiryDelay)
|
||||||
|
|
|
@ -33,9 +33,6 @@ namespace Resource
|
||||||
virtual void apply(osg::Node& node) override;
|
virtual void apply(osg::Node& node) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string parseTextKey(const std::string& line);
|
|
||||||
double parseTimeSignature(const std::string& line);
|
|
||||||
|
|
||||||
SceneUtil::KeyframeHolder& mTarget;
|
SceneUtil::KeyframeHolder& mTarget;
|
||||||
osg::ref_ptr<osgAnimation::BasicAnimationManager> mAnimationManager;
|
osg::ref_ptr<osgAnimation::BasicAnimationManager> mAnimationManager;
|
||||||
VFS::Path::Normalized mPath;
|
VFS::Path::Normalized mPath;
|
||||||
|
|
Loading…
Reference in a new issue