the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include "Consoles_SoundEngine.h"
3
4
5bool ConsoleSoundEngine::GetIsPlayingStreamingCDMusic()
6{
7 return m_bIsPlayingStreamingCDMusic;
8}
9bool ConsoleSoundEngine::GetIsPlayingStreamingGameMusic()
10{
11 return m_bIsPlayingStreamingGameMusic;
12}
13void ConsoleSoundEngine::SetIsPlayingStreamingCDMusic(bool bVal)
14{
15 m_bIsPlayingStreamingCDMusic=bVal;
16}
17void ConsoleSoundEngine::SetIsPlayingStreamingGameMusic(bool bVal)
18{
19 m_bIsPlayingStreamingGameMusic=bVal;
20}
21bool ConsoleSoundEngine::GetIsPlayingEndMusic()
22{
23 return m_bIsPlayingEndMusic;
24}
25bool ConsoleSoundEngine::GetIsPlayingNetherMusic()
26{
27 return m_bIsPlayingNetherMusic;
28}
29void ConsoleSoundEngine::SetIsPlayingEndMusic(bool bVal)
30{
31 m_bIsPlayingEndMusic=bVal;
32}
33void ConsoleSoundEngine::SetIsPlayingNetherMusic(bool bVal)
34{
35 m_bIsPlayingNetherMusic=bVal;
36}
37
38void ConsoleSoundEngine::tick()
39{
40 if (scheduledSounds.empty())
41 {
42 return;
43 }
44
45 for(AUTO_VAR(it,scheduledSounds.begin()); it != scheduledSounds.end();)
46 {
47 SoundEngine::ScheduledSound *next = *it;
48 next->delay--;
49
50 if (next->delay <= 0)
51 {
52 play(next->iSound, next->x, next->y, next->z, next->volume, next->pitch);
53 it =scheduledSounds.erase(it);
54 delete next;
55 }
56 else
57 {
58 ++it;
59 }
60 }
61}
62
63void ConsoleSoundEngine::schedule(int iSound, float x, float y, float z, float volume, float pitch, int delayTicks)
64{
65 scheduledSounds.push_back(new SoundEngine::ScheduledSound(iSound, x, y, z, volume, pitch, delayTicks));
66}
67
68ConsoleSoundEngine::ScheduledSound::ScheduledSound(int iSound, float x, float y, float z, float volume, float pitch, int delay)
69{
70 this->iSound = iSound;
71 this->x = x;
72 this->y = y;
73 this->z = z;
74 this->volume = volume;
75 this->pitch = pitch;
76 this->delay = delay;
77}