Skip to content

Commit

Permalink
Fixed Windows Vista/7: Non-working music volume controls.
Browse files Browse the repository at this point in the history
Fixed Windows: "SDL_mixer: Music volume and balance" (see here http://sourceforge.net/tracker/?func=detail&aid=2719125&group_id=74815&atid=542099).
  • Loading branch information
danij committed Aug 30, 2009
1 parent 9b5a8cd commit 4dcfc9d
Show file tree
Hide file tree
Showing 12 changed files with 303 additions and 478 deletions.
8 changes: 0 additions & 8 deletions doomsday/build/codeblocks/doomsday.cbp
Expand Up @@ -341,7 +341,6 @@
<Unit filename="..\..\engine\portable\include\sys_findfile.h" />
<Unit filename="..\..\engine\portable\include\sys_input.h" />
<Unit filename="..\..\engine\portable\include\sys_master.h" />
<Unit filename="..\..\engine\portable\include\sys_mixer.h" />
<Unit filename="..\..\engine\portable\include\sys_network.h" />
<Unit filename="..\..\engine\portable\include\sys_opengl.h" />
<Unit filename="..\..\engine\portable\include\sys_sock.h" />
Expand Down Expand Up @@ -853,10 +852,6 @@
<Option compilerVar="CC" />
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="..\..\engine\unix\src\sys_mixer.c">
<Option compilerVar="CC" />
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="..\..\engine\unix\src\sys_path.c">
<Option compilerVar="CC" />
<Option target="&lt;{~None~}&gt;" />
Expand Down Expand Up @@ -887,9 +882,6 @@
<Unit filename="..\..\engine\win32\src\sys_input.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="..\..\engine\win32\src\sys_mixer.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="..\..\engine\win32\src\sys_audiod_loader.c">
<Option compilerVar="CC" />
</Unit>
Expand Down
1 change: 0 additions & 1 deletion doomsday/build/win32/doomsday_cl.rsp
Expand Up @@ -127,7 +127,6 @@
.\..\..\engine\portable\src\sys_system.c
.\..\..\engine\portable\src\sys_sock.c
.\..\..\engine\portable\src\sys_network.c
.\..\..\engine\win32\src\sys_mixer.c
.\..\..\engine\portable\src\sys_master.c
.\..\..\engine\win32\src\sys_input.c
.\..\..\engine\win32\src\sys_findfile.c
Expand Down
32 changes: 0 additions & 32 deletions doomsday/build/win32/vs8/doomsday.vcproj
Expand Up @@ -900,10 +900,6 @@
RelativePath="..\..\..\engine\win32\src\sys_input.c"
>
</File>
<File
RelativePath="..\..\..\engine\win32\src\sys_mixer.c"
>
</File>
<File
RelativePath="..\..\..\engine\win32\src\sys_window.c"
>
Expand Down Expand Up @@ -1132,30 +1128,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\engine\unix\src\sys_mixer.c"
>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\engine\unix\src\sys_path.c"
>
Expand Down Expand Up @@ -1902,10 +1874,6 @@
RelativePath="..\..\..\engine\portable\include\sys_master.h"
>
</File>
<File
RelativePath="..\..\..\engine\portable\include\sys_mixer.h"
>
</File>
<File
RelativePath="..\..\..\engine\portable\include\sys_network.h"
>
Expand Down
1 change: 0 additions & 1 deletion doomsday/engine/portable/include/de_system.h
Expand Up @@ -38,7 +38,6 @@
#include "sys_sock.h"
#include "sys_master.h"
#include "sys_timer.h"
#include "sys_mixer.h"
#include "sys_opengl.h"

// Use SDL for window management under *nix
Expand Down
42 changes: 0 additions & 42 deletions doomsday/engine/portable/include/sys_mixer.h

This file was deleted.

17 changes: 0 additions & 17 deletions doomsday/engine/portable/src/s_mus.c
Expand Up @@ -220,22 +220,6 @@ void Mus_StartFrame(void)
*/
void Mus_SetVolume(float vol)
{
#if WIN32
int val;

if(!musAvail)
return;

// Under Win32 we need to do this via the mixer.
val = MINMAX_OF(0, (byte) (vol * 255 + .5f), 255);

// Straighten the volume curve.
val <<= 8; // Make it a word.
val = (int) (255.9980469 * sqrt(vol));

Sys_Mixer4i(MIX_MIDI, MIX_SET, MIX_VOLUME, val);
Sys_Mixer4i(MIX_CDAUDIO, MIX_SET, MIX_VOLUME, val);
#else
unsigned int i;

if(!musAvail)
Expand All @@ -247,7 +231,6 @@ void Mus_SetVolume(float vol)
if(*interfaces[i].ip)
(*interfaces[i].ip)->Set(MUSIP_VOLUME, vol);
}
#endif
}

/**
Expand Down
4 changes: 1 addition & 3 deletions doomsday/engine/portable/src/sys_system.c
Expand Up @@ -3,7 +3,7 @@
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
*
*\author Copyright © 2003-2009 Jaakko Kernen <jaakko.keranen@iki.fi>
*\author Copyright © 2003-2009 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2006-2009 Daniel Swanson <danij@dengine.net>
*\author Copyright © 2006 Jamie Jones <jamie_jones_au@yahoo.com.au>
*
Expand Down Expand Up @@ -100,7 +100,6 @@ void Sys_Init(void)
// Virtual devices need to be created even in dedicated mode.
I_InitVirtualInputDevices();
Sys_InitTimer();
Sys_InitMixer();
S_Init();
Huff_Init();
N_Init();
Expand Down Expand Up @@ -137,7 +136,6 @@ void Sys_Shutdown(void)
// Let's shut down sound first, so Windows' HD-hogging doesn't jam
// the MUS player (would produce horrible bursts of notes).
S_Shutdown();
Sys_ShutdownMixer();
GL_Shutdown();
DD_ClearEvents();
I_ShutdownInputDevices();
Expand Down
87 changes: 0 additions & 87 deletions doomsday/engine/unix/src/sys_mixer.c

This file was deleted.

0 comments on commit 4dcfc9d

Please sign in to comment.