fixing bugs + InnerOnKeyPress added
This commit is contained in:
1 parent
ec2e6830aa
commit
94e073eaaa
5 files changed
+67
-9
No files matched your search
@@ -38,6 +38,8 @@ public:
|
||||
//To do on mouse wheel move
|
||||
|
||||
virtual void OnKeyPress(cardinal key); //Try not to override this. But if you need to override, call ancestor!
|
||||
|
||||
virtual void InnerOnKeyPress(cardinal key) { }
|
||||
};
|
||||
|
||||
bool CreateEngine(int width, int height, int x = 0, int y = 0, std::string windowName = "Salmon Engine App", std::string logFileName = "log.txt");
|
||||
|
||||
@@ -29,6 +29,21 @@ public:
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
template <typename TVALUE>
|
||||
TVALUE GetValueFromSubtree(const boost::property_tree::ptree::value_type& subTree, const std::string& path)
|
||||
{
|
||||
return subTree.second.get<TVALUE>(path);
|
||||
}
|
||||
|
||||
template <>
|
||||
vec2 GetValueFromSubtree(const boost::property_tree::ptree::value_type& subTree, const std::string& path);
|
||||
|
||||
template <>
|
||||
vec3 GetValueFromSubtree(const boost::property_tree::ptree::value_type& subTree, const std::string& path);
|
||||
|
||||
template <>
|
||||
vec4 GetValueFromSubtree(const boost::property_tree::ptree::value_type& subTree, const std::string& path);
|
||||
|
||||
|
||||
template <typename TKEY, typename TVALUE>
|
||||
@@ -43,7 +58,7 @@ public:
|
||||
BOOST_FOREACH(boost::property_tree::ptree::value_type& subTree, propertyTree)
|
||||
{
|
||||
TKEY key = subTree.second.get<TKEY>("<xmlattr>.key");
|
||||
TVALUE value = subTree.second.get<TVALUE>("<xmlattr>.value");
|
||||
TVALUE value = GetValueFromSubtree<TVALUE>(subTree, "<xmlattr>.value");
|
||||
|
||||
Map[key] = value;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user