X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fmoof%2Fmesh_bindings.cc;h=8c9f9e0c07aff424d717944ea3499b73edb19e1d;hp=02138add2249c6c3ecae12a085ea9bf96b97f5e4;hb=574af38ed616d1adfa5e6ce35f67cda1f707f89d;hpb=6c9943707d4f33035830eba0587a61a34eaecbc2 diff --git a/src/moof/mesh_bindings.cc b/src/moof/mesh_bindings.cc index 02138ad..8c9f9e0 100644 --- a/src/moof/mesh_bindings.cc +++ b/src/moof/mesh_bindings.cc @@ -1,13 +1,11 @@ -/*] Copyright (c) 2009-2010, Charles McGarvey [************************** +/*] Copyright (c) 2009-2011, Charles McGarvey [***************************** **] All rights reserved. * -* vi:ts=4 sw=4 tw=75 -* * Distributable under the terms and conditions of the 2-clause BSD license; * see the file COPYING for a complete text of the license. * -**************************************************************************/ +*****************************************************************************/ #include "log.hh" #include "mesh.hh" @@ -37,8 +35,10 @@ static int mesh_draw(script& script) script[1].require_object("mesh").get(mesh); scalar alpha; - if (script[2].get(alpha)) (*mesh)->draw(alpha); - else (*mesh)->draw(); + if (script[2].get(alpha)) + (*mesh)->draw(alpha); + else + (*mesh)->draw(); return 0; } @@ -70,17 +70,19 @@ static int object_draw(script& script) mesh::object_ptr* object; script[1].require_object("mesh object").get(object); - scalar alpha; - bool recurse; - if (script[2].get(alpha)) - { - if (script[3].get(recurse)) (*object)->draw(alpha, recurse); - else (*object)->draw(alpha); + scalar alpha; + bool recurse; + if (script[2].get(alpha)) { + if (script[3].get(recurse)) + (*object)->draw(alpha, recurse); + else + (*object)->draw(alpha); } - else - { - if (script[2].get(recurse)) (*object)->draw(SCALAR(0.0), recurse); - else (*object)->draw(); + else { + if (script[2].get(recurse)) + (*object)->draw(SCALAR(0.0), recurse); + else + (*object)->draw(); } return 0; @@ -91,21 +93,18 @@ static int object_index(script& script) mesh::object_ptr* object; script[1].require_object("mesh object").get(object); - if (script[2].is_number()) - { + if (script[2].is_number()) { unsigned index; script[2].get(index); --index; script.push((*object)->kids[index]); } - else if (script[2].is_string()) - { + else if (script[2].is_string()) { std::string name; script[2].get(name); script.push((*object)->kids_byname[name]); } - else - { + else { script[2].raise_type_error("index or name"); } return 1;