2
0

dib.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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/Library/dib.h $*
  25. * *
  26. * $Author:: Greg_h $*
  27. * *
  28. * $Modtime:: 7/26/97 11:33a $*
  29. * *
  30. * $Revision:: 2 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #ifndef DIB_H
  36. #define DIB_H
  37. #include "always.h"
  38. #include "bsurface.h"
  39. #include "palette.h"
  40. #include "win.h"
  41. class DIB8Class
  42. {
  43. public:
  44. DIB8Class(HWND hwnd,int width, int height, PaletteClass & pal);
  45. ~DIB8Class(void);
  46. HBITMAP Get_Handle() { return Handle; }
  47. int Get_Width(void) { return Width; }
  48. int Get_Height(void) { return Height; }
  49. Surface & Get_Surface(void) { return *Surface; }
  50. void Clear(unsigned char color);
  51. private:
  52. bool IsZombie; // object constructor failed, its a living-dead object!
  53. BITMAPINFO * Info; // info used in creating the dib + the palette.
  54. HBITMAP Handle; // handle to the actual dib
  55. unsigned char * Pixels; // address of memory containing the pixel data
  56. int Width; // width of the dib
  57. int Height; // height of the dib
  58. unsigned char * PixelBase; // address of upper left pixel (this and DIBPitch abstract up/down DIBS)
  59. int Pitch; // offset from DIBPixelBase to next row (can be negative for bottom-up DIBS)
  60. BSurface * Surface; // Bsurface wrapped around the pixel buffer.
  61. };
  62. #endif /*DIB_H*/