mirror of
https://github.com/glest/glest-source.git
synced 2025-08-30 11:19:48 +02:00
- restore timeflow and gamecamera on load game
This commit is contained in:
@@ -451,6 +451,42 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
// playerColor="x [1] y [0] z [0]"
|
||||
static inline Vec3<T> strToVec3(std::string value) {
|
||||
Vec3<T> result;
|
||||
|
||||
std::vector<std::string> tokens = TokenizeString(value,"[");
|
||||
//for(unsigned int i = 0; i < tokens.size(); ++i) {
|
||||
//printf("#1 Vec2T i = %d [%s]\n",i,tokens[i].c_str());
|
||||
//}
|
||||
if(tokens.size() == 4) {
|
||||
std::vector<std::string> tokens2 = TokenizeString(tokens[1],"]");
|
||||
//for(unsigned int i = 0; i < tokens2.size(); ++i) {
|
||||
//printf("#2 Vec2T i = %d [%s]\n",i,tokens2[i].c_str());
|
||||
//}
|
||||
std::vector<std::string> tokens3 = TokenizeString(tokens[2],"]");
|
||||
//for(unsigned int i = 0; i < tokens3.size(); ++i) {
|
||||
//printf("#3 Vec2T i = %d [%s]\n",i,tokens3[i].c_str());
|
||||
//}
|
||||
|
||||
std::vector<std::string> tokens4 = TokenizeString(tokens[3],"]");
|
||||
//for(unsigned int i = 0; i < tokens3.size(); ++i) {
|
||||
//printf("#3 Vec2T i = %d [%s]\n",i,tokens3[i].c_str());
|
||||
//}
|
||||
|
||||
if(tokens2.size() == 2 && tokens3.size() == 2 && tokens4.size() == 2) {
|
||||
result.x = (T)strToType<T>(tokens2[0]);
|
||||
result.y = (T)strToType<T>(tokens3[0]);
|
||||
result.z = (T)strToType<T>(tokens4[0]);
|
||||
|
||||
//printf("#3 Vec2T [%s]\n",result.getString().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
typedef Vec3<int> Vec3i;
|
||||
|
Reference in New Issue
Block a user