nuauseqplayerfadeout.c 1.24 KB
/*======================================================================*/
/*		NuSYS							*/
/*		nuauseqplayersetno.c					*/
/*									*/
/*		Copyright (C) 1997, NINTENDO Co,Ltd.			*/
/*									*/
/*======================================================================*/
/* $Id: nuauseqplayerfadeout.c,v 1.1.1.1 2002/10/30 02:07:09 blythe Exp $*/
/*======================================================================*/

#include <nusys.h>
#include <nualsgi.h>

/*----------------------------------------------------------------------*/
/*	nuAuSeqPlayerFadeOut - フェードアウト				*/
/*	IN:	player_no	シーケンスプレイヤーの番号		*/
/*				NU_AU_SEQ_PLAYER0 or NU_AU_SEQ_PLAYER1	*/
/*		speed		fame num				*/
/*	RET:	無し							*/
/*----------------------------------------------------------------------*/
void nuAuSeqPlayerFadeOut(u32 player_no ,u32 speed)
{
    s16	vol;

    /* 現在のボリュームの取得 */
    vol = nuAuSeqPlayerGetVol(player_no);

    /* speed が0ならSTOPと同じ。除算エラー対策 */
    if(speed){
	nuAuSeqPlayer[player_no].speed = vol/speed;
	nuAuSeqPlayer[player_no].counter = speed;	    
    } else {
	nuAuSeqPlayer[player_no].speed = vol;
	nuAuSeqPlayer[player_no].counter = 0;
    }
    nuAuSeqPlayer[player_no].mode |= NU_AU_SEQ_MODE_FADEOUT;
}