]> Dogcows Code - chaz/yoink/blobdiff - src/moof/mesh_bindings.cc
fixed documentation about where to find licenses
[chaz/yoink] / src / moof / mesh_bindings.cc
index 02138add2249c6c3ecae12a085ea9bf96b97f5e4..290b42aef012ab09a8e221a7756bfd700c5d2a7f 100644 (file)
@@ -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"
@@ -33,12 +31,14 @@ static int mesh_new(script& script)
 
 static int mesh_draw(script& script)
 {
-       mesh_handle* mesh;
+       mesh_handle mesh;
        script[1].require_object<mesh_handle>("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_ptr>("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_ptr>("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;
This page took 0.019731 seconds and 4 git commands to generate.