std::experimental fix for android
This commit is contained in:
@@ -11,7 +11,8 @@
|
||||
// LINUX ONLY
|
||||
//#include <dirent.h>
|
||||
//#include <stdio.h>
|
||||
#include <experimental/filesystem>
|
||||
#include "../../../data/File.h"
|
||||
|
||||
|
||||
#include "../../../misc/Debug.h"
|
||||
|
||||
@@ -83,17 +84,17 @@ namespace Ray3D {
|
||||
/** scan the given folder for all *.obj files */
|
||||
void scanFolder(const std::string& folder) {
|
||||
|
||||
std::experimental::filesystem::path d(folder);
|
||||
if (!std::experimental::filesystem::exists(d)) {
|
||||
FS::File d(folder);
|
||||
if (!d.exists()) {
|
||||
throw Exception("OBJPool: folder not found: " + folder);
|
||||
}
|
||||
|
||||
for (std::experimental::filesystem::directory_entry entry : std::experimental::filesystem::directory_iterator(d)) {
|
||||
const std::string absFile = entry.path().string();
|
||||
if (endsWith(absFile, ".obj")) {
|
||||
std::string name = entry.path().filename().string();
|
||||
for (const FS::File& f : d.listFiles()) {
|
||||
std::string name = f.getFilename();
|
||||
if (endsWith(name, ".obj")) {
|
||||
//std::string name = entry.path().filename().string();
|
||||
name = name.substr(0, name.length() - 4); // without extension
|
||||
load(absFile, name);
|
||||
load(f.getPath(), name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user