diff --git a/Standard Gaming Platform/soundman.cpp b/Standard Gaming Platform/soundman.cpp index 435e4f6e..37216332 100644 --- a/Standard Gaming Platform/soundman.cpp +++ b/Standard Gaming Platform/soundman.cpp @@ -28,6 +28,7 @@ //#include "english.h" //#include "input.h" #include + #include #endif // Uncomment this to disable the startup of sound hardware @@ -291,7 +292,13 @@ void ShutdownSoundManager(void) // //******************************************************************************* -std::map> gSoundMap; +std::map> gSoundMap; + +uint64_t TimeMS() +{ + using namespace std::chrono; + return duration_cast(system_clock::now().time_since_epoch()).count(); +} UINT32 SoundPlay(STR pFilename, SOUNDPARMS *pParms) { @@ -305,7 +312,7 @@ UINT32 SoundPlay(STR pFilename, SOUNDPARMS *pParms) if (gGameExternalOptions.fLimitSimultaneousSound) //!_KeyDown(SHIFT)) { - std::time_t curtime = std::time(0); + uint64_t curtime = TimeMS(); std::string filename(pFilename); if (gSoundMap[filename] > curtime) @@ -314,7 +321,7 @@ UINT32 SoundPlay(STR pFilename, SOUNDPARMS *pParms) } // set delay for this sound type - gSoundMap[filename] = curtime + 1; + gSoundMap[filename] = curtime + 50; } if ((uiSample = SoundLoadSample(pFilename)) != NO_SAMPLE)