renombrades extensions .h a .hpp

This commit is contained in:
2025-10-17 21:45:19 +02:00
parent 50ccb2ccc2
commit 46974ef2eb
144 changed files with 1758 additions and 1783 deletions

View File

@@ -1,4 +1,4 @@
#include "scoreboard.h"
#include "scoreboard.hpp"
#include <SDL3/SDL.h> // Para SDL_DestroyTexture, SDL_SetRenderDrawColor, SDL_SetRenderTarget, SDL_CreateTexture, SDL_GetRenderTarget, SDL_GetTicks, SDL_RenderClear, SDL_RenderLine, SDL_RenderTexture, SDL_SetTextureBlendMode, SDL_FRect, SDL_BLENDMODE_BLEND, SDL_PixelFormat, SDL_Texture, SDL_TextureAccess
@@ -7,16 +7,16 @@
#include <iomanip> // Para operator<<, setfill, setw
#include <sstream> // Para basic_ostream, basic_ostringstream, basic_ostream::operator<<, ostringstream
#include "color.h"
#include "enter_name.h" // Para NAME_SIZE
#include "lang.h" // Para getText
#include "param.h" // Para Param, ParamScoreboard, param
#include "resource.h" // Para Resource
#include "screen.h" // Para Screen
#include "sprite.h" // Para Sprite
#include "text.h" // Para Text, Text::CENTER, Text::COLOR
#include "texture.h" // Para Texture
#include "utils.h" // Para easeOutCubic
#include "color.hpp"
#include "enter_name.hpp" // Para NAME_SIZE
#include "lang.hpp" // Para getText
#include "param.hpp" // Para Param, ParamScoreboard, param
#include "resource.hpp" // Para Resource
#include "screen.hpp" // Para Screen
#include "sprite.hpp" // Para Sprite
#include "text.hpp" // Para Text, Text::CENTER, Text::COLOR
#include "texture.hpp" // Para Texture
#include "utils.hpp" // Para easeOutCubic
// .at(SINGLETON) Hay que definir las variables estáticas, desde el .h sólo la hemos declarado
Scoreboard* Scoreboard::instance = nullptr;
@@ -125,7 +125,7 @@ void Scoreboard::setCarouselAnimation(Id id, int selected_index, EnterName* ente
if (direction > LIST_SIZE / 2) {
direction = -(LIST_SIZE - direction); // Wrap backward (ej: Z → A)
} else if (direction < -LIST_SIZE / 2) {
direction = LIST_SIZE + direction; // Wrap forward (ej: A → Z)
direction = LIST_SIZE + direction; // Wrap forward (ej: A → Z)
}
// Normalizar a -1 o +1
@@ -447,21 +447,17 @@ void Scoreboard::renderScoreToEnterNameMode(size_t panel_index) {
// ========== Texto que SALE hacia arriba ==========
// name_ (sale desde ROW1 hacia arriba)
text_->writeDX(Text::CENTER | Text::COLOR, slot4_1_.x, slot4_1_.y - t * delta_1_to_2,
name_.at(panel_index), 1, text_color1_);
text_->writeDX(Text::CENTER | Text::COLOR, slot4_1_.x, slot4_1_.y - t * delta_1_to_2, name_.at(panel_index), 1, text_color1_);
// ========== Textos que SE MUEVEN hacia arriba ==========
// score_ (se mueve de ROW2 a ROW1)
text_->writeDX(Text::CENTER | Text::COLOR, slot4_2_.x, slot4_2_.y - t * delta_1_to_2,
updateScoreText(score_.at(panel_index)), 1, text_color2_);
text_->writeDX(Text::CENTER | Text::COLOR, slot4_2_.x, slot4_2_.y - t * delta_1_to_2, updateScoreText(score_.at(panel_index)), 1, text_color2_);
// "ENTER NAME" (se mueve de ROW3 a ROW2)
text_->writeDX(Text::CENTER | Text::COLOR, slot4_3_.x, slot4_3_.y - t * delta_2_to_3,
Lang::getText("[SCOREBOARD] 11"), 1, text_color1_);
text_->writeDX(Text::CENTER | Text::COLOR, slot4_3_.x, slot4_3_.y - t * delta_2_to_3, Lang::getText("[SCOREBOARD] 11"), 1, text_color1_);
// enter_name_ (se mueve de ROW4 a ROW3)
text_->writeDX(Text::CENTER | Text::COLOR, slot4_4_.x, slot4_4_.y - t * delta_3_to_4,
enter_name_.at(panel_index), 1, text_color2_);
text_->writeDX(Text::CENTER | Text::COLOR, slot4_4_.x, slot4_4_.y - t * delta_3_to_4, enter_name_.at(panel_index), 1, text_color2_);
// ========== Elemento que ENTRA desde abajo ==========
// CARRUSEL (entra desde debajo de ROW4 hacia ROW4)
@@ -505,21 +501,17 @@ void Scoreboard::renderEnterToShowNameMode(size_t panel_index) {
// ========== Texto que ENTRA desde arriba ==========
// name_ (entra desde arriba hacia ROW1)
// Debe venir desde donde estaría ROW0, que está a delta_1_to_2 píxeles arriba de ROW1
text_->writeDX(Text::CENTER | Text::COLOR, slot4_1_.x, slot4_1_.y + t * delta_1_to_2 - delta_1_to_2,
name_.at(panel_index), 1, text_color1_);
text_->writeDX(Text::CENTER | Text::COLOR, slot4_1_.x, slot4_1_.y + t * delta_1_to_2 - delta_1_to_2, name_.at(panel_index), 1, text_color1_);
// ========== Textos que SE MUEVEN (renderizar UNA sola vez) ==========
// SCORE (se mueve de ROW1 a ROW2)
text_->writeDX(Text::CENTER | Text::COLOR, slot4_1_.x, slot4_1_.y + t * delta_1_to_2,
updateScoreText(score_.at(panel_index)), 1, text_color2_);
text_->writeDX(Text::CENTER | Text::COLOR, slot4_1_.x, slot4_1_.y + t * delta_1_to_2, updateScoreText(score_.at(panel_index)), 1, text_color2_);
// "ENTER NAME" (se mueve de ROW2 a ROW3)
text_->writeDX(Text::CENTER | Text::COLOR, slot4_2_.x, slot4_2_.y + t * delta_2_to_3,
Lang::getText("[SCOREBOARD] 11"), 1, text_color1_);
text_->writeDX(Text::CENTER | Text::COLOR, slot4_2_.x, slot4_2_.y + t * delta_2_to_3, Lang::getText("[SCOREBOARD] 11"), 1, text_color1_);
// enter_name_ (se mueve de ROW3 a ROW4)
text_->writeDX(Text::CENTER | Text::COLOR, slot4_3_.x, slot4_3_.y + t * delta_3_to_4,
enter_name_.at(panel_index), 1, text_color2_);
text_->writeDX(Text::CENTER | Text::COLOR, slot4_3_.x, slot4_3_.y + t * delta_3_to_4, enter_name_.at(panel_index), 1, text_color2_);
// ========== Elemento que SALE hacia abajo ==========
// CARRUSEL (sale desde ROW4 hacia abajo, fuera de pantalla)