Changeset 954

Show
Ignore:
Timestamp:
02/19/08 14:28:52 (10 months ago)
Author:
ArcRiley
Message:

#930 : Scene processing removed from CoreLoop, no turning back now

Location:
trunk/pysoy/src
Files:
2 removed
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/pysoy/src/_core/_coreLoop.pxi

    r946 r954  
    1818# $Id$ 
    1919 
    20 cdef soy._internals.PointerSet _givefields 
    21 _givefields = soy._internals.PointerSet() 
    22  
    2320cdef void _coreLoop() : 
    24   cdef int i, j 
    25   cdef int _step, _maxstep 
    26   cdef soy.scenes.Scene _scene 
    27   cdef soy._internals.Children _scenes 
    28   _scenes = <soy._internals.Children> soy.scenes._getScenes() 
     21  cdef int i 
    2922  while (1) : 
    3023    _screens.lock() 
     
    3730      (<Window> _windows.list[i])._coreRender() 
    3831    _windows.unlock() 
    39     # 
    40     _scenes.lock() 
    41     _maxstep = 0 
    42     for i from 0 <= i < _scenes.current : 
    43       _scene = <soy.scenes.Scene> _scenes.list[i] 
    44       _scene._updateTime() 
    45       # Clear outdated lists 
    46       _callfields._empty() 
    47       _givefields._empty() 
    48       _scene._bodies.lock() 
    49       for j from 0 <= j < _scene._bodies.current : 
    50         if isinstance(<soy.bodies._bodies.Body> _scene._bodies.list[j],  
    51                       soy.bodies.fields.Field) : 
    52           # Make sure every field is in givefields & _give each one 
    53           if not _givefields._has_key(<void*> _scene._bodies.list[j]) : 
    54             (<soy.bodies.fields.Field> _scene._bodies.list[j])._give(0) 
    55             _givefields._insert(<void*> _scene._bodies.list[j]) 
    56  
    57       for j from 0 <= j < _scene._bodies.current : 
    58         if isinstance(<soy.bodies._bodies.Body> _scene._bodies.list[j],  
    59                       soy.bodies.fields.Field) : 
    60           # Apply fields; add incompletly applied fiels to the list 
    61           if not (<soy.bodies.fields.Field> _scene._bodies.list[j])._apply() : 
    62             _callfields._insert(_scene._bodies.list[j]) 
    63       # Apply any outstanding fields 
    64       _callfields._foreach(_runField, NULL) 
    65       _step = _scene._steps() 
    66       if _step > _maxstep : 
    67         _maxstep = _step 
    68       _scene._stepLock() 
    69       for j from 0 <= j < _step : 
    70         _scene._updateTime() 
    71         _givefields._foreach(_prerunField, NULL) 
    72         _callfields._empty() 
    73         ode.dSpaceCollide(_scene._spaceID, NULL, _callback) 
    74         ode.dWorldQuickStep(_scene._worldID, _scene._stepSize) 
    75         ode.dJointGroupEmpty(_contactgroup) 
    76         if j != 0 : 
    77           _callfields._foreach(_runField, NULL) 
    78       _scene._stepUnLock() 
    79       _scene._bodies.unlock() 
    80     _scenes.unlock() 
    81     if _maxstep == 0 : 
    82       soy._internals._sleep(10) 
    83     else : 
    84       soy._internals._sleep(1) 
     32    soy._internals._sleep(1) 
  • trunk/pysoy/src/scenes/soy.scenes.pxd

    r950 r954  
    2424cimport soy._internals 
    2525 
    26 cdef void*  _getScenes ( ) 
    27  
    2826cdef class Scene (soy._internals.Loopable) : 
    2927  cdef ode.dWorldID               _worldID 
  • trunk/pysoy/src/scenes/soy.scenes.pyx

    r944 r954  
    3030from soy._internals cimport _time 
    3131 
    32 '''  For when this is no longer in _coreLoop 
    3332cdef soy._internals.LoopThread _scenes 
    3433_scenes = soy._internals.LoopThread('SceneLoop') 
    35 ''' 
    3634 
    3735cimport soy.colors