From bf18c35dd7e1e74da4ee23eddb2f638ab09c3650 Mon Sep 17 00:00:00 2001 From: Ralph Minderhoud Date: Thu, 13 Jul 2017 17:15:55 -0500 Subject: [PATCH] Moved binds of PRIMITIVE_* contants from ArrayMesh to Mesh --- doc/base/classes.xml | 42 ++++++++++++++++++++-------------------- scene/resources/mesh.cpp | 19 ++++++++++-------- scene/resources/mesh.h | 2 ++ 3 files changed, 34 insertions(+), 29 deletions(-) diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 7a81eddd92f..af2f89642e3 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -4937,27 +4937,6 @@ Index array will be used. - - Render array as points (one vertex equals one point). - - - Render array as lines (every two vertices a line is created). - - - Render array as line strip. - - - Render array as line loop (like line strip, but closed). - - - Render array as triangles (every three vertices a triangle is created). - - - Render array as triangle strips. - - - Render array as triangle fans. - @@ -23565,6 +23544,27 @@ + + Render array as points (one vertex equals one point). + + + Render array as lines (every two vertices a line is created). + + + Render array as line strip. + + + Render array as line loop (like line strip, but closed). + + + Render array as triangles (every three vertices a triangle is created). + + + Render array as triangle strips. + + + Render array as triangle fans. + diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index ef7011b2afa..414d0a62406 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -413,6 +413,17 @@ Ref Mesh::create_outline(float p_margin) const { return newmesh; } +void Mesh::_bind_methods() { + + BIND_CONSTANT(PRIMITIVE_POINTS); + BIND_CONSTANT(PRIMITIVE_LINES); + BIND_CONSTANT(PRIMITIVE_LINE_STRIP); + BIND_CONSTANT(PRIMITIVE_LINE_LOOP); + BIND_CONSTANT(PRIMITIVE_TRIANGLES); + BIND_CONSTANT(PRIMITIVE_TRIANGLE_STRIP); + BIND_CONSTANT(PRIMITIVE_TRIANGLE_FAN); +} + Mesh::Mesh() { } @@ -1034,14 +1045,6 @@ void ArrayMesh::_bind_methods() { BIND_CONSTANT(ARRAY_FORMAT_BONES); BIND_CONSTANT(ARRAY_FORMAT_WEIGHTS); BIND_CONSTANT(ARRAY_FORMAT_INDEX); - - BIND_CONSTANT(PRIMITIVE_POINTS); - BIND_CONSTANT(PRIMITIVE_LINES); - BIND_CONSTANT(PRIMITIVE_LINE_STRIP); - BIND_CONSTANT(PRIMITIVE_LINE_LOOP); - BIND_CONSTANT(PRIMITIVE_TRIANGLES); - BIND_CONSTANT(PRIMITIVE_TRIANGLE_STRIP); - BIND_CONSTANT(PRIMITIVE_TRIANGLE_FAN); } ArrayMesh::ArrayMesh() { diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h index f716b59fe97..4adb871e09c 100644 --- a/scene/resources/mesh.h +++ b/scene/resources/mesh.h @@ -46,6 +46,8 @@ class Mesh : public Resource { protected: void _clear_triangle_mesh(); + static void _bind_methods(); + public: enum {