[DEV] start change format

This commit is contained in:
Edouard DUPIN 2017-03-19 23:07:04 +01:00
parent 6fa74968b6
commit 1c4e81bdba

View File

@ -185,10 +185,14 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) {
} }
if(strncmp(inputDataLine, "Mesh:", 5) == 0) { if(strncmp(inputDataLine, "Mesh:", 5) == 0) {
currentMode = EMFModuleMesh; currentMode = EMFModuleMesh;
EGE_VERBOSE("Parse Mesh :"); removeEndLine(inputDataLine);
currentMeshName = inputDataLine + 5;
currentMode = EMFModuleMeshNamed;
EGE_VERBOSE("Parse Mesh :" << currentMeshName);
} else if(strncmp(inputDataLine, "Materials:", 9) == 0) { } else if(strncmp(inputDataLine, "Materials:", 9) == 0) {
currentMode = EMFModuleMaterial; currentMode = EMFModuleMaterial;
EGE_VERBOSE("Parse Material :"); EGE_VERBOSE("Parse Material :");
} else { } else {
currentMode = EMFModuleNone; currentMode = EMFModuleNone;
} }
@ -196,18 +200,6 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) {
if ( currentMode >= EMFModuleMesh if ( currentMode >= EMFModuleMesh
&& currentMode <= EMFModuleMesh_END) { && currentMode <= EMFModuleMesh_END) {
if (level == 1) { if (level == 1) {
//Find mesh name ...
if (loadNextData(inputDataLine, 2048, fileName, true) == nullptr) {
// reach end of file ...
break;
}
removeEndLine(inputDataLine);
currentMeshName = inputDataLine;
currentMode = EMFModuleMeshNamed;
EGE_VERBOSE(" "<< currentMeshName);
continue;
}
if (level == 2) {
// In the mesh level 2 the line size must not exced 2048 // In the mesh level 2 the line size must not exced 2048
if (loadNextData(inputDataLine, 2048, fileName, true) == nullptr) { if (loadNextData(inputDataLine, 2048, fileName, true) == nullptr) {
// reach end of file ... // reach end of file ...
@ -239,7 +231,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) {
} }
continue; continue;
} }
// level > 2 // level > 1
switch (currentMode) { switch (currentMode) {
default: default:
EGE_ERROR("Unknow ... "<< level); EGE_ERROR("Unknow ... "<< level);
@ -320,7 +312,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) {
} }
case EMFModuleMeshFace: case EMFModuleMeshFace:
case EMFModuleMeshFaceMaterial: case EMFModuleMeshFaceMaterial:
if (level == 3) { if (level == 2) {
//Find mesh name ... //Find mesh name ...
if (loadNextData(inputDataLine, 2048, fileName, true) == nullptr) { if (loadNextData(inputDataLine, 2048, fileName, true) == nullptr) {
// reach end of file ... // reach end of file ...
@ -391,7 +383,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) {
break; break;
} }
removeEndLine(inputDataLine); removeEndLine(inputDataLine);
if (level == 3) { if (level == 2) {
physics = ege::PhysicsShape::create(inputDataLine); physics = ege::PhysicsShape::create(inputDataLine);
if (physics == nullptr) { if (physics == nullptr) {
EGE_ERROR("Allocation error when creating physical shape ..."); EGE_ERROR("Allocation error when creating physical shape ...");