From 9cfe1bffd62e008f384613f9bbf0eb909fe8191f Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 20 Jun 2013 19:13:37 +0000 Subject: [PATCH] easymesh: print full mesh source when compilation fails. --- src/easymesh/easymesh-compiler.cpp | 3 +++ test/physicobject.h | 28 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/easymesh/easymesh-compiler.cpp b/src/easymesh/easymesh-compiler.cpp index d7f92897..d4f5df79 100644 --- a/src/easymesh/easymesh-compiler.cpp +++ b/src/easymesh/easymesh-compiler.cpp @@ -33,7 +33,10 @@ bool EasyMeshCompiler::ParseString(char const *command) m_lexer = &scanner; EasyMeshParser parser(*this); if (parser.parse() != 0) + { + Log::Debug("Mesh source: %s\n", command); return false; + } return true; } diff --git a/test/physicobject.h b/test/physicobject.h index d03efca8..83bca594 100644 --- a/test/physicobject.h +++ b/test/physicobject.h @@ -28,7 +28,7 @@ public: { m_physics = new EasyPhysic(this); - m_mesh.Compile("[sc#ddd afcb60 1 60 -.1]"); + m_mesh.Compile("[sc#ddd afcb 60 1 60 -.1]"); vec3 BoxSize = vec3(60.f, 1.f, 60.f); m_physics->SetCollisionChannel(0, 0xFF); m_physics->SetShapeToBox(BoxSize); @@ -45,7 +45,7 @@ public: { m_physics = new EasyPhysic(this); - m_mesh.Compile("[sc#ddd afcb20 1 20 -.1]"); + m_mesh.Compile("[sc#ddd afcb 20 1 20 -.1]"); vec3 BoxSize = vec3(20.f, 1.f, 20.f); m_physics->SetCollisionChannel(0, 0xFF); m_physics->SetShapeToBox(BoxSize); @@ -63,12 +63,12 @@ public: "[sc#000 scb#000" //"[sc#aaa scb#aaa" "[ad8 2 0 rx180 ty-1]" - "[asph8 .5 .5 .5 ty1]" + "[asph8 .5 ty1]" "[ac32 2 .5 .5 0 0]" - "[asph6 .1 .1 .1 ty.9 tx.5 tz.15]" - "[asph6 .1 .1 .1 ty.9 tx.5 tz-.15]" - "[asph8 .05 .5 .05 ty.6 tz.5]" - "[asph8 .05 .5 .05 ty.6 tz-.5]" + "[asph6 .1 ty.9 tx.5 tz.15]" + "[asph6 .1 ty.9 tx.5 tz-.15]" + "[asph8 .05 sy10 ty.6 tz.5]" + "[asph8 .05 sy10 ty.6 tz-.5]" "]" "[sc#fd0 scb#fd0" "[ac8 .4 .1 0 0 0 ty.25 rz-90 ty.7 tx.5]" @@ -76,7 +76,7 @@ public: "[" "[sc#fff scb#fff" "[ad8 2 0 rx180 ty-1]" - "[asph8 .5 .5 .5 ty1]" + "[asph8 .5 ty1]" "[ac32 1.9 .5 .5 0 0]" "]" " ty-.1 tx.05]" @@ -119,12 +119,12 @@ public: int SphereLimit = MeshRand.Count(); - MeshRand << "[sc#add asph1 2 2 2]"; - MeshRand << "[sc#dad asph1 2 2 2]"; - MeshRand << "[sc#dda asph1 2 2 2]"; - MeshRand << "[sc#daa asph1 2 2 2]"; - MeshRand << "[sc#ada asph1 2 2 2]"; - MeshRand << "[sc#aad asph1 2 2 2]"; + MeshRand << "[sc#add asph1 2]"; + MeshRand << "[sc#dad asph1 2]"; + MeshRand << "[sc#dda asph1 2]"; + MeshRand << "[sc#daa asph1 2]"; + MeshRand << "[sc#ada asph1 2]"; + MeshRand << "[sc#aad asph1 2]"; int ConeLimit = MeshRand.Count();