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
c5f38756
Commit
c5f38756
authored
Nov 30, 2002
by
Lionel Ulmer
Committed by
Alexandre Julliard
Nov 30, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- actually use the VertexBuffer stubs
- implement Lock function to prevent crash when the stubs are used
parent
f4b941e8
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
78 additions
and
8 deletions
+78
-8
d3d_private.h
dlls/ddraw/d3d_private.h
+3
-0
mesa.c
dlls/ddraw/d3ddevice/mesa.c
+19
-2
d3dvertexbuffer.c
dlls/ddraw/d3dvertexbuffer.c
+26
-3
mesa.c
dlls/ddraw/direct3d/mesa.c
+20
-1
helper.c
dlls/ddraw/helper.c
+3
-1
mesa_private.h
dlls/ddraw/mesa_private.h
+5
-1
ddraw.h
include/ddraw.h
+2
-0
No files found.
dlls/ddraw/d3d_private.h
View file @
c5f38756
...
...
@@ -194,6 +194,9 @@ struct IDirect3DVertexBufferImpl
ICOM_VFIELD_MULTI
(
IDirect3DVertexBuffer
);
DWORD
ref
;
IDirect3DImpl
*
d3d
;
D3DVERTEXBUFFERDESC
desc
;
LPVOID
*
vertices
;
DWORD
vertex_buffer_size
;
};
/* Various dump functions */
...
...
dlls/ddraw/d3ddevice/mesa.c
View file @
c5f38756
...
...
@@ -241,7 +241,7 @@ static void fill_opengl_caps_7(D3DDEVICEDESC7 *d)
d
->
dvMaxVertexW
=
100000000
.
0
;
/* No idea exactly what to put here... */
d
->
deviceGUID
=
IID_IDirect3DTnLHalDevice
;
d
->
wMaxUserClipPlanes
=
1
;
d
->
wMaxVertexBlendMatrices
=
1
;
d
->
wMaxVertexBlendMatrices
=
0
;
d
->
dwVertexProcessingCaps
=
D3DVTXPCAPS_TEXGEN
|
D3DVTXPCAPS_MATERIALSOURCE7
|
D3DVTXPCAPS_VERTEXFOG
|
D3DVTXPCAPS_DIRECTIONALLIGHTS
|
D3DVTXPCAPS_POSITIONALLIGHTS
|
D3DVTXPCAPS_LOCALVIEWER
;
d
->
dwReserved1
=
0
;
...
...
@@ -883,7 +883,24 @@ GL_IDirect3DDeviceImpl_1_CreateExecuteBuffer(LPDIRECT3DDEVICE iface,
return
ret_value
;
}
static
void
dump_flexible_vertex
(
DWORD
d3dvtVertexType
)
DWORD
get_flexible_vertex_size
(
DWORD
d3dvtVertexType
)
{
DWORD
size
=
0
;
if
(
d3dvtVertexType
&
D3DFVF_NORMAL
)
size
+=
3
*
sizeof
(
D3DVALUE
);
if
(
d3dvtVertexType
&
D3DFVF_DIFFUSE
)
size
+=
sizeof
(
DWORD
);
if
(
d3dvtVertexType
&
D3DFVF_SPECULAR
)
size
+=
sizeof
(
DWORD
);
switch
(
d3dvtVertexType
&
D3DFVF_POSITION_MASK
)
{
case
D3DFVF_XYZ
:
size
+=
3
*
sizeof
(
D3DVALUE
);
break
;
case
D3DFVF_XYZRHW
:
size
+=
4
*
sizeof
(
D3DVALUE
);
break
;
default:
TRACE
(
" matrix weighting not handled yet...
\n
"
);
}
size
+=
2
*
sizeof
(
D3DVALUE
)
*
((
d3dvtVertexType
&
D3DFVF_TEXCOUNT_MASK
)
>>
D3DFVF_TEXCOUNT_SHIFT
);
return
size
;
}
void
dump_flexible_vertex
(
DWORD
d3dvtVertexType
)
{
static
const
flag_info
flags
[]
=
{
FE
(
D3DFVF_NORMAL
),
...
...
dlls/ddraw/d3dvertexbuffer.c
View file @
c5f38756
...
...
@@ -91,7 +91,16 @@ Main_IDirect3DVertexBufferImpl_7_1T_Lock(LPDIRECT3DVERTEXBUFFER7 iface,
LPDWORD
lpdwSize
)
{
ICOM_THIS_FROM
(
IDirect3DVertexBufferImpl
,
IDirect3DVertexBuffer7
,
iface
);
FIXME
(
"(%p/%p)->(%08lx,%p,%p): stub!
\n
"
,
This
,
iface
,
dwFlags
,
lplpData
,
lpdwSize
);
TRACE
(
"(%p/%p)->(%08lx,%p,%p)
\n
"
,
This
,
iface
,
dwFlags
,
lplpData
,
lpdwSize
);
if
(
TRACE_ON
(
ddraw
))
{
TRACE
(
" lock flags : "
);
DDRAW_dump_lockflag
(
dwFlags
);
}
if
(
lpdwSize
!=
NULL
)
*
lpdwSize
=
This
->
vertex_buffer_size
;
*
lplpData
=
This
->
vertices
;
return
DD_OK
;
}
...
...
@@ -279,22 +288,36 @@ ICOM_VTABLE(IDirect3DVertexBuffer) VTABLE_IDirect3DVertexBuffer =
#undef XCAST
#endif
HRESULT
d3dvertexbuffer_create
(
IDirect3DVertexBufferImpl
**
obj
,
IDirect3DImpl
*
d3d
,
LPD3DVERTEXBUFFERDESC
lpD3DVertBufDesc
)
HRESULT
d3dvertexbuffer_create
(
IDirect3DVertexBufferImpl
**
obj
,
IDirect3DImpl
*
d3d
,
LPD3DVERTEXBUFFERDESC
lpD3DVertBufDesc
,
DWORD
dwFlags
)
{
IDirect3DVertexBufferImpl
*
object
;
static
const
flag_info
flags
[]
=
{
FE
(
D3DVBCAPS_OPTIMIZED
),
FE
(
D3DVBCAPS_SYSTEMMEMORY
),
FE
(
D3DVBCAPS_WRITEONLY
)
};
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirect3DVertexBufferImpl
));
if
(
object
==
NULL
)
return
DDERR_OUTOFMEMORY
;
object
->
ref
=
1
;
object
->
d3d
=
d3d
;
object
->
desc
=
*
lpD3DVertBufDesc
;
object
->
vertex_buffer_size
=
get_flexible_vertex_size
(
lpD3DVertBufDesc
->
dwFVF
)
*
lpD3DVertBufDesc
->
dwNumVertices
;
object
->
vertices
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
object
->
vertex_buffer_size
);
ICOM_INIT_INTERFACE
(
object
,
IDirect3DVertexBuffer
,
VTABLE_IDirect3DVertexBuffer
);
ICOM_INIT_INTERFACE
(
object
,
IDirect3DVertexBuffer7
,
VTABLE_IDirect3DVertexBuffer7
);
*
obj
=
object
;
TRACE
(
" creating implementation at %p.
\n
"
,
*
obj
);
if
(
TRACE_ON
(
ddraw
))
{
TRACE
(
" creating implementation at %p with description :
\n
"
,
*
obj
);
TRACE
(
" - "
);
DDRAW_dump_flags_
(
lpD3DVertBufDesc
->
dwCaps
,
flags
,
sizeof
(
flags
)
/
sizeof
(
flags
[
0
]),
TRUE
);
TRACE
(
" - "
);
dump_flexible_vertex
(
lpD3DVertBufDesc
->
dwFVF
);
TRACE
(
" - %ld
\n
"
,
lpD3DVertBufDesc
->
dwNumVertices
);
}
return
D3D_OK
;
}
dlls/ddraw/direct3d/mesa.c
View file @
c5f38756
...
...
@@ -320,6 +320,25 @@ GL_IDirect3DImpl_7_CreateDevice(LPDIRECT3D7 iface,
return
create_device_helper
(
This
,
rclsid
,
ddsurfaceimpl
,
(
void
**
)
lplpD3DDevice
,
7
);
}
HRESULT
WINAPI
GL_IDirect3DImpl_7_3T_CreateVertexBuffer
(
LPDIRECT3D7
iface
,
LPD3DVERTEXBUFFERDESC
lpD3DVertBufDesc
,
LPDIRECT3DVERTEXBUFFER7
*
lplpD3DVertBuf
,
DWORD
dwFlags
)
{
ICOM_THIS_FROM
(
IDirect3DImpl
,
IDirect3D7
,
iface
);
IDirect3DVertexBufferImpl
*
vbimpl
;
HRESULT
res
;
TRACE
(
"(%p/%p)->(%p,%p,%08lx)
\n
"
,
This
,
iface
,
lpD3DVertBufDesc
,
lplpD3DVertBuf
,
dwFlags
);
res
=
d3dvertexbuffer_create
(
&
vbimpl
,
This
,
lpD3DVertBufDesc
,
dwFlags
);
*
lplpD3DVertBuf
=
ICOM_INTERFACE
(
vbimpl
,
IDirect3DVertexBuffer7
);
return
res
;
}
static
void
light_released
(
IDirect3DImpl
*
This
,
GLenum
light_num
)
{
IDirect3DGLImpl
*
glThis
=
(
IDirect3DGLImpl
*
)
This
;
...
...
@@ -340,7 +359,7 @@ ICOM_VTABLE(IDirect3D7) VTABLE_IDirect3D7 =
XCAST
(
Release
)
Main_IDirect3DImpl_7_3T_2T_1T_Release
,
XCAST
(
EnumDevices
)
GL_IDirect3DImpl_7_EnumDevices
,
XCAST
(
CreateDevice
)
GL_IDirect3DImpl_7_CreateDevice
,
XCAST
(
CreateVertexBuffer
)
Main
_IDirect3DImpl_7_3T_CreateVertexBuffer
,
XCAST
(
CreateVertexBuffer
)
GL
_IDirect3DImpl_7_3T_CreateVertexBuffer
,
XCAST
(
EnumZBufferFormats
)
GL_IDirect3DImpl_7_3T_EnumZBufferFormats
,
XCAST
(
EvictManagedTextures
)
Main_IDirect3DImpl_7_3T_EvictManagedTextures
,
};
...
...
dlls/ddraw/helper.c
View file @
c5f38756
...
...
@@ -315,7 +315,9 @@ void DDRAW_dump_lockflag(DWORD lockflag)
FE
(
DDLOCK_EVENT
),
FE
(
DDLOCK_READONLY
),
FE
(
DDLOCK_WRITEONLY
),
FE
(
DDLOCK_NOSYSLOCK
)
FE
(
DDLOCK_NOSYSLOCK
),
FE
(
DDLOCK_DISCARDCONTENTS
),
FE
(
DDLOCK_NOOVERWRITE
)
};
DDRAW_dump_flags
(
lockflag
,
flags
,
sizeof
(
flags
)
/
sizeof
(
flags
[
0
]));
...
...
dlls/ddraw/mesa_private.h
View file @
c5f38756
...
...
@@ -119,7 +119,7 @@ extern HRESULT d3dlight_create(IDirect3DLightImpl **obj, IDirect3DImpl *d3d, GLe
extern
HRESULT
d3dexecutebuffer_create
(
IDirect3DExecuteBufferImpl
**
obj
,
IDirect3DImpl
*
d3d
,
IDirect3DDeviceImpl
*
d3ddev
,
LPD3DEXECUTEBUFFERDESC
lpDesc
);
extern
HRESULT
d3dmaterial_create
(
IDirect3DMaterialImpl
**
obj
,
IDirect3DImpl
*
d3d
);
extern
HRESULT
d3dviewport_create
(
IDirect3DViewportImpl
**
obj
,
IDirect3DImpl
*
d3d
);
extern
HRESULT
d3dvertexbuffer_create
(
IDirect3DVertexBufferImpl
**
obj
,
IDirect3DImpl
*
d3d
,
LPD3DVERTEXBUFFERDESC
lpD3DVertBufDesc
);
extern
HRESULT
d3dvertexbuffer_create
(
IDirect3DVertexBufferImpl
**
obj
,
IDirect3DImpl
*
d3d
,
LPD3DVERTEXBUFFERDESC
lpD3DVertBufDesc
,
DWORD
dwFlags
);
extern
HRESULT
d3ddevice_create
(
IDirect3DDeviceImpl
**
obj
,
IDirect3DImpl
*
d3d
,
IDirectDrawSurfaceImpl
*
surface
);
/* Used for Direct3D to request the device to enumerate itself */
...
...
@@ -127,6 +127,10 @@ extern HRESULT d3ddevice_enumerate(LPD3DENUMDEVICESCALLBACK cb, LPVOID context,
extern
HRESULT
d3ddevice_enumerate7
(
LPD3DENUMDEVICESCALLBACK7
cb
,
LPVOID
context
)
;
extern
HRESULT
d3ddevice_find
(
IDirect3DImpl
*
d3d
,
LPD3DFINDDEVICESEARCH
lpD3DDFS
,
LPD3DFINDDEVICERESULT
lplpD3DDevice
,
DWORD
interface_version
);
/* Some helper functions.. Would need to put them in a better place */
extern
void
dump_flexible_vertex
(
DWORD
d3dvtVertexType
);
extern
DWORD
get_flexible_vertex_size
(
DWORD
d3dvtVertexType
);
/* Matrix copy WITH transposition */
#define conv_mat2(mat,gl_mat) \
{ \
...
...
include/ddraw.h
View file @
c5f38756
...
...
@@ -1319,6 +1319,8 @@ ICOM_DEFINE(IDirectDraw,IUnknown)
#define DDLOCK_READONLY 0x00000010
#define DDLOCK_WRITEONLY 0x00000020
#define DDLOCK_NOSYSLOCK 0x00000800
#define DDLOCK_NOOVERWRITE 0x00001000
#define DDLOCK_DISCARDCONTENTS 0x00002000
/*****************************************************************************
...
...
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