Author: ArcRiley
Date: 2007-07-08 02:55:48 -0400 (Sun, 08 Jul 2007)
New Revision: 413
Modified:
trunk/pysoy/src/bodies._bodies/Mesh.pxi
Log:
was not returning store from alloc when no (re)alloc was being performed
Modified: trunk/pysoy/src/bodies._bodies/Mesh.pxi
===================================================================
--- trunk/pysoy/src/bodies._bodies/Mesh.pxi 2007-07-08 03:32:06 UTC (rev
412)
+++ trunk/pysoy/src/bodies._bodies/Mesh.pxi 2007-07-08 06:55:48 UTC (rev
413)
@@ -22,11 +22,16 @@
This is a body which renders a group of triangles called a "mesh".
'''
- def __new__(self, object scene=None, *args, **keywords) :
+ def __new__(self, scene=None, *args, **keywords) :
self._cface = soy._internals.Children()
self._cvert = soy._internals.Children()
+ def __repr__(self) :
+ return '<Mesh with %d verticies, %d faces, and %d materials>' % (
+ self._nvert, self._nface, self._nmate)
+
+
property faces :
'''Mesh.faces
@@ -223,22 +228,25 @@
m[0] = 0
py.PyMem_Free(store)
return NULL
- if m[0] == 0 and num<16 :
- m[0] = 32
+ if m[0] == 0 :
+ m[0] = num + 15
return py.PyMem_Malloc(m[0] * size)
if num > m[0] or num+120 < m[0] :
m[0] = num + 15
return py.PyMem_Realloc(store, m[0] * size)
+ return store
cdef void _allocFaces(self, int num) :
self._faces = <Face *> self._alloc(num, &self._mface,
self._faces, sizeof(Face))
+
cdef void _allocVerts(self, int num) :
self._verts = <Vert *> self._alloc(num, &self._mvert,
self._verts, sizeof(Vert))
+
cdef void _allocMates(self, int num) :
self._mates = <MatRange *> self._alloc(num, &self._mmate,
self._mates, sizeof(MatRange))
_______________________________________________
PySoy-SVN mailing list
[email protected]
http://www.pysoy.org/mailman/listinfo/pysoy-svn