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

@@ -439,7 +439,7 @@ void Surface::copyToTexture(SDL_Renderer* renderer, SDL_Texture* texture) {
int pitch = 0;
// Bloquea la textura para modificar los píxeles directamente
if (SDL_LockTexture(texture, nullptr, reinterpret_cast<void**>(&pixels), &pitch) != 0) {
if (!SDL_LockTexture(texture, nullptr, reinterpret_cast<void**>(&pixels), &pitch)) {
throw std::runtime_error("Failed to lock texture: " + std::string(SDL_GetError()));
}
@@ -459,7 +459,7 @@ void Surface::copyToTexture(SDL_Renderer* renderer, SDL_Texture* texture) {
SDL_UnlockTexture(texture); // Desbloquea la textura
// Renderiza la textura en la pantalla completa
if (SDL_RenderTexture(renderer, texture, nullptr, nullptr) != 0) {
if (!SDL_RenderTexture(renderer, texture, nullptr, nullptr)) {
throw std::runtime_error("Failed to copy texture to renderer: " + std::string(SDL_GetError()));
}
}
@@ -486,7 +486,7 @@ void Surface::copyToTexture(SDL_Renderer* renderer, SDL_Texture* texture, SDL_FR
}
// Usa lockRect solo si destRect no es nulo
if (SDL_LockTexture(texture, destRect ? &lockRect : nullptr, reinterpret_cast<void**>(&pixels), &pitch) != 0) {
if (!SDL_LockTexture(texture, destRect ? &lockRect : nullptr, reinterpret_cast<void**>(&pixels), &pitch)) {
throw std::runtime_error("Failed to lock texture: " + std::string(SDL_GetError()));
}
@@ -504,7 +504,7 @@ void Surface::copyToTexture(SDL_Renderer* renderer, SDL_Texture* texture, SDL_FR
SDL_UnlockTexture(texture);
// Renderiza la textura con los rectángulos especificados
if (SDL_RenderTexture(renderer, texture, srcRect, destRect) != 0) {
if (!SDL_RenderTexture(renderer, texture, srcRect, destRect)) {
throw std::runtime_error("Failed to copy texture to renderer: " + std::string(SDL_GetError()));
}
}