dropZoneBrush.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #define DROPZONEBRUSH_CPP
  2. /*************************************************************************************************\
  3. dropZoneBrush.cpp : Implementation of the dropZoneBrush component.
  4. //---------------------------------------------------------------------------//
  5. // Copyright (C) Microsoft Corporation. All rights reserved. //
  6. //===========================================================================//
  7. \*************************************************************************************************/
  8. #include "dropZoneBrush.h"
  9. #include "EditorObjectMgr.h"
  10. DropZoneBrush::DropZoneBrush(int align, bool bVtol)
  11. {
  12. alignment = align;
  13. bVTol = bVtol;
  14. }
  15. bool DropZoneBrush::paint( Stuff::Vector3D& worldPos, int screenX, int screenY )
  16. {
  17. EditorObject* pInfo = EditorObjectMgr::instance()->addDropZone( worldPos, alignment, bVTol );
  18. if ( pInfo && pAction )
  19. {
  20. pAction->addBuildingInfo( *pInfo );
  21. return true;
  22. }
  23. return false;
  24. }
  25. bool DropZoneBrush::canPaint( Stuff::Vector3D& worldPos, int screenX, int screenY, int flags )
  26. {
  27. return EditorObjectMgr::instance()->canAddDropZone( worldPos, alignment, bVTol );
  28. }
  29. //*************************************************************************************************
  30. // end of file ( dropZoneBrush.cpp )