mirror of
https://github.com/glest/glest-source.git
synced 2025-08-21 15:41:24 +02:00
- bugfixes for g3d viewer to display only particles without a unit
This commit is contained in:
@@ -1255,6 +1255,8 @@ void MainWindow::loadModel(string path) {
|
|||||||
|
|
||||||
void MainWindow::loadParticle(string path) {
|
void MainWindow::loadParticle(string path) {
|
||||||
if(timer) timer->Stop();
|
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) {
|
if(path != "" && fileExists(path) == true) {
|
||||||
renderer->end();
|
renderer->end();
|
||||||
unitParticleSystems.clear();
|
unitParticleSystems.clear();
|
||||||
@@ -1269,9 +1271,11 @@ void MainWindow::loadParticle(string path) {
|
|||||||
this->particlePathList.clear();
|
this->particlePathList.clear();
|
||||||
this->particlePathList.push_back(path);
|
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{
|
try {
|
||||||
if(this->particlePathList.empty() == false) {
|
if(this->particlePathList.empty() == false) {
|
||||||
string titlestring=winHeader;
|
string titlestring=winHeader;
|
||||||
for(unsigned int idx = 0; idx < this->particlePathList.size(); idx++) {
|
for(unsigned int idx = 0; idx < this->particlePathList.size(); idx++) {
|
||||||
@@ -1288,13 +1292,14 @@ void MainWindow::loadParticle(string path) {
|
|||||||
|
|
||||||
std::string unitXML = dir + folderDelimiter + extractFileFromDirectoryPath(dir) + ".xml";
|
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 size = -1;
|
||||||
//int height = -1;
|
//int height = -1;
|
||||||
|
|
||||||
if(fileExists(unitXML) == true) {
|
|
||||||
|
|
||||||
int size = 0;
|
int size = 0;
|
||||||
int height= 0;
|
int height= 0;
|
||||||
|
|
||||||
|
if(fileExists(unitXML) == true) {
|
||||||
{
|
{
|
||||||
XmlTree xmlTree;
|
XmlTree xmlTree;
|
||||||
xmlTree.load(unitXML,Properties::getTagReplacementValues());
|
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;
|
// 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;
|
std::map<string,vector<pair<string, string> > > loadedFileList;
|
||||||
UnitParticleSystemType *unitParticleSystemType = new UnitParticleSystemType();
|
UnitParticleSystemType *unitParticleSystemType = new UnitParticleSystemType();
|
||||||
@@ -1336,7 +1348,7 @@ void MainWindow::loadParticle(string path) {
|
|||||||
renderer->initTextureManager();
|
renderer->initTextureManager();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
SetTitle(ToUnicode(titlestring));
|
SetTitle(ToUnicode(titlestring));
|
||||||
}
|
}
|
||||||
@@ -1387,8 +1399,8 @@ void MainWindow::loadProjectileParticle(string path) {
|
|||||||
|
|
||||||
std::string unitXML = dir + folderDelimiter + extractFileFromDirectoryPath(dir) + ".xml";
|
std::string unitXML = dir + folderDelimiter + extractFileFromDirectoryPath(dir) + ".xml";
|
||||||
|
|
||||||
int size = -1;
|
int size = 1;
|
||||||
int height = -1;
|
int height = 1;
|
||||||
|
|
||||||
if(fileExists(unitXML) == true) {
|
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);
|
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";
|
std::string unitXML = dir + folderDelimiter + extractFileFromDirectoryPath(dir) + ".xml";
|
||||||
|
|
||||||
int size = -1;
|
int size = 1;
|
||||||
int height = -1;
|
int height = 1;
|
||||||
|
|
||||||
if(fileExists(unitXML) == true) {
|
if(fileExists(unitXML) == true) {
|
||||||
XmlTree xmlTree;
|
XmlTree xmlTree;
|
||||||
|
Reference in New Issue
Block a user