SDLImageLoader.h 1013 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * SDLImageLoader.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/GameConstants.h"
  12. #ifdef IN
  13. #undef IN
  14. #endif
  15. #ifdef OUT
  16. #undef OUT
  17. #endif
  18. VCMI_LIB_NAMESPACE_BEGIN
  19. class JsonNode;
  20. class Rect;
  21. class Point;
  22. VCMI_LIB_NAMESPACE_END
  23. struct SDL_Surface;
  24. struct SDL_Color;
  25. class CDefFile;
  26. class ColorFilter;
  27. class SDLImageLoader
  28. {
  29. SDLImage * image;
  30. ui8 * lineStart;
  31. ui8 * position;
  32. public:
  33. //load size raw pixels from data
  34. inline void Load(size_t size, const ui8 * data);
  35. //set size pixels to color
  36. inline void Load(size_t size, ui8 color=0);
  37. inline void EndLine();
  38. //init image with these sizes and palette
  39. inline void init(Point SpriteSize, Point Margins, Point FullSize, SDL_Color *pal);
  40. SDLImageLoader(SDLImage * Img);
  41. ~SDLImageLoader();
  42. };