X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2F3dengfx%2Fsrc%2F3dengfx%2Fply.cpp;fp=src%2F3dengfx%2Fsrc%2F3dengfx%2Fply.cpp;h=95dbae74d3023020828e77b610cf500f857b6462;hb=2b4c0d15331a49f96411abe7dfe3f4c6a8e4b170;hp=78bdc53524b93c1f65a362dd5c25627d3e60bc58;hpb=3f8f761e9f2030af5128ff45aec9e44fefe3f82b;p=summerhack diff --git a/src/3dengfx/src/3dengfx/ply.cpp b/src/3dengfx/src/3dengfx/ply.cpp index 78bdc53..95dbae7 100644 --- a/src/3dengfx/src/3dengfx/ply.cpp +++ b/src/3dengfx/src/3dengfx/ply.cpp @@ -28,7 +28,7 @@ enum PropType { const size_t prop_size[] = {32, 8, 16, 32, 0}; struct PropTypeMatch { - char *symb; + const char *symb; PropType type; } prop_match[] = { {"float", PROP_FLOAT}, @@ -68,6 +68,8 @@ struct Ply { vector elem; FILE *fp; unsigned long header_skip; + + Ply(); }; static Ply *read_header(FILE *fp); @@ -75,6 +77,13 @@ static Element *seek_elem(Ply *ply, ElementType elem_type); static const char *ply_filename = 0; // for error reports +Ply::Ply() +{ + fmt = PLY_ASCII; + fp = 0; + header_skip = 0; +} + bool file_is_ply(FILE *file) { char sig[5] = {0}; @@ -205,7 +214,6 @@ static Ply *read_header(FILE *fp) { fseek(fp, 0, SEEK_SET); Ply *ply = new Ply; - memset(ply, 0, sizeof(Ply)); bool vertex_ok = false, face_ok = false;