- Timestamp:
- May 20, 2004, 2:33:29 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/core/shoot_laser.cc
r1896 r1898 41 41 /* now draw all the shoots (many) */ 42 42 shoot* tmpShoot = lastShoot; 43 shoot* lastRef = null; 43 44 while( tmpShoot != null ) 44 45 { … … 49 50 glutWireCube(1.0); 50 51 glPopMatrix(); 51 tmpShoot = tmpShoot->next; 52 53 /* garbage collection: look if shoot is outside world */ 54 /* fix1: weak boundaries check all four sides */ 55 /* fix2: conditions, that a struct tree can be cut off */ 56 if (tmpShoot->yCor > 50) 57 { 58 if (lastRef != null) 59 { 60 cout << "garbage collection" << endl; 61 lastRef->next = tmpShoot->next; 62 delete tmpShoot; 63 tmpShoot = lastRef; 64 lastRef = tmpShoot; 65 tmpShoot = tmpShoot->next; 66 cout << "garbage collection left" << endl; 67 } 68 else 69 { 70 cout << "garbage collecton on last el" << endl; 71 lastRef = tmpShoot->next; 72 delete tmpShoot; 73 tmpShoot = lastRef; 74 if (tmpShoot != null) { 75 lastRef = tmpShoot; 76 tmpShoot = tmpShoot->next; 77 cout << "noch nich null" << endl; 78 } 79 else { 80 lastRef = null; 81 tmpShoot = null; 82 lastShoot = null; 83 cout << "endl null" << endl; 84 } 85 cout << "garbage collection on last el left" << endl; 86 } 87 } 88 else 89 { 90 lastRef = tmpShoot; 91 tmpShoot = tmpShoot->next; 92 } 52 93 } 53 94 //cout << "ShootLaser::drawShoot - finished" << endl; … … 61 102 } 62 103 63 void ShootLaser::addShoot(float x, float y, float z) 104 void ShootLaser::addShoot(float x, float y, float z) 64 105 { 65 106 //cout << "ShootLaser::addShoot" << endl;
Note: See TracChangeset
for help on using the changeset viewer.