- bugfixes for g3d viewer to display only particles without a unit

This commit is contained in:
Mark Vejvoda 2012-05-11 16:05:26 +00:00
parent bf3e5a15bf
commit fff77031fc

View File

@ -1255,6 +1255,8 @@ void MainWindow::loadModel(string path) {
void MainWindow::loadParticle(string path) {
if(timer) timer->Stop();
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] about to load [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,path.c_str());
if(path != "" && fileExists(path) == true) {
renderer->end();
unitParticleSystems.clear();
@ -1269,6 +1271,8 @@ void MainWindow::loadParticle(string path) {
this->particlePathList.clear();
this->particlePathList.push_back(path);
}
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] added file [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,path.c_str());
}
try {
@ -1288,13 +1292,14 @@ void MainWindow::loadParticle(string path) {
std::string unitXML = dir + folderDelimiter + extractFileFromDirectoryPath(dir) + ".xml";
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] looking for unit XML [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,unitXML.c_str());
//int size = -1;
//int height = -1;
if(fileExists(unitXML) == true) {
int size = 0;
int height= 0;
if(fileExists(unitXML) == true) {
{
XmlTree xmlTree;
xmlTree.load(unitXML,Properties::getTagReplacementValues());
@ -1307,6 +1312,13 @@ void MainWindow::loadParticle(string path) {
}
// std::cout << "About to load [" << particlePath << "] from [" << dir << "] unit [" << unitXML << "]" << std::endl;
}
else {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] unit XML NOT FOUND [%s] using default position values\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,unitXML.c_str());
int size = 1;
int height= 1;
}
std::map<string,vector<pair<string, string> > > loadedFileList;
UnitParticleSystemType *unitParticleSystemType = new UnitParticleSystemType();
@ -1336,7 +1348,7 @@ void MainWindow::loadParticle(string path) {
renderer->initTextureManager();
}
}
}
}
SetTitle(ToUnicode(titlestring));
}
@ -1387,8 +1399,8 @@ void MainWindow::loadProjectileParticle(string path) {
std::string unitXML = dir + folderDelimiter + extractFileFromDirectoryPath(dir) + ".xml";
int size = -1;
int height = -1;
int size = 1;
int height = 1;
if(fileExists(unitXML) == true) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] loading [%s] idx = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,unitXML.c_str(),idx);
@ -1503,8 +1515,8 @@ void MainWindow::loadSplashParticle(string path) { // uses ParticleSystemTypeSp
std::string unitXML = dir + folderDelimiter + extractFileFromDirectoryPath(dir) + ".xml";
int size = -1;
int height = -1;
int size = 1;
int height = 1;
if(fileExists(unitXML) == true) {
XmlTree xmlTree;