MCPcopy Create free account
hub / github.com/diasurgical/devilution / InitMonsterSND

Function InitMonsterSND

Source/effects.cpp:928–953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

926}
927
928void InitMonsterSND(int monst)
929{
930 TSnd *pSnd;
931 char name[MAX_PATH];
932 char *path;
933 int mtype, i, j;
934
935 if (!gbSndInited) {
936 return;
937 }
938
939 mtype = Monsters[monst].mtype;
940 for (i = 0; i < 4; i++) {
941 if (MonstSndChar[i] != 's' || monsterdata[mtype].snd_special) {
942 for (j = 0; j < 2; j++) {
943 sprintf(name, monsterdata[mtype].sndfile, MonstSndChar[i], j + 1);
944 path = (char *)DiabloAllocPtr(strlen(name) + 1);
945 strcpy(path, name);
946 pSnd = sound_file_load(path);
947 Monsters[monst].Snds[i][j] = pSnd;
948 if (!pSnd)
949 mem_free_dbg(path);
950 }
951 }
952 }
953}
954
955void FreeEffects()
956{

Callers 1

AddMonsterTypeFunction · 0.85

Calls 3

DiabloAllocPtrFunction · 0.85
sound_file_loadFunction · 0.85
mem_free_dbgFunction · 0.85

Tested by

no test coverage detected