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
1c73ce1e
Commit
1c73ce1e
authored
Feb 02, 2015
by
Mark Harmstone
Committed by
Alexandre Julliard
Feb 03, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Fix 3D positioning bug with head-relative buffers.
parent
530a039d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
sound3d.c
dlls/dsound/sound3d.c
+11
-8
No files found.
dlls/dsound/sound3d.c
View file @
1c73ce1e
...
@@ -181,13 +181,14 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb)
...
@@ -181,13 +181,14 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb)
case
DS3DMODE_NORMAL
:
case
DS3DMODE_NORMAL
:
TRACE
(
"Normal 3D processing mode
\n
"
);
TRACE
(
"Normal 3D processing mode
\n
"
);
/* we need to calculate distance between buffer and listener*/
/* we need to calculate distance between buffer and listener*/
vDistance
=
VectorBetweenTwoPoints
(
&
dsb
->
d
s3db_ds3db
.
vPosition
,
&
dsb
->
device
->
ds3dl
.
vPosition
);
vDistance
=
VectorBetweenTwoPoints
(
&
dsb
->
d
evice
->
ds3dl
.
vPosition
,
&
dsb
->
ds3db_ds3db
.
vPosition
);
flDistance
=
VectorMagnitude
(
&
vDistance
);
flDistance
=
VectorMagnitude
(
&
vDistance
);
break
;
break
;
case
DS3DMODE_HEADRELATIVE
:
case
DS3DMODE_HEADRELATIVE
:
TRACE
(
"Head-relative 3D processing mode
\n
"
);
TRACE
(
"Head-relative 3D processing mode
\n
"
);
/* distance between buffer and listener is same as buffer's position */
/* distance between buffer and listener is same as buffer's position */
flDistance
=
VectorMagnitude
(
&
dsb
->
ds3db_ds3db
.
vPosition
);
vDistance
=
dsb
->
ds3db_ds3db
.
vPosition
;
flDistance
=
VectorMagnitude
(
&
vDistance
);
break
;
break
;
}
}
...
@@ -220,8 +221,14 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb)
...
@@ -220,8 +221,14 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb)
}
}
else
else
{
{
D3DVECTOR
vDistanceInv
;
vDistanceInv
.
x
=
-
vDistance
.
x
;
vDistanceInv
.
y
=
-
vDistance
.
y
;
vDistanceInv
.
z
=
-
vDistance
.
z
;
/* calculate angle */
/* calculate angle */
flAngle
=
AngleBetweenVectorsDeg
(
&
dsb
->
ds3db_ds3db
.
vConeOrientation
,
&
vDistance
);
flAngle
=
AngleBetweenVectorsDeg
(
&
dsb
->
ds3db_ds3db
.
vConeOrientation
,
&
vDistance
Inv
);
/* if by any chance it happens that OutsideConeAngle = InsideConeAngle (that means that conning has no effect) */
/* if by any chance it happens that OutsideConeAngle = InsideConeAngle (that means that conning has no effect) */
if
(
dsb
->
ds3db_ds3db
.
dwInsideConeAngle
!=
dsb
->
ds3db_ds3db
.
dwOutsideConeAngle
)
if
(
dsb
->
ds3db_ds3db
.
dwInsideConeAngle
!=
dsb
->
ds3db_ds3db
.
dwOutsideConeAngle
)
{
{
...
@@ -254,14 +261,10 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb)
...
@@ -254,14 +261,10 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb)
}
}
/* panning */
/* panning */
if
(
dsb
->
device
->
ds3dl
.
vPosition
.
x
==
dsb
->
ds3db_ds3db
.
vPosition
.
x
&&
if
(
vDistance
.
x
==
0
.
0
f
&&
vDistance
.
y
==
0
.
0
f
&&
vDistance
.
z
==
0
.
0
f
)
dsb
->
device
->
ds3dl
.
vPosition
.
y
==
dsb
->
ds3db_ds3db
.
vPosition
.
y
&&
dsb
->
device
->
ds3dl
.
vPosition
.
z
==
dsb
->
ds3db_ds3db
.
vPosition
.
z
)
{
flAngle
=
0
.
0
;
flAngle
=
0
.
0
;
}
else
else
{
{
vDistance
=
VectorBetweenTwoPoints
(
&
dsb
->
device
->
ds3dl
.
vPosition
,
&
dsb
->
ds3db_ds3db
.
vPosition
);
vLeft
=
VectorProduct
(
&
dsb
->
device
->
ds3dl
.
vOrientFront
,
&
dsb
->
device
->
ds3dl
.
vOrientTop
);
vLeft
=
VectorProduct
(
&
dsb
->
device
->
ds3dl
.
vOrientFront
,
&
dsb
->
device
->
ds3dl
.
vOrientTop
);
flAngle
=
AngleBetweenVectorsRad
(
&
dsb
->
device
->
ds3dl
.
vOrientFront
,
&
vDistance
);
flAngle
=
AngleBetweenVectorsRad
(
&
dsb
->
device
->
ds3dl
.
vOrientFront
,
&
vDistance
);
flAngle2
=
AngleBetweenVectorsRad
(
&
vLeft
,
&
vDistance
);
flAngle2
=
AngleBetweenVectorsRad
(
&
vLeft
,
&
vDistance
);
...
...
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