MapPreview.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. ** Command & Conquer Generals Zero Hour(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. // FILE: MapPreview.h /////////////////////////////////////////////////
  19. //-----------------------------------------------------------------------------
  20. //
  21. // Electronic Arts Pacific.
  22. //
  23. // Confidential Information
  24. // Copyright (C) 2002 - All Rights Reserved
  25. //
  26. //-----------------------------------------------------------------------------
  27. //
  28. // created: Oct 2002
  29. //
  30. // Filename: MapPreview.h
  31. //
  32. // author: Chris Huybregts
  33. //
  34. // purpose:
  35. //
  36. //-----------------------------------------------------------------------------
  37. ///////////////////////////////////////////////////////////////////////////////
  38. #pragma once
  39. #ifndef __MAP_PREVIEW_H_
  40. #define __MAP_PREVIEW_H_
  41. //-----------------------------------------------------------------------------
  42. // SYSTEM INCLUDES ////////////////////////////////////////////////////////////
  43. //-----------------------------------------------------------------------------
  44. //-----------------------------------------------------------------------------
  45. // USER INCLUDES //////////////////////////////////////////////////////////////
  46. //-----------------------------------------------------------------------------
  47. //-----------------------------------------------------------------------------
  48. // FORWARD REFERENCES /////////////////////////////////////////////////////////
  49. //-----------------------------------------------------------------------------
  50. //-----------------------------------------------------------------------------
  51. // TYPE DEFINES ///////////////////////////////////////////////////////////////
  52. //-----------------------------------------------------------------------------
  53. enum
  54. {
  55. MAP_PREVIEW_HEIGHT = 128,//256,
  56. MAP_PREVIEW_WIDTH = 128,//256,
  57. };
  58. class MapPreview
  59. {
  60. public:
  61. MapPreview(void );
  62. void save( CString mapName );
  63. private:
  64. void interpolateColorForHeight( RGBColor *color, Real height, Real hiZ, Real midZ, Real loZ );
  65. Bool mapPreviewToWorld(const ICoord2D *radar, Coord3D *world);
  66. void buildMapPreviewTexture( CString tgaName );
  67. UnsignedInt m_pixelBuffer[MAP_PREVIEW_HEIGHT][MAP_PREVIEW_WIDTH];
  68. };
  69. //-----------------------------------------------------------------------------
  70. // INLINING ///////////////////////////////////////////////////////////////////
  71. //-----------------------------------------------------------------------------
  72. //-----------------------------------------------------------------------------
  73. // EXTERNALS //////////////////////////////////////////////////////////////////
  74. //-----------------------------------------------------------------------------
  75. #endif // __MAP_PREVIEW_H_