DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
tisound.cpp
1#include "common.h"
2
3#include "snd.hpp"
4#include "sound.hpp"
5
6void TiPlayVolSE(int group, int no, int voice, float volume) {
7 short *se_info;
8 short base_volume;
9 int se_index;
10 int level;
11
12 se_index = CSnd.GetSeNo(no, voice);
13 se_info = CSnd.GetSeInfTbl();
14 base_volume = se_info[se_index * 2 + 1];
15 level = (int) ((float) base_volume * volume);
16
17 if (level < 0) {
18 level = 0;
19 }
20
21 if (level > 127) {
22 level = 127;
23 }
24
25 CSnd.SE_Play(group, no, voice, 64, 127, level, 0);
26}
void SE_Play(int port, int bank, int program, int pan, int velocity, int volume, int voice)
Definition sound.cpp:579
short * GetSeInfTbl()
Definition sound.cpp:49
int GetSeNo(int bank, int program)
Definition sound.cpp:53