netejant capçaleres

This commit is contained in:
2025-11-12 13:47:19 +01:00
parent e626ec9763
commit 9cf45062a3
21 changed files with 198 additions and 1224 deletions

View File

@@ -125,7 +125,7 @@ auto Cache::getPalette(const std::string& name) -> Palette {
}
// Obtiene el fichero de texto a partir de un nombre
auto Cache::getTextFile(const std::string& name) -> std::shared_ptr<TextFile> {
auto Cache::getTextFile(const std::string& name) -> std::shared_ptr<Text::File> {
auto it = std::ranges::find_if(text_files_, [&name](const auto& t) { return t.name == name; });
if (it != text_files_.end()) {
@@ -287,7 +287,7 @@ void Cache::loadTextFiles() {
for (const auto& l : list) {
auto name = getFileName(l);
text_files_.emplace_back(name, loadTextFile(l));
text_files_.emplace_back(name, Text::loadTextFile(l));
updateLoadingProgress();
}
}
@@ -426,7 +426,7 @@ void Cache::renderProgress() {
// Draw APP_NAME centered above center
const std::string APP_NAME = spaceBetweenLetters(Version::APP_NAME);
loading_text_->writeColored(
CENTER_X - (loading_text_->lenght(APP_NAME) / 2),
CENTER_X - (loading_text_->length(APP_NAME) / 2),
CENTER_Y - TEXT_HEIGHT,
APP_NAME,
LOADING_TEXT_COLOR);
@@ -434,7 +434,7 @@ void Cache::renderProgress() {
// Draw VERSION centered below center
const std::string VERSION_TEXT = "(" + std::string(Version::GIT_HASH) + ")";
loading_text_->writeColored(
CENTER_X - (loading_text_->lenght(VERSION_TEXT) / 2),
CENTER_X - (loading_text_->length(VERSION_TEXT) / 2),
CENTER_Y + TEXT_HEIGHT,
VERSION_TEXT,
LOADING_TEXT_COLOR);

View File

@@ -58,11 +58,11 @@ struct ResourcePalette {
// Estructura para almacenar ficheros TextFile y su nombre
struct ResourceTextFile {
std::string name; // Nombre del fichero
std::shared_ptr<TextFile> text_file; // Objeto con los descriptores de la fuente de texto
std::string name; // Nombre del fichero
std::shared_ptr<Text::File> text_file; // Objeto con los descriptores de la fuente de texto
// Constructor
ResourceTextFile(std::string name, std::shared_ptr<TextFile> text_file)
ResourceTextFile(std::string name, std::shared_ptr<Text::File> text_file)
: name(std::move(name)),
text_file(std::move(std::move(text_file))) {}
};
@@ -80,7 +80,7 @@ struct ResourceText {
// Estructura para almacenar ficheros animaciones y su nombre
struct ResourceAnimation {
std::string name; // Nombre del fichero
std::string name; // Nombre del fichero
SurfaceAnimatedSprite::Animations animation; // Objeto con las animaciones
// Constructor
@@ -239,7 +239,7 @@ class Cache {
auto getPalette(const std::string& name) -> Palette;
// Obtiene el fichero de texto a partir de un nombre
auto getTextFile(const std::string& name) -> std::shared_ptr<TextFile>;
auto getTextFile(const std::string& name) -> std::shared_ptr<Text::File>;
// Obtiene el objeto de texto a partir de un nombre
auto getText(const std::string& name) -> std::shared_ptr<Text>;