simpdib.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. ** Command & Conquer Renegade(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. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Command & Conquer *
  23. * *
  24. * $Archive:: /Commando/Code/Tools/max2w3d/simpdib.h $*
  25. * *
  26. * $Author:: Greg_h $*
  27. * *
  28. * $Modtime:: 10/14/97 3:07p $*
  29. * *
  30. * $Revision:: 3 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #ifndef SIMPDIB_H
  36. #define SIMPDIB_H
  37. #ifndef ALWAYS_H
  38. #include "always.h"
  39. #endif
  40. #include <Max.h>
  41. #ifndef WIN_H
  42. #include "win.h"
  43. #endif
  44. #ifndef PALETTE_H
  45. #include "palette.h"
  46. #endif
  47. class SimpleDIBClass
  48. {
  49. public:
  50. SimpleDIBClass(HWND hwnd,int width, int height,PaletteClass & pal);
  51. ~SimpleDIBClass(void);
  52. HBITMAP Get_Handle() { return Handle; }
  53. int Get_Width(void) { return Width; }
  54. int Get_Height(void) { return Height; }
  55. void Clear(unsigned char color);
  56. void Set_Pixel(int i,int j,unsigned char color);
  57. private:
  58. bool IsZombie; // object constructor failed, its a living-dead object!
  59. BITMAPINFO * Info; // info used in creating the dib + the palette.
  60. HBITMAP Handle; // handle to the actual dib
  61. unsigned char * Pixels; // address of memory containing the pixel data
  62. int Width; // width of the dib
  63. int Height; // height of the dib
  64. unsigned char * PixelBase; // address of upper left pixel (this and DIBPitch abstract up/down DIBS)
  65. int Pitch; // offset from DIBPixelBase to next row (can be negative for bottom-up DIBS)
  66. };
  67. #endif /*SIMPDIB_H*/