Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
53b5a474
Commit
53b5a474
authored
Mar 05, 2003
by
Rok Mandeljc
Committed by
Alexandre Julliard
Mar 05, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed some stuff so distance attenuation works for both 3d
processing modes.
parent
d04ccb8e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
14 deletions
+18
-14
sound3d.c
dlls/dsound/sound3d.c
+18
-14
No files found.
dlls/dsound/sound3d.c
View file @
53b5a474
...
...
@@ -174,16 +174,30 @@ static void WINAPI DSOUND_Mix3DBuffer(IDirectSound3DBufferImpl *ds3db)
dsl
=
ds3db
->
dsb
->
dsound
->
listener
;
/* FIXME: i guess initial volume should be that, but if it's set, sounds get too quiet */
/* FIXME: i guess initial volume should be that, but if it's set, sounds get too quiet.
It makes sense, though: at min. distance we hear sound with practically no
attuneation. If someone has idea, please do it.*/
/* lVolume = ds3db->lVolume; */
switch
(
ds3db
->
ds3db
.
dwMode
)
{
case
DS3DMODE_DISABLE
:
TRACE
(
"3D processing disabled
\n
"
);
DSOUND_RecalcVolPan
(
&
ds3db
->
dsb
->
volpan
);
DSOUND_ForceRemix
(
ds3db
->
dsb
);
break
;
case
DS3DMODE_NORMAL
:
{
/*
distance attuneation stuff
*/
TRACE
(
"Normal 3D processing mode
\n
"
);
/*
we need to calculate distance between buffer and listener
*/
vDistance
=
VectorBetweenTwoPoints
(
&
ds3db
->
ds3db
.
vPosition
,
&
dsl
->
ds3dl
.
vPosition
);
flDistance
=
VectorMagnitude
(
&
vDistance
);
break
;
case
DS3DMODE_HEADRELATIVE
:
TRACE
(
"Head-relative 3D processing mode
\n
"
);
/* distance between buffer and listener is same as buffer's position */
flDistance
=
VectorMagnitude
(
&
ds3db
->
ds3db
.
vPosition
);
break
;
}
if
(
flDistance
>
ds3db
->
ds3db
.
flMaxDistance
)
{
...
...
@@ -198,9 +212,9 @@ static void WINAPI DSOUND_Mix3DBuffer(IDirectSound3DBufferImpl *ds3db)
else
flDistance
=
ds3db
->
ds3db
.
flMaxDistance
;
}
if
(
flDistance
<
ds3db
->
ds3db
.
flMinDistance
)
flDistance
=
ds3db
->
ds3db
.
flMinDistance
;
/* the following formula is taken from my physics book. I think it's ok for the *real* world...i hope m$ does it that way */
lVolume
+=
10000
;
/* ms likes working with negative volume...i don't */
lVolume
/=
1000
;
/* convert hundreths of dB into B */
...
...
@@ -212,21 +226,11 @@ static void WINAPI DSOUND_Mix3DBuffer(IDirectSound3DBufferImpl *ds3db)
lVolume
*=
1000
;
/* convert back to hundreths of dB */
lVolume
-=
10000
;
/* we need to do it in ms way */
TRACE
(
"dist. att: Distance = %f, MinDistance = %f => adjusting volume %ld to %ld
\n
"
,
flDistance
,
ds3db
->
ds3db
.
flMinDistance
,
ds3db
->
lVolume
,
lVolume
);
/* add correct conning here */
/* at last, we got the desired volume */
ds3db
->
dsb
->
volpan
.
lVolume
=
lVolume
;
DSOUND_RecalcVolPan
(
&
ds3db
->
dsb
->
volpan
);
DSOUND_ForceRemix
(
ds3db
->
dsb
);
break
;
}
case
DS3DMODE_HEADRELATIVE
:
case
DS3DMODE_DISABLE
:
DSOUND_RecalcVolPan
(
&
ds3db
->
dsb
->
volpan
);
DSOUND_ForceRemix
(
ds3db
->
dsb
);
break
;
}
}
static
void
WINAPI
DSOUND_ChangeListener
(
IDirectSound3DListenerImpl
*
ds3dl
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment