Team Fortress 2 Source Code as on 22/4/2020
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.

49 lines
889 B

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #ifndef _GAMEPALETTE_H
  9. #define _GAMEPALETTE_H
  10. #include <d3drmdef.h>
  11. class CGamePalette
  12. {
  13. public:
  14. CGamePalette();
  15. ~CGamePalette();
  16. BOOL Create(LPCTSTR pszFile);
  17. void SetBrightness(float fValue);
  18. float GetBrightness();
  19. operator LOGPALETTE*()
  20. { return pPalette; }
  21. operator D3DRMPALETTEENTRY*()
  22. { return (D3DRMPALETTEENTRY*) pPalette->palPalEntry; }
  23. operator CPalette*()
  24. { return &GDIPalette; }
  25. private:
  26. float fBrightness;
  27. // CPalette:
  28. CPalette GDIPalette;
  29. // palette working with:
  30. LOGPALETTE *pPalette;
  31. // to convert & store in pPalette:
  32. LOGPALETTE *pOriginalPalette;
  33. // file stored in:
  34. CString strFile;
  35. // sizeof each palette:
  36. size_t uPaletteBytes;
  37. };
  38. #endif