1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

new texture stuff quite working

This commit is contained in:
Perttu Ahola 2011-02-11 16:43:26 +02:00
parent 841ac10e5c
commit 804b2647ce
14 changed files with 253 additions and 78 deletions

View file

@ -716,6 +716,26 @@ inline std::string ftos(float f)
return o.str();
}
inline void str_replace(std::string & str, std::string const & pattern,
std::string const & replacement)
{
std::string::size_type start = str.find(pattern, 0);
while(start != str.npos)
{
str.replace(start, pattern.size(), replacement);
start = str.find(pattern, start+replacement.size());
}
}
inline void str_replace_char(std::string & str, char from, char to)
{
for(unsigned int i=0; i<str.size(); i++)
{
if(str[i] == from)
str[i] = to;
}
}
/*
A base class for simple background thread implementation
*/