Home My Page Projects Code Snippets Project Openings 3D graphics for Standard ML
Summary Activity SCM

SCM Repository

[sml3d] Diff of /trunk/sml3d/src/particles/compiler/translate.sml
ViewVC logotype

Diff of /trunk/sml3d/src/particles/compiler/translate.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 750, Tue Feb 2 16:12:23 2010 UTC revision 758, Tue Feb 9 04:46:06 2010 UTC
# Line 421  Line 421 
421                      letPRIM("nextPos", IR.T_VEC, IR.ADD_VEC, [theScale, pos], fn newPos =>                      letPRIM("nextPos", IR.T_VEC, IR.ADD_VEC, [theScale, pos], fn newPos =>
422                        k(PS{pos = newPos, vel = vel, size = size, isDead = isDead, color = color})))                        k(PS{pos = newPos, vel = vel, size = size, isDead = isDead, color = color})))
423    
424                | P.SINK({d, kill_inside}) => let                | P.SINK({d, kill_inside}) =>
                   val deadState = PS{  
                           pos = pos, vel = vel, size = size,  
                           isDead = IR.newConst("reallyDead", IR.C_BOOL true),  
                           color = color  
                       }  
                   val blk = newBlock (env, k)  
                   in  
425                      mkWithinVar("isWithin", env, state, d, fn withinVal =>                      mkWithinVar("isWithin", env, state, d, fn withinVal =>
426                      mkXOR ("shouldNotKill", withinVal, psvToIRVar(env, kill_inside),                      mkXOR ("shouldNotKill", withinVal, psvToIRVar(env, kill_inside),
427                        fn shouldNotKill =>                        fn shouldNotKill =>
428                          IR.mkIF(shouldNotKill,                      letPRIM("shouldKill", IR.T_BOOL, IR.NOT, [shouldNotKill], fn shouldKill =>
429                            (*then*) goto(state, blk),                      letPRIM("isReallyDead", IR.T_BOOL, IR.OR, [shouldKill, isDead], fn isReallyDead =>
430                            (*else*) goto(deadState, blk))                      k(PS{pos = pos, vel = vel, size = size, isDead = isReallyDead, color = color})
431                          ))                          ))))
                   end  
432    
433                | P.ORBITLINESEG {endp1, endp2, maxRad, mag} => let                | P.ORBITLINESEG {endp1, endp2, maxRad, mag} => let
434                    val blk = newBlock (env, k)                    val blk = newBlock (env, k)

Legend:
Removed from v.750  
changed lines
  Added in v.758

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0