improved editor (deletion of entities and better loading dialog)
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include <cstdarg>
|
||||
#include <cstdlib>
|
||||
#include <assert.h>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
int vasprintf (char **result, const char *format, va_list *string) {
|
||||
return 0;
|
||||
@@ -381,5 +382,17 @@ std::string GetUserDirFullPath (const std::string &path) {
|
||||
return EngineInstance->GetUserDirFullPath(path);
|
||||
}
|
||||
|
||||
bool FileExists (const std::string &path) {
|
||||
boost::filesystem::path file_path (path);
|
||||
|
||||
if (!boost::filesystem::exists(file_path))
|
||||
return false;
|
||||
|
||||
if (boost::filesystem::is_directory(file_path))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -186,6 +186,10 @@ std::string GetResourceFullPath (const std::string &resource);
|
||||
/** \brief Returns the path to a file by prepending the user data path to it
|
||||
*/
|
||||
std::string GetUserDirFullPath (const std::string &path);
|
||||
|
||||
/** \brief Checks whether a given file exists */
|
||||
bool FileExists (const std::string &path);
|
||||
|
||||
}
|
||||
|
||||
/* Include the globally visible declarations of the other modules */
|
||||
|
||||
+1
-1
@@ -22,6 +22,7 @@ int ModelBase::OnInit (int argc, char* argv[]) {
|
||||
mKilledEntities.clear ();
|
||||
mEntityIdCounter = 0;
|
||||
mDeltaSec = 0.;
|
||||
mPlayerEntityId = NullEntityId;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -192,7 +193,6 @@ EntityBase* ModelBase::GetEntityAt (const vector3d &pos) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
unsigned int ModelBase::CreateEntityId () {
|
||||
if (mEntityIdCounter == NullEntityId - 1)
|
||||
LogError ("Could not create valid entity id, reached maximum value of %u", mEntityIdCounter);
|
||||
|
||||
Reference in New Issue
Block a user