[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25532] trunk/blender/source/gameengine: BGE: fix more transpose bug when MathUtils is not used.

Benoit Bolsee benoit.bolsee at online.be
Wed Dec 23 10:55:34 CET 2009


Revision: 25532
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25532
Author:   ben2610
Date:     2009-12-23 10:55:34 +0100 (Wed, 23 Dec 2009)

Log Message:
-----------
BGE: fix more transpose bug when MathUtils is not used.

Modified Paths:
--------------
    trunk/blender/source/gameengine/Expressions/PyObjectPlus.cpp
    trunk/blender/source/gameengine/Ketsji/KX_PyMath.cpp

Modified: trunk/blender/source/gameengine/Expressions/PyObjectPlus.cpp
===================================================================
--- trunk/blender/source/gameengine/Expressions/PyObjectPlus.cpp	2009-12-22 23:38:09 UTC (rev 25531)
+++ trunk/blender/source/gameengine/Expressions/PyObjectPlus.cpp	2009-12-23 09:55:34 UTC (rev 25532)
@@ -421,18 +421,18 @@
 #ifdef USE_MATHUTILS
 					return newMatrixObject(val, attrdef->m_imin, attrdef->m_imax, Py_WRAP, NULL);
 #else
-					PyObject* rowlist = PyList_New(attrdef->m_imin);
+					PyObject* collist = PyList_New(attrdef->m_imin);
 					for (unsigned int i=0; i<attrdef->m_imin; i++)
 					{
-						PyObject* collist = PyList_New(attrdef->m_imax);
+						PyObject* col = PyList_New(attrdef->m_imax);
 						for (unsigned int j=0; j<attrdef->m_imax; j++)
 						{
-							PyList_SET_ITEM(collist,j,PyFloat_FromDouble(val[j]));
+							PyList_SET_ITEM(col,j,PyFloat_FromDouble(val[j]));
 						}
-						PyList_SET_ITEM(rowlist,i,collist);
+						PyList_SET_ITEM(collist,i,col);
 						val += attrdef->m_imax;
 					}
-					return rowlist;
+					return collist;
 #endif
 				}
 			}

Modified: trunk/blender/source/gameengine/Ketsji/KX_PyMath.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_PyMath.cpp	2009-12-22 23:38:09 UTC (rev 25531)
+++ trunk/blender/source/gameengine/Ketsji/KX_PyMath.cpp	2009-12-23 09:55:34 UTC (rev 25532)
@@ -103,20 +103,20 @@
 	mat.getValue(fmat);
 	return newMatrixObject(fmat, 4, 4, Py_NEW, NULL);
 #else
-	PyObject *list = PyList_New(4);
-	PyObject *sublist;
+	PyObject *collist = PyList_New(4);
+	PyObject *col;
 	int i;
 	
 	for(i=0; i < 4; i++) {
-		sublist = PyList_New(4);
-		PyList_SET_ITEM(sublist, 0, PyFloat_FromDouble(mat[i][0]));
-		PyList_SET_ITEM(sublist, 1, PyFloat_FromDouble(mat[i][1]));
-		PyList_SET_ITEM(sublist, 2, PyFloat_FromDouble(mat[i][2]));
-		PyList_SET_ITEM(sublist, 3, PyFloat_FromDouble(mat[i][3]));
-		PyList_SET_ITEM(list, i, sublist);
+		col = PyList_New(4);
+		PyList_SET_ITEM(col, 0, PyFloat_FromDouble(mat[0][i]));
+		PyList_SET_ITEM(col, 1, PyFloat_FromDouble(mat[1][i]));
+		PyList_SET_ITEM(col, 2, PyFloat_FromDouble(mat[2][i]));
+		PyList_SET_ITEM(col, 3, PyFloat_FromDouble(mat[3][i]));
+		PyList_SET_ITEM(collist, i, col);
 	}
 	
-	return list;
+	return collist;
 #endif
 }
 
@@ -127,19 +127,19 @@
 	mat.getValue3x3(fmat);
 	return newMatrixObject(fmat, 3, 3, Py_NEW, NULL);
 #else
-	PyObject *list = PyList_New(3);
-	PyObject *sublist;
+	PyObject *collist = PyList_New(3);
+	PyObject *col;
 	int i;
 	
 	for(i=0; i < 3; i++) {
-		sublist = PyList_New(3);
-		PyList_SET_ITEM(sublist, 0, PyFloat_FromDouble(mat[i][0]));
-		PyList_SET_ITEM(sublist, 1, PyFloat_FromDouble(mat[i][1]));
-		PyList_SET_ITEM(sublist, 2, PyFloat_FromDouble(mat[i][2]));
-		PyList_SET_ITEM(list, i, sublist);
+		col = PyList_New(3);
+		PyList_SET_ITEM(col, 0, PyFloat_FromDouble(mat[0][i]));
+		PyList_SET_ITEM(col, 1, PyFloat_FromDouble(mat[1][i]));
+		PyList_SET_ITEM(col, 2, PyFloat_FromDouble(mat[2][i]));
+		PyList_SET_ITEM(collist, i, col);
 	}
 	
-	return list;
+	return collist;
 #endif
 }
 





More information about the Bf-blender-cvs mailing list