clang-tidy readability
This commit is contained in:
@@ -42,7 +42,7 @@ Intro::Intro()
|
||||
initTexts();
|
||||
|
||||
// Configura el fondo
|
||||
tiled_bg_->setSpeed(0.3f);
|
||||
tiled_bg_->setSpeed(0.3F);
|
||||
tiled_bg_->setColor(bg_color_);
|
||||
}
|
||||
|
||||
@@ -51,55 +51,67 @@ void Intro::checkEvents() {
|
||||
SDL_Event event;
|
||||
while (SDL_PollEvent(&event)) {
|
||||
#ifdef DEBUG
|
||||
if (event.type == SDL_EVENT_KEY_DOWN && event.key.repeat == 1) {
|
||||
if (event.type == SDL_EVENT_KEY_DOWN && static_cast<int>(event.key.repeat) == 1) {
|
||||
static Color color_ = param.intro.bg_color;
|
||||
switch (event.key.key) {
|
||||
case SDLK_A:
|
||||
if (color_.r < 255)
|
||||
if (color_.r < 255) {
|
||||
++color_.r;
|
||||
}
|
||||
break;
|
||||
|
||||
case SDLK_Z:
|
||||
if (color_.r > 0)
|
||||
if (color_.r > 0) {
|
||||
--color_.r;
|
||||
}
|
||||
break;
|
||||
|
||||
case SDLK_S:
|
||||
if (color_.g < 255)
|
||||
if (color_.g < 255) {
|
||||
++color_.g;
|
||||
}
|
||||
break;
|
||||
|
||||
case SDLK_X:
|
||||
if (color_.g > 0)
|
||||
if (color_.g > 0) {
|
||||
--color_.g;
|
||||
}
|
||||
break;
|
||||
|
||||
case SDLK_D:
|
||||
if (color_.b < 255)
|
||||
if (color_.b < 255) {
|
||||
++color_.b;
|
||||
}
|
||||
break;
|
||||
|
||||
case SDLK_C:
|
||||
if (color_.b > 0)
|
||||
if (color_.b > 0) {
|
||||
--color_.b;
|
||||
}
|
||||
break;
|
||||
|
||||
case SDLK_F:
|
||||
if (color_.r < 255)
|
||||
if (color_.r < 255) {
|
||||
++color_.r;
|
||||
if (color_.g < 255)
|
||||
}
|
||||
if (color_.g < 255) {
|
||||
++color_.g;
|
||||
if (color_.b < 255)
|
||||
}
|
||||
if (color_.b < 255) {
|
||||
++color_.b;
|
||||
}
|
||||
break;
|
||||
|
||||
case SDLK_V:
|
||||
if (color_.r > 0)
|
||||
if (color_.r > 0) {
|
||||
--color_.r;
|
||||
if (color_.g > 0)
|
||||
}
|
||||
if (color_.g > 0) {
|
||||
--color_.g;
|
||||
if (color_.b > 0)
|
||||
}
|
||||
if (color_.b > 0) {
|
||||
--color_.b;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -335,7 +347,7 @@ void Intro::initSprites() {
|
||||
|
||||
// Constantes
|
||||
constexpr int TOTAL_SPRITES = TEXTURE_LIST.size();
|
||||
const float BORDER = 2.0f;
|
||||
const float BORDER = 2.0F;
|
||||
|
||||
auto texture = Resource::get()->getTexture(TEXTURE_LIST.front());
|
||||
const float CARD_WIDTH = texture->getWidth() + (BORDER * 2);
|
||||
@@ -351,7 +363,7 @@ void Intro::initSprites() {
|
||||
card_texture->setBlendMode(SDL_BLENDMODE_BLEND);
|
||||
|
||||
// Apuntamos el renderizador a la textura
|
||||
auto temp = SDL_GetRenderTarget(Screen::get()->getRenderer());
|
||||
auto *temp = SDL_GetRenderTarget(Screen::get()->getRenderer());
|
||||
card_texture->setAsRenderTarget(Screen::get()->getRenderer());
|
||||
|
||||
// Limpia la textura
|
||||
@@ -406,7 +418,7 @@ void Intro::initSprites() {
|
||||
shadow_texture->setBlendMode(SDL_BLENDMODE_BLEND);
|
||||
|
||||
// Apuntamos el renderizador a la textura
|
||||
auto temp = SDL_GetRenderTarget(Screen::get()->getRenderer());
|
||||
auto *temp = SDL_GetRenderTarget(Screen::get()->getRenderer());
|
||||
shadow_texture->setAsRenderTarget(Screen::get()->getRenderer());
|
||||
|
||||
// Limpia la textura
|
||||
@@ -572,7 +584,7 @@ void Intro::updatePostState() {
|
||||
|
||||
void Intro::renderTextRect() {
|
||||
static const float HEIGHT = Resource::get()->getText("04b_25_metal")->getCharacterSize();
|
||||
static SDL_FRect rect_ = {0.0f, param.game.height - param.intro.text_distance_from_bottom - HEIGHT, param.game.width, HEIGHT * 3};
|
||||
static SDL_FRect rect_ = {0.0F, param.game.height - param.intro.text_distance_from_bottom - HEIGHT, param.game.width, HEIGHT * 3};
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), param.intro.shadow_color.r, param.intro.shadow_color.g, param.intro.shadow_color.b, param.intro.shadow_color.a);
|
||||
SDL_RenderFillRect(Screen::get()->getRenderer(), &rect_);
|
||||
}
|
||||
Reference in New Issue
Block a user