migrant a SDL3

This commit is contained in:
2025-03-27 08:14:37 +01:00
parent a9c869baf6
commit d2286905dc
83 changed files with 570 additions and 541 deletions

View File

@@ -96,7 +96,7 @@ Text::Text(std::shared_ptr<Texture> texture, const std::string &text_file)
}
// Crea los objetos
sprite_ = std::make_unique<Sprite>(texture, (SDL_FRect){0, 0, box_width_, box_height_});
sprite_ = std::make_unique<Sprite>(texture, (SDL_FRect){0, 0, static_cast<float>(box_width_), static_cast<float>(box_height_)});
// Inicializa variables
fixed_width_ = false;
@@ -116,7 +116,7 @@ Text::Text(std::shared_ptr<Texture> texture, std::shared_ptr<TextFile> text_file
}
// Crea los objetos
sprite_ = std::make_unique<Sprite>(texture, (SDL_FRect){0, 0, box_width_, box_height_});
sprite_ = std::make_unique<Sprite>(texture, (SDL_FRect){0, 0, static_cast<float>(box_width_), static_cast<float>(box_height_)});
// Inicializa variables
fixed_width_ = false;
@@ -148,7 +148,7 @@ void Text::write2X(int x, int y, const std::string &text, int kerning)
for (size_t i = 0; i < text.length(); ++i)
{
auto index = static_cast<size_t>(text[i]);
SDL_FRect rect = {offset_[index].x, offset_[index].y, box_width_, box_height_};
SDL_FRect rect = {static_cast<float>(offset_[index].x), static_cast<float>(offset_[index].y), static_cast<float>(box_width_), static_cast<float>(box_height_)};
sprite_->getTexture()->render(x + shift, y, &rect, 2.0f, 2.0f);
shift += (offset_[index].w + kerning) * 2;
}