projects
/
summerhack
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
minor gitignore additions
[summerhack]
/
src
/
3dengfx
/
src
/
3dengfx
/
ply.cpp
diff --git
a/src/3dengfx/src/3dengfx/ply.cpp
b/src/3dengfx/src/3dengfx/ply.cpp
index
78bdc53
..
95dbae7
100644
(file)
--- 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 {
const size_t prop_size[] = {32, 8, 16, 32, 0};
struct PropTypeMatch {
- char *symb;
+ const char *symb;
PropType type;
} prop_match[] = {
{"float", PROP_FLOAT},
PropType type;
} prop_match[] = {
{"float", PROP_FLOAT},
@@
-68,6
+68,8
@@
struct Ply {
vector<Element> elem;
FILE *fp;
unsigned long header_skip;
vector<Element> elem;
FILE *fp;
unsigned long header_skip;
+
+ Ply();
};
static Ply *read_header(FILE *fp);
};
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
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};
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;
fseek(fp, 0, SEEK_SET);
Ply *ply = new Ply;
- memset(ply, 0, sizeof(Ply));
bool vertex_ok = false, face_ok = false;
bool vertex_ok = false, face_ok = false;