clang-tidy (amb el fuck de que no feien bona parella el clang de macos i el tidy de llvm)
This commit is contained in:
@@ -8,18 +8,18 @@
|
||||
// Constructor
|
||||
Sprite::Sprite(std::shared_ptr<Texture> texture, float pos_x, float pos_y, float width, float height)
|
||||
: textures_{std::move(texture)},
|
||||
pos_((SDL_FRect){pos_x, pos_y, width, height}),
|
||||
sprite_clip_((SDL_FRect){0, 0, pos_.w, pos_.h}) {}
|
||||
pos_((SDL_FRect){.x = pos_x, .y = pos_y, .w = width, .h = height}),
|
||||
sprite_clip_((SDL_FRect){.x = 0, .y = 0, .w = pos_.w, .h = pos_.h}) {}
|
||||
|
||||
Sprite::Sprite(std::shared_ptr<Texture> texture, SDL_FRect rect)
|
||||
: textures_{std::move(texture)},
|
||||
pos_(rect),
|
||||
sprite_clip_((SDL_FRect){0, 0, pos_.w, pos_.h}) {}
|
||||
sprite_clip_((SDL_FRect){.x = 0, .y = 0, .w = pos_.w, .h = pos_.h}) {}
|
||||
|
||||
Sprite::Sprite(std::shared_ptr<Texture> 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())}),
|
||||
pos_(SDL_FRect{.x = 0, .y = 0, .w = static_cast<float>(textures_.at(texture_index_)->getWidth()), .h = static_cast<float>(textures_.at(texture_index_)->getHeight())}),
|
||||
sprite_clip_(pos_) {}
|
||||
|
||||
// Muestra el sprite por pantalla
|
||||
@@ -49,7 +49,6 @@ void Sprite::clear() {
|
||||
auto Sprite::setActiveTexture(size_t index) -> bool {
|
||||
if (index < textures_.size()) {
|
||||
texture_index_ = index;
|
||||
return true;
|
||||
}
|
||||
return false; // Índice fuera de rango
|
||||
return index < textures_.size();
|
||||
}
|
||||
Reference in New Issue
Block a user