refactor: JI_* a Ji:: i JG_* a Jg::

This commit is contained in:
2026-05-16 14:43:16 +02:00
parent 9d30dd538c
commit bbcc10da81
27 changed files with 174 additions and 163 deletions
+9 -9
View File
@@ -9,7 +9,7 @@
ModuleGame::ModuleGame() {
this->gfx_ = Jd8::loadSurface(info::ctx.pepe_activat ? "gfx/frames2.gif" : "gfx/frames.gif");
JG_SetUpdateTicks(10);
Jg::setUpdateTicks(10);
this->sam_ = std::make_unique<Prota>(this->gfx_);
this->mapa_ = std::make_unique<Mapa>(this->gfx_, this->sam_.get());
@@ -92,7 +92,7 @@ void ModuleGame::tick(int delta_ms) {
}
auto ModuleGame::nextState() const -> int {
if (JG_Quitting()) {
if (Jg::quitting()) {
return -1;
}
if (info::ctx.num_habitacio == 1 ||
@@ -133,8 +133,8 @@ void ModuleGame::draw() {
}
void ModuleGame::update() {
if (JG_ShouldUpdate()) {
JI_Update();
if (Jg::shouldUpdate()) {
Ji::update();
this->final_ = this->sam_->update();
const auto erased = std::erase_if(this->momies_, [](auto& m) { return m->update(); });
@@ -148,14 +148,14 @@ void ModuleGame::update() {
info::ctx.momies++;
}
if (JI_CheatActivated("reviu")) {
if (Ji::cheatActivated("reviu")) {
info::ctx.vida = 5;
}
if (JI_CheatActivated("alone")) {
if (Ji::cheatActivated("alone")) {
this->momies_.clear();
info::ctx.momies = 0;
}
if (JI_CheatActivated("obert")) {
if (Ji::cheatActivated("obert")) {
for (int i = 0; i < 16; i++) {
this->mapa_->tombes[i].costat[0] = true;
this->mapa_->tombes[i].costat[1] = true;
@@ -165,8 +165,8 @@ void ModuleGame::update() {
}
}
if (JI_KeyPressed(SDL_SCANCODE_ESCAPE)) {
JG_QuitSignal();
if (Ji::keyPressed(SDL_SCANCODE_ESCAPE)) {
Jg::quitSignal();
}
}
}