90 lines
1.6 KiB
C++
90 lines
1.6 KiB
C++
#include "modules.h"
|
|
|
|
#include "jgame.h"
|
|
#include "jdraw8.h"
|
|
#include "jinput.h"
|
|
#include "jsound.h"
|
|
#include <stdlib.h>
|
|
#include <string>
|
|
#include "info.h"
|
|
|
|
|
|
namespace module
|
|
{
|
|
namespace staticScreen
|
|
{
|
|
void go()
|
|
{
|
|
bool eixir = false;
|
|
JD8_Surface gfx = nullptr;
|
|
JD8_Palette pal = nullptr;
|
|
|
|
// Carrega grafics i música
|
|
switch( info::estat_joc ) {
|
|
case ESTAT_ICEKAS:
|
|
JS_LoadMusic("mlogo.mid");
|
|
JS_PlayMusic(1);
|
|
|
|
gfx = JD8_LoadSurface( "logo.gif" );
|
|
pal = JD8_LoadPalette( "logo.gif" );
|
|
break;
|
|
|
|
case ESTAT_LOGO:
|
|
gfx = JD8_LoadSurface("titol.gif");
|
|
pal = JD8_LoadPalette("titol.gif");
|
|
break;
|
|
}
|
|
|
|
// Fade in
|
|
JD8_Blit(gfx);
|
|
JG_SetUpdateTicks(8);
|
|
while (!JD8_FadeToPalAsync(pal))
|
|
{
|
|
while (!JG_ShouldUpdate())
|
|
{
|
|
JI_Update();
|
|
if (JI_AnyKey() || JG_Quitting())
|
|
{
|
|
eixir = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
// DELAY
|
|
JG_SetUpdateTicks(100);
|
|
int contador = 20;
|
|
while (contador > 0 && !eixir) {
|
|
contador--;
|
|
while (!JG_ShouldUpdate())
|
|
{
|
|
JI_Update();
|
|
if (JI_AnyKey() || JG_Quitting())
|
|
{
|
|
eixir = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
// FADE OUT
|
|
JG_SetUpdateTicks(2);
|
|
while (!JD8_FadeOutAsync()) {
|
|
while (!JG_ShouldUpdate()) { JI_Update(); if (JI_AnyKey() || JG_Quitting()) { eixir = true; } }
|
|
}
|
|
|
|
JD8_FreeSurface( gfx );
|
|
free(pal);
|
|
|
|
//JD8_FadeOut();
|
|
|
|
if( JG_Quitting() ) {
|
|
info::estat_joc = ESTAT_EIXIR;
|
|
} else {
|
|
switch (info::estat_joc) {
|
|
case ESTAT_ICEKAS: info::estat_joc = ESTAT_LOGO; break;
|
|
case ESTAT_LOGO: info::estat_joc = ESTAT_MENU; break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|