Permalink
Browse files

Added function for loading predefined meshes (For the engine stuff). …

…Don't forget to call it after game initializating
  • Loading branch information...
max-frai committed Aug 28, 2010
1 parent 7977329 commit ce1907d47020494e42bac95273b3a943693f8f87
Showing with 16 additions and 3 deletions.
  1. +9 −3 include/Core/Utils.hpp
  2. +7 −0 src/Core/Utils.cpp
View
@@ -34,6 +34,9 @@ class Utils : public singleton<Utils>
string mDimension;
ptime mTimeStamp;
+ // Default entities
+ Ogre::Entity mError;
+
void createPlane(Ogre::Mesh *newMesh);
void createSphere(Ogre::Mesh *newMesh);
void createCube(Ogre::Mesh *newMesh);
@@ -43,15 +46,18 @@ class Utils : public singleton<Utils>
string checkLocation(const string &path);
const string getMediaPath() const;
+ void setMediaPath(const string &path);
+
const string getDimension() const;
void setDimension(string &d);
- ptime getCurrentTime() const;
-
- void setMediaPath(const string &path);
// For time measuring
+ ptime getCurrentTime() const;
void writeTimestamp();
string getTimeDifference();
+
+ // For default entities
+ void configureEntities();
};
#endif
View
@@ -50,6 +50,13 @@ string Utils::checkLocation(const string &path)
return path;
}
+void Utils::configureEntities()
+{
+ // Error mesh
+ string entMesh = LOCATION(utils.getMediaPath() + "/Engine/" + "Error.mesh");
+ mError = graphicSystem.getSceneMgr()->createEntity("Engine:Error", entMesh);
+}
+
string Utils::getTimeDifference()
{
// If we don't call writeTimestamp before this function

0 comments on commit ce1907d

Please sign in to comment.