2
0

Graphics.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. void loadErmuToPicture();
  21. public:
  22. using PlayerPalette = std::array<ColorRGBA, 32>;
  23. //various graphics
  24. std::array<ColorRGBA, 8> playerColors;
  25. std::array<PlayerPalette, 8> playerColorPalette; //palette to make interface colors good - array of size [256]
  26. PlayerPalette neutralColorPalette;
  27. ColorRGBA neutralColor;
  28. //towns
  29. std::map<int, std::string> ERMUtoPicture[GameConstants::F_NUMBER]; //maps building ID to it's picture's name for each town type
  30. //for battles
  31. std::map< int, std::vector < std::string > > battleACToDef; //maps AC format to vector of appropriate def names
  32. //functions
  33. Graphics();
  34. void setPlayerPalette(SDL_Palette * sur, PlayerColor player);
  35. void setPlayerFlagColor(SDL_Palette * sur, PlayerColor player);
  36. };
  37. extern Graphics * graphics;