Changeset 72

Show
Ignore:
Timestamp:
06/01/08 17:49:45 (3 months ago)
Author:
JoeCoder
Message:

Insignificant changes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/proj/buildme.d

    r63 r72  
    1010 * This script can either use precompiled derelict libraries in the lib folder 
    1111 * or build the derelict source directly with the engine.  The former is 
    12  * of course faster, but the latter can be achieved by setting ign_path and 
    13  * lib_path to empty strings in the compilation options below. 
     12 * of course faster, but the latter can be achieved by setting  
     13 * lib_path to empty string and adding ../src/derelict to the src_path 
     14 * in the compilation options below. 
    1415 *  
    1516 * This script can easily be expanded to compile and generate docs for most 
  • trunk/src/demo1/main.d

    r71 r72  
    119119    planet.setAngularVelocity(Vec3f(0, -0.01, 0)); 
    120120     
     121     
     122     
     123     
    121124    //planet.getModel().clearAttribute("gl_Normal"); 
    122125     
    123126    // Asteroids 
    124127    asteroidBelt(800, 1400, planet); 
     128     
     129    //delete planet; 
    125130 
    126131    // Add to the scene's update loop 
  • trunk/src/yage/core/tree.d

    r71 r72  
    66module yage.core.tree; 
    77 
     8import std.gc; 
    89 
    910/** 
     
    2021    T[T] children; 
    2122     
    22     /// Prohibit manual deletion of Tree elements.  Use .remove() instead
    23     delete(void* p
    24     {   throw new Exception("Tree elements cannot be deleted.  Use remove()."); 
     23    /// Ensure that child is removed from its parent
     24    ~this(
     25    {   remove();       
    2526    } 
    2627     
     
    3031     * Returns: A self reference.*/ 
    3132    T addChild(T child) 
    32     in {assert(child !is this);} 
    33     body 
     33    in { 
     34        assert(child != this); 
     35        assert(child !is null); 
     36    }body 
    3437    {   child.setParent(cast(T)this); 
    3538        return cast(T)this; 
     
    4649    T getParent() 
    4750    {   return parent; 
    48     }   
     51    } 
    4952    T setParent(T _parent) /// Ditto 
    5053    in { assert(_parent !is null); 
    5154    }body 
    52     {            
    53         if (parent && cast(T)this in parent.children) 
     55    {   if (parent && cast(T)this in parent.children) 
    5456            parent.children.remove(cast(T)this); 
    5557         
     
    6062    } 
    6163     
    62     /// Remove this element.  This function should be used instead of delete. 
     64    /// Is elem a child of this element? 
     65    bool isChild(T elem) 
     66    {   return cast(bool)(elem in children); 
     67    } 
     68     
     69    /// Remove this element from its parent 
    6370    void remove() 
    6471    {   // this needs to happen because some children (like lights) may need to do more in their remove() function. 
  • trunk/src/yage/node/model.d

    r71 r72  
    2626    this(Node parent) 
    2727    {   super(parent); 
    28         visible = true; 
    29     } 
     28    }    
    3029 
    3130    /** 
  • trunk/src/yage/node/node.d

    r71 r72  
    127127        } 
    128128    } 
    129      
    130     /// Prohibit manual deletion of Nodes.  Use node.remove() instead. 
    131     delete(void* p) 
    132     {   throw new Exception("Nodes cannot be deleted.  Use remove()."); 
    133     } 
    134129 
    135130    /** 
  • trunk/src/yage/node/visible.d

    r71 r72  
    3939    protected LightNode[] lights;       // Lights that affect this VisibleNode 
    4040 
     41     
    4142    /// Construct as a child of parent. 
    4243    this(Node parent) 
    43     {   visible = false; 
    44         size = Vec3f(1); 
     44    {   size = Vec3f(1); 
    4545        color = Color("white"); 
    4646        super(parent);