Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.5 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #ifndef _GAMEPALETTE_H
  9. #define _GAMEPALETTE_H
  10. //
  11. // Snippet from the deprecated 'd3drmdef.h'
  12. //
  13. typedef enum _D3DRMPALETTEFLAGS
  14. { D3DRMPALETTE_FREE, /* renderer may use this entry freely */
  15. D3DRMPALETTE_READONLY, /* fixed but may be used by renderer */
  16. D3DRMPALETTE_RESERVED /* may not be used by renderer */
  17. } D3DRMPALETTEFLAGS, *LPD3DRMPALETTEFLAGS;
  18. typedef struct _D3DRMPALETTEENTRY
  19. { unsigned char red; /* 0 .. 255 */
  20. unsigned char green; /* 0 .. 255 */
  21. unsigned char blue; /* 0 .. 255 */
  22. unsigned char flags; /* one of D3DRMPALETTEFLAGS */
  23. } D3DRMPALETTEENTRY, *LPD3DRMPALETTEENTRY;
  24. class CGamePalette
  25. {
  26. public:
  27. CGamePalette();
  28. ~CGamePalette();
  29. BOOL Create(LPCTSTR pszFile);
  30. void SetBrightness(float fValue);
  31. float GetBrightness();
  32. operator LOGPALETTE*()
  33. { return pPalette; }
  34. operator D3DRMPALETTEENTRY*()
  35. { return (D3DRMPALETTEENTRY*) pPalette->palPalEntry; }
  36. operator CPalette*()
  37. { return &GDIPalette; }
  38. private:
  39. float fBrightness;
  40. // CPalette:
  41. CPalette GDIPalette;
  42. // palette working with:
  43. LOGPALETTE *pPalette;
  44. // to convert & store in pPalette:
  45. LOGPALETTE *pOriginalPalette;
  46. // file stored in:
  47. CString strFile;
  48. // sizeof each palette:
  49. size_t uPaletteBytes;
  50. };
  51. #endif