Exemplo n.º 1
0
PUBLIC void INTRO_DoIntro(void) {
    LLK_LastScan = 0;
    LLS_Init(LLSM_DIRECT, LLSVM_MODE13);
    VGA_ZeroPalette();

    Intro1("wwsplash", 320, 200);
    if (Wait(200)) goto bye;
    FadeOut(0, 0, 0, 6);
    VGA_ZeroPalette();

    Intro1("friend", 320, 200);
    if (Wait(200)) goto bye;
    FadeOut(0, 0, 0, 6);
    VGA_ZeroPalette();
/*
    LLS_Init(LLSM_DIRECT, LLSVM_MODEZ);
    VGA_ZeroPalette();
    Intro1("ivtl360", 224, 414);
    if (Wait(200)) goto bye;
    FadeOut(0, 0, 0, 6);
    VGA_ZeroPalette();
    LLS_Init(LLSM_DIRECT, LLSVM_MODE13);
    VGA_ZeroPalette();
*/
    Intro1("noria", 320, 200);
    if (Wait(200)) goto bye;
    FadeOut(0, 0, 0, 6);
    if (DoFire()) goto bye;
    FadeOut(0, 0, 0, 6);
  bye:
    LLS_Init(LLSM_DIRECT, LLSVM_MODE13);
    VGA_ZeroPalette();
}
Exemplo n.º 2
0
void WinGame(){

	while(GetMasterVolume()){
		if(GetMasterVolume() > 4)
			SetMasterVolume(GetMasterVolume()-4);
		else{
			StopSong();
			break;
		}
		WaitVsync(1);
	}
	FadeOut(9,true);
	SetTileTable(font_tiles);
	ClearVram();
	WaitVsync(45);
	SetMasterVolume(BB_MASTER_VOLUME);
	//TriggerNote(4,24,8,255);//StartSong(main_song);
	FadeIn(2,false);
	TextWriter(1,0,epilogue_string);
	while(1){
		WaitVsync(1);
		if(padState & BTN_START && !(oldPadState & BTN_START))
			break;
	}
	FadeOut(7,true);
}
void DrivenFeature::Update(float now, FaceAPIData* data, float adaptiveSmooth)
{
	bool dataExists = 
			data != NULL && 
			data->h_confidence > 0 && 
			data->h_data.find(m_fapiIndex) != data->h_data.end();

	float value;

	if(!dataExists)
	{
		value = FadeOut(now);
	}
	else
	{
		value = data->h_data[m_fapiIndex] * (m_reverse ? -1 : 1);
		Neutralise(value, data->h_frameNum, data->h_frameDuration);
		Smooth(value, now, adaptiveSmooth);
		Scale(value);
		value = FadeIn(value, now);
	}

	if(m_isPose)
	{
		m_actor->SetPoseParameter(m_poseIndex, RAD_TO_DEG(value));
	}
	else
	{
		value = clamp(value, 0, 1);
		for(int i = 0; i < m_flexors.size(); i++)
			m_actor->SetFlexWeight(m_flexors[i], value);
	}
}
Exemplo n.º 4
0
void MisOrd(char num)
{
    int i, j = 0;

    ShBox(63, 19, 257, 173);
    InBox(74, 36, 246, 163);
    display::graphics.setForegroundColor(36);
    draw_string(77, 30, "       LAUNCH ORDER");

    for (i = 0; i < num; i++) {
        InBox(78, 39 + 21 * j, 105, 55 + 21 * j);
        draw_small_flag(Order[i].plr, 79, 40 + 21 * j);
        display::graphics.setForegroundColor(34);
        draw_string(110, 45 + 21 * j, "SCHEDULED LAUNCH");
        draw_string(110, 52 + 21 * j, "DATE: ");
        display::graphics.setForegroundColor(1);

        draw_string(0, 0,
                    Month[Data->P[Order[i].plr].Mission[Order[i].loc].Month]);

        draw_string(0, 0, " 19");
        draw_number(0, 0, Data->Year);
        j++;
    };

    FadeIn(2, display::graphics.palette(), 10, 0, 0);

    WaitForMouseUp();

    WaitForKeyOrMouseDown();

    WaitForMouseUp();

    FadeOut(2, display::graphics.palette(), 10, 0, 0);
}
Exemplo n.º 5
0
void MisOrd(char num)
{
    int i, j = 0;

    ShBox(63, 19, 257, 173);
    InBox(74, 36, 246, 163);
    grSetColor(36);
    PrintAt(77, 30, "       LAUNCH ORDER");

    for (i = 0; i < num; i++) {
        InBox(78, 39 + 21 * j, 105, 55 + 21 * j);
        FlagSm(Order[i].plr, 79, 40 + 21 * j);
        grSetColor(34);
        PrintAt(110, 45 + 21 * j, "SCHEDULED LAUNCH");
        PrintAt(110, 52 + 21 * j, "DATE: ");
        grSetColor(1);

        PrintAt(0, 0,
                Month[Data->P[Order[i].plr].Mission[Order[i].loc].Month]);

        PrintAt(0, 0, " 19");
        DispNum(0, 0, Data->Year);
        j++;
    };

    FadeIn(2, pal, 10, 0, 0);

    WaitForMouseUp();

    WaitForKeyOrMouseDown();

    WaitForMouseUp();

    FadeOut(2, pal, 10, 0, 0);
}
Exemplo n.º 6
0
void CSceneManager::SceneUpdate()
{
	if (state != State::Update) return;

	scene->Update();
	FadeOut();
}
Exemplo n.º 7
0
void BriefGo(char *MissionName)
{
    SetConstants();
    LinksSeq[0] = (char*)memalloc(8);
    
    strcpy(LinksSeq[0], MissionName);
    
    BriefInit(LinksSeq[0]);

  DrawOnScreen(1);
  FadeIn(Palette, 0);
  
  int BriefEvent; 
    // -7: Exit, -4: Up, -3: Down, -2: PgUp, -1: PgDown, 1..n: Odkazy HT
    do {
      BriefEvent = BriefGetEvent();
      BriefHandleEvent(BriefEvent);
  } while (BriefEvent != -7);
  
    BriefDone();
    FadeOut(Palette, 0);
    {
        TEvent e;
        do {GetEvent(&e);} while (e.What != evNothing);
    }
}
Exemplo n.º 8
0
// 更新
void CSceneManager::Update(){
	SceneUpdate();
	Transition();

	FadeIn();
	FadeOut();
}
Exemplo n.º 9
0
int scene_ItemMenu(int index)
{
	FadeOut();
	scene_BreakBattleScreen();
	int i = BattleInventory();
	if(items[i].param1 != 1)
	{
		scene_BuildBattleScreen();
		REG_BG0HOFS = 0;
		REG_BG0VOFS = 0;
		scene_BuildPlayerWin();
		scene_BuildOpponentWin();
		if(fighters[0].mon->Status.CurrentHP)
			battle_SendOut(0, fighters[0].pokemonIndex, 0);
		if(fighters[1].mon->Status.CurrentHP)
			battle_SendOut(1, fighters[1].pokemonIndex, 0);
		OamBak[2].HPos = 158;
		OamBak[3].HPos = 190;
		OamBak[4].HPos = 36;
		OamBak[5].HPos = 68;
		OamBak[8].HPos = 126;
		OamBak[9].HPos = 190;
		OamBak[10].HPos= 12;
		OamBak[11].HPos= 76;
		REG_WIN0V = ((80-(40*2)) << 8) + (80+(40*2));
		FadeIn();
	}
	return i;
}
Exemplo n.º 10
0
int scene_Switch(int index, int lax, int cancancel)
{
	int i;
	AGBPrintf("scene_Switch(%d,%d,%d)\n",index,lax,cancancel);
	FadeOut();
	scene_BreakBattleScreen();
	i = ShowParty(1,0);
	scene_BuildBattleScreen();
	REG_BG0HOFS = 0;
	REG_BG0VOFS = 0;
	scene_BuildPlayerWin();
	scene_BuildOpponentWin();
	if(fighters[0].mon->Status.CurrentHP)
		battle_SendOut(0, fighters[0].pokemonIndex, 0);
	if(fighters[1].mon->Status.CurrentHP)
		battle_SendOut(1, fighters[1].pokemonIndex, 0);
	OamBak[2].HPos = 158;
	OamBak[3].HPos = 190;
	OamBak[4].HPos = 36;
	OamBak[5].HPos = 68;
	OamBak[8].HPos = 126;
	OamBak[9].HPos = 190;
	OamBak[10].HPos= 12;
	OamBak[11].HPos= 76;
	REG_WIN0V = ((80-(40*2)) << 8) + (80+(40*2));
	FadeIn();
	AGBPrintf("scene_Switch: returning %d\n",i);
	return i;
}
Exemplo n.º 11
0
// ---------------------------------------------------------------------------
/// 更新
// ---------------------------------------------------------------------------
Scene::SCENE Title::Update() {
    Scene::Update();

    // スタート表示の点滅
    if(mFadeFlag) {
        mStartTex.setAlpha(mStartTex.getAlpha() - mFadeSpeed);
        if(mStartTex.getAlpha() <= 0.0f) mFadeFlag = false;
    }
    else {
        mStartTex.setAlpha(mStartTex.getAlpha() + mFadeSpeed);
        if(mStartTex.getAlpha() >= 1.0f) mFadeFlag = true;
    }

    // スタート
    if(!mStart && mMouse.IsClickLeftButton()) {
        mStartSE.PlaySE();
        mStart = true;
        mStartTex.setAlpha(1.0f);
        mFadeSpeed = 0.1f;
        FadeOut(2.0f);
    }

    // ゲームメインへ
    if(mFadeOutComp) {
        ChangeScene(SCENE::GAMEMAIN_SCENE);
    }

    return mScene;
}
Exemplo n.º 12
0
void PauseGame()
{
	bool pause;

	FadeOut(5, 150);
	pause = true;

	ALLEGRO_EVENT evento;
	ALLEGRO_TIMEOUT timeout;
	al_init_timeout(&timeout, 0.05);

	al_draw_text(Fonte, al_map_rgb(255, 255, 255), (cameraPosition[0] + LARGURA_TELA / 2 - al_get_font_ascent(Fonte)), (cameraPosition[1] + ALTURA_TELA / 2 - al_get_font_ascent(Fonte)), ALLEGRO_ALIGN_CENTRE, "Pause Game! Pressione Enter.");
	al_flip_display();
	while (pause)
	{
		int tem_eventos = al_wait_for_event_until(Fila_Eventos, &evento, &timeout);
		if (tem_eventos)
		{
			if (evento.keyboard.keycode == ALLEGRO_KEY_ENTER)
			{
				pause = false;
			}
		}
	}
	redraw = true;
}
Exemplo n.º 13
0
void AI_Done(void)
{
    music_stop();
    FadeOut(2, pal, 10, 0, 0);
    memset(screen, 0x00, 64000);

}
void ManagementScene::Loop() {
    FadeOut();

    Init();

    UpDate();
}
Exemplo n.º 15
0
void CharacterIndication::Update()
{
    uint32_t elapsed_time = vt_system::SystemManager->GetUpdateTime();
    // Apply fading
    if (_fade_out) {
        _image_alpha -= 0.005f * (float)elapsed_time;
        if (_image_alpha <= 0.0f) {
            _image_alpha = 0.0f;
            _fade_out = false;
        }
    }
    else if (_fade_in) {
        _image_alpha += 0.005f * (float)elapsed_time;
        if (_image_alpha >= 1.0f) {
            _image_alpha = 1.0f;
            _fade_in = false;
        }
    }

    // Check time limit
    if (_display_time <= 0) {
        _display_time = 0;
        FadeOut();
        return;
    }

    // Update display time otherwise
    _display_time -= (int32_t)elapsed_time;
}
Exemplo n.º 16
0
int cbExitProc(PASSPROCVARS Params){
//cbExit
FadeOut(Pass.DDObject, &Pass.DDFront,&ScreenUnhighlighted, 0);
Pass.SettingsInfo=SETTINGS_EXIT;
Pass.ProgramFlow=PF_EXIT;
return 0;
}
Exemplo n.º 17
0
void CMessageBox::Clear (void)
{
if (gameStates.app.bClearMessage) {
	FadeOut ();
	backgroundManager.Remove ();
	gameStates.app.bClearMessage = 0;
	}
}
Exemplo n.º 18
0
int cbCreditsProc(PASSPROCVARS Params){
	//cbCredits
	FadeOut(Pass.DDObject, &Pass.DDFront, &ScreenUnhighlighted, 0);
	CreditsMain();
	if(Pass.ProgramFlow==PF_EXIT) Pass.SettingsInfo=SETTINGS_EXIT;
	else FadeIn(Pass.DDObject, &Pass.DDFront, &ScreenUnhighlighted, 0);
	settingsRedrawScreen();
	return 0;
}
Exemplo n.º 19
0
void ObjectiveIcons::SetObjective(C_ASW_Objective* pObjective)
{
	if (pObjective != m_pObjective 
		&& pObjective != m_pQueuedObjective)
	{
		m_pQueuedObjective = pObjective;
		m_bHaveQueued = true;
		FadeOut();
	}	
}
Exemplo n.º 20
0
/// <summary>
/// Transición entre dos músicas (LShift + K).
/// </summary>
///<param name="MusicName">Nombre de la música a reproducir en el Fade in.</param>
void CSoundManager::CrossFade (const std::string &MusicName, DWORD _ulTime)
{
	// Apagar la música que está sonando actualmente
	FadeOut(_ulTime);
	
	// Fade in de la música que va a sonar	 
	FadeIn(MusicName, _ulTime);

	DWORD MusicId = m_Channels[m_iMusicChannels + 1].m_dwSource;
}
Exemplo n.º 21
0
int cbOptionsProc(PASSPROCVARS Params){
	//cbsound
	FadeOut(Pass.DDObject, &Pass.DDFront, &ScreenUnhighlighted, 0);
	OptionsMain();
	if(Pass.ProgramFlow==PF_EXIT) Pass.SettingsInfo=SETTINGS_EXIT;
	else FadeIn(Pass.DDObject, &Pass.DDFront, &ScreenUnhighlighted, 0);
	Blit(Pass.DDBack, ScreenUnhighlighted, 0,0,640,480,0,0);
	settingsRedrawScreen();
	return 0;
}
Exemplo n.º 22
0
void TunnelPartExec(int time)
{
	int i;
	int32 dir[3];
	
	CurrentTime = time;
	
	
	
	TunnelFxDraw((time>>6), sinLerp(time>>1), cosLerp(time>>1));
	
	
	
	glEnable(GL_BLEND);
		
	DiscoElephant->transform->translation[2] = floattof32(-1) + ABS(sinLerp(time)/2);
	DiscoElephant->transform->rotation[0] = (DEGREES_IN_CIRCLE/16);
	DiscoElephant->transform->rotation[1] = sinLerp(time*2) / 2;

	for(i=0; i<4; i++) {
		dir[0] = (DiscoElephant->transform->translation[0] - flares[i]->position[0]);
		dir[1] = (DiscoElephant->transform->translation[1] - flares[i]->position[1]);
		dir[2] = (DiscoElephant->transform->translation[2] - flares[i]->position[2]);
		
		normalizef32(dir);
		
		dir[0] *= 0.9;
		dir[1] *= 0.9;
		dir[2] *= 0.9;
		
		Scene->lights[i]->direction[0] = f32tov10(dir[0]);
		Scene->lights[i]->direction[1] = f32tov10(dir[1]);
		Scene->lights[i]->direction[2] = f32tov10(dir[2]);
	}

	RenderScene(Scene);	
		
	for(i=0; i<4; i++) {
		flares[i]->position[0] = DiscoElephant->transform->translation[0] + (int32)sinLerp((time<<1) + (i+1) * DEGREES_IN_CIRCLE/4)/2;
		flares[i]->position[1] = DiscoElephant->transform->translation[1] + (int32)cosLerp((time<<2) + (i+1) * DEGREES_IN_CIRCLE/4)/2;
		flares[i]->position[2] = DiscoElephant->transform->translation[2] + (int32)sinLerp((time<<3) + DEGREES_IN_CIRCLE/(i+1))/2;
		DrawBillboard(flares[i], false, 0, 0, 0, 0);
	}
	
	if(time < 1000) {
		FadeIn(time);
	} else if(time >= 28000) {
		FadeOut(time);
	} else {
		DrawFlash(time);
	}
	
	glFlush(0);
	swiWaitForVBlank();
}
Exemplo n.º 23
0
//=============================================================================
//処理
//=============================================================================
//[input]
//	pScene:設定するシーン
//=============================================================================
void CSceneEffect::Exec( CScene *pScene )
{
	if( m_eEffect == FADE_IN )
	{
		FadeIn( pScene );
	}
	
	else if( m_eEffect == FADE_OUT )
	{
		FadeOut( pScene );
	}
}
Exemplo n.º 24
0
void NPCFalando(NPC *NPC)
{
	ALLEGRO_FONT *FonteFala = al_load_font("Arial.ttf", 16, 0);
	bool Sair;

	FadeOut(5, 150);
	Sair = true;
	int PosFala = 0;
	bool Redraw = true;

	ALLEGRO_EVENT evento;
	ALLEGRO_TIMEOUT timeout;
	al_init_timeout(&timeout, 0.05);

	while (Sair)
	{
		int tem_eventos = al_wait_for_event_until(Fila_Eventos, &evento, &timeout);
		if (tem_eventos)
		{
			if (evento.type == ALLEGRO_EVENT_KEY_DOWN && evento.keyboard.keycode == ALLEGRO_KEY_S)
			{
				if (PosFala >= NPC->QtdFalas)
				{
					Redraw = false;
					Sair = false;
					break;
				}
				else
				{
					Redraw = true;
				}
			}

		}

		if (Redraw)
		{
			Redraw = false;
			/* Desenha a Borda do Retangulo */
			al_draw_rectangle(cameraPosition[0], cameraPosition[1] + (ALTURA_TELA - 80), cameraPosition[0] + LARGURA_TELA, cameraPosition[1] + ALTURA_TELA, al_map_rgb(255, 255, 255), 2);
			al_draw_filled_rectangle(cameraPosition[0], cameraPosition[1] + (ALTURA_TELA - 80), cameraPosition[0] + LARGURA_TELA, cameraPosition[1] + ALTURA_TELA, al_map_rgb(240, 255, 113));

			/* Escreve o Texto na Tela */
			al_draw_textf(FonteFala, al_map_rgb(0, 0, 0), cameraPosition[0] + 30, cameraPosition[1] + (ALTURA_TELA - 70), 0, "%s", NPC->FalaNPC[PosFala]);
			al_draw_text(Fonte12, al_map_rgb(0, 0, 0), cameraPosition[0] + (LARGURA_TELA - 80), ((cameraPosition[1] + (ALTURA_TELA - 100) + cameraPosition[1] + ALTURA_TELA) / 2) + 30, 0, "Pressione S");
			al_flip_display();
			PosFala++;
		}
	}
	redraw = true;
	al_destroy_font(FonteFala);
}
Exemplo n.º 25
0
//=============================================================================
//シーン状態による処理
//=============================================================================
void CScene::SceneStateExec()
{
	if( m_eSceneState == STATE_FADEIN )
	{
		FadeIn();
	}
	
	if( m_eSceneState == STATE_FADEOUT )
	{
		FadeOut();
	}
	
}
Exemplo n.º 26
0
ClResult ClSoundDS::ChangeMusic(int &handle,int arcFileNum,int fnum,BOOL bFade,int repeat)
{
	BOOL			ret;
	ClSoundBuffer	*lpSoundBuffer;
	int				num;

	char	fn[32];
	wsprintf(fn,"BGM_%03d.ogg",fnum);
	num = readFile->SearchFile(pack_bgmfile,fn);
	if(num==(-1)){
		wsprintf(fn,"BGM_%03d_a.ogg",fnum);
		num = readFile->SearchFile(pack_bgmfile,fn);
	}
	if(num==(-1))return Cl_PCM_NOTFOUND;
	saveInf.musicNum = fnum;

	lpSoundBuffer = SelectSoundBuffer(handle);
	if(lpSoundBuffer){		
		int status = GetStatus(handle);
		if(status != PCM_STOP){
			if(lpSoundBuffer->orgMusicNum==num && status!=PCM_FADEOUT){
				return Cl_OK;
			}
			if(FALSE==bFade){
				Stop(handle);
			}else{
				if(PCM_FADEOUT==status){
					if(lpSoundBuffer->fo_step>25){
						lpSoundBuffer->fo_frame = 25*lpSoundBuffer->fo_frame/lpSoundBuffer->fo_step;
						lpSoundBuffer->fo_step = 25;
					}
				}
				lpSoundBuffer->nextArcFileNum = arcFileNum;
				lpSoundBuffer->nextMusicNum = num;
				lpSoundBuffer->nextRepeat = repeat;
				if(status!=PCM_FADEOUT)FadeOut(handle);
				return Cl_OK;
			}
		}
		ret = CreateStreamBuffer(handle,arcFileNum,num);
		if(-1==ret)return Cl_PCM_NOTFOUND;
	}else{
		CreateSoundObj(handle,arcFileNum,num,TRUE);
		if(-1==handle)return Cl_PCM_NOTFOUND;
	}
	int volume = sysInf.bgmVolume*0xff /10;
	SetVolume(handle,volume);

	play(handle,repeat);
	return Cl_OK;
} // ClSoundDS::ChangeMusic
Exemplo n.º 27
0
void CColorCorrection::InputDisable( inputdata_t &inputdata )
{
	m_bEnabled = false;

	if ( m_flFadeOutDuration > 0.0f )
	{
		FadeOut();
	}
	else
	{
		m_flCurWeight = 0.0f;
	}
	
}
Exemplo n.º 28
0
void Animation::PlayAnimation( AnimType type, const glm::vec3& from, const glm::vec3& to, float delay )
{

	switch(type)
	{
	case NOMATCH:
		NoMatch(from, to);
		break;
	case MATCH:
		Matched(from, to);
		break;
	case SCALE:
		FadeOut(delay);
		break;
	default:
		break;
	}
}
Exemplo n.º 29
0
void SaveGame(Mapas Mapa, Heroi Heroi)
{
	bool salvando;

	FadeOut(5, 150);
	salvando = true;

	ALLEGRO_EVENT evento;
	ALLEGRO_TIMEOUT timeout;
	al_init_timeout(&timeout, 0.05);

	FILE *save;
	save = fopen("SaveLoadGame/SaveLoadGame.bin", "w");

	fprintf(save, "%d\n", Mapa.ID);
	fprintf(save, "%d\n", Heroi.x);
	fprintf(save, "%d\n", Heroi.y);
	fprintf(save, "%d\n", Heroi.LinhaAnimacao);
	fprintf(save, "%d\n", Heroi.ColunaAnimacao);
	fprintf(save, "%d\n", Heroi.Life);
	fprintf(save, "%d\n", Heroi.MaxLife);
	fprintf(save, "%d\n", Heroi.Mana);
	fprintf(save, "%d\n", Heroi.MaxMana);
	fprintf(save, "%d\n", Heroi.QtdVida);
	fprintf(save, "%d\n", Heroi.QtdMana);

	fclose(save);

	al_draw_text(Fonte, al_map_rgb(255, 255, 255), (cameraPosition[0] + LARGURA_TELA / 2 - al_get_font_ascent(Fonte)), (cameraPosition[1] + ALTURA_TELA / 2 - al_get_font_ascent(Fonte)), ALLEGRO_ALIGN_CENTRE, "Jogo Salvo. Preciso Enter!");
	al_flip_display();

	while (salvando)
	{
		int tem_eventos = al_wait_for_event_until(Fila_Eventos, &evento, &timeout);
		if (tem_eventos)
		{
			if (evento.keyboard.keycode == ALLEGRO_KEY_ENTER)
			{
				salvando = false;
			}
		}
	}
}
Exemplo n.º 30
0
//-------------------------------------------------------------------
// 終了処理
//-------------------------------------------------------------------
void cTitleScene::End()
{
	if( select_ != Select_Exit  && !FadeOut() ) return;
	
	pTitleBackGround->SetIsExit(TRUE);
	pTitleCursor->SetIsExit(TRUE);
	pTitleKeyConfigString->SetIsExit(TRUE);
	Device->Draw.Remove();
	SAFE_DELETE( pTitleBackGround );
	SAFE_DELETE( pTitleCursor );
	SAFE_DELETE( pTitleKeyConfigString );
	
	Device->Sound.StopBGM();

	MyOutputDebugString( _T("タイトルシーン:終了\n\n") );
	stateResult_ = StateResult_Finish;
	stateFunc_.setFunc( &cTitleScene::Init );

	DxLib::SetDrawBright( 255, 255, 255 );
}