/src/TileSet.h

http://github.com/clintbellanger/flare · C Header · 55 lines · 23 code · 10 blank · 22 comment · 0 complexity · 147cc4d99743e61d40b76778bec43939 MD5 · raw file

  1. /*
  2. Copyright 2011 Clint Bellanger
  3. This file is part of FLARE.
  4. FLARE is free software: you can redistribute it and/or modify it under the terms
  5. of the GNU General Public License as published by the Free Software Foundation,
  6. either version 3 of the License, or (at your option) any later version.
  7. FLARE is distributed in the hope that it will be useful, but WITHOUT ANY
  8. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  9. PARTICULAR PURPOSE. See the GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License along with
  11. FLARE. If not, see http://www.gnu.org/licenses/
  12. */
  13. /**
  14. * class TileSet
  15. *
  16. * TileSet storage and file loading
  17. */
  18. #ifndef TILE_SET_H
  19. #define TILE_SET_H
  20. #include "Utils.h"
  21. #include <SDL.h>
  22. #include <SDL_image.h>
  23. #include <string>
  24. struct Tile_Def {
  25. SDL_Rect src;
  26. Point offset;
  27. };
  28. class TileSet {
  29. private:
  30. void loadGraphics(const std::string& filename);
  31. int alpha_background;
  32. std::string current_map;
  33. public:
  34. // functions
  35. TileSet();
  36. ~TileSet();
  37. void load(const std::string& filename);
  38. Tile_Def tiles[1024];
  39. SDL_Surface *sprites;
  40. };
  41. #endif