neteja tidy a source/core i encamina Texture::loadFromFile pel ResourceHelper

This commit is contained in:
2026-05-14 20:22:54 +02:00
parent 88fa3f296f
commit 1912200b21
40 changed files with 699 additions and 578 deletions
+8 -6
View File
@@ -1,8 +1,8 @@
#include "core/rendering/fade.h"
#include <SDL3/SDL.h>
#include <stdlib.h> // for rand
#include <cstdlib> // for rand
#include <iostream> // for char_traits, basic_ostream, operator<<
#include "game/defaults.hpp" // for GAMECANVAS_HEIGHT, GAMECANVAS_WIDTH
@@ -15,7 +15,7 @@ Fade::Fade(SDL_Renderer *renderer)
SDL_SetTextureScaleMode(mBackbuffer, SDL_SCALEMODE_NEAREST);
}
if (mBackbuffer == nullptr) {
std::cout << "Error: textTexture could not be created!\nSDL Error: " << SDL_GetError() << std::endl;
std::cout << "Error: textTexture could not be created!\nSDL Error: " << SDL_GetError() << '\n';
}
}
@@ -92,8 +92,9 @@ void Fade::render() {
SDL_RenderFillRect(mRenderer, &fR2);
}
if ((mCounter * 4) > GAMECANVAS_HEIGHT)
if ((mCounter * 4) > GAMECANVAS_HEIGHT) {
mFinished = true;
}
break;
}
@@ -145,8 +146,9 @@ void Fade::render() {
// Actualiza las variables internas
void Fade::update() {
if (mEnabled)
if (mEnabled) {
mCounter++;
}
}
// Activa el fade
@@ -163,12 +165,12 @@ void Fade::activateFade() {
}
// Comprueba si está activo
bool Fade::isEnabled() {
auto Fade::isEnabled() const -> bool {
return mEnabled;
}
// Comprueba si ha terminado la transicion
bool Fade::hasEnded() {
auto Fade::hasEnded() const -> bool {
return mFinished;
}