Skip to content

Commit

Permalink
Properly strip off parsed coordinates of vertices
Browse files Browse the repository at this point in the history
  • Loading branch information
rexim committed Sep 18, 2024
1 parent 7ef36ef commit ba729c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/obj2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,21 +260,21 @@ int main(int argc, char **argv)

line = sv_trim_left(line);
float x = strtof(line.data, &endptr);
line.data = endptr;
if (lx > x) lx = x;
if (hx < x) hx = x;
sv_chop_left(&line, endptr - line.data);

line = sv_trim_left(line);
float y = strtof(line.data, &endptr);
line.data = endptr;
if (ly > y) ly = y;
if (hy < y) hy = y;
sv_chop_left(&line, endptr - line.data);

line = sv_trim_left(line);
float z = strtof(line.data, &endptr);
line.data = endptr;
if (lz > z) lz = z;
if (hz < z) hz = z;
sv_chop_left(&line, endptr - line.data);

da_append(&vertices, make_vector3(x, y, z));
} else if (sv_eq(kind, SV("f"))) {
Expand Down

0 comments on commit ba729c7

Please sign in to comment.