passant linters a vore si trobe variables sense inicialitzar

This commit is contained in:
2025-08-17 00:23:59 +02:00
parent ada5025c65
commit 327987447d
55 changed files with 516 additions and 474 deletions

View File

@@ -1,22 +1,23 @@
#include "sprite.h"
#include <utility>
#include <vector> // Para vector
#include "texture.h" // Para Texture
// Constructor
Sprite::Sprite(std::shared_ptr<Texture> texture, float pos_x, float pos_y, float width, float height)
: textures_{texture},
: textures_{std::move(texture)},
pos_((SDL_FRect){pos_x, pos_y, width, height}),
sprite_clip_((SDL_FRect){0, 0, pos_.w, pos_.h}) {}
Sprite::Sprite(std::shared_ptr<Texture> texture, SDL_FRect rect)
: textures_{texture},
: textures_{std::move(texture)},
pos_(rect),
sprite_clip_((SDL_FRect){0, 0, pos_.w, pos_.h}) {}
Sprite::Sprite(std::shared_ptr<Texture> texture)
: textures_{texture},
: textures_{std::move(texture)},
pos_(SDL_FRect{0, 0, static_cast<float>(textures_.at(texture_index_)->getWidth()), static_cast<float>(textures_.at(texture_index_)->getHeight())}),
sprite_clip_(pos_) {}