GUIEditDisplay.cpp 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /*
  2. ** Command & Conquer Generals(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. ////////////////////////////////////////////////////////////////////////////////
  19. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: .cpp /////////////////////////////////////////////////////////////////
  24. //-----------------------------------------------------------------------------
  25. //
  26. // Westwood Studios Pacific.
  27. //
  28. // Confidential Information
  29. // Copyright (C) 2001 - All Rights Reserved
  30. //
  31. //-----------------------------------------------------------------------------
  32. //
  33. // Project: RTS3
  34. //
  35. // File name: .cpp
  36. //
  37. // Created:
  38. //
  39. // Desc:
  40. //
  41. //-----------------------------------------------------------------------------
  42. ///////////////////////////////////////////////////////////////////////////////
  43. // SYSTEM INCLUDES ////////////////////////////////////////////////////////////
  44. #include <stdlib.h>
  45. // USER INCLUDES //////////////////////////////////////////////////////////////
  46. #include "GUIEditDisplay.h"
  47. #include "EditWindow.h"
  48. // DEFINES ////////////////////////////////////////////////////////////////////
  49. // PRIVATE TYPES //////////////////////////////////////////////////////////////
  50. // PRIVATE DATA ///////////////////////////////////////////////////////////////
  51. // PUBLIC DATA ////////////////////////////////////////////////////////////////
  52. // PRIVATE PROTOTYPES /////////////////////////////////////////////////////////
  53. // PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
  54. ///////////////////////////////////////////////////////////////////////////////
  55. // PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
  56. ///////////////////////////////////////////////////////////////////////////////
  57. // GUIEditDisplay::GUIEditDisplay =============================================
  58. /** */
  59. //=============================================================================
  60. GUIEditDisplay::GUIEditDisplay( void )
  61. {
  62. } // end GUIEditDisplay
  63. // GUIEditDisplay::~GUIEditDisplay ============================================
  64. /** */
  65. //=============================================================================
  66. GUIEditDisplay::~GUIEditDisplay( void )
  67. {
  68. } // end ~GUIEditDisplay
  69. // GUIEditDisplay::drawLine ===================================================
  70. /** draw a line on the display in pixel coordinates with the specified color */
  71. //=============================================================================
  72. void GUIEditDisplay::drawLine( Int startX, Int startY,
  73. Int endX, Int endY,
  74. Real lineWidth, UnsignedInt lineColor )
  75. {
  76. TheEditWindow->drawLine( startX, startY, endX, endY, lineWidth, lineColor );
  77. } // end drawLIne
  78. // GUIEditDisplay::drawOpenRect ===============================================
  79. /** draw a rect border on the display in pixel coordinates with the
  80. * specified color */
  81. //=============================================================================
  82. void GUIEditDisplay::drawOpenRect( Int startX, Int startY,
  83. Int width, Int height,
  84. Real lineWidth, UnsignedInt lineColor )
  85. {
  86. TheEditWindow->drawOpenRect( startX, startY, width, height,
  87. lineWidth, lineColor );
  88. } // end drawOpenRect
  89. // GUIEditDisplay::drawFillRect ===============================================
  90. /** draw a filled rect on the display in pixel coords with the
  91. * specified color */
  92. //=============================================================================
  93. void GUIEditDisplay::drawFillRect( Int startX, Int startY,
  94. Int width, Int height,
  95. UnsignedInt color )
  96. {
  97. TheEditWindow->drawFillRect( startX, startY,
  98. width, height,
  99. color );
  100. } // end drawFillRect
  101. // GUIEditDisplay::drawImage ==================================================
  102. /** draw an image fit within the screen coordinates */
  103. //=============================================================================
  104. void GUIEditDisplay::drawImage( const Image *image,
  105. Int startX, Int startY,
  106. Int endX, Int endY,
  107. Color color, DrawImageMode mode )
  108. {
  109. TheEditWindow->drawImage( image,
  110. startX, startY,
  111. endX, endY,
  112. color );
  113. } // end drawImage
  114. // GUIEditDisplay::setClipRegion ==============================================
  115. /** sets clipping rectangle for 2D drawing operations */
  116. //=============================================================================
  117. void GUIEditDisplay::setClipRegion( IRegion2D *region )
  118. {
  119. TheEditWindow->setClipRegion(region);
  120. }
  121. // GUIEditDisplay::isClippingEnabled ==============================================
  122. /** returns current state of 2D image clipping */
  123. //=============================================================================
  124. Bool GUIEditDisplay::isClippingEnabled( void )
  125. {
  126. return TheEditWindow->isClippingEnabled();
  127. }
  128. // GUIEditDisplay::isClippingEnabled ==============================================
  129. /** returns current state of 2D image clipping */
  130. //=============================================================================
  131. void GUIEditDisplay::enableClipping( Bool onoff )
  132. {
  133. TheEditWindow->enableClipping(onoff);
  134. }