Utilites.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef UTILITES_H
  2. #define UTILITES_H
  3. #include <OgreColourValue.h>
  4. #include <OgreMatrix4.h>
  5. #include <OgreString.h>
  6. #include <OgreStringVector.h>
  7. #include <Ogre.h>
  8. #include <Overlay/OgreUTFString.h>
  9. #include <OIS/OIS.h>
  10. #include <tinyxml.h>
  11. bool GetBool( TiXmlNode* node, const Ogre::String& tag, bool def = false );
  12. int GetInt( TiXmlNode* node, const Ogre::String& tag, int def = 0 );
  13. float GetFloat( TiXmlNode* node, const Ogre::String& tag, float def = 0.0f );
  14. const Ogre::String GetString( TiXmlNode* node, const Ogre::String& tag, const Ogre::String& def = "" );
  15. const Ogre::UTFString GetUTFString( TiXmlNode* node, const Ogre::String& tag, const Ogre::UTFString& def = "" );
  16. const Ogre::Vector2 GetVector2( TiXmlNode* node, const Ogre::String& tag, const Ogre::Vector2& def = Ogre::Vector2::ZERO );
  17. const Ogre::Vector3 GetVector3( TiXmlNode* node, const Ogre::String& tag, const Ogre::Vector3& def = Ogre::Vector3::ZERO );
  18. const Ogre::Vector4 GetVector4( TiXmlNode* node, const Ogre::String& tag, const Ogre::Vector4& def = Ogre::Vector4::ZERO );
  19. const Ogre::Matrix4 GetMatrix4( TiXmlNode* node, const Ogre::String& tag, const Ogre::Matrix4& def = Ogre::Matrix4::IDENTITY );
  20. const Ogre::Quaternion GetQuaternion( TiXmlNode* node, const Ogre::String& tag, const Ogre::Quaternion& def = Ogre::Quaternion::IDENTITY );
  21. const Ogre::ColourValue GetColourValue( TiXmlNode* node, const Ogre::String& tag, const Ogre::ColourValue& def = Ogre::ColourValue::ZERO );
  22. void ParsePersent( float& value_percent, float& value, const Ogre::String& string );
  23. float ParseKeyFrameTime( const float length, const Ogre::String& string );
  24. const Ogre::String
  25. CreateAutoName( const Ogre::String prefix );
  26. Ogre::String
  27. KeyToString( OIS::KeyCode key );
  28. OIS::KeyCode
  29. StringToKey( const Ogre::String& str );
  30. Ogre::StringVector
  31. StringTokenise( const Ogre::String& str, const Ogre::String& delimiters = "\t\n ", const Ogre::String& delimiters_preserve = "", const Ogre::String& quote = "\"", const Ogre::String& esc = "\\" );
  32. #endif // UTILITES_H