comparison ply2bin.cpp @ 70:03aa729a9e90

Refactor PLY file parsing from dmscene.* to dmply.* and some helper functions into dmutil.h
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 16 Dec 2019 07:51:05 +0200
parents 7b138613e2fc
children
comparison
equal deleted inserted replaced
69:267b3fd2c98c 70:03aa729a9e90
9 9
10 // Get rid of the SDL_main mess for some commandline tools 10 // Get rid of the SDL_main mess for some commandline tools
11 #define _SDL_main_h 11 #define _SDL_main_h
12 #define SDL_main main 12 #define SDL_main main
13 13
14 #include "dmutil.h"
15 #include "dmscene.h" 14 #include "dmscene.h"
15 #include "dmply.h"
16 16
17 17
18 bool dmFWriteFloatLE(FILE *fh, const float val) 18 bool dmFWriteFloatLE(FILE *fh, const float val)
19 { 19 {
20 float tmp = SDL_SwapFloatLE(val); 20 float tmp = SDL_SwapFloatLE(val);
164 ); 164 );
165 165
166 goto exit; 166 goto exit;
167 } 167 }
168 168
169 if (!model.loadFromPLY(optInputFilename)) 169 if (!dmLoadFromPLY(model, optInputFilename))
170 goto exit; 170 goto exit;
171 171
172 if ((outFile = fopen(optOutputFilename.c_str(), "wb")) == NULL) 172 if ((outFile = fopen(optOutputFilename.c_str(), "wb")) == NULL)
173 { 173 {
174 printf("ERROR: Could not create output file.\n"); 174 printf("ERROR: Could not create output file.\n");