Advertisement
Guest User

Untitled

a guest
Jul 5th, 2017
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
IDL 1.25 KB | None | 0 0
  1.         //  the tile selection
  2.         Info("Tiles selected from " << startTile << " to " << endTile);
  3.  
  4.         // Disable auto-updates until we're done making all our changes
  5.         _terrain->setAutoUpdate(false);
  6.  
  7.         // Now, set tiles selected - only on the starting z-level for now.
  8.         for(Real x = Math::Min(startTile[0], endTile[0]); x <= Math::Max(startTile[0], endTile[0]); x++) {
  9.  
  10.             for(Real y = Math::Min(startTile[1], endTile[1]); y <= Math::Max(startTile[1], endTile[1]); y++) {
  11.                 Info("Marking " << x << " " << y << " " << startTile[2] << " as selected");
  12.  
  13.                 // FIXME: to-implement pseudo-code
  14.                 // if(!Tile.empty? and Tile.is_visible?) {
  15.                 // Add tile to selection
  16.                 Vector3 toAdd(x, y, startTile[2]);
  17.                 _selection->append(toAdd);
  18.                 // Mark tile to display as selected
  19.                 // FIXME: this currently isn't being removed anywhere
  20.                 if(!_terrain->isTileEmpty(x, y, startTile[2])) {
  21.                     _terrain->setTileProperty(x, y, startTile[2], SELECTED, PropertyType(true));
  22.                 }  
  23.             }  
  24.         }  
  25.  
  26.         // Re-enable auto-updates
  27.         _terrain->setAutoUpdate(true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement