improved editor (deletion of entities and better loading dialog)

This commit is contained in:
2011-01-02 21:04:11 +01:00
parent 965c4d9269
commit 3e05c967ab
7 changed files with 67 additions and 30 deletions
+13
View File
@@ -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;
}
}
+4
View File
@@ -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
View File
@@ -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);