diff --git a/src/body.cpp b/src/body.cpp index d10f321..3e9f2f4 100644 --- a/src/body.cpp +++ b/src/body.cpp @@ -37,10 +37,6 @@ bool load_body(body* out_body, const char* obj_filepath) { int start = 0; for (int i = 1; i < source.len; i++) { - if (source[i] == '\n') { - state = ParserState::PREFIX; - continue; - } switch (state) { case ParserState::PREFIX: if (source[i - 1] == 'v' && source[i] == ' ') { @@ -52,8 +48,8 @@ bool load_body(body* out_body, const char* obj_filepath) { } break; case ParserState::VERTEX: - if (source[i] == ' ' || source[i] == '\r' || source[i] == '\n') { - verts[vert_i] = atof(&source[start])/1.5; + if (iswspace(source[i])) { + verts[vert_i] = atof(&source[start]); vert_i++; start = i + 1; } @@ -66,11 +62,15 @@ bool load_body(body* out_body, const char* obj_filepath) { } break; case ParserState::FACE_SKIP: - if (source[i] == ' ') { + if (iswspace(source[i])) { state = ParserState::FACE; start = i + 1; } } + if (source[i] == '\n') { + state = ParserState::PREFIX; + continue; + } } // Need a good validation check here. This is a stand in. diff --git a/src/main.cpp b/src/main.cpp index 12ac3d8..d779adb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -155,7 +155,6 @@ int main() { glEnable(GL_DEPTH_TEST); float time; - glm::mat4 projection_t = glm::perspective(glm::radians(60.0f), (float)width / (float)height, 0.1f, 1300.0f);