From Jean-Sebastien Guay, osgDB functions to expand wildcards - required to aid windows consule usage as this doesn't not automatically expand * usage.

This commit is contained in:
Robert Osfield
2010-11-01 11:06:12 +00:00
parent cd336a7d73
commit 2ce4b9d8e9
3 changed files with 65 additions and 7 deletions

View File

@@ -1107,11 +1107,29 @@ int main( int argc, char **argv )
int pos=images_pos+1;
for(;pos<arguments.argc() && !arguments.isOption(pos);++pos)
{
// not an option so assume string is a filename.
osg::Image *image = osgDB::readImageFile( arguments[pos]);
if(image)
std::string arg(arguments[pos]);
if (arg.find('*') != std::string::npos)
{
imageList.push_back(image);
osgDB::DirectoryContents contents = osgDB::expandWildcardsInFilename(arg);
for (unsigned int i = 0; i < contents.size(); ++i)
{
osg::Image *image = osgDB::readImageFile( contents[i] );
if(image)
{
imageList.push_back(image);
}
}
}
else
{
// not an option so assume string is a filename.
osg::Image *image = osgDB::readImageFile( arguments[pos] );
if(image)
{
imageList.push_back(image);
}
}
}