From 1e19d706fc5f5e3490d4ce204a6c5ca56c6614f8 Mon Sep 17 00:00:00 2001 From: vimene Date: Tue, 31 Dec 2024 08:38:30 +0100 Subject: fixed parse_object by implementing custom parsers std::setlocale also change the parsing of floats with std::stof. It is also more future proof to use a parser specific to Wavefront .obj files. --- src/engine.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/engine.cpp') diff --git a/src/engine.cpp b/src/engine.cpp index c484b0d..9b2f673 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -79,14 +79,16 @@ static void scene_main(Renderer& renderer, const Matrix4& final_tra Scene scene{ {{{0.f, 0.f, rad * dist}, {1.f, 0.f, 0.f, 0.f}, {1.f, 1.f, 1.f}}}, { - // { - // Mesh::plane(), - // { - // Vector3(0.f, 0.f, 0.f), - // {1.f, 0.f, 0.f, 0.f}, - // Vector3(rad, rad, rad), - // } - // }, +#if 0 + { + Mesh::plane(), + { + Vector3(0.f, 0.f, 0.f), + {1.f, 0.f, 0.f, 0.f}, + Vector3(rad, rad, rad), + } + }, +#else { engine::parse_object("../assets/suzanne.obj"), { @@ -95,6 +97,7 @@ static void scene_main(Renderer& renderer, const Matrix4& final_tra Vector3(rad, rad, rad), } }, +#endif } }; float mul_angle = 0.f; @@ -133,7 +136,7 @@ static void scene_main(Renderer& renderer, const Matrix4& final_tra static int main_term() { // init - setlocale(LC_ALL, ""); + std::setlocale(LC_ALL, ""); initscr(); cbreak(); noecho(); -- cgit v1.2.3