From d7c688e4b290597bdb678add4d68a1f34c95a1e1 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Thu, 11 Jan 2024 12:14:02 -0700 Subject: [PATCH] Organized ply constants --- include/ply.h | 38 ++++++++++++++++++++++++++++++++++++++ src/ply.c | 35 ----------------------------------- 2 files changed, 38 insertions(+), 35 deletions(-) diff --git a/include/ply.h b/include/ply.h index 03cdf86..9ea9d29 100644 --- a/include/ply.h +++ b/include/ply.h @@ -1,6 +1,8 @@ #ifndef PLY_H #define PLY_H +#include + typedef enum { PLY_FORMAT_INVALID = -1, PLY_FORMAT_ASCII, @@ -46,6 +48,42 @@ typedef struct PlyElementStruct { struct PlyElementStruct* next; } PlyElement; + +char* ply_formats[] = { + "ascii", + "binary_little_endian", + "binary_big_endian" +}; + +char* ply_header_items[] = { + "comment", + "end_header", + "element", + "property", +}; + +char* ply_type_strings[] = { + "char", + "uchar", + "short", + "ushort", + "int", + "uint", + "float", + "double", +}; + +size_t ply_type_sizes[] = { + 1, + 1, + 2, + 2, + 4, + 4, + 4, + 8, +}; + PlyElement* ply_load_mesh(char* filename); void ply_free_mesh(PlyElement* elements_head); diff --git a/src/ply.c b/src/ply.c index 1a859ba..e83dda4 100644 --- a/src/ply.c +++ b/src/ply.c @@ -3,41 +3,6 @@ #include #include -char* ply_formats[] = { - "ascii", - "binary_little_endian", - "binary_big_endian" -}; - -char* ply_header_items[] = { - "comment", - "end_header", - "element", - "property", -}; - -char* ply_type_strings[] = { - "char", - "uchar", - "short", - "ushort", - "int", - "uint", - "float", - "double", -}; - -size_t ply_type_sizes[] = { - 1, - 1, - 2, - 2, - 4, - 4, - 4, - 8, -}; - PlyPropertyType ply_parse_type(const char* type_string) { for(uint32_t i = 0; i < sizeof(ply_type_strings)/sizeof(char*); i++) { if(strcmp(ply_type_strings[i], type_string) == 0) {