From bf28532dcc154cf0ba45e3d5a3a9d10c2e4a8833 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 18 Mar 2019 12:41:34 +0100 Subject: [PATCH] Apply volume to dialogs Fixes #40 --- SourceX/storm/storm.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SourceX/storm/storm.cpp b/SourceX/storm/storm.cpp index ff0e1c35f..344f03b14 100644 --- a/SourceX/storm/storm.cpp +++ b/SourceX/storm/storm.cpp @@ -58,6 +58,9 @@ BOOL SFileDdaBeginEx(HANDLE hFile, DWORD flags, DWORD mask, unsigned __int32 lDi SFileChunk = Mix_LoadWAV_RW(rw, 1); free(SFXbuffer); + Mix_Volume(0, MIX_MAX_VOLUME - MIX_MAX_VOLUME * volume / VOLUME_MIN); + int panned = 255 - 255 * abs(pan) / 10000; + Mix_SetPanning(0, pan <= 0 ? 255 : panned, pan >= 0 ? 255 : panned); Mix_PlayChannel(0, SFileChunk, 0); return true;