Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…Don't forget to call it after game initializating
  • Loading branch information...
commit ce1907d47020494e42bac95273b3a943693f8f87 1 parent 7977329
@Ockonal Ockonal authored
Showing with 16 additions and 3 deletions.
  1. +9 −3 include/Core/Utils.hpp
  2. +7 −0 src/Core/Utils.cpp
View
12 include/Core/Utils.hpp
@@ -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
7 src/Core/Utils.cpp
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.