edit.h 783 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Jovian Hersemeule
  2. #include <iostream>
  3. #include <fstream>
  4. #include <vector>
  5. #include <SDL/SDL.h>
  6. #include <SDL/SDL_gfxPrimitives.h>
  7. #include "SnapFile.h"
  8. #define MULTI_DEFAULT 50
  9. #define NAME_DEFAULT "Sans Nom"
  10. #define FOLDER "Niveaux/"
  11. #define EXT ".lvl"
  12. class Editor
  13. {
  14. public:
  15. Editor();
  16. ~Editor();
  17. bool init(); // Recquire SDL initiated
  18. void addPlot( int ex, int ey );
  19. void removePlot();
  20. void zoomIn();
  21. void zoomOut();
  22. void draw( int ix, int iy );
  23. void save();
  24. void load();
  25. void toggleHelp();
  26. protected:
  27. int m_multi; // Zoom
  28. Uint32 m_last_save;
  29. bool m_help;
  30. unsigned int m_leftPoint; // Optimise drawing
  31. const std::string m_index;
  32. std::string m_name;
  33. SDL_Surface* m_screen;
  34. std::vector<float> m_vx;
  35. std::vector<float> m_vy;
  36. };