MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / CreateSoundEffect

Function CreateSoundEffect

Descent3/TelComEffects.cpp:920–947  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

918}
919
920bool CreateSoundEffect(TCSNDDESC* desc, int monitor, int screen, int id) {
921 ASSERT(desc);
922 int efxtype = -1;
923 switch (desc->type) {
924 case TC_SND_STATIC:
925 efxtype = EFX_SOUND;
926 break;
927 default:
928 Int3();
929 }
930 if (efxtype == -1)
931 return false;
932 // Creates an instance of the Effect
933 int efxnum = EfxCreate(efxtype, monitor, screen, id);
934 if (efxnum == -1)
935 return false;
936 tceffect *tce = &TCEffects[efxnum];
937 if (desc->caps & TCSD_WAITTIME)
938 tce->start_time = desc->waittime;
939 else
940 tce->start_time = 0;
941
942 switch (tce->type) {
943 case EFX_SOUND:
944 return CreateSound(tce, desc->filename);
945 }
946 return false;
947}
948
949int CreateButtonEffect(TCBUTTONDESC* desc, int monitor, int screen, int id) {
950 ASSERT(desc);

Callers 1

PBAddSoundEffectFunction · 0.85

Calls 2

EfxCreateFunction · 0.85
CreateSoundFunction · 0.85

Tested by

no test coverage detected