migrant a SDL3
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user