aboutsummaryrefslogtreecommitdiff
path: root/src/engine.cpp
diff options
context:
space:
mode:
authorvimene <vincent.menegaux@gmail.com>2024-12-31 08:38:30 +0100
committervimene <vincent.menegaux@gmail.com>2024-12-31 08:38:30 +0100
commit1e19d706fc5f5e3490d4ce204a6c5ca56c6614f8 (patch)
tree609ad177b9368ed4ae62f2b3e4ae60f6d154c89c /src/engine.cpp
parentcc6fb8c33637566a7b116d46440e6063f016deea (diff)
downloadengine-1e19d706fc5f5e3490d4ce204a6c5ca56c6614f8.tar.gz
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.
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp21
1 files changed, 12 insertions, 9 deletions
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<FrameBuffer>& 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<FrameBuffer>& renderer, const Matrix4& final_tra
Vector3(rad, rad, rad),
}
},
+#endif
}
};
float mul_angle = 0.f;
@@ -133,7 +136,7 @@ static void scene_main(Renderer<FrameBuffer>& renderer, const Matrix4& final_tra
static int main_term() {
// init
- setlocale(LC_ALL, "");
+ std::setlocale(LC_ALL, "");
initscr();
cbreak();
noecho();