Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed build/ComponentManager.o
Binary file not shown.
Binary file removed build/Engine.o
Binary file not shown.
Binary file removed build/EngineMain.o
Binary file not shown.
Binary file removed build/EntityManager.o
Binary file not shown.
Binary file removed build/Event.o
Binary file not shown.
Binary file removed build/GraphicAPI/Opengl.o
Binary file not shown.
Binary file removed build/GraphicAPI/Vulkan.o
Binary file not shown.
Binary file removed build/JsonParser.o
Binary file not shown.
Binary file removed build/MeshManager.o
Binary file not shown.
Binary file removed build/ShaderProgram.o
Binary file not shown.
Binary file removed build/SoundEngineFactory.o
Binary file not shown.
Binary file removed build/SystemManager.o
Binary file not shown.
Binary file removed build/Systems/AnimationSystem.o
Binary file not shown.
Binary file removed build/Systems/CameraSystem.o
Binary file not shown.
Binary file removed build/Systems/CollisionSystem.o
Binary file not shown.
Binary file removed build/Systems/GUISystem.o
Binary file not shown.
Binary file removed build/Systems/MovementSystem.o
Binary file not shown.
Binary file removed build/Systems/PhysicsSystem.o
Binary file not shown.
Binary file removed build/Systems/ProjectileSystem.o
Binary file not shown.
Binary file removed build/TextureManager.o
Binary file not shown.
Binary file removed build/TimerCreator.o
Binary file not shown.
Binary file removed build/UnixApi/ChronoX.o
Binary file not shown.
Binary file removed build/UnixApi/SoundEngineAlsa.o
Binary file not shown.
Binary file removed build/UnixApi/WindowXCBOpengl.o
Binary file not shown.
Binary file removed build/UnixApi/WindowXCBVulkan.o
Binary file not shown.
Binary file removed build/UnixApi/WindowXOpengl.o
Binary file not shown.
Binary file removed build/UnixApi/WindowXVulkan.o
Binary file not shown.
Binary file removed build/WavefrontObjParser.o
Binary file not shown.
Binary file removed build/linGame
Binary file not shown.
62 changes: 40 additions & 22 deletions src/WavefrontObjParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,32 +87,50 @@ namespace GLVM::core
}
}

GLVM::core::vector<vector<char>> CWaveFrontObjParser::Split(const char* _pWaveFrontObjFileData, const char _separator, const char _exitSymbol, unsigned int& _uiCounter) {
GLVM::core::vector<vector<char>> wordsContainer;
unsigned int outerIndex = 0;
wordsContainer.Push({});

for(;;++_uiCounter) {
if (_pWaveFrontObjFileData[_uiCounter] == '#') {
while(_pWaveFrontObjFileData[_uiCounter] != '\n') {
++_uiCounter;
}
continue;
}
if (_pWaveFrontObjFileData[_uiCounter] == _separator) {
wordsContainer[outerIndex].Push('\0');
wordsContainer.Push({});
++outerIndex;
continue;
}
if (_pWaveFrontObjFileData[_uiCounter] == _exitSymbol) {
GLVM::core::vector<GLVM::core::vector<char>> CWaveFrontObjParser::Split(const char* _pWaveFrontObjFileData, const char _separator, const char _exitSymbol, unsigned int& _uiCounter) {
GLVM::core::vector<GLVM::core::vector<char>> wordsContainer;
unsigned int outerIndex = 0;
wordsContainer.Push({});

GLVM::core::vector<char> currentWord;

while (_pWaveFrontObjFileData[_uiCounter] != '\0') {
if (_pWaveFrontObjFileData[_uiCounter] == '#') {
while (_pWaveFrontObjFileData[_uiCounter] != '\n') {
++_uiCounter;
wordsContainer[outerIndex].Push('\0');
return wordsContainer;
}
wordsContainer[outerIndex].Push(_pWaveFrontObjFileData[_uiCounter]);
continue;
}

if (_pWaveFrontObjFileData[_uiCounter] == _separator) {
currentWord.Push('\0');

wordsContainer[outerIndex] = currentWord;

currentWord = {};

wordsContainer.Push(currentWord);
++outerIndex;
continue;
}

if (_pWaveFrontObjFileData[_uiCounter] == _exitSymbol) {
currentWord.Push('\0');

wordsContainer[outerIndex] = currentWord;

++_uiCounter;
break;
}

currentWord.Push(_pWaveFrontObjFileData[_uiCounter]);
++_uiCounter;
}

wordsContainer[outerIndex] = currentWord;

return wordsContainer;
}

SVertex CWaveFrontObjParser::ParseVertices(GLVM::core::vector<vector<char>> _wordsContainer) {
SVertex vertex;
Expand Down