forked from jaildesigner-jailgames/jaildoctors_dilemma
clang-format
clang-tidy (macos)
This commit is contained in:
@@ -18,6 +18,9 @@
|
||||
#include "utils/delta_timer.hpp" // Para DeltaTimer
|
||||
#include "utils/utils.hpp" // Para PaletteColor
|
||||
|
||||
// Destructor
|
||||
Ending::~Ending() = default;
|
||||
|
||||
// Constructor
|
||||
Ending::Ending()
|
||||
: delta_timer_(std::make_unique<DeltaTimer>()) {
|
||||
@@ -31,9 +34,6 @@ Ending::Ending()
|
||||
Screen::get()->setBorderColor(static_cast<Uint8>(PaletteColor::BLACK)); // Cambia el color del borde
|
||||
}
|
||||
|
||||
// Destructor
|
||||
Ending::~Ending() = default;
|
||||
|
||||
// Actualiza el objeto
|
||||
void Ending::update() {
|
||||
const float DELTA_TIME = delta_timer_->tick();
|
||||
@@ -170,39 +170,39 @@ void Ending::updateState(float delta_time) {
|
||||
}
|
||||
|
||||
// Inicializa los textos
|
||||
void Ending::iniTexts() {
|
||||
void Ending::iniTexts() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
// Vector con los textos (traducidos según el idioma activo)
|
||||
std::vector<TextAndPosition> texts;
|
||||
auto* loc = Locale::get();
|
||||
|
||||
// Escena #0
|
||||
texts.push_back({loc->get("ending.t0"), 32});
|
||||
texts.push_back({loc->get("ending.t1"), 42});
|
||||
texts.push_back({loc->get("ending.t2"), 142});
|
||||
texts.push_back({loc->get("ending.t3"), 152});
|
||||
texts.push_back({.caption = loc->get("ending.t0"), .pos = 32});
|
||||
texts.push_back({.caption = loc->get("ending.t1"), .pos = 42});
|
||||
texts.push_back({.caption = loc->get("ending.t2"), .pos = 142});
|
||||
texts.push_back({.caption = loc->get("ending.t3"), .pos = 152});
|
||||
|
||||
// Escena #1
|
||||
texts.push_back({loc->get("ending.t4"), 1});
|
||||
texts.push_back({loc->get("ending.t5"), 11});
|
||||
texts.push_back({loc->get("ending.t6"), 21});
|
||||
texts.push_back({.caption = loc->get("ending.t4"), .pos = 1});
|
||||
texts.push_back({.caption = loc->get("ending.t5"), .pos = 11});
|
||||
texts.push_back({.caption = loc->get("ending.t6"), .pos = 21});
|
||||
|
||||
texts.push_back({loc->get("ending.t7"), 161});
|
||||
texts.push_back({loc->get("ending.t8"), 171});
|
||||
texts.push_back({.caption = loc->get("ending.t7"), .pos = 161});
|
||||
texts.push_back({.caption = loc->get("ending.t8"), .pos = 171});
|
||||
|
||||
texts.push_back({loc->get("ending.t9"), 181});
|
||||
texts.push_back({.caption = loc->get("ending.t9"), .pos = 181});
|
||||
|
||||
// Escena #2
|
||||
texts.push_back({loc->get("ending.t10"), 19});
|
||||
texts.push_back({loc->get("ending.t11"), 29});
|
||||
texts.push_back({.caption = loc->get("ending.t10"), .pos = 19});
|
||||
texts.push_back({.caption = loc->get("ending.t11"), .pos = 29});
|
||||
|
||||
// Escena #3
|
||||
texts.push_back({loc->get("ending.t12"), 36});
|
||||
texts.push_back({loc->get("ending.t13"), 46});
|
||||
texts.push_back({.caption = loc->get("ending.t12"), .pos = 36});
|
||||
texts.push_back({.caption = loc->get("ending.t13"), .pos = 46});
|
||||
|
||||
// Escena #4
|
||||
texts.push_back({loc->get("ending.t14"), 36});
|
||||
texts.push_back({loc->get("ending.t15"), 46});
|
||||
texts.push_back({loc->get("ending.t16"), 158});
|
||||
texts.push_back({.caption = loc->get("ending.t14"), .pos = 36});
|
||||
texts.push_back({.caption = loc->get("ending.t15"), .pos = 46});
|
||||
texts.push_back({.caption = loc->get("ending.t16"), .pos = 158});
|
||||
|
||||
// Crea los sprites
|
||||
sprite_texts_.clear();
|
||||
@@ -242,11 +242,11 @@ void Ending::iniPics() {
|
||||
// Vector con las rutas y la posición
|
||||
std::vector<TextAndPosition> pics;
|
||||
|
||||
pics.push_back({"ending1.gif", 48});
|
||||
pics.push_back({"ending2.gif", 26});
|
||||
pics.push_back({"ending3.gif", 29});
|
||||
pics.push_back({"ending4.gif", 63});
|
||||
pics.push_back({"ending5.gif", 53});
|
||||
pics.push_back({.caption = "ending1.gif", .pos = 48});
|
||||
pics.push_back({.caption = "ending2.gif", .pos = 26});
|
||||
pics.push_back({.caption = "ending3.gif", .pos = 29});
|
||||
pics.push_back({.caption = "ending4.gif", .pos = 63});
|
||||
pics.push_back({.caption = "ending5.gif", .pos = 53});
|
||||
|
||||
// Crea los sprites
|
||||
sprite_pics_.clear();
|
||||
@@ -274,7 +274,7 @@ void Ending::iniPics() {
|
||||
}
|
||||
|
||||
// Inicializa las escenas
|
||||
void Ending::iniScenes() {
|
||||
void Ending::iniScenes() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
// Variable para los tiempos
|
||||
int trigger;
|
||||
constexpr int LAPSE = 80;
|
||||
@@ -291,13 +291,13 @@ void Ending::iniScenes() {
|
||||
sc.text_index.clear();
|
||||
trigger = 85 * 2;
|
||||
trigger += LAPSE;
|
||||
sc.text_index.push_back({0, trigger});
|
||||
sc.text_index.push_back({.index = 0, .trigger = trigger});
|
||||
trigger += LAPSE;
|
||||
sc.text_index.push_back({1, trigger});
|
||||
sc.text_index.push_back({.index = 1, .trigger = trigger});
|
||||
trigger += LAPSE * 3;
|
||||
sc.text_index.push_back({2, trigger});
|
||||
sc.text_index.push_back({.index = 2, .trigger = trigger});
|
||||
trigger += LAPSE;
|
||||
sc.text_index.push_back({3, trigger});
|
||||
sc.text_index.push_back({.index = 3, .trigger = trigger});
|
||||
scenes_.push_back(sc);
|
||||
|
||||
// Crea la escena #1
|
||||
@@ -306,17 +306,17 @@ void Ending::iniScenes() {
|
||||
sc.text_index.clear();
|
||||
trigger = 140 * 2;
|
||||
trigger += LAPSE;
|
||||
sc.text_index.push_back({4, trigger});
|
||||
sc.text_index.push_back({.index = 4, .trigger = trigger});
|
||||
trigger += LAPSE;
|
||||
sc.text_index.push_back({5, trigger});
|
||||
sc.text_index.push_back({.index = 5, .trigger = trigger});
|
||||
trigger += LAPSE;
|
||||
sc.text_index.push_back({6, trigger});
|
||||
sc.text_index.push_back({.index = 6, .trigger = trigger});
|
||||
trigger += LAPSE * 3;
|
||||
sc.text_index.push_back({7, trigger});
|
||||
sc.text_index.push_back({.index = 7, .trigger = trigger});
|
||||
trigger += LAPSE;
|
||||
sc.text_index.push_back({8, trigger});
|
||||
sc.text_index.push_back({.index = 8, .trigger = trigger});
|
||||
trigger += LAPSE * 3;
|
||||
sc.text_index.push_back({9, trigger});
|
||||
sc.text_index.push_back({.index = 9, .trigger = trigger});
|
||||
scenes_.push_back(sc);
|
||||
|
||||
// Crea la escena #2
|
||||
@@ -325,9 +325,9 @@ void Ending::iniScenes() {
|
||||
sc.text_index.clear();
|
||||
trigger = 148 / 2;
|
||||
trigger += LAPSE;
|
||||
sc.text_index.push_back({10, trigger});
|
||||
sc.text_index.push_back({.index = 10, .trigger = trigger});
|
||||
trigger += LAPSE;
|
||||
sc.text_index.push_back({11, trigger});
|
||||
sc.text_index.push_back({.index = 11, .trigger = trigger});
|
||||
scenes_.push_back(sc);
|
||||
|
||||
// Crea la escena #3
|
||||
@@ -336,9 +336,9 @@ void Ending::iniScenes() {
|
||||
sc.text_index.clear();
|
||||
trigger = 87 / 2;
|
||||
trigger += LAPSE;
|
||||
sc.text_index.push_back({12, trigger});
|
||||
sc.text_index.push_back({.index = 12, .trigger = trigger});
|
||||
trigger += LAPSE / 2;
|
||||
sc.text_index.push_back({13, trigger});
|
||||
sc.text_index.push_back({.index = 13, .trigger = trigger});
|
||||
scenes_.push_back(sc);
|
||||
|
||||
// Crea la escena #4
|
||||
@@ -347,11 +347,11 @@ void Ending::iniScenes() {
|
||||
sc.text_index.clear();
|
||||
trigger = 91 * 2;
|
||||
trigger += LAPSE;
|
||||
sc.text_index.push_back({14, trigger});
|
||||
sc.text_index.push_back({.index = 14, .trigger = trigger});
|
||||
trigger += LAPSE * 2;
|
||||
sc.text_index.push_back({15, trigger});
|
||||
sc.text_index.push_back({.index = 15, .trigger = trigger});
|
||||
trigger += LAPSE * 3;
|
||||
sc.text_index.push_back({16, trigger});
|
||||
sc.text_index.push_back({.index = 16, .trigger = trigger});
|
||||
scenes_.push_back(sc);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user