Graphics.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Graphics.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "../lib/constants/NumericConstants.h"
  12. #include "../lib/constants/EntityIdentifiers.h"
  13. #include "../lib/Color.h"
  14. struct SDL_Palette;
  15. /// Handles fonts, hero images, town images, various graphics
  16. class Graphics
  17. {
  18. void initializeBattleGraphics();
  19. void loadPaletteAndColors();
  20. public:
  21. using PlayerPalette = std::array<ColorRGBA, 32>;
  22. //various graphics
  23. std::array<ColorRGBA, 8> playerColors;
  24. std::array<PlayerPalette, 8> playerColorPalette; //palette to make interface colors good - array of size [256]
  25. PlayerPalette neutralColorPalette;
  26. ColorRGBA neutralColor;
  27. //for battles
  28. std::map< int, std::vector < std::string > > battleACToDef; //maps AC format to vector of appropriate def names
  29. //functions
  30. Graphics();
  31. void setPlayerPalette(SDL_Palette * sur, PlayerColor player);
  32. void setPlayerFlagColor(SDL_Palette * sur, PlayerColor player);
  33. };
  34. extern Graphics * graphics;