[Bug] Project Generation Nested Folders - LOGGED
by Joseph W. · in Torque 3D Professional · 06/16/2010 (8:21 am) · 2 replies
It would appear there is some sort of bug when using the addSrcDir with how it recursively adds the directories. I have a /source/T3D/fps and inside of fps I have a single .cpp file. The project generator will add a /T3D directory under the source folder and then add in my .cpp file under that T3D filter instead of adding a T3D filter and then creating a "fps" filter and THEN adding the .cpp
If I add a .cpp or .h file at the same level as my "fps" folder then it will correctly add the fps filter so it appears that the project generation skips folders at levels where there are no files. I do not code in PHP so I didn't look into this very far and hope someone with more experience in PHP can look into this, not a major show stopper but annoying none the less that files are not added to the projects with the correct structure.
I did find one other bug that could crop up for people though while looking into this bug a little and might cause some loops to prematurely exit.
Currently in several PHP functions it does this kind of file looping:
I was looking up PHP functions and the readdir function specifically states that is not the correct way of looping. It should be:
Otherwise some directory names can return false when they are valid files.
If I add a .cpp or .h file at the same level as my "fps" folder then it will correctly add the fps filter so it appears that the project generation skips folders at levels where there are no files. I do not code in PHP so I didn't look into this very far and hope someone with more experience in PHP can look into this, not a major show stopper but annoying none the less that files are not added to the projects with the correct structure.
I did find one other bug that could crop up for people though while looking into this bug a little and might cause some loops to prematurely exit.
Currently in several PHP functions it does this kind of file looping:
static function addSrcDirRecursive($basePath, $dirPath)
{
$ignore = array( '.', '..', '.svn', '_svn', 'CVS' );
$absPath = realpath($argv[1])."/buildFiles/";
array_push( self::$project_cur->dir_list, $basePath.'/'.$dirPath );
$dirHandle = opendir( $absPath.$basePath.'/'.$dirPath);
while($file = readdir( $dirHandle ) )
{
if( !in_array( $file, $ignore ) )
{
if( is_dir( $absPath.$basePath.'/'.$dirPath.'/'.$file ) )
self::addSrcDirRecursive( $basePath, "$dirPath/$file");
}
}
closedir( $dirHandle );
}I was looking up PHP functions and the readdir function specifically states that is not the correct way of looping. It should be:
while(false !== ($file = readdir( $dirHandle )) )
Otherwise some directory names can return false when they are valid files.
#2
11/07/2011 (7:28 pm)
im not sure if whats happening to me is the same. i try to put in a folder in my art\shape folder with a tree or dts in it and the engine wont recognize it when i load the game engine.is there a file with the folders listed that i need to add those folders to? sorry i cant help you, but maybe you can help me , i cant find anywhere in the search forums about this.
Full Sail QA&U Lab Intern