feat: refactor code + optimizations for obj file parsing

This commit is contained in:
2025-10-01 17:55:29 +02:00
parent 2b0494a23d
commit fc91f6662e
10 changed files with 510 additions and 235 deletions

20
include/IO/parser.h Normal file
View 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_