SpriteLoader.h 714 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef SPRITELOADER_H_INCLUDED
  2. #define SPRITELOADER_H_INCLUDED
  3. #include <iostream>
  4. #include <string>
  5. #include <map>
  6. #include <SDL.h>
  7. class SpriteLoader
  8. {
  9. public:
  10. SpriteLoader();
  11. SpriteLoader(std::string folder);
  12. SpriteLoader(std::string folder, bool optiFormat);
  13. ~SpriteLoader();
  14. SDL_Surface* takeSprite(std::string nom);
  15. void destroySprite(std::string nom);
  16. void addSprite(std::string nom, SDL_Surface* sprite);
  17. void assignFolder(std::string folder);
  18. private:
  19. std::string m_folder;
  20. std::map<std::string, SDL_Surface*>::iterator m_it;
  21. std::map<std::string, SDL_Surface*> m_paquet;
  22. bool m_optiFormat; // True par défaut
  23. };
  24. #endif // SPRITELOADER_H_INCLUDED