From 3bf577d04dab877d8cd4831bebbed2d442beb1e4 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 23 Feb 2015 17:14:01 +0100 Subject: [PATCH] Add OpenSpace version information Make info text in WaveFrontGeometry more useful --- src/CMakeLists.txt | 2 ++ src/engine/openspaceengine.cpp | 5 +++++ src/rendering/model/wavefrontgeometry.cpp | 14 +++++--------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0fd94a19b4..4dcd2ba88d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -28,6 +28,8 @@ set(SOURCE_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(HEADER_ROOT_DIR ${CMAKE_SOURCE_DIR}/include) +set(OPENSPACE_HEADER ${OPENSPACE_HEADER} ${HEADER_ROOT_DIR}/openspace/version.h) + file(GLOB CONFIGURATION_SOURCE ${SOURCE_ROOT_DIR}/configuration/*.cpp) set(OPENSPACE_SOURCE ${OPENSPACE_SOURCE} ${CONFIGURATION_SOURCE}) file(GLOB CONFIGURATION_HEADER ${HEADER_ROOT_DIR}/openspace/configuration/*.h) diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 75ebe6ec66..429c6c2112 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -27,6 +27,7 @@ // sgct #define SGCT_WINDOWS_INCLUDE #include +#include #include #include @@ -186,6 +187,10 @@ bool OpenSpaceEngine::create(int argc, char** argv, // Initialize the requested logs from the configuration file _engine->configureLogging(); + LINFOC("OpenSpace Version", OPENSPACE_VERSION_MAJOR << "." << + OPENSPACE_VERSION_MINOR << "." << + OPENSPACE_VERSION_BUILD << " (" << OPENSPACE_VERSION_STRING << ")"); + // Create directories that doesn't exist auto tokens = FileSys.tokens(); for (const std::string& token : tokens) { diff --git a/src/rendering/model/wavefrontgeometry.cpp b/src/rendering/model/wavefrontgeometry.cpp index 1081af7200..54796dee62 100644 --- a/src/rendering/model/wavefrontgeometry.cpp +++ b/src/rendering/model/wavefrontgeometry.cpp @@ -59,21 +59,17 @@ WavefrontGeometry::WavefrontGeometry(const ghoul::Dictionary& dictionary) } const std::string filename = FileSys.absolutePath(file); - std::ifstream ifile(filename.c_str()); - if (ifile){ - LDEBUG("Found file..\n"); - ifile.close(); - loadObj(filename.c_str()); - } - else { - LERROR("Did not find file..\n"); - } + if (FileSys.fileExists(filename)) + loadObj(filename.c_str()); + else + LERROR("Could not load OBJ file '" << filename << "': File not found"); } void WavefrontGeometry::loadObj(const char *filename){ // temporary const char *mtl_basepat = filename; + LINFO("Loading OBJ file '" << filename << "'"); std::string err = tinyobj::LoadObj(shapes, materials, filename, mtl_basepat); LINFO("Loaded Mesh");