@@ -60,23 +60,27 @@ pyLoadObj(PyObject* self, PyObject* args)
6060 {
6161 current = PyList_New (0 );
6262
63- if (i == 0 ){
63+ switch (i) {
64+
65+ case 0 :
6466 current_name = " positions" ;
65- vect = vectd (cm.positions .begin (), cm.positions .end ()); }
66- else if (i == 1 ){
67+ vect = vectd (cm.positions .begin (), cm.positions .end ()); break ;
68+ case 1 :
6769 current_name = " normals" ;
68- vect = vectd (cm.normals .begin (), cm.normals .end ()); }
69- else if (i == 2 ) {
70+ vect = vectd (cm.normals .begin (), cm.normals .end ()); break ;
71+ case 2 :
7072 current_name = " texcoords" ;
71- vect = vectd (cm.texcoords .begin (), cm.texcoords .end ()); }
72- else if (i == 3 ) {
73+ vect = vectd (cm.texcoords .begin (), cm.texcoords .end ()); break ;
74+ case 3 :
7375 current_name = " indicies" ;
74- vect = vectd (cm.indices .begin (), cm.indices .end ()); }
75- else if (i == 4 ) {
76+ vect = vectd (cm.indices .begin (), cm.indices .end ()); break ;
77+ case 4 :
7678 current_name = " material_ids" ;
77- vect = vectd (cm.material_ids .begin (), cm.material_ids .end ()); }
78-
79- for (vectd::iterator it = vect.begin () ;
79+ vect = vectd (cm.material_ids .begin (), cm.material_ids .end ()); break ;
80+
81+ }
82+
83+ for (vectd::iterator it = vect.begin () ;
8084 it != vect.end (); it++)
8185 {
8286 PyList_Insert (current, it - vect.begin (), PyFloat_FromDouble (*it));
0 commit comments