Add ghc::filesystem and glob.

Update tinygltf.
Fix Android app build.
This commit is contained in:
Syoyo Fujita
2022-08-18 20:14:41 +09:00
parent e84dcb4917
commit 46a1a9e82b
21 changed files with 8692 additions and 43 deletions

View File

@@ -14,9 +14,10 @@ set(TINYUSDZ_SOURCES
${PROJECT_SOURCE_DIR}/../../../../../src/crate-pprint.cc
${PROJECT_SOURCE_DIR}/../../../../../src/io-util.cc
${PROJECT_SOURCE_DIR}/../../../../../src/pprinter.cc
${PROJECT_SOURCE_DIR}/../../../../../src/value-type.cc
${PROJECT_SOURCE_DIR}/../../../../../src/value-types.cc
${PROJECT_SOURCE_DIR}/../../../../../src/value-pprint.cc
${PROJECT_SOURCE_DIR}/../../../../../src/primvar.cc
${PROJECT_SOURCE_DIR}/../../../../../src/image-loader.cc
${PROJECT_SOURCE_DIR}/../../../../../src/usda-writer.cc)
if(TINYUSDZ_USE_USDOBJ)
@@ -29,7 +30,7 @@ endif()
set(TINYUSDZ_DEP_SOURCES
${PROJECT_SOURCE_DIR}/../../../../../src/integerCoding.cpp
${PROJECT_SOURCE_DIR}/../../../../../src/lz4-compression.cc
${PROJECT_SOURCE_DIR}/../../../../../src/pxrLZ4/lz4.cpp
${PROJECT_SOURCE_DIR}/../../../../../src/lz4/lz4.c
${PROJECT_SOURCE_DIR}/../../../../../src/external/string_id/database.cpp
${PROJECT_SOURCE_DIR}/../../../../../src/external/string_id/string_id.cpp
${PROJECT_SOURCE_DIR}/../../../../../src/external/string_id/error.cpp

View File

@@ -123,10 +123,10 @@ Java_com_example_hellotinyusdz_MainActivity_touchMove(JNIEnv *env, jobject obj,
tinyusdz::USDLoadOptions options;
// load from Android asset folder
example::g_gui_ctx.scene = tinyusdz::HighLevelScene(); // reset
example::g_gui_ctx.stage = tinyusdz::Stage(); // reset
std::string warn, err;
bool ret = LoadUSDCFromFile(filename, &example::g_gui_ctx.scene, &warn, &err, options);
bool ret = LoadUSDCFromFile(filename, &example::g_gui_ctx.stage, &warn, &err, options);
if (warn.size()) {
__android_log_print(ANDROID_LOG_WARN, "tinyusdz", "USD load warning: %s", warn.c_str());
@@ -140,7 +140,7 @@ Java_com_example_hellotinyusdz_MainActivity_touchMove(JNIEnv *env, jobject obj,
if (ret) {
// TODO
//__android_log_print(ANDROID_LOG_INFO, "tinyusdz", "USD loaded. #of geom_meshes: %d", int(example::g_gui_ctx.scene.geom_meshes.size()));
//__android_log_print(ANDROID_LOG_INFO, "tinyusdz", "USD loaded. #of geom_meshes: %d", int(example::g_gui_ctx.stage.geom_meshes.size()));
}
ret = example::SetupScene(example::g_gui_ctx);
@@ -151,7 +151,7 @@ Java_com_example_hellotinyusdz_MainActivity_touchMove(JNIEnv *env, jobject obj,
// TODO
//return int(example::g_gui_ctx.scene.geom_meshes.size()); // OK
//return int(example::g_gui_ctx.stage.geom_meshes.size()); // OK
return 0;
}
}

View File

@@ -57,7 +57,8 @@ inline uint8_t ftouc(float f) {
bool SetupScene(GUIContext &ctx) {
__android_log_print(ANDROID_LOG_INFO, "tinyusdz", "SetupScene");
if (ctx.scene.root_nodes.empty()) {
#if 0 // TODO
if (ctx.stage.root_nodes.empty()) {
__android_log_print(ANDROID_LOG_ERROR, "tinyusdz", "No GeomMesh");
// No GeomMesh in the scene
return false;
@@ -78,6 +79,7 @@ bool SetupScene(GUIContext &ctx) {
__android_log_print(ANDROID_LOG_ERROR, "tinyusdz", "Scene::Setup failed");
return false;
}
#endif
// init camera matrix
{

View File

@@ -55,7 +55,7 @@ struct GUIContext {
int render_height = 512;
// scene reload
tinyusdz::HighLevelScene scene;
tinyusdz::Stage stage;
std::atomic<bool> request_reload{false};
std::string filename;