terrainBrush.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. #define TERRAINBRUSH_CPP
  2. /*************************************************************************************************\
  3. terrainBrush.cpp : Implementation of the terrainBrush component.
  4. //---------------------------------------------------------------------------//
  5. // Copyright (C) Microsoft Corporation. All rights reserved. //
  6. //===========================================================================//
  7. \*************************************************************************************************/
  8. #include "terrainBrush.h"
  9. int TerrainBrush::s_lastType = 0;
  10. Action* TerrainBrush::applyToSelection()
  11. {
  12. ActionPaintTile* pRetAction = new ActionPaintTile();
  13. for ( int i = 0; i < land->realVerticesMapSide; ++i )
  14. {
  15. for ( int j = 0; j < land->realVerticesMapSide; ++j )
  16. {
  17. if ( land->isVertexSelected( j, i ) )
  18. {
  19. pRetAction->addChangedVertexInfo( j, i );
  20. land->setTerrain( j, i, terrainType );
  21. }
  22. }
  23. }
  24. return pRetAction;
  25. }
  26. //*************************************************************************************************
  27. // end of file ( terrainBrush.cpp )