Fix mp3-player.

This commit is contained in:
Night Owl 2017-06-14 02:29:13 +05:00
parent 6408f67bb5
commit 9a33e5318c
4 changed files with 20 additions and 12 deletions

View File

@ -61,6 +61,7 @@ int CHudTimer::Draw( float flTime )
if (smbSoundCounter == 5) //Note: the counter will still continue until 120 seconds turns into 119.
{
char * songchoice = "media/hurryup.mp3";
gEngfuncs.pfnPrimeMusicStream( songchoice, 0 );
//gMP3.PlayMP3NL( songchoice );
}
//Draw BG

View File

@ -77,7 +77,7 @@ int __MsgFunc_GameMode( const char *pszName, int iSize, void *pbuf )
{
return gHUD.MsgFunc_GameMode( pszName, iSize, pbuf );
}
/*
int __MsgFunc_PlayMP3(const char *pszName, int iSize, void *pbuf )
{
return gHUD.MsgFunc_PlayMP3( pszName, iSize, pbuf );
@ -92,7 +92,7 @@ int __MsgFunc_StopMP3(const char *pszName, int iSize, void *pbuf )
{
return gHUD.MsgFunc_StopMP3( pszName, iSize, pbuf );
}
*/
int __MsgFunc_AddELight(const char *pszName, int iSize, void *pbuf )
{
return gHUD.MsgFunc_AddELight( pszName, iSize, pbuf );
@ -200,6 +200,11 @@ void CHud::Init( void )
HOOK_COMMAND( "stopaudio", StopMP3 );
}*/
HOOK_MESSAGE( PlayMP3 );
HOOK_MESSAGE( PlayBGM );
HOOK_MESSAGE( StopMP3 );
HOOK_COMMAND( "stopaudio", StopMP3 );
// TFFree CommandMenu
HOOK_COMMAND( "+commandmenu", OpenCommandMenu );
HOOK_COMMAND( "-commandmenu", CloseCommandMenu );

View File

@ -116,13 +116,13 @@ int CHud::MsgFunc_Concuss( const char *pszName, int iSize, void *pbuf )
this->m_StatusIcons.DisableIcon( "dmg_concuss" );
return 1;
}
/*
int CHud::MsgFunc_PlayMP3( const char *pszName, int iSize, void *pbuf ) //AJH -Killar MP3
{
BEGIN_READ( pbuf, iSize );
gMP3.PlayMP3( READ_STRING() );
//gMP3.PlayMP3( READ_STRING() );
gEngfuncs.pfnPrimeMusicStream( READ_STRING(), 1 );
return 1;
}
@ -131,18 +131,19 @@ int CHud::MsgFunc_PlayBGM( const char *pszName, int iSize, void *pbuf ) //AJH -K
BEGIN_READ( pbuf, iSize );
if( CVAR_GET_FLOAT( "hud_bgm" ) > 0 )
gMP3.PlayMP3( READ_STRING() );
//gMP3.PlayMP3( READ_STRING() );
gEngfuncs.pfnPrimeMusicStream( READ_STRING(), 1 );
return 1;
}
int CHud::MsgFunc_StopMP3( const char *pszName, int iSize, void *pbuf ) //AJH -Killar MP3
{
gMP3.StopMP3();
//gMP3.StopMP3();
gEngfuncs.pfnPrimeMusicStream( 0, 0 );
return 1;
}
*/
int CHud::MsgFunc_AddELight( const char *pszName, int iSize, void *pbuf )
{
BEGIN_READ( pbuf, iSize );

View File

@ -96,7 +96,7 @@ int CHud::Redraw( float flTime, int intermission )
if( !m_iIntermission && intermission )
{
int ranmus;
/*
ranmus = gEngfuncs.pfnRandomLong( 0, 9 );
char *songchoice;
@ -134,8 +134,9 @@ int CHud::Redraw( float flTime, int intermission )
break;
}
gMP3.PlayMP3NL( songchoice );
*/
//gMP3.PlayMP3NL( songchoice );
gEngfuncs.pfnPrimeMusicStream( songchoice, 0 );
// Take a screenshot if the client's got the cvar set
if( CVAR_GET_FLOAT( "hud_takesshots" ) != 0 )
m_flShotTime = flTime + 1.0; // Take a screenshot in a second