diff --git a/src/easymesh/easymesh.cpp b/src/easymesh/easymesh.cpp index ed577850..a119a3d6 100644 --- a/src/easymesh/easymesh.cpp +++ b/src/easymesh/easymesh.cpp @@ -371,10 +371,7 @@ EasyMesh::EasyMesh() bool EasyMesh::Compile(char const *command) { EasyMeshCompiler mc(*this); - bool res = mc.ParseString(command); - delete(m_build_data); - m_build_data = NULL; - return res; + return mc.ParseString(command); } //----------------------------------------------------------------------------- @@ -391,6 +388,9 @@ void EasyMesh::CloseBrace() //----------------------------------------------------------------------------- void EasyMesh::MeshConvert(GpuShaderData* new_gpu_sdata) { + delete(m_build_data); + m_build_data = NULL; + if (new_gpu_sdata) { m_gpu_data.AddGpuData(new_gpu_sdata, this); diff --git a/src/easymesh/easymesh.h b/src/easymesh/easymesh.h index 73277507..733533e4 100644 --- a/src/easymesh/easymesh.h +++ b/src/easymesh/easymesh.h @@ -21,6 +21,22 @@ namespace lol { +//Utility enum for renderers +struct MeshRender +{ + enum Value + { + NeedInit, + CanRender, + IgnoreRender + } + m_value; + + inline MeshRender(Value v) : m_value(v) {} + inline MeshRender() : m_value(NeedInit) {} + inline operator Value() { return m_value; } +}; + //Vertex datas for easymesh vertex list. //TODO : struct VertexData