nuauseqplayerfadeout.c
1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*======================================================================*/
/* 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;
}