linter: varios
This commit is contained in:
@@ -130,12 +130,7 @@ void Fade::updatePostState() {
|
||||
}
|
||||
|
||||
// Mantener el estado final del fade
|
||||
Uint8 post_alpha = a_;
|
||||
if (type_ == Type::RANDOM_SQUARE2 || type_ == Type::DIAGONAL) {
|
||||
post_alpha = (mode_ == Mode::OUT) ? 255 : 0;
|
||||
} else {
|
||||
post_alpha = (mode_ == Mode::OUT) ? 255 : 0;
|
||||
}
|
||||
Uint8 post_alpha = (mode_ == Mode::OUT) ? 255 : 0;
|
||||
|
||||
cleanBackbuffer(r_, g_, b_, post_alpha);
|
||||
}
|
||||
@@ -145,7 +140,7 @@ void Fade::updateFullscreenFade() {
|
||||
float progress = std::min(static_cast<float>(elapsed_time) / fading_duration_, 1.0F);
|
||||
|
||||
// Modifica la transparencia basada en el progreso
|
||||
Uint8 current_alpha = static_cast<Uint8>(progress * 255.0f);
|
||||
auto current_alpha = static_cast<Uint8>(progress * 255.0F);
|
||||
a_ = (mode_ == Mode::OUT) ? current_alpha : 255 - current_alpha;
|
||||
SDL_SetTextureAlphaMod(backbuffer_, a_);
|
||||
|
||||
@@ -162,10 +157,10 @@ void Fade::updateCenterFade() {
|
||||
float progress = std::min(static_cast<float>(elapsed_time) / fading_duration_, 1.0F);
|
||||
|
||||
// Calcula la altura de las barras
|
||||
float rect_height = progress * (param.game.height / 2.0f);
|
||||
|
||||
float rect_height = progress * (param.game.height / 2.0F);
|
||||
|
||||
if (mode_ == Mode::IN) {
|
||||
rect_height = (param.game.height / 2.0f) - rect_height;
|
||||
rect_height = (param.game.height / 2.0F) - rect_height;
|
||||
}
|
||||
|
||||
rect1_.h = rect_height;
|
||||
@@ -509,7 +504,7 @@ void Fade::activate() {
|
||||
|
||||
case Type::VENETIAN: {
|
||||
square_.clear();
|
||||
rect1_ = {.x = 0, .y = 0, .w = param.game.width, .h = (mode_ == Mode::OUT) ? 0.0f : static_cast<float>(param.fade.venetian_size)};
|
||||
rect1_ = {.x = 0, .y = 0, .w = param.game.width, .h = (mode_ == Mode::OUT) ? 0.0F : param.fade.venetian_size};
|
||||
const int MAX = param.game.height / param.fade.venetian_size;
|
||||
for (int i = 0; i < MAX; ++i) {
|
||||
rect1_.y = i * param.fade.venetian_size;
|
||||
@@ -546,7 +541,11 @@ void Fade::cleanBackbuffer(Uint8 r, Uint8 g, Uint8 b, Uint8 a) {
|
||||
|
||||
// Calcula el valor del estado del fade
|
||||
auto Fade::calculateValue(int min, int max, int current) -> int {
|
||||
if (current <= min) return 0;
|
||||
if (current >= max) return 100;
|
||||
if (current <= min) {
|
||||
return 0;
|
||||
}
|
||||
if (current >= max) {
|
||||
return 100;
|
||||
}
|
||||
return static_cast<int>(100.0 * (current - min) / (max - min));
|
||||
}
|
||||
Reference in New Issue
Block a user