1234567891011121314151617181920 |
- #include "Affichable.h"
- Affichable::Affichable(SDL_Surface* img)
- :m_img(img), m_pos(0.0f, 0.0f)
- {
- //ctor
- }
- Affichable::~Affichable()
- {
- //dtor
- }
- void Affichable::afficher(const Vec &lookAt, SDL_Surface* screen)
- {
- m_rect.x = m_pos.getX() - lookAt.getX() + screen->w/2 - m_img->w/2;
- m_rect.y = lookAt.getY() - m_pos.getY() + screen->h/2 - m_img->h/2;
- SDL_BlitSurface(m_img, 0, screen, &m_rect);
- }
|