1
0

Terrain.h 627 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. # ifndef TERRAIN_HEADER_FILE
  2. # define TERRAIN_HEADER_FILE
  3. // Basiques
  4. # include <iostream>
  5. # include <vector>
  6. // Random
  7. # include <ctime>
  8. # include <cstdlib>
  9. // SDL
  10. # include <SDL/SDL.h>
  11. # undef main
  12. # include <SDL/SDL_gfxPrimitives.h>
  13. // bBox2D
  14. # include <box2d/box2d.h>
  15. # define MULTI 100.0f
  16. class Terrain
  17. {
  18. public:
  19. Terrain( const unsigned int size );
  20. ~Terrain();
  21. void addPlot( float x, float y );
  22. void build( b2World &world );
  23. void draw( SDL_Surface* screen, b2Vec2 origin );
  24. protected :
  25. const unsigned int m_size ;
  26. unsigned int m_nextAdd ;
  27. b2Vec2* m_plot; // Static array
  28. };
  29. # endif // TERRAIN_HEADER_FILE