|
|
|
|
@@ -9,6 +9,7 @@
|
|
|
|
|
#include "core/jail/jfile.hpp"
|
|
|
|
|
#include "core/jail/jgame.hpp"
|
|
|
|
|
#include "core/jail/jinput.hpp"
|
|
|
|
|
#include "game/options.hpp"
|
|
|
|
|
|
|
|
|
|
ModuleSequence::ModuleSequence() {
|
|
|
|
|
}
|
|
|
|
|
@@ -84,6 +85,17 @@ const int minim(const int a, const int b) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Pinta el wordmark JAILGAMES/Jailgames en el mateix lloc (y=78) durant les
|
|
|
|
|
// animacions de sprites de l'intro. Branqueja entre logo vell i nou segons
|
|
|
|
|
// Options::game.use_new_logo.
|
|
|
|
|
static void drawIntroWordmark(JD8_Surface gfx) {
|
|
|
|
|
if (Options::game.use_new_logo) {
|
|
|
|
|
JD8_Blit(60, 78, gfx, 60, 158, 188, 28);
|
|
|
|
|
} else {
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void play_music(const char* music, bool loop = -1) {
|
|
|
|
|
int size;
|
|
|
|
|
char* buffer = file_getfilebuffer(music, size);
|
|
|
|
|
@@ -91,6 +103,11 @@ void play_music(const char* music, bool loop = -1) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ModuleSequence::doIntro() {
|
|
|
|
|
if (Options::game.use_new_logo) {
|
|
|
|
|
doIntroNewLogo();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JG_SetUpdateTicks(1000);
|
|
|
|
|
|
|
|
|
|
play_music("00000003.ogg");
|
|
|
|
|
@@ -213,7 +230,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JG_SetUpdateTicks(200);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
JD8_Blit(274, 78, gfx, 274, 155, 27, 45);
|
|
|
|
|
JD8_Flip();
|
|
|
|
|
while (!JG_ShouldUpdate()) {
|
|
|
|
|
@@ -224,7 +241,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
JD8_Flip();
|
|
|
|
|
while (!JG_ShouldUpdate()) {
|
|
|
|
|
JI_Update();
|
|
|
|
|
@@ -233,7 +250,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
JD8_Blit(274, 78, gfx, 274, 155, 27, 45);
|
|
|
|
|
JD8_Flip();
|
|
|
|
|
while (!JG_ShouldUpdate()) {
|
|
|
|
|
@@ -244,7 +261,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
JD8_Flip();
|
|
|
|
|
while (!JG_ShouldUpdate()) {
|
|
|
|
|
JI_Update();
|
|
|
|
|
@@ -253,7 +270,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
JD8_Blit(274, 78, gfx, 274, 155, 27, 45);
|
|
|
|
|
JD8_Flip();
|
|
|
|
|
while (!JG_ShouldUpdate()) {
|
|
|
|
|
@@ -264,7 +281,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
JD8_Flip();
|
|
|
|
|
while (!JG_ShouldUpdate()) {
|
|
|
|
|
JI_Update();
|
|
|
|
|
@@ -296,6 +313,11 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
doIntroSprites(gfx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ModuleSequence::doIntroSprites(JD8_Surface gfx) {
|
|
|
|
|
JG_SetUpdateTicks(20);
|
|
|
|
|
|
|
|
|
|
Uint16 fr1 = 13;
|
|
|
|
|
@@ -345,7 +367,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
// camina cap a la DRETA }
|
|
|
|
|
for (int i = 0; i <= 200; i++) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_1[(i div 5) mod fr1],15,15,i,150);
|
|
|
|
|
JD8_BlitCK(i, 150, gfx, fr_ani_1[(i / 5) % fr1], 0, 15, 15, 0);
|
|
|
|
|
|
|
|
|
|
@@ -363,7 +385,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i <= 200; i++) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_3[minim((i div 5),fr3-1)],15,15,200,150);
|
|
|
|
|
JD8_BlitCK(200, 150, gfx, fr_ani_3[minim((i / 5), fr3 - 1)], 30, 15, 15, 0);
|
|
|
|
|
|
|
|
|
|
@@ -381,7 +403,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
|
|
|
|
|
for (int i = 200; i >= 0; i--) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_3[minim((i div 5),fr3-1)],15,15,200,150);
|
|
|
|
|
JD8_BlitCK(200, 150, gfx, fr_ani_3[minim((i / 5), fr3 - 1)], 30, 15, 15, 0);
|
|
|
|
|
|
|
|
|
|
@@ -399,7 +421,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
|
|
|
|
|
for (int i = 200; i >= 80; i--) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_2[(i div 5) mod fr2],15,15,i,150);
|
|
|
|
|
JD8_BlitCK(i, 150, gfx, fr_ani_2[(i / 5) % fr2], 15, 15, 15, 0);
|
|
|
|
|
|
|
|
|
|
@@ -417,7 +439,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i <= 200; i++) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_4[minim((i div 5),fr4-1)],15,15,80,150);
|
|
|
|
|
JD8_BlitCK(80, 150, gfx, fr_ani_4[minim((i / 5), fr4 - 1)], 45, 15, 15, 0);
|
|
|
|
|
|
|
|
|
|
@@ -435,7 +457,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
|
|
|
|
|
for (int i = 300; i >= 95; i--) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_6[(i div 10) mod fr6],15,15,i,150);
|
|
|
|
|
JD8_BlitCK(i, 150, gfx, fr_ani_6[(i / 5) % fr6], 60, 15, 15, 0);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_4[fr4-1],15,15,80,150);
|
|
|
|
|
@@ -455,7 +477,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i <= 50; i++) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_1[1],15,15,80,150);
|
|
|
|
|
JD8_BlitCK(80, 150, gfx, fr_ani_1[1], 0, 15, 15, 0);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_6[4],15,15,95,150);
|
|
|
|
|
@@ -477,7 +499,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i <= 49; i++) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_5[minim((i div 5),fr5-1)],15,15,80,150-((i mod 50) div 5));
|
|
|
|
|
JD8_BlitCK(80, 150 - ((i % 50) / 5), gfx, fr_ani_5[minim(i / 5, fr5 - 1)], 45, 15, 15, 0);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_6[4],15,15,95,150);
|
|
|
|
|
@@ -497,7 +519,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
|
|
|
|
|
for (int i = 50; i <= 99; i++) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_5[minim((i div 5),fr5-1)],15,15,80,140+((i mod 50) div 5));
|
|
|
|
|
JD8_BlitCK(80, 140 + ((i % 50) / 5), gfx, fr_ani_5[minim(i / 5, fr5 - 1)], 45, 15, 15, 0);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_6[4],15,15,95,150);
|
|
|
|
|
@@ -517,7 +539,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
|
|
|
|
|
for (int i = 80; i >= 0; i--) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_2[(i div 5) mod fr2],15,15,i,150);
|
|
|
|
|
JD8_BlitCK(i, 150, gfx, fr_ani_2[(i / 5) % fr2], 15, 15, 15, 0);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_6[4],15,15,95,150);
|
|
|
|
|
@@ -537,7 +559,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i <= 150; i++) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_6[4],15,15,95,150);
|
|
|
|
|
JD8_BlitCK(95, 150, gfx, fr_ani_6[4], 60, 15, 15, 0);
|
|
|
|
|
// Put_sprite(from,where,interrogant,15,15,95,133);
|
|
|
|
|
@@ -552,7 +574,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
// camina cap a la DRETA }
|
|
|
|
|
for (int i = 0; i <= 200; i++) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,creu,15,15,200,155);
|
|
|
|
|
JD8_BlitCK(200, 155, gfx, 0, creu, 15, 15, 255);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_1[(i div 5) mod fr1],15,15,i,150);
|
|
|
|
|
@@ -572,7 +594,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i <= 300; i++) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,creu,15,15,200,155);
|
|
|
|
|
JD8_BlitCK(200, 155, gfx, 0, creu, 15, 15, 255);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_3[minim((i div 5),fr3-1)],15,15,200,150);
|
|
|
|
|
@@ -592,7 +614,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i <= 100; i++) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,creu,15,15,200,155);
|
|
|
|
|
JD8_BlitCK(200, 155, gfx, 0, creu, 15, 15, 255);
|
|
|
|
|
// Put_sprite(from,where,interrogant,15,15,200,134);
|
|
|
|
|
@@ -614,7 +636,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i <= 200; i++) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,creu,15,15,200,155);
|
|
|
|
|
JD8_BlitCK(200, 155, gfx, 0, creu, 15, 15, 255);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_7[minim((i div 5),fr7-1)],15,15,200,150);
|
|
|
|
|
@@ -638,7 +660,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i <= 75; i++) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,creu,15,15,200,155);
|
|
|
|
|
JD8_BlitCK(200, 155, gfx, 0, creu, 15, 15, 255);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_7[fr7-1],15,15,200,150);
|
|
|
|
|
@@ -660,7 +682,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i <= 19; i++) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,creu,15,15,200,155);
|
|
|
|
|
JD8_BlitCK(200, 155, gfx, 0, creu, 15, 15, 255);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_8[i div 10],15,15,200,150);
|
|
|
|
|
@@ -680,7 +702,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i <= 200; i++) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,creu,15,15,200,155);
|
|
|
|
|
JD8_BlitCK(200, 155, gfx, 0, creu, 15, 15, 255);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_8[1],15,15,200,150);
|
|
|
|
|
@@ -704,7 +726,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
// camina cap a la DRETA }
|
|
|
|
|
for (int i = 0; i <= 145; i++) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_1[(i div 5) mod fr1],15,15,i,150);
|
|
|
|
|
JD8_BlitCK(i, 150, gfx, fr_ani_1[(i / 5) % fr1], 0, 15, 15, 255);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_6[(i div 10) mod fr6],15,15,304-i,150);
|
|
|
|
|
@@ -724,7 +746,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i <= 100; i++) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_1[1],15,15,145,150);
|
|
|
|
|
JD8_BlitCK(145, 150, gfx, fr_ani_1[1], 0, 15, 15, 255);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_6[1],15,15,160,150);
|
|
|
|
|
@@ -744,7 +766,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i <= 50; i++) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_11[(i div 10) mod 2],15,15,125,150);
|
|
|
|
|
JD8_BlitCK(125, 150, gfx, fr_ani_11[(i / 10) % 2], 90, 15, 15, 255);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_1[1],15,15,145,150);
|
|
|
|
|
@@ -766,7 +788,7 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i <= 800; i++) {
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(43, 78, gfx, 43, 155, 231, 45);
|
|
|
|
|
drawIntroWordmark(gfx);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_9[(i div 10) mod fr9],15,15,145,150);
|
|
|
|
|
JD8_BlitCK(145, 150, gfx, fr_ani_9[(i / 10) % fr9], 120, 15, 15, 255);
|
|
|
|
|
// Put_sprite(from,where,fr_ani_10[(i div 10) mod fr10],15,15,160,150);
|
|
|
|
|
@@ -790,6 +812,129 @@ void ModuleSequence::doIntro() {
|
|
|
|
|
JD8_FreeSurface(gfx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ModuleSequence::doIntroNewLogo() {
|
|
|
|
|
// Coordenades mesurades del wordmark "Jailgames" dins logo/logo_new.gif
|
|
|
|
|
// (imatge 320x200, fons negre = index 0, lletres en index 17 = verd brillant).
|
|
|
|
|
// TUNE: ajusta aquests valors si canvies el logo.
|
|
|
|
|
constexpr int LOGO_SRC_X = 60; // x d'inici de la 'J' a la imatge font
|
|
|
|
|
constexpr int LOGO_SRC_Y = 158; // y del top del wordmark a la imatge font
|
|
|
|
|
constexpr int LOGO_DST_Y = 78; // y de destinació en pantalla (igual que logo vell)
|
|
|
|
|
constexpr int LOGO_HEIGHT = 28; // alçada del wordmark
|
|
|
|
|
// Amplada del crop des de LOGO_SRC_X fins al final de cada lletra
|
|
|
|
|
// (J, Ja, Jai, Jail, Jailg, Jailga, Jailgam, Jailgame, Jailgames):
|
|
|
|
|
constexpr int LETTER_WIDTHS[9] = {16, 39, 50, 69, 92, 115, 146, 169, 188};
|
|
|
|
|
// Cursor horitzontal (subratllat) al peu de la lletra següent que apareixerà.
|
|
|
|
|
// x absolut en pantalla, on comença cada cursor (just després de l'última lletra revelada):
|
|
|
|
|
constexpr int CURSOR_X[9] = {77, 100, 111, 130, 153, 176, 207, 230, 249};
|
|
|
|
|
constexpr int CURSOR_W = 12;
|
|
|
|
|
constexpr int CURSOR_H = 3;
|
|
|
|
|
constexpr int CURSOR_Y = LOGO_DST_Y + LOGO_HEIGHT - CURSOR_H; // peu de la lletra (y=103)
|
|
|
|
|
constexpr Uint8 CURSOR_COLOR = 17; // mateix index verd que les lletres (cicla amb el palette)
|
|
|
|
|
|
|
|
|
|
JG_SetUpdateTicks(1000);
|
|
|
|
|
|
|
|
|
|
play_music("00000003.ogg");
|
|
|
|
|
|
|
|
|
|
JD8_Surface gfx = JD8_LoadSurface("logo/logo_new.gif");
|
|
|
|
|
JD8_Palette pal = JD8_LoadPalette("logo/logo_new.gif");
|
|
|
|
|
JD8_SetScreenPalette(pal);
|
|
|
|
|
|
|
|
|
|
// Surface auxiliar plena amb el color del cursor, per poder "blittejar" rectangles.
|
|
|
|
|
JD8_Surface cursor_surf = JD8_NewSurface();
|
|
|
|
|
memset(cursor_surf, CURSOR_COLOR, 64000);
|
|
|
|
|
|
|
|
|
|
auto cleanup = [&]() {
|
|
|
|
|
JD8_FreeSurface(gfx);
|
|
|
|
|
JD8_FreeSurface(cursor_surf);
|
|
|
|
|
};
|
|
|
|
|
auto waitTick = [&]() -> bool {
|
|
|
|
|
// Retorna true si cal sortir (tecla o quitting).
|
|
|
|
|
while (!JG_ShouldUpdate()) {
|
|
|
|
|
JI_Update();
|
|
|
|
|
if (JI_AnyKey() || JG_Quitting()) return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Flip();
|
|
|
|
|
if (waitTick()) {
|
|
|
|
|
cleanup();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JG_SetUpdateTicks(150);
|
|
|
|
|
|
|
|
|
|
// Revelat progressiu lletra-a-lletra amb cursor parpadejant (subratllat horitzontal).
|
|
|
|
|
for (int i = 0; i < 9; i++) {
|
|
|
|
|
// Frame amb cursor visible
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(LOGO_SRC_X, LOGO_DST_Y, gfx, LOGO_SRC_X, LOGO_SRC_Y, LETTER_WIDTHS[i], LOGO_HEIGHT);
|
|
|
|
|
JD8_Blit(CURSOR_X[i], CURSOR_Y, cursor_surf, 0, 0, CURSOR_W, CURSOR_H);
|
|
|
|
|
JD8_Flip();
|
|
|
|
|
if (waitTick()) {
|
|
|
|
|
cleanup();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Frame sense cursor (parpadeig)
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(LOGO_SRC_X, LOGO_DST_Y, gfx, LOGO_SRC_X, LOGO_SRC_Y, LETTER_WIDTHS[i], LOGO_HEIGHT);
|
|
|
|
|
JD8_Flip();
|
|
|
|
|
if (waitTick()) {
|
|
|
|
|
cleanup();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Mostra el logo complet amb el cursor final fix un moment més.
|
|
|
|
|
JG_SetUpdateTicks(200);
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(LOGO_SRC_X, LOGO_DST_Y, gfx, LOGO_SRC_X, LOGO_SRC_Y, LETTER_WIDTHS[8], LOGO_HEIGHT);
|
|
|
|
|
JD8_Blit(CURSOR_X[8], CURSOR_Y, cursor_surf, 0, 0, CURSOR_W, CURSOR_H);
|
|
|
|
|
JD8_Flip();
|
|
|
|
|
if (waitTick()) {
|
|
|
|
|
cleanup();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Treu el cursor abans del cicle de paleta (els seus pixels cicla rien amb les lletres).
|
|
|
|
|
JD8_ClearScreen(0);
|
|
|
|
|
JD8_Blit(LOGO_SRC_X, LOGO_DST_Y, gfx, LOGO_SRC_X, LOGO_SRC_Y, LETTER_WIDTHS[8], LOGO_HEIGHT);
|
|
|
|
|
JD8_Flip();
|
|
|
|
|
|
|
|
|
|
// Cicle de paleta final (mateix efecte que l'intro original, indexs 16-31).
|
|
|
|
|
JG_SetUpdateTicks(20);
|
|
|
|
|
for (int j = 0; j < 256; j++) {
|
|
|
|
|
for (int i = 16; i < 32; i++) {
|
|
|
|
|
if (i == 17) {
|
|
|
|
|
if (pal[i].r < 255) pal[i].r++;
|
|
|
|
|
if (pal[i].g < 255) pal[i].g++;
|
|
|
|
|
if (pal[i].b < 255) pal[i].b++;
|
|
|
|
|
}
|
|
|
|
|
if (pal[i].b < pal[i].g) pal[i].b++;
|
|
|
|
|
if (pal[i].b > pal[i].g) pal[i].b--;
|
|
|
|
|
if (pal[i].r < pal[i].g) pal[i].r++;
|
|
|
|
|
if (pal[i].r > pal[i].g) pal[i].r--;
|
|
|
|
|
}
|
|
|
|
|
JD8_Flip();
|
|
|
|
|
if (waitTick()) {
|
|
|
|
|
cleanup();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Espera abans d'entrar a les animacions de sprites (igual que l'intro vella).
|
|
|
|
|
if (waitTick()) {
|
|
|
|
|
cleanup();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// doIntroSprites pren propietat de gfx i el allibera ell mateix.
|
|
|
|
|
JD8_FreeSurface(cursor_surf);
|
|
|
|
|
doIntroSprites(gfx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ModuleSequence::doMenu() {
|
|
|
|
|
JG_SetUpdateTicks(20);
|
|
|
|
|
JD8_Surface fondo = JD8_LoadSurface("menu.gif");
|
|
|
|
|
|