VOID PAL_NEW_EndingScreen2( VOID ) /*++ Purpose: 显示结尾处的人物介绍,对应95/98版的第六个avi视频 Parameters: None. Return value: None. --*/ { PAL_SetPalette(5, FALSE);//不加这句有可能会出现白屏的情况 //1141 00A5 0031 FFFF 0007 淡入FBP图片 49 65535 07 PAL_EndingSetEffectSprite(0x27b); PAL_ShowFBP(49, 7); //1142 0076 0031 0006 0000 显示FBP图像 49 06 PAL_EndingSetEffectSprite(0); PAL_ShowFBP(49, 6); //1143 004D 0000 0000 0000 等待按键 PAL_WaitForKey(0); //1144 0077 0001 0000 0000 停止播放音乐 01 PAL_PlayMUS(0, FALSE, 0.5); UTIL_Delay(500); //1145 0043 0009 0003 0000 设置播放音乐 09 if (!SOUND_PlayCDA(13)) { PAL_PlayMUS(9, TRUE, 0); } //1146 00A4 0030 0000 0010 卷动FBP图片 48 00 16 int i = 48; PAL_ScrollFBP(i--, 0xf, TRUE); PAL_ScrollFBP(i--, 0xf, TRUE); PAL_ScrollFBP(i--, 0xf, TRUE); PAL_ScrollFBP(i--, 0xf, TRUE); PAL_ScrollFBP(i--, 0xf, TRUE); PAL_ScrollFBP(i--, 0xf, TRUE); PAL_ScrollFBP(i--, 0xf, TRUE); PAL_ScrollFBP(i--, 0xf, TRUE); PAL_ScrollFBP(i--, 0xf, TRUE); //1150 0077 0001 0000 0000 停止播放音乐 01 PAL_PlayMUS(0, FALSE, 3); //1151 0050 0004 0000 0000 全屏淡出 PAL_FadeOut(3); }
VOID RIX_Play( INT iNumRIX, BOOL fLoop, FLOAT flFadeTime ) /*++ Purpose: Start playing the specified music. Parameters: [IN] iNumRIX - number of the music. 0 to stop playing current music. [IN] fLoop - Whether the music should be looped or not. [IN] flFadeTime - the fade in/out time when switching music. Return value: None. --*/ { // // Check for NULL pointer. // if (gpRixPlayer == NULL) { return; } // // Stop the current CD music. // SOUND_PlayCDA(-1); DWORD t = SDL_GetTicks(); gpRixPlayer->fNextLoop = fLoop; if (iNumRIX == gpRixPlayer->iCurrentMusic && !g_fNoMusic) { return; } gpRixPlayer->iNextMusic = iNumRIX; gpRixPlayer->dwStartFadeTime = t; gpRixPlayer->dwEndFadeTime = t + (DWORD)(flFadeTime * 1000) / 2; gpRixPlayer->FadeType = RIXPLAYER::FADE_OUT; }
VOID MIDI_Play( INT iNumRIX, BOOL fLoop ) /*++ Purpose: Start playing the specified music in MIDI format. Parameters: [IN] iNumRIX - number of the music. 0 to stop playing current music. [IN] fLoop - Whether the music should be looped or not. Return value: None. --*/ { FILE *fp; unsigned char *buf; int size; SDL_RWops *rw; #ifdef PAL_WIN95 char filename[1024]; #endif if (g_pMid != NULL && iNumRIX == iMidCurrent && native_midi_active()) { return; } SOUND_PlayCDA(-1); native_midi_freesong(g_pMid); g_pMid = NULL; iMidCurrent = -1; if (g_fNoMusic || iNumRIX <= 0) { return; } #ifdef PAL_WIN95 sprintf(filename, "%s/musics/%.3d.mid", PAL_PREFIX, iNumRIX); g_pMid = native_midi_loadsong(filename); if (g_pMid != NULL) { native_midi_start(g_pMid); iMidCurrent = iNumRIX; fMidLoop = fLoop; } #else fp = UTIL_OpenFile("midi.mkf"); if (fp == NULL) { return; } if (iNumRIX > PAL_MKFGetChunkCount(fp)) { fclose(fp); return; } size = PAL_MKFGetChunkSize(iNumRIX, fp); if (size <= 0) { fclose(fp); return; } buf = (unsigned char *)UTIL_malloc(size); PAL_MKFReadChunk((LPBYTE)buf, size, iNumRIX, fp); fclose(fp); rw = SDL_RWFromConstMem((const void *)buf, size); g_pMid = native_midi_loadsong_RW(rw); if (g_pMid != NULL) { native_midi_start(g_pMid); iMidCurrent = iNumRIX; fMidLoop = fLoop; } SDL_RWclose(rw); free(buf); #endif }
VOID PAL_NEW_EndingScreen1( VOID ) /*++ Purpose: 显示结尾处的消灭合体水魔兽的动画,对应95/98版的第4、5个avi视频 Parameters: None. Return value: None. --*/ { //1128 0043 0019 0000 0000 设置播放音乐 25 PAL_PlayMUS(0x19, TRUE, 0); //1129 008B 0005 0000 0000 改变调色板 05 PAL_SetPalette(5, FALSE); //112A 00A4 0044 0000 000F 卷动FBP图片 68 00 15 PAL_ScrollFBP(68, 0xf, TRUE); //112B 0050 0000 0000 0000 全屏淡出 PAL_FadeOut(1); SDL_FillRect(gpScreen, NULL, 0); //112C 008B 0004 0000 0000 改变调色板 04 PAL_SetPalette(4, FALSE); //112D 0096 0000 0000 0000 播放结束动画 PAL_EndingAnimation(); gpGlobals->wNumPalette = 4; //112E 0077 0001 0000 0000 停止播放音乐 01 PAL_PlayMUS(0, FALSE, 1); //112F 008C 000F 0007 0000 屏幕逐渐褪色 15 07 00 PAL_ColorFade(7, 15, FALSE); //1131 00A3 0002 0011 0000 播放CD音轨 02 若失败 则播放RIX 17 if (!SOUND_PlayCDA(2)) { RIX_Play(0x11, TRUE, 0); } SDL_FillRect(gpScreen, NULL, 0); //1132 0036 000B 0000 0000 设置动画 11 //1133 0037 0000 0001 0000 播放动画 00 01 00 PAL_RNGPlay(0xb, 0, 1, 7); //1134 008B 0000 0000 0000 改变调色板 00 PAL_SetPalette(0, FALSE); //1135 0037 0002 0000 0007 播放动画 02 00 07 PAL_RNGPlay(0xb, 2, 999, 7); //1136 0050 0003 0000 0000 全屏淡出 PAL_FadeOut(3); SDL_FillRect(gpScreen, NULL, 0); //1137 008B 0008 0000 0000 改变调色板 08 PAL_SetPalette(8, FALSE); //1138 0036 000A 0000 0000 设置动画 10 //1139 0037 0000 0000 0006 播放动画 00 00 06 PAL_RNGPlay(10, 0, 999, 6); //113A 0076 0047 000A 0000 显示FBP图像 71 10 PAL_EndingSetEffectSprite(0); PAL_ShowFBP(71, 10); //113B 00A6 0000 0000 0000 备份画面 VIDEO_BackupScreen(); //113C 00A5 0046 027B 0007 淡入FBP图片 70 635 07 PAL_EndingSetEffectSprite(0x27b); PAL_ShowFBP(70, 7); //113D 008B 0005 0000 0000 改变调色板 05 PAL_SetPalette(5, FALSE); //113E 00A5 0043 FFFF 0007 淡入FBP图片 67 65535 07 PAL_ShowFBP(67, 7); //113F 00A4 0042 FFFF 0007 卷动FBP图片 66 65535 07 PAL_ScrollFBP(66, 0xf, TRUE); //1140 00A5 0041 FFFF 0007 淡入FBP图片 65 65535 07 PAL_ShowFBP(65, 7); }
VOID PAL_EndingScreen( VOID ) { RIX_Play(0x1a, TRUE, 0); PAL_RNGPlay(gpGlobals->iCurPlayingRNG, 110, 150, 7); PAL_RNGPlay(gpGlobals->iCurPlayingRNG, 151, 999, 9); PAL_FadeOut(2); RIX_Play(0x19, TRUE, 0); PAL_ShowFBP(75, 0); PAL_FadeIn(5, FALSE, 1); PAL_ScrollFBP(74, 0xf, TRUE); PAL_FadeOut(1); SDL_FillRect(gpScreen, NULL, 0); gpGlobals->wNumPalette = 4; gpGlobals->fNeedToFadeIn = TRUE; PAL_EndingAnimation(); RIX_Play(0, FALSE, 2); PAL_ColorFade(7, 15, FALSE); if (!SOUND_PlayCDA(2)) { RIX_Play(0x11, TRUE, 0); } SDL_FillRect(gpScreen, NULL, 0); PAL_SetPalette(0, FALSE); PAL_RNGPlay(0xb, 0, 999, 7); PAL_FadeOut(2); SDL_FillRect(gpScreen, NULL, 0); gpGlobals->wNumPalette = 8; gpGlobals->fNeedToFadeIn = TRUE; PAL_RNGPlay(10, 0, 999, 6); PAL_EndingSetEffectSprite(0); PAL_ShowFBP(77, 10); VIDEO_BackupScreen(); PAL_EndingSetEffectSprite(0x27b); PAL_ShowFBP(76, 7); PAL_SetPalette(5, FALSE); PAL_ShowFBP(73, 7); PAL_ScrollFBP(72, 0xf, TRUE); PAL_ShowFBP(71, 7); PAL_ShowFBP(68, 7); PAL_EndingSetEffectSprite(0); PAL_ShowFBP(68, 6); PAL_WaitForKey(0); RIX_Play(0, FALSE, 1); UTIL_Delay(500); if (!SOUND_PlayCDA(13)) { RIX_Play(9, TRUE, 0); } PAL_ScrollFBP(67, 0xf, TRUE); PAL_ScrollFBP(66, 0xf, TRUE); PAL_ScrollFBP(65, 0xf, TRUE); PAL_ScrollFBP(64, 0xf, TRUE); PAL_ScrollFBP(63, 0xf, TRUE); PAL_ScrollFBP(62, 0xf, TRUE); PAL_ScrollFBP(61, 0xf, TRUE); PAL_ScrollFBP(60, 0xf, TRUE); PAL_ScrollFBP(59, 0xf, TRUE); RIX_Play(0, FALSE, 6); PAL_FadeOut(3); }
VOID MIDI_Play( INT iNumRIX, BOOL fLoop ) /*++ Purpose: Start playing the specified music in MIDI format. Parameters: [IN] iNumRIX - number of the music. 0 to stop playing current music. [IN] fLoop - Whether the music should be looped or not. Return value: None. --*/ { FILE *fp; unsigned char *buf; int size; SDL_RWops *rw; #ifdef TIMIDITY if (g_pMid != NULL && iNumRIX == iMidCurrent && Timidity_Active()) #else if (g_pMid != NULL && iNumRIX == iMidCurrent && native_midi_active()) #endif { return; } SOUND_PlayCDA(-1); #ifdef TIMIDITY Timidity_FreeSong(g_pMid); #else native_midi_freesong(g_pMid); #endif g_pMid = NULL; iMidCurrent = -1; if (g_fNoMusic || iNumRIX <= 0) { return; } fp = fopen(PAL_PREFIX "midi.mkf", "rb"); if (fp == NULL) { return; } if (iNumRIX > PAL_MKFGetChunkCount(fp)) { fclose(fp); return; } size = PAL_MKFGetChunkSize(iNumRIX, fp); if (size <= 0) { fclose(fp); return; } buf = (unsigned char *)UTIL_malloc(size); PAL_MKFReadChunk((LPBYTE)buf, size, iNumRIX, fp); fclose(fp); rw = SDL_RWFromConstMem((const void *)buf, size); #ifdef TIMIDITY g_pMid = Timidity_LoadSong_RW(rw); #else g_pMid = native_midi_loadsong_RW(rw); #endif if (g_pMid != NULL) { #ifdef TIMIDITY Timidity_Start(g_pMid); #else native_midi_start(g_pMid); #endif iMidCurrent = iNumRIX; fMidLoop = fLoop; } SDL_RWclose(rw); free(buf); }