?? cbavi.cpp
字號:
}
// WriteLogFile( "sound.log","KKKKK\n" );
//DATA_WAVE_MusicPlay(0) ;
// to fade in the interface of this game
DDC_UpdateScreen();
//--fade in
DD_FadeInScreen( 5, 10 );
DD_FadeRestore( palMain.GetPalette() );
//--fade in
// to show the mission dialog
PostMessage(hwndGame, WM_COMMAND, SHOW_CAMPAIGN_MISSION, 0);
// to restore all button's state
FACE_RestoreAllButtonState();
}
// what are you going to do after play the real time AVI
else if( nCommandState == COMMAND_STATE_AVI_REALTIME )
{
// to restore the palette
palMain.ReloadPalette();
//--fade in
DD_FadeClear( palMain.GetPalette() );
palMain.SetPalette();
//--fade in
// to get current cursor and show it
CURSOR_Get()->Show(TRUE);
FACE_SetProgramState( FACE_GetPreProgramState() );
FACE_SetCommandState( FACE_GetPreCommandState() ) ;
DDC_UpdateScreen();
//to play the sound
if( GAME_nDisk == 0 )
{
DATA_WAVE_MusicPlay( GAME.nMusicID );
}
//DATA_WAVE_MusicPlay(0) ;
// to fade in the interface of this game
DDC_UpdateScreen();
//--fade in
DD_FadeInScreen( 5, 10 );
DD_FadeRestore( palMain.GetPalette() );
//--fade in
// to restore all button's state
FACE_RestoreAllButtonState();
}
else if( nCommandState == COMMAND_STATE_AVI_SINGLE )
{
// to restore the palette
palMain.ReloadPalette();
//--fade in
DD_FadeClear( palMain.GetPalette() );
palMain.SetPalette();
//--fade in
// to get current cursor and show it
CURSOR_Get()->Show(TRUE);
FACE_SetProgramState( PROGRAM_STATE_MENU );
FACE_SetCommandState( COMMAND_STATE_MENU ) ;
//to play the sound
if( GAME_nDisk == 0 )
{
DATA_WAVE_MusicPlay( GAME.nMusicID );
}
//DATA_WAVE_MusicPlay(0) ;
// to fade in the interface of this game
DDC_UpdateScreen();
//--fade in
DD_FadeInScreen( 5, 10 );
DD_FadeRestore( palMain.GetPalette() );
//--fade in
PostMessage(hwndGame, WM_COMMAND, BUTTON_SINGLE_RESULT, 0 );
}
else if( nCommandState == COMMAND_STATE_AVI_HISTORY )
{
if( GAME_nDisk == 0 )
{
char wavfile[_MAX_FNAME];
strcpy( wavfile, GAME_strSetupDirectory );
strcat( wavfile, "\\sound\\Start.wav" );
DATA_WAVE_MusicPlayS( wavfile );
}
// to get current cursor and show it
CURSOR_Get()->Show(TRUE);
FACE_SetProgramState( PROGRAM_STATE_MENU );
FACE_SetCommandState( COMMAND_STATE_MENU );
SendMessage(hwndGame, WM_COMMAND, SHOW_MAIN_MENU, 0);
// to restore all button's state
FACE_RestoreAllButtonState();
}
DDC_UpdateScreen() ;
MAIN_bFirst = TRUE;
return TRUE;
}
return FALSE;
}
// close avi step 1, close AVI files
BOOL FACE_Avi_Close1()
{
if( (FACE_GetCommandState() == COMMAND_STATE_AVI_BEGIN ) ||
(FACE_GetCommandState() == COMMAND_STATE_AVI_END ) ||
(FACE_GetCommandState() == COMMAND_STATE_AVI_MISSION ) ||
(FACE_GetCommandState() == COMMAND_STATE_AVI_REALTIME ) ||
(FACE_GetCommandState() == COMMAND_STATE_AVI_SINGLE ) ||
(FACE_GetCommandState() == COMMAND_STATE_AVI_HISTORY )
)
{ // 會接收到兩次消息
// to erase the whole screen to black
// 不能使用,否則出錯
// DD_EraseFrontScreen();
if( FACE_AVI_FLAG == FALSE )
{
}
else if( MAIN_bMMX == TRUE
&& FACE_GetCommandState() != COMMAND_STATE_AVI_SINGLE )
{
Assert( bMoviePlaying == TRUE );
MovieStop( hwndGame );
MovieFileClose( hwndGame );
MovieTerminate( hwndGame );
nCurrentVideoID = -1;
bMoviePlaying = FALSE;
}
else
{
Assert( nCurrentVideoID != -1 );
MCI_AVI_Stop( hwndGame, nCurrentVideoID );
MCI_AVI_Close( nCurrentVideoID );
nCurrentVideoID = -1;
}
return TRUE;
}
return FALSE;
}
// close avi step 2, do anything after closing AVI files
// 必須接著FACE_Avi_Close1()
BOOL FACE_Avi_Close2()
{
if( (FACE_GetCommandState() == COMMAND_STATE_AVI_BEGIN ) ||
(FACE_GetCommandState() == COMMAND_STATE_AVI_END ) ||
(FACE_GetCommandState() == COMMAND_STATE_AVI_MISSION ) ||
(FACE_GetCommandState() == COMMAND_STATE_AVI_REALTIME ) ||
(FACE_GetCommandState() == COMMAND_STATE_AVI_SINGLE ) ||
(FACE_GetCommandState() == COMMAND_STATE_AVI_HISTORY )
)
{ // 會接收到兩次消息
// to do the next thing by the current program state
int nCommandState;
nCommandState = FACE_GetCommandState();
if( GAME_nDisk != 0 )
{
if( nCommandState == COMMAND_STATE_AVI_BEGIN )
{
char wavfile[_MAX_FNAME];
strcpy( wavfile, GAME_strSetupDirectory );
strcat( wavfile, "\\sound\\Start.wav" );
DATA_WAVE_MusicPlayS( wavfile );
strcpy( GAME.strStartWAV, wavfile );
}
else if( nCommandState == COMMAND_STATE_AVI_END )
{
DATA_WAVE_MusicPlay( GAME.nMusicID );
}
else if( nCommandState == COMMAND_STATE_AVI_MISSION )
{
DATA_WAVE_MusicPlay( GAME.nMusicID );
}
else if( nCommandState == COMMAND_STATE_AVI_REALTIME )
{
DATA_WAVE_MusicPlay( GAME.nMusicID );
}
else if( nCommandState == COMMAND_STATE_AVI_SINGLE )
{
DATA_WAVE_MusicPlay( GAME.nMusicID );
}
else if( nCommandState == COMMAND_STATE_AVI_HISTORY )
{
char wavfile[_MAX_FNAME];
strcpy( wavfile, GAME_strSetupDirectory );
strcat( wavfile, "\\sound\\Start.wav" );
DATA_WAVE_MusicPlayS( wavfile );
}
}
// to get the sound device
DS_InitSound( hwndGame ) ;
// what are you going to do after play the begin AVI
if( nCommandState == COMMAND_STATE_AVI_BEGIN )
{
DD_EraseFrontScreen();
MAIN_InitOthers();
if( GAME_nDisk == 0 )
{
char wavfile[_MAX_FNAME];
strcpy( wavfile, GAME_strSetupDirectory );
strcat( wavfile, "\\sound\\Start.wav" );
DATA_WAVE_MusicPlayS( wavfile );
strcpy( GAME.strStartWAV, wavfile );
}
GAME.nID = 0;
FACE_SetProgramState( PROGRAM_STATE_PLAY );
FACE_SetCommandState( COMMAND_STATE_PLAY );
SendMessage(hwndGame, WM_COMMAND, SHOW_MAIN_MENU, 0);
// to restore all button's state
FACE_RestoreAllButtonState();
}
// what are you going to do after play the end AVI
else if( nCommandState == COMMAND_STATE_AVI_END )
{
//to play the sound
if( GAME_nDisk == 0 )
{
DATA_WAVE_MusicPlay( GAME.nMusicID );
}
//DATA_WAVE_MusicPlay(0) ;
// WriteLogFile( "sound.log","IIIII\n" );
// to restore all button's state
FACE_RestoreAllButtonState();
}
// what are you going to do after play the mission AVI
else if( nCommandState == COMMAND_STATE_AVI_MISSION )
{
// to restore the palette
palMain.ReloadPalette();
//--fade in
DD_FadeClear( palMain.GetPalette() );
palMain.SetPalette();
//--fade in
// to get current cursor and show it
CURSOR_Get()->Show(TRUE);
// FACE_SetProgramState( FACE_GetPreProgramState() );
FACE_SetProgramState( PROGRAM_STATE_PLAY );
FACE_SetCommandState( COMMAND_STATE_MENU );
//to play the sound
if( GAME_nDisk == 0 )
{
DATA_WAVE_MusicPlay( GAME.nMusicID );
}
// WriteLogFile( "sound.log","KKKKK\n" );
//DATA_WAVE_MusicPlay(0) ;
// to fade in the interface of this game
DDC_UpdateScreen();
//--fade in
DD_FadeInScreen( 5, 10 );
DD_FadeRestore( palMain.GetPalette() );
//--fade in
// to show the mission dialog
PostMessage(hwndGame, WM_COMMAND, SHOW_CAMPAIGN_MISSION, 0);
// to restore all button's state
FACE_RestoreAllButtonState();
}
// what are you going to do after play the real time AVI
else if( nCommandState == COMMAND_STATE_AVI_REALTIME )
{
// to restore the palette
palMain.ReloadPalette();
//--fade in
DD_FadeClear( palMain.GetPalette() );
palMain.SetPalette();
//--fade in
// to get current cursor and show it
CURSOR_Get()->Show(TRUE);
FACE_SetProgramState( FACE_GetPreProgramState() );
FACE_SetCommandState( FACE_GetPreCommandState() ) ;
DDC_UpdateScreen();
//to play the sound
if( GAME_nDisk == 0 )
{
DATA_WAVE_MusicPlay( GAME.nMusicID );
}
//DATA_WAVE_MusicPlay(0) ;
// to fade in the interface of this game
DDC_UpdateScreen();
//--fade in
DD_FadeInScreen( 5, 10 );
DD_FadeRestore( palMain.GetPalette() );
//--fade in
// to restore all button's state
FACE_RestoreAllButtonState();
}
else if( nCommandState == COMMAND_STATE_AVI_SINGLE )
{
// to restore the palette
palMain.ReloadPalette();
//--fade in
DD_FadeClear( palMain.GetPalette() );
palMain.SetPalette();
//--fade in
// to get current cursor and show it
CURSOR_Get()->Show(TRUE);
FACE_SetProgramState( PROGRAM_STATE_MENU );
FACE_SetCommandState( COMMAND_STATE_MENU ) ;
//to play the sound
if( GAME_nDisk == 0 )
{
DATA_WAVE_MusicPlay( GAME.nMusicID );
}
//DATA_WAVE_MusicPlay(0) ;
// to fade in the interface of this game
DDC_UpdateScreen();
//--fade in
DD_FadeInScreen( 5, 10 );
DD_FadeRestore( palMain.GetPalette() );
//--fade in
PostMessage(hwndGame, WM_COMMAND, BUTTON_SINGLE_RESULT, 0 );
}
else if( nCommandState == COMMAND_STATE_AVI_HISTORY )
{
if( GAME_nDisk == 0 )
{
char wavfile[_MAX_FNAME];
strcpy( wavfile, GAME_strSetupDirectory );
strcat( wavfile, "\\sound\\Start.wav" );
DATA_WAVE_MusicPlayS( wavfile );
}
// to get current cursor and show it
CURSOR_Get()->Show(TRUE);
FACE_SetProgramState( PROGRAM_STATE_MENU );
FACE_SetCommandState( COMMAND_STATE_MENU );
SendMessage(hwndGame, WM_COMMAND, SHOW_MAIN_MENU, 0);
// to restore all button's state
FACE_RestoreAllButtonState();
}
DDC_UpdateScreen() ;
MAIN_bFirst = TRUE;
return TRUE;
}
return FALSE;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -