refactor: JD8_* a namespace Jd8::
This commit is contained in:
@@ -50,7 +50,7 @@ namespace scenes {
|
||||
fade_.startFadeOut();
|
||||
|
||||
gfx_ = SurfaceHandle("gfx/tomba1.gif");
|
||||
pal_aux_ = JD8_LoadPalette("gfx/tomba1.gif");
|
||||
pal_aux_ = Jd8::loadPalette("gfx/tomba1.gif");
|
||||
pal_active_ = new Color[256];
|
||||
std::memcpy(pal_active_, pal_aux_, 768);
|
||||
|
||||
@@ -59,20 +59,20 @@ namespace scenes {
|
||||
}
|
||||
|
||||
void SecretaScene::swapToTomba2() {
|
||||
JD8_ClearScreen(255);
|
||||
Jd8::clearScreen(255);
|
||||
gfx_.reset("gfx/tomba2.gif");
|
||||
|
||||
delete[] pal_aux_;
|
||||
pal_aux_ = JD8_LoadPalette("gfx/tomba2.gif");
|
||||
pal_aux_ = Jd8::loadPalette("gfx/tomba2.gif");
|
||||
// pal_active_ continua sent el mateix buffer: només actualitzem
|
||||
// el seu contingut. main_palette ja apunta ací.
|
||||
std::memcpy(pal_active_, pal_aux_, 768);
|
||||
}
|
||||
|
||||
void SecretaScene::beginRedPulseSetup() {
|
||||
JD8_ClearScreen(0);
|
||||
JD8_SetPaletteColor(254, 12, 11, 11);
|
||||
JD8_SetPaletteColor(253, 12, 11, 11);
|
||||
Jd8::clearScreen(0);
|
||||
Jd8::setPaletteColor(254, 12, 11, 11);
|
||||
Jd8::setPaletteColor(253, 12, 11, 11);
|
||||
}
|
||||
|
||||
void SecretaScene::beginFinalFade() {
|
||||
@@ -98,8 +98,8 @@ namespace scenes {
|
||||
// SetScreenPalette allibera la vella i adopta pal_active_
|
||||
// — des d'ara main_palette == pal_active_, així que les
|
||||
// futures escriptures a pal_active_ afecten la pantalla.
|
||||
JD8_SetScreenPalette(pal_active_);
|
||||
JD8_ClearScreen(255);
|
||||
Jd8::setScreenPalette(pal_active_);
|
||||
Jd8::clearScreen(255);
|
||||
phase_ = Phase::Tomba1ScrollIn;
|
||||
phase_acc_ms_ = 0;
|
||||
}
|
||||
@@ -110,8 +110,8 @@ namespace scenes {
|
||||
const int contador = std::min(128, (phase_acc_ms_ / TICK_MS) + 1);
|
||||
// Dos blits solapats: el primer avança a velocitat completa,
|
||||
// el segon (contingut de la dreta del src) a meitat (contador>>1).
|
||||
JD8_Blit(70, 60, gfx_, 0, contador, 178, 70);
|
||||
JD8_BlitCK(70, 60, gfx_, 178, contador >> 1, 142, 70, 255);
|
||||
Jd8::blit(70, 60, gfx_, 0, contador, 178, 70);
|
||||
Jd8::blitCK(70, 60, gfx_, 178, contador >> 1, 142, 70, 255);
|
||||
if (phase_acc_ms_ >= TOMBA1_SCROLL_MS) {
|
||||
phase_ = Phase::Tomba1Hold;
|
||||
phase_acc_ms_ = 0;
|
||||
@@ -131,7 +131,7 @@ namespace scenes {
|
||||
case Phase::Tomba2ScrollIn: {
|
||||
phase_acc_ms_ += delta_ms;
|
||||
const int contador = std::min(94, (phase_acc_ms_ / TICK_MS) + 1);
|
||||
JD8_Blit(55, 53, gfx_, 0, 158 - contador, 211, contador);
|
||||
Jd8::blit(55, 53, gfx_, 0, 158 - contador, 211, contador);
|
||||
if (phase_acc_ms_ >= TOMBA2_SCROLL_MS) {
|
||||
phase_ = Phase::Tomba2Hold;
|
||||
phase_acc_ms_ = 0;
|
||||
@@ -153,7 +153,7 @@ namespace scenes {
|
||||
const int contador = std::min(80, (phase_acc_ms_ / TICK_MS) + 1);
|
||||
// Revelat horitzontal simètric: l'amplada creix 2px per tick
|
||||
// i el src_x es desplaça a l'esquerra el mateix.
|
||||
JD8_Blit(80, 68, gfx_, 160 - (contador * 2), 0, contador * 2, 64);
|
||||
Jd8::blit(80, 68, gfx_, 160 - (contador * 2), 0, contador * 2, 64);
|
||||
if (phase_acc_ms_ >= TOMBA2_REVEAL_MS) {
|
||||
phase_ = Phase::Tomba2RevealHold;
|
||||
phase_acc_ms_ = 0;
|
||||
@@ -174,8 +174,8 @@ namespace scenes {
|
||||
const int contador = std::min(51, phase_acc_ms_ / TICK_MS);
|
||||
// Anima el canal R dels índexs 254 i 253 (aquest a la meitat
|
||||
// de brillantor). Va de (12,11,11) fins a (63,11,11) / (31,11,11).
|
||||
JD8_SetPaletteColor(254, contador + 12, 11, 11);
|
||||
JD8_SetPaletteColor(253, (contador + 12) >> 1, 11, 11);
|
||||
Jd8::setPaletteColor(254, contador + 12, 11, 11);
|
||||
Jd8::setPaletteColor(253, (contador + 12) >> 1, 11, 11);
|
||||
if (phase_acc_ms_ >= RED_PULSE_MS) {
|
||||
phase_ = Phase::RedPulseHold;
|
||||
phase_acc_ms_ = 0;
|
||||
|
||||
Reference in New Issue
Block a user