Corregits mil warnings de int a float

Corregit getDisplayInfo per al calcul del zoomMax
This commit is contained in:
2025-10-16 10:12:03 +02:00
parent e811cf0a1d
commit 9a4b3b04a5
13 changed files with 95 additions and 55 deletions

View File

@@ -152,8 +152,8 @@ void Ending::iniTexts() {
for (const auto& txt : texts) {
auto text = Resource::get()->getText("smb2");
const int WIDTH = text->lenght(txt.caption, 1) + 2 + 2;
const int HEIGHT = text->getCharacterSize() + 2 + 2;
const float WIDTH = text->lenght(txt.caption, 1) + 2 + 2;
const float HEIGHT = text->getCharacterSize() + 2 + 2;
auto text_color = static_cast<Uint8>(PaletteColor::WHITE);
auto shadow_color = static_cast<Uint8>(PaletteColor::BLACK);
@@ -227,8 +227,8 @@ void Ending::iniPics() {
// Crea la texture
sp.image_surface = Resource::get()->getSurface(pic.caption);
sp.image_surface->setTransparentColor();
const int WIDTH = sp.image_surface->getWidth();
const int HEIGHT = sp.image_surface->getHeight();
const float WIDTH = sp.image_surface->getWidth();
const float HEIGHT = sp.image_surface->getHeight();
// Crea el sprite
sp.image_sprite = std::make_shared<SSprite>(sp.image_surface, 0, 0, WIDTH, HEIGHT);
@@ -256,7 +256,7 @@ void Ending::iniPics() {
}
// El resto se rellena de color sólido
SDL_FRect rect = {0, 8, WIDTH, HEIGHT};
SDL_FRect rect = {0.0F, 8.0F, WIDTH, HEIGHT};
surface->fillRect(&rect, color);
// Crea el sprite
@@ -464,8 +464,8 @@ void Ending::renderCoverTexture() {
if (cover_counter_ > 0) {
// Dibuja la textura que cubre el texto
const int OFFSET = std::min(cover_counter_, 100);
SDL_FRect srcRect = {0, 200 - (cover_counter_ * 2), 256, OFFSET * 2};
SDL_FRect dstRect = {0, 0, 256, OFFSET * 2};
SDL_FRect srcRect = {0.0F, 200.0F - (cover_counter_ * 2.0F), 256.0F, OFFSET * 2.0F};
SDL_FRect dstRect = {0.0F, 0.0F, 256.0F, OFFSET * 2.0F};
cover_surface_->render(&srcRect, &dstRect);
}
}