Commit 0e3c08e7 authored by Robert Menzel's avatar Robert Menzel

Merge branch 'refactorGLobjects' of...

Merge branch 'refactorGLobjects' of file:///data/git-repository/acgl/libraries/acgl into refactorGLobjects
parents e6ee447f 9fbe7d89
cmake @ fbc7a6c6
Subproject commit 809ae57efe0fb1b44c069aacfabd3f5f988cafdb
Subproject commit fbc7a6c6d438fd390368709eb7727f3a522bfe27
......@@ -337,9 +337,6 @@ public:
//Calculate the distance
float distance = mCurrentSpeed*((float)_msec)/1000.0f;
if(distance > 10.0f)
distance = 1000.0f;
//Move on that distance
float realDistance = mInterpolator.interpolate(mpData, distance);
long msecLeft = (uint_t)((distance-realDistance)*1000.0f/mCurrentSpeed);
......@@ -350,7 +347,7 @@ public:
else
mCurrentSpeed += fmin(mTargetSpeed-mCurrentSpeed, mAcceleration*((float)_msec)/1000.0f);
return 0;//msecLeft;
return msecLeft;
}
virtual bool finished()
......
......@@ -25,6 +25,7 @@ namespace StringOperations
bool splitFileExtension (const std::string& _full, std::string& _file, std::string& _extension );
bool splitLastFileOrFolder (const std::string& _full, std::string& _path, std::string& _fileOrFolder);
bool startsWith (const std::string& _string, const std::string& _prefix);
bool startsWith (const std::string& _string, const char _prefix);
std::vector<std::string> split (const std::string& _string, char _splitChar, bool _skipEmptyStrings = true);
......
......@@ -36,14 +36,23 @@ namespace StringOperations
bool startsWith(const std::string& _string, const std::string& _prefix)
{
if(_prefix.length() > _string.length())
std::size_t prefixLen = _prefix.length();
if(prefixLen > _string.length())
return false;
for(std::size_t i = 0; i < _prefix.length(); i++)
for(std::size_t i = 0; i < prefixLen; i++)
if(_prefix[i] != _string[i])
return false;
return true;
// a bit slower in some cases:
//return (std::mismatch(_prefix.begin(), _prefix.end(), _string.begin()).first == _prefix.end());
}
bool startsWith(const std::string& _string, const char _prefix)
{
return ((_string.length() > 0) && (_string[0] == _prefix));
}
std::vector<std::string> split(const std::string& _string, char _splitChar, bool _skipEmptyStrings)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment