1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- # ifndef TERRAIN_HEADER_FILE
- # define TERRAIN_HEADER_FILE
- // Basiques
- # include <iostream>
- # include <fstream>
- # include <vector>
- # include <cmath>
- // Random
- # include <ctime>
- # include <cstdlib>
- // SDL
- # include <SDL/SDL.h>
- # undef main
- # include <SDL/SDL_gfxPrimitives.h>
- # include <SDL/SDL_image.h>
- // bBox2D
- # include <box2d/box2d.h>
- # define MULTI 100.0f
- class Terrain
- {
- public:
- Terrain();
- ~Terrain();
- void defaultPlot();
- void build( b2World &world );
- void textureLoad( SDL_Surface* screen );
- void accelerateTexture( SDL_Surface* & text );
- void draw( SDL_Surface* screen, b2Vec2 origin ); // Pas opti
- void drawUni( SDL_Surface* screen, b2Vec2 origin );
- void drawWithTexture( SDL_Surface* screen, b2Vec2 origin ); // Lent
- void drawArtist( SDL_Surface* screen, b2Vec2 origin ); // Wonderful landscape
- void load( std::string chemin );
- void setMaxRect();
- void setMulti( float newMulti );
- protected :
- unsigned int m_size ;
- float m_multi;
- b2Vec2* m_plot; // Static array
- b2Body* m_areaBody;
- float m_minX;
- float m_minY;
- float m_maxX;
- float m_maxY;
- SDL_Surface* m_backTexture;
- SDL_Surface* m_groundTexture;
- SDL_Surface* m_bricks;
- SDL_Surface* m_buff1;
- SDL_Surface* m_buff2;
- std::vector<Sint16> m_vx;
- std::vector<Sint16> m_vy;
- };
- # endif // TERRAIN_HEADER_FILE
|