feat: refactor code + optimizations for obj file parsing
This commit is contained in:
20
include/IO/parser.h
Normal file
20
include/IO/parser.h
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef PARSER_H_
|
||||
#define PARSER_H_
|
||||
|
||||
// Very fast OBJ/MTL line parser
|
||||
class Parser {
|
||||
private:
|
||||
char* m_sv;
|
||||
public:
|
||||
Parser(char* sv) : m_sv(sv) {}
|
||||
public:
|
||||
void SkipSpaces();
|
||||
char* TakeWord();
|
||||
float TakeFloat();
|
||||
int TakeInt();
|
||||
bool TakeFaceIndices(int& vi, int& ti, int& ni);
|
||||
char* TakeUntil(char d);
|
||||
int TakeIndex(int baseCount);
|
||||
};
|
||||
|
||||
#endif // PARSER_H_
|
Reference in New Issue
Block a user