From a9626cc33fd919927f2de015b98c1bd95c5d2652 Mon Sep 17 00:00:00 2001 From: Hartmut Seichter Date: Mon, 2 Mar 2020 12:27:04 +0100 Subject: [PATCH] just a bit of tinkering around --- src/CMakeLists.txt | 2 +- src/core/include/pw/core/math.hpp | 4 ++-- src/core/include/pw/core/mesh.hpp | 4 ++-- src/core/include/pw/core/serialize.hpp | 10 +++++----- src/{engine => runtime}/CMakeLists.txt | 0 src/{engine => runtime}/pixwerx.cpp | 1 + src/scripting/src/script_io.cpp | 2 +- src/visual/src/pipeline.cpp | 1 - 8 files changed, 12 insertions(+), 12 deletions(-) rename src/{engine => runtime}/CMakeLists.txt (100%) rename src/{engine => runtime}/pixwerx.cpp (99%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 36776fb..975553a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,4 +10,4 @@ add_subdirectory(scripting) add_subdirectory(visual) add_subdirectory(geometry) -add_subdirectory(engine) +add_subdirectory(runtime) diff --git a/src/core/include/pw/core/math.hpp b/src/core/include/pw/core/math.hpp index b24e6e6..0c039b4 100644 --- a/src/core/include/pw/core/math.hpp +++ b/src/core/include/pw/core/math.hpp @@ -30,8 +30,8 @@ namespace pw { -const static double __PW_PI = 3.1415926535897932384626433832795028841971693993751058209; -const static double __PW_PI_DOUBLE = 2.0 * __PW_PI; +constexpr double __PW_PI = 3.1415926535897932384626433832795028841971693993751058209; +constexpr double __PW_PI_DOUBLE = 2.0 * __PW_PI; template inline const T pi() { return static_cast(__PW_PI); } diff --git a/src/core/include/pw/core/mesh.hpp b/src/core/include/pw/core/mesh.hpp index 0cbf446..b03b1e7 100644 --- a/src/core/include/pw/core/mesh.hpp +++ b/src/core/include/pw/core/mesh.hpp @@ -69,7 +69,7 @@ public: void reset(); - aabb aabb() const { return _aabb; } + aabb get_aabb() const { return _aabb; } void compute_normals(); @@ -86,7 +86,7 @@ protected: std::vector _uvs; //!< storing multiple UV sets - struct aabb _aabb; + struct aabb _aabb; // TODO add weights, tangents etc. pp. diff --git a/src/core/include/pw/core/serialize.hpp b/src/core/include/pw/core/serialize.hpp index 80cd020..37343fd 100644 --- a/src/core/include/pw/core/serialize.hpp +++ b/src/core/include/pw/core/serialize.hpp @@ -33,13 +33,13 @@ namespace pw { struct serialize { - template - inline static std::string matrix(const matrix_& m) { + template + inline static std::string matrix(const matrix_& m) { std::stringstream ss; - for (int r = 0; r < m.rows;r++) { - for (int c = 0; c < m.cols;c++) { - ss << m(r,c) << " "; + for (int r = 0; r < m.rows;r++) { + for (int c = 0; c < m.cols;c++) { + ss << m(r,c) << " "; } ss << std::endl; } diff --git a/src/engine/CMakeLists.txt b/src/runtime/CMakeLists.txt similarity index 100% rename from src/engine/CMakeLists.txt rename to src/runtime/CMakeLists.txt diff --git a/src/engine/pixwerx.cpp b/src/runtime/pixwerx.cpp similarity index 99% rename from src/engine/pixwerx.cpp rename to src/runtime/pixwerx.cpp index 78d871c..f4297e7 100644 --- a/src/engine/pixwerx.cpp +++ b/src/runtime/pixwerx.cpp @@ -38,6 +38,7 @@ int main(int argc,const char** argv) { } catch (std::exception &e) { std::cerr << e.what() << std::endl; + return -1; } diff --git a/src/scripting/src/script_io.cpp b/src/scripting/src/script_io.cpp index aebef78..1250d47 100644 --- a/src/scripting/src/script_io.cpp +++ b/src/scripting/src/script_io.cpp @@ -6,7 +6,7 @@ namespace pw { -void register_io_function(sol::state& lua,sol::table& ns) +void register_io_function(sol::state&,sol::table& ns) { ns.new_usertype("imageio" ,"new", sol::no_constructor diff --git a/src/visual/src/pipeline.cpp b/src/visual/src/pipeline.cpp index f54f6ac..4e946b7 100644 --- a/src/visual/src/pipeline.cpp +++ b/src/visual/src/pipeline.cpp @@ -165,7 +165,6 @@ struct triangle_renderer auto proj_mat = matrix_transform::perspective_projection(deg_to_rad(60.f), 1.3f, 0.2f,1000.f); - #endif