merged with main branch

metadata
Wenzel Jakob 2010-08-16 18:56:18 +02:00
commit ed46832262
3 changed files with 26 additions and 9 deletions

View File

@ -1104,8 +1104,8 @@ void ColladaConverter::convert(const std::string &inputFile,
MemBufInputSource* memBufIS = new MemBufInputSource((const XMLByte*) xmlString.c_str(), MemBufInputSource* memBufIS = new MemBufInputSource((const XMLByte*) xmlString.c_str(),
xmlString.length(), "bufID", false); xmlString.length(), "bufID", false);
Wrapper4InputSource *wrapper = new Wrapper4InputSource(memBufIS, false); Wrapper4InputSource *wrapper = new Wrapper4InputSource(memBufIS, false);
DOMDocument *doc = parser->parse(wrapper); XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc = parser->parse(wrapper);
DOMDocument *adj = parser->parseURI(adjustmentFile.c_str()); XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *adj = parser->parseURI(adjustmentFile.c_str());
std::set<std::string> removals; std::set<std::string> removals;
findRemovals(adj, removals); findRemovals(adj, removals);

View File

@ -34,6 +34,9 @@
#include "converter.h" #include "converter.h"
#include <mitsuba/hw/glrenderer.h> #include <mitsuba/hw/glrenderer.h>
#include <mitsuba/core/fresolver.h> #include <mitsuba/core/fresolver.h>
#if defined(WIN32)
#include "../mitsuba/getopt.h"
#endif
XERCES_CPP_NAMESPACE_USE XERCES_CPP_NAMESPACE_USE

View File

@ -8,12 +8,12 @@
#include <mitsuba/render/renderjob.h> #include <mitsuba/render/renderjob.h>
#include <fstream> #include <fstream>
#include <stdexcept> #include <stdexcept>
#include <dirent.h>
#include <sys/types.h> #include <sys/types.h>
#include "shandler.h" #include "shandler.h"
#if !defined(WIN32) #if !defined(WIN32)
#include <dlfcn.h> #include <dlfcn.h>
#include <dirent.h>
#endif #endif
#if defined(WIN32) #if defined(WIN32)
@ -166,22 +166,31 @@ void help() {
cout << " -v Be more verbose" << endl << endl; cout << " -v Be more verbose" << endl << endl;
FileResolver *resolver = FileResolver::getInstance(); FileResolver *resolver = FileResolver::getInstance();
cout << "The following utilities are available:" << endl << endl;
std::string dirPath = resolver->resolveAbsolute("plugins");
#if !defined(WIN32)
DIR *directory; DIR *directory;
struct dirent *dirinfo; struct dirent *dirinfo;
std::string dirPath = resolver->resolveAbsolute("plugins");
if ((directory = opendir(dirPath.c_str())) == NULL) if ((directory = opendir(dirPath.c_str())) == NULL)
SLog(EInfo, "Could not open plugin directory"); SLog(EInfo, "Could not open plugin directory");
cout << "The following utilities are available:" << endl << endl;
while ((dirinfo = readdir(directory)) != NULL) { while ((dirinfo = readdir(directory)) != NULL) {
std::string fname(dirinfo->d_name); std::string fname(dirinfo->d_name);
if (!endsWith(fname, ".dylib") && !endsWith(fname, ".dll") && !endsWith(fname, ".so")) if (!endsWith(fname, ".dylib") !endsWith(fname, ".so"))
continue; continue;
#if defined(WIN32)
std::string fullName = dirPath + "\\" + fname;
#else
std::string fullName = dirPath + "/" + fname; std::string fullName = dirPath + "/" + fname;
#else
HANDLE hFind;
WIN32_FIND_DATA findFileData;
if ((hFind = FindFirstFile((dirPath + "\\*.dll").c_str(), &findFileData)) == INVALID_HANDLE_VALUE)
SLog(EInfo, "Could not open plugin directory");
do {
std::string fname = findFileData.cFileName;
std::string fullName = dirPath + "\\" + fname;
#endif #endif
UtilityPlugin utility(fullName); UtilityPlugin utility(fullName);
if (!utility.isUtility()) if (!utility.isUtility())
@ -191,7 +200,12 @@ void help() {
for (int i=0; i<22-(int) shortName.length(); ++i) for (int i=0; i<22-(int) shortName.length(); ++i)
cout << ' '; cout << ' ';
cout << utility.getDescription() << endl; cout << utility.getDescription() << endl;
#if !defined(WIN32)
} }
#else
} while (FindNextFile(hFind, &findFileData));
FindClose(hFind);
#endif
} }