Explosion sound, and direct calling of sound API outside of composition

This commit is contained in:
stevenhowes
2021-03-20 22:46:32 +00:00
parent 500a4fac42
commit bd0fdd3418
4 changed files with 30 additions and 27 deletions
BIN
View File
Binary file not shown.
+15 -22
View File
@@ -25,34 +25,27 @@ Linkflags = -aif -o $@
cc $(ccflags) -o @.o.Input @.c.Input
# Dynamic dependencies:
o.CTheEscape: c.CTheEscape
o.CTheEscape: C:h.swis
o.CTheEscape: C:h.kernel
o.CTheEscape: C:h.kernel
o.CTheEscape: h.Sound
o.CTheEscape: c.CTheEscape
o.CTheEscape: C:h.swis
o.CTheEscape: C:h.kernel
o.CTheEscape: C:h.kernel
o.CTheEscape: h.Sound
o.Graphics: c.Graphics
o.Graphics: C:h.swis
o.Graphics: C:h.kernel
o.Graphics: C:h.kernel
o.Sound: c.Sound
o.Sound: C:h.swis
o.Sound: C:h.kernel
o.Sound: C:h.kernel
o.Sound: h.Sound
o.Graphics: c.Graphics
o.Graphics: C:h.swis
o.Graphics: C:h.kernel
o.Graphics: C:h.kernel
o.Graphics: c.Graphics
o.Graphics: C:h.swis
o.Graphics: C:h.kernel
o.Graphics: C:h.kernel
o.Input: c.Input
o.Input: C:h.swis
o.Input: C:h.kernel
o.Input: C:h.kernel
o.Input: c.Input
o.Input: C:h.swis
o.Input: C:h.kernel
o.Input: C:h.kernel
o.CTheEscape: c.CTheEscape
o.CTheEscape: C:h.swis
o.CTheEscape: C:h.kernel
o.CTheEscape: C:h.kernel
o.CTheEscape: h.Sound
o.CTheEscape: c.CTheEscape
o.CTheEscape: C:h.swis
o.CTheEscape: C:h.kernel
o.CTheEscape: C:h.kernel
o.CTheEscape: h.Sound
+3
View File
@@ -451,6 +451,9 @@ void game_collider_tick()
{
NPCS[i].sprite = explode_shp1;
NPCS[i].explodenextframe = tick + 4;
sound_play(1,-5,0,100);
sound_play(3,-15,0,1000);
sound_play(2,-10,1,100);
}
}
}
+12 -5
View File
@@ -38,15 +38,22 @@ void sound_set_voice(int voicenum, char* voicename)
_kernel_swi(Sound_AttachNamedVoice,&inreg,&outreg);
}
void sound_composition_element_play(struct CompositionElement element)
void sound_play(unsigned char Channel, signed char Volume, unsigned char Note, unsigned short int Length)
{
inreg.r[0] = element.Channel;
inreg.r[1] = element.Volume;
inreg.r[2] = element.Note;
inreg.r[3] = element.Length;
inreg.r[0] = Channel;
inreg.r[1] = Volume;
inreg.r[2] = Note;
inreg.r[3] = Length;
_kernel_swi(Sound_Control,&inreg,&outreg);
}
void sound_composition_element_play(struct CompositionElement element)
{
sound_play(element.Channel, element.Volume, element.Note, element.Length);
}
void sound_composition_init()
{
int i;