Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
71f923a6
Commit
71f923a6
authored
Jan 16, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jan 17, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Improve drawStridedSlow a bit.
parent
8137c094
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
80 deletions
+43
-80
drawprim.c
dlls/wined3d/drawprim.c
+43
-80
No files found.
dlls/wined3d/drawprim.c
View file @
71f923a6
...
@@ -615,9 +615,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
...
@@ -615,9 +615,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
const
long
*
pIdxBufL
=
NULL
;
const
long
*
pIdxBufL
=
NULL
;
LONG
vx_index
;
LONG
vx_index
;
float
x
=
0
.
0
f
,
y
=
0
.
0
f
,
z
=
0
.
0
f
;
/* x,y,z coordinates */
float
x
=
0
.
0
f
,
y
=
0
.
0
f
,
z
=
0
.
0
f
;
/* x,y,z coordinates */
float
nx
=
0
.
0
f
,
ny
=
0
.
0
,
nz
=
0
.
0
f
;
/* normal x,y,z coordinates */
float
rhw
=
0
.
0
f
;
/* rhw */
float
rhw
=
0
.
0
f
;
/* rhw */
float
ptSize
=
0
.
0
f
;
/* Point size */
DWORD
diffuseColor
=
0xFFFFFFFF
;
/* Diffuse Color */
DWORD
diffuseColor
=
0xFFFFFFFF
;
/* Diffuse Color */
DWORD
specularColor
=
0
;
/* Specular Color */
DWORD
specularColor
=
0
;
/* Specular Color */
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
...
@@ -635,6 +633,19 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
...
@@ -635,6 +633,19 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
VTRACE
((
"glBegin(%x)
\n
"
,
glPrimType
));
VTRACE
((
"glBegin(%x)
\n
"
,
glPrimType
));
glBegin
(
glPrimType
);
glBegin
(
glPrimType
);
/* Default settings for data that is not passed */
if
(
sd
->
u
.
s
.
normal
.
lpData
==
NULL
)
{
glNormal3f
(
0
,
0
,
1
);
}
if
(
sd
->
u
.
s
.
diffuse
.
lpData
!=
NULL
)
{
glColor4f
(
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
);
}
if
(
sd
->
u
.
s
.
specular
.
lpData
!=
NULL
)
{
if
(
GL_SUPPORT
(
EXT_SECONDARY_COLOR
))
{
GL_EXTCALL
(
glSecondaryColor3fEXT
)(
0
,
0
,
0
);
}
}
/* We shouldn't start this function if any VBO is involved. Should I put a safety check here?
/* We shouldn't start this function if any VBO is involved. Should I put a safety check here?
* Guess it's not necessary(we crash then anyway) and would only eat CPU time
* Guess it's not necessary(we crash then anyway) and would only eat CPU time
*/
*/
...
@@ -645,6 +656,10 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
...
@@ -645,6 +656,10 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
/* Initialize diffuse color */
/* Initialize diffuse color */
diffuseColor
=
0xFFFFFFFF
;
diffuseColor
=
0xFFFFFFFF
;
/* Blending data and Point sizes are not supported by this function. They are not supported by the fixed
* function pipeline at all. A Fixme for them is printed after decoding the vertex declaration
*/
/* For indexed data, we need to go a few more strides in */
/* For indexed data, we need to go a few more strides in */
if
(
idxData
!=
NULL
)
{
if
(
idxData
!=
NULL
)
{
...
@@ -658,68 +673,6 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
...
@@ -658,68 +673,6 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
}
}
}
}
/* Position Information ------------------ */
if
(
sd
->
u
.
s
.
position
.
lpData
!=
NULL
)
{
float
*
ptrToCoords
=
(
float
*
)(
sd
->
u
.
s
.
position
.
lpData
+
(
SkipnStrides
*
sd
->
u
.
s
.
position
.
dwStride
));
x
=
ptrToCoords
[
0
];
y
=
ptrToCoords
[
1
];
z
=
ptrToCoords
[
2
];
rhw
=
1
.
0
;
VTRACE
((
"x,y,z=%f,%f,%f
\n
"
,
x
,
y
,
z
));
/* RHW follows, only if transformed, ie 4 floats were provided */
if
(
sd
->
u
.
s
.
position_transformed
)
{
rhw
=
ptrToCoords
[
3
];
VTRACE
((
"rhw=%f
\n
"
,
rhw
));
}
}
/* Blending data -------------------------- */
if
(
sd
->
u
.
s
.
blendWeights
.
lpData
!=
NULL
)
{
/* float *ptrToCoords = (float *)(sd->u.s.blendWeights.lpData + (SkipnStrides * sd->u.s.blendWeights.dwStride)); */
FIXME
(
"Blending not supported yet
\n
"
);
if
(
sd
->
u
.
s
.
blendMatrixIndices
.
lpData
!=
NULL
)
{
/*DWORD *ptrToCoords = (DWORD *)(sd->u.s.blendMatrixIndices.lpData + (SkipnStrides * sd->u.s.blendMatrixIndices.dwStride));*/
}
}
/* Vertex Normal Data (untransformed only)- */
if
(
sd
->
u
.
s
.
normal
.
lpData
!=
NULL
)
{
float
*
ptrToCoords
=
(
float
*
)(
sd
->
u
.
s
.
normal
.
lpData
+
(
SkipnStrides
*
sd
->
u
.
s
.
normal
.
dwStride
));
nx
=
ptrToCoords
[
0
];
ny
=
ptrToCoords
[
1
];
nz
=
ptrToCoords
[
2
];
VTRACE
((
"nx,ny,nz=%f,%f,%f
\n
"
,
nx
,
ny
,
nz
));
}
/* Point Size ----------------------------- */
if
(
sd
->
u
.
s
.
pSize
.
lpData
!=
NULL
)
{
float
*
ptrToCoords
=
(
float
*
)(
sd
->
u
.
s
.
pSize
.
lpData
+
(
SkipnStrides
*
sd
->
u
.
s
.
pSize
.
dwStride
));
ptSize
=
ptrToCoords
[
0
];
VTRACE
((
"ptSize=%f
\n
"
,
ptSize
));
FIXME
(
"No support for ptSize yet
\n
"
);
}
/* Diffuse -------------------------------- */
if
(
sd
->
u
.
s
.
diffuse
.
lpData
!=
NULL
)
{
DWORD
*
ptrToCoords
=
(
DWORD
*
)(
sd
->
u
.
s
.
diffuse
.
lpData
+
(
SkipnStrides
*
sd
->
u
.
s
.
diffuse
.
dwStride
));
diffuseColor
=
ptrToCoords
[
0
];
VTRACE
((
"diffuseColor=%lx
\n
"
,
diffuseColor
));
}
/* Specular -------------------------------- */
if
(
sd
->
u
.
s
.
specular
.
lpData
!=
NULL
)
{
DWORD
*
ptrToCoords
=
(
DWORD
*
)(
sd
->
u
.
s
.
specular
.
lpData
+
(
SkipnStrides
*
sd
->
u
.
s
.
specular
.
dwStride
));
specularColor
=
ptrToCoords
[
0
];
VTRACE
((
"specularColor=%lx
\n
"
,
specularColor
));
}
/* Texture coords --------------------------- */
/* Texture coords --------------------------- */
for
(
textureNo
=
0
,
texture_idx
=
0
;
textureNo
<
GL_LIMITS
(
texture_stages
);
++
textureNo
)
{
for
(
textureNo
=
0
,
texture_idx
=
0
;
textureNo
<
GL_LIMITS
(
texture_stages
);
++
textureNo
)
{
...
@@ -835,7 +788,11 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
...
@@ -835,7 +788,11 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
/* Diffuse -------------------------------- */
/* Diffuse -------------------------------- */
if
(
sd
->
u
.
s
.
diffuse
.
lpData
!=
NULL
)
{
if
(
sd
->
u
.
s
.
diffuse
.
lpData
!=
NULL
)
{
glColor4ub
(
D3DCOLOR_B_R
(
diffuseColor
),
DWORD
*
ptrToCoords
=
(
DWORD
*
)(
sd
->
u
.
s
.
diffuse
.
lpData
+
(
SkipnStrides
*
sd
->
u
.
s
.
diffuse
.
dwStride
));
diffuseColor
=
ptrToCoords
[
0
];
VTRACE
((
"diffuseColor=%lx
\n
"
,
diffuseColor
));
glColor4ub
(
D3DCOLOR_B_R
(
diffuseColor
),
D3DCOLOR_B_G
(
diffuseColor
),
D3DCOLOR_B_G
(
diffuseColor
),
D3DCOLOR_B_B
(
diffuseColor
),
D3DCOLOR_B_B
(
diffuseColor
),
D3DCOLOR_B_A
(
diffuseColor
));
D3DCOLOR_B_A
(
diffuseColor
));
...
@@ -844,12 +801,14 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
...
@@ -844,12 +801,14 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
D3DCOLOR_B_G
(
diffuseColor
),
D3DCOLOR_B_G
(
diffuseColor
),
D3DCOLOR_B_B
(
diffuseColor
),
D3DCOLOR_B_B
(
diffuseColor
),
D3DCOLOR_B_A
(
diffuseColor
)));
D3DCOLOR_B_A
(
diffuseColor
)));
}
else
{
if
(
vx_index
==
0
)
glColor4f
(
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
);
}
}
/* Specular ------------------------------- */
/* Specular ------------------------------- */
if
(
sd
->
u
.
s
.
specular
.
lpData
!=
NULL
)
{
if
(
sd
->
u
.
s
.
specular
.
lpData
!=
NULL
)
{
DWORD
*
ptrToCoords
=
(
DWORD
*
)(
sd
->
u
.
s
.
specular
.
lpData
+
(
SkipnStrides
*
sd
->
u
.
s
.
specular
.
dwStride
));
specularColor
=
ptrToCoords
[
0
];
VTRACE
((
"specularColor=%lx
\n
"
,
specularColor
));
/* special case where the fog density is stored in the diffuse alpha channel */
/* special case where the fog density is stored in the diffuse alpha channel */
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGENABLE
]
&&
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGENABLE
]
&&
(
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGVERTEXMODE
]
==
WINED3DFOG_NONE
||
sd
->
u
.
s
.
position
.
dwType
==
WINED3DDECLTYPE_FLOAT4
)
&&
(
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGVERTEXMODE
]
==
WINED3DFOG_NONE
||
sd
->
u
.
s
.
position
.
dwType
==
WINED3DDECLTYPE_FLOAT4
)
&&
...
@@ -879,27 +838,31 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
...
@@ -879,27 +838,31 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
/* Do not worry if specular colour missing and disable request */
/* Do not worry if specular colour missing and disable request */
VTRACE
((
"Specular color extensions not supplied
\n
"
));
VTRACE
((
"Specular color extensions not supplied
\n
"
));
}
}
}
else
{
if
(
vx_index
==
0
)
{
if
(
GL_SUPPORT
(
EXT_SECONDARY_COLOR
))
{
GL_EXTCALL
(
glSecondaryColor3fEXT
)(
0
,
0
,
0
);
}
else
{
/* Do not worry if specular colour missing and disable request */
VTRACE
((
"Specular color extensions not supplied
\n
"
));
}
}
}
}
/* Normal -------------------------------- */
/* Normal -------------------------------- */
if
(
sd
->
u
.
s
.
normal
.
lpData
!=
NULL
)
{
if
(
sd
->
u
.
s
.
normal
.
lpData
!=
NULL
)
{
VTRACE
((
"glNormal:nx,ny,nz=%f,%f,%f
\n
"
,
nx
,
ny
,
nz
));
float
*
ptrToCoords
=
(
float
*
)(
sd
->
u
.
s
.
normal
.
lpData
+
(
SkipnStrides
*
sd
->
u
.
s
.
normal
.
dwStride
));
glNormal3f
(
nx
,
ny
,
nz
);
}
else
{
VTRACE
((
"glNormal:nx,ny,nz=%f,%f,%f
\n
"
,
ptrToCoords
[
0
],
ptrToCoords
[
1
],
ptrToCoords
[
2
]));
if
(
vx_index
==
0
)
glNormal3f
(
0
,
0
,
1
);
glNormal3f
(
ptrToCoords
[
0
],
ptrToCoords
[
1
],
ptrToCoords
[
2
]
);
}
}
/* Position -------------------------------- */
/* Position -------------------------------- */
if
(
sd
->
u
.
s
.
position
.
lpData
!=
NULL
)
{
if
(
sd
->
u
.
s
.
position
.
lpData
!=
NULL
)
{
float
*
ptrToCoords
=
(
float
*
)(
sd
->
u
.
s
.
position
.
lpData
+
(
SkipnStrides
*
sd
->
u
.
s
.
position
.
dwStride
));
x
=
ptrToCoords
[
0
];
y
=
ptrToCoords
[
1
];
z
=
ptrToCoords
[
2
];
rhw
=
1
.
0
;
VTRACE
((
"x,y,z=%f,%f,%f
\n
"
,
x
,
y
,
z
));
/* RHW follows, only if transformed, ie 4 floats were provided */
if
(
sd
->
u
.
s
.
position_transformed
)
{
rhw
=
ptrToCoords
[
3
];
VTRACE
((
"rhw=%f
\n
"
,
rhw
));
}
if
(
1
.
0
f
==
rhw
||
((
rhw
<
eps
)
&&
(
rhw
>
-
eps
)))
{
if
(
1
.
0
f
==
rhw
||
((
rhw
<
eps
)
&&
(
rhw
>
-
eps
)))
{
VTRACE
((
"Vertex: glVertex:x,y,z=%f,%f,%f
\n
"
,
x
,
y
,
z
));
VTRACE
((
"Vertex: glVertex:x,y,z=%f,%f,%f
\n
"
,
x
,
y
,
z
));
glVertex3f
(
x
,
y
,
z
);
glVertex3f
(
x
,
y
,
z
);
...
...
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