fix: tidy director/jdraw8/jinput/jfile (locals UPPER_CASE, file_*→Jf::)
This commit is contained in:
@@ -170,7 +170,7 @@ auto Director::iterate() -> bool {
|
||||
constexpr Uint32 FRAME_MS_VSYNC = 16; // ~60 FPS amb VSync
|
||||
constexpr Uint32 FRAME_MS_NO_VSYNC = 4; // ~250 FPS sense VSync (límit superior)
|
||||
|
||||
const Uint32 frame_start = SDL_GetTicks();
|
||||
const Uint32 FRAME_START = SDL_GetTicks();
|
||||
|
||||
Gamepad::update();
|
||||
KeyRemap::update();
|
||||
@@ -184,12 +184,12 @@ auto Director::iterate() -> bool {
|
||||
|
||||
// Dispara els crèdits cinematogràfics la primera vegada que el joc
|
||||
// arriba al menú del títol (info::ctx.num_piramide == 0).
|
||||
static bool credits_triggered = false;
|
||||
if (!credits_triggered && info::ctx.num_piramide == 0) {
|
||||
static bool credits_triggered_ = false;
|
||||
if (!credits_triggered_ && info::ctx.num_piramide == 0) {
|
||||
if (Options::game.show_title_credits) {
|
||||
Overlay::startCredits();
|
||||
}
|
||||
credits_triggered = true;
|
||||
credits_triggered_ = true;
|
||||
}
|
||||
|
||||
// Si l'overlay ja no bloqueja ESC (timeout), desbloquegem
|
||||
@@ -225,12 +225,12 @@ auto Director::iterate() -> bool {
|
||||
}
|
||||
|
||||
// Tick de l'escena. Ji::update refresca key_pressed/any_key; el
|
||||
// delta_ms és el temps real transcorregut des de l'últim tick.
|
||||
// DELTA_MS és el temps real transcorregut des de l'últim tick.
|
||||
Ji::update();
|
||||
const Uint32 now = SDL_GetTicks();
|
||||
const int delta_ms = static_cast<int>(now - last_tick_ms_);
|
||||
last_tick_ms_ = now;
|
||||
current_scene_->tick(delta_ms);
|
||||
const Uint32 NOW = SDL_GetTicks();
|
||||
const int DELTA_MS = static_cast<int>(NOW - last_tick_ms_);
|
||||
last_tick_ms_ = NOW;
|
||||
current_scene_->tick(DELTA_MS);
|
||||
|
||||
// Converteix `screen` indexat → `pixel_data` ARGB amb la paleta
|
||||
// actual. Jd8::flip ja no fa yield (Phase B.2 eliminà els fibers);
|
||||
@@ -250,10 +250,10 @@ auto Director::iterate() -> bool {
|
||||
// Nota: quan el runtime posseïx el main loop (SDL_AppIterate /
|
||||
// emscripten), aquest SDL_Delay no és ideal. Fase 7 afegirà un mode
|
||||
// que es basa en el timing intern de SDL en lloc del delay explícit.
|
||||
const Uint32 target_ms = Options::video.vsync ? FRAME_MS_VSYNC : FRAME_MS_NO_VSYNC;
|
||||
const Uint32 elapsed = SDL_GetTicks() - frame_start;
|
||||
if (elapsed < target_ms) {
|
||||
SDL_Delay(target_ms - elapsed);
|
||||
const Uint32 TARGET_MS = Options::video.vsync ? FRAME_MS_VSYNC : FRAME_MS_NO_VSYNC;
|
||||
const Uint32 ELAPSED = SDL_GetTicks() - FRAME_START;
|
||||
if (ELAPSED < TARGET_MS) {
|
||||
SDL_Delay(TARGET_MS - ELAPSED);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -386,10 +386,10 @@ void Director::handleEvent(const SDL_Event& event) {
|
||||
// KeyConfig::isGuiKey cobreix totes les tecles GUI a la vegada,
|
||||
// incloent pause_toggle i menu_toggle (defensa en profunditat:
|
||||
// aquestes ja s'haurien hagut de menjar al swallow d'amunt).
|
||||
const auto sc = event.key.scancode;
|
||||
if (!KeyConfig::isGuiKey(sc)) {
|
||||
const auto SC = event.key.scancode;
|
||||
if (!KeyConfig::isGuiKey(SC)) {
|
||||
key_pressed_ = true;
|
||||
Ji::moveCheats(sc);
|
||||
Ji::moveCheats(SC);
|
||||
}
|
||||
}
|
||||
Mouse::handleEvent(event);
|
||||
|
||||
Reference in New Issue
Block a user