Author: DerekRhodes
Date: 2008-03-05 17:32:04 -0500 (Wed, 05 Mar 2008)
New Revision: 1056

Modified:
   trunk/pysoy/src/_datatypes/FaceList.pxi
   trunk/pysoy/src/_datatypes/MaterialList.pxi
Log:
locks changed for Children API, trylock needs attention

Modified: trunk/pysoy/src/_datatypes/FaceList.pxi
===================================================================
--- trunk/pysoy/src/_datatypes/FaceList.pxi     2008-03-05 22:29:22 UTC (rev 
1055)
+++ trunk/pysoy/src/_datatypes/FaceList.pxi     2008-03-05 22:32:04 UTC (rev 
1056)
@@ -51,18 +51,21 @@
     # instance of every face in every mesh - that'd eat way too much memory.
     #
     _found = 0
-    self._children.lock()
+    ##self._children.lock()
+    self._children._stepLock()
     if _index < 0 :    
       _index = self._arraySize + _index
     if _index < 0 or _index >= self._arraySize :
-      self._children.unlock()
+      ##self._children.unlock()
+      self._children._stepUnlock()
       raise IndexError('face index out of range')
     for i from 0 <= i < self._children.current :
       if (<soy.atoms.Face> self._children.list[i])._index == _index :
         _face = <soy.atoms.Face> self._children.list[i]
         _found = 1
         break
-    self._children.unlock()
+    ##self._children.unlock()
+    self._children._stepUnlock()
     if not _found :
       _face = soy.atoms.Face(mesh = <soy.meshes.Mesh> self._mesh,
                              index= _index)
@@ -86,14 +89,16 @@
 
 
   cdef void _createBuffer(self) :
-    self._children.lock()
+    ##self._children.lock()
+    self._children._stepLock()
     self._bufferAlloc = self._arrayAlloc
     self._updateRange.length = 0
     gl.glGenBuffersARB(1, &self._buffer)
     gl.glBindBufferARB(gl.GL_ELEMENT_ARRAY_BUFFER_ARB, self._buffer)
     gl.glBufferDataARB(gl.GL_ELEMENT_ARRAY_BUFFER_ARB, 6*self._bufferAlloc,
                        self._array, gl.GL_STATIC_DRAW_ARB)
-    self._children.unlock()
+    ##self._children.unlock()
+    self._children._stepUnlock()
 
 
   cdef void _flagUpdated(self, int _offset, int _length) :
@@ -133,7 +138,8 @@
                             6 * (self._updateRange.length+1),
                             &self._array[self._updateRange.offset])
     self._updateRange.length = 0
-    self._children.unlock()
+    ##self._children.unlock()
+    self._children._stepUnlock()
 
 
   cdef void _allocArray(self, int num) :

Modified: trunk/pysoy/src/_datatypes/MaterialList.pxi
===================================================================
--- trunk/pysoy/src/_datatypes/MaterialList.pxi 2008-03-05 22:29:22 UTC (rev 
1055)
+++ trunk/pysoy/src/_datatypes/MaterialList.pxi 2008-03-05 22:32:04 UTC (rev 
1056)
@@ -37,11 +37,11 @@
 
   def __dealloc__(self) :
     cdef int i
-    #self._children.lock()
+    ##self._children.lock()
     self._children._stepLock()
     for i from 0 <= i < self._children.current :
       py.Py_DECREF(<object> self._children.list[i])
-    #self._children.unlock()
+    ##self._children.unlock()
     self._children._stepUnlock()
 
 
@@ -67,7 +67,7 @@
 
   def __getitem__(self, _index) :
     cdef soy.materials.Material _mat
-    #self._children.lock()
+    ##self._children.lock()
     self._children._stepLock()    
     if _index < 0 :
       _index = self._children.current + _index
@@ -75,7 +75,7 @@
       self._children._stepUnlock()
       raise IndexError('material index out of range')
     _mat = <soy.materials.Material> self._children.list[_index]
-    #self._children.unlock()
+    ##self._children.unlock()
     self._children._stepUnlock()
     return _mat
 
@@ -89,23 +89,23 @@
       _mesh._verts._calculateTSLV(body)
 
     _mesh._verts._coreRenderArrayBumpPass()
-    #self._children.lock()
+    ##self._children.lock()
     self._children._stepLock()
     for i from 0 <= i < self._children.current :
       (<soy.materials.Material> self._children.list[i])._coreBind()
       _mesh._faces._coreRenderArray(self._ranges[i].offset, 
self._ranges[i].length)
       (<soy.materials.Material> self._children.list[i])._coreUnBind()
-    #self._children.unlock()
+    ##self._children.unlock()
     self._children._stepUnlock()
 
     _mesh._verts._coreRenderArray()
-    #self._children.lock()
+    ##self._children.lock()
     self._children._stepLock()
     for i from 0 <= i < self._children.current :
       (<soy.materials.Material> self._children.list[i])._coreBind()
       _mesh._faces._coreRenderArray(self._ranges[i].offset, 
self._ranges[i].length)
       (<soy.materials.Material> self._children.list[i])._coreUnBind()
-    #self._children.unlock()
+    ##self._children.unlock()
     self._children._stepUnlock()
 
 
@@ -126,24 +126,24 @@
 
     _mesh._verts._coreRenderBufferBumpPass()
 
-    #self._children.lock()
+    ##self._children.lock()
     self._children._stepLock()
     for i from 0 <= i < self._children.current :
         if (<soy.materials.Material> self._children.list[i])._has_bumpmap():
           (<soy.materials.Material> self._children.list[i])._coreBindBumpPass()
           _mesh._faces._coreRenderBuffer(self._ranges[i].offset, 
self._ranges[i].length)
           (<soy.materials.Material> 
self._children.list[i])._coreUnBindBumpPass()
-    #self._children.unlock()
+    ##self._children.unlock()
     self._children._stepUnlock()
 
     _mesh._verts._coreRenderBuffer()
-    #self._children.lock()
+    ##self._children.lock()
     self._children._stepLock()
     for i from 0 <= i < self._children.current :
       (<soy.materials.Material> self._children.list[i])._coreBind()
       _mesh._faces._coreRenderBuffer(self._ranges[i].offset, 
self._ranges[i].length)
       (<soy.materials.Material> self._children.list[i])._coreUnBind()
-    #self._children.unlock()
+    ##self._children.unlock()
     self._children._stepUnlock()      
 
 

_______________________________________________
PySoy-SVN mailing list
PySoy-SVN@pysoy.org
http://www.pysoy.org/mailman/listinfo/pysoy-svn

Reply via email to