MCPcopy Create free account
hub / github.com/JACoders/OpenJK / EALFileInit

Function EALFileInit

code/client/snd_dma.cpp:953–996  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

951
952#ifdef USE_OPENAL
953static void EALFileInit(const char *level)
954{
955 // If an EAL File is already unloaded, remove it
956 if (s_bEALFileLoaded)
957 {
958 UnloadEALFile();
959 }
960
961 // Reset variables
962 s_bInWater = false;
963
964 // Try and load an EAL file for the new level
965 char name[MAX_QPATH];
966 COM_StripExtension(level, name, sizeof(name));
967
968 char szEALFilename[MAX_QPATH];
969 Com_sprintf(szEALFilename, MAX_QPATH, "eagle/%s.eal", name);
970
971 s_bEALFileLoaded = LoadEALFile(szEALFilename);
972
973 if (!s_bEALFileLoaded)
974 {
975 Com_sprintf(szEALFilename, MAX_QPATH, "base/eagle/%s.eal", name);
976 s_bEALFileLoaded = LoadEALFile(szEALFilename);
977 }
978
979 if (s_bEALFileLoaded)
980 {
981 s_lLastEnvUpdate = timeGetTime();
982 }
983 else
984 {
985 // Mute reverbs if no EAL file is found
986 if ((s_bEAX)&&(s_eaxSet))
987 {
988 long lRoom = -10000;
989 for (int i = 0; i < s_NumFXSlots; i++)
990 {
991 s_eaxSet(&s_FXSlotInfo[i].FXSlotGuid, EAXREVERB_ROOM, NULL,
992 &lRoom, sizeof(long));
993 }
994 }
995 }
996}
997#endif
998
999/*

Callers 2

snd_dma.cppFile · 0.70
S_BeginRegistrationFunction · 0.70

Calls 4

UnloadEALFileFunction · 0.70
LoadEALFileFunction · 0.70
COM_StripExtensionFunction · 0.50
Com_sprintfFunction · 0.50

Tested by

no test coverage detected