Commit de Boromir

This commit is contained in:
2024-10-14 22:33:45 +02:00
parent 39a8c992e1
commit 3b9885ab03
10 changed files with 48 additions and 66 deletions

View File

@@ -12,7 +12,9 @@ Sprite::Sprite(SDL_Rect rect, std::shared_ptr<Texture> texture)
sprite_clip_((SDL_Rect){0, 0, pos_.w, pos_.h}) {}
Sprite::Sprite(std::shared_ptr<Texture> texture)
: texture_(texture) {}
: texture_(texture),
pos_({0, 0, texture_->getWidth(), texture_->getHeight()}),
sprite_clip_(pos_) {}
// Muestra el sprite por pantalla
void Sprite::render()