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
b3523a44
Commit
b3523a44
authored
May 17, 2010
by
Owen Rudge
Committed by
Alexandre Julliard
May 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Implement D3DXCreateEffectCompilerFromFile/Resource.
parent
943eefc8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
101 additions
and
4 deletions
+101
-4
d3dx9_36.spec
dlls/d3dx9_36/d3dx9_36.spec
+4
-4
effect.c
dlls/d3dx9_36/effect.c
+97
-0
No files found.
dlls/d3dx9_36/d3dx9_36.spec
View file @
b3523a44
...
...
@@ -48,10 +48,10 @@
@ stub D3DXCreateCylinder
@ stdcall D3DXCreateEffect(ptr ptr long ptr ptr long ptr ptr ptr)
@ stdcall D3DXCreateEffectCompiler(ptr long ptr ptr long ptr ptr)
@ st
ub D3DXCreateEffectCompilerFromFileA
@ st
ub D3DXCreateEffectCompilerFromFileW
@ st
ub D3DXCreateEffectCompilerFromResourceA
@ st
ub D3DXCreateEffectCompilerFromResourceW
@ st
dcall D3DXCreateEffectCompilerFromFileA(str ptr ptr long ptr ptr)
@ st
dcall D3DXCreateEffectCompilerFromFileW(wstr ptr ptr long ptr ptr)
@ st
dcall D3DXCreateEffectCompilerFromResourceA(long str ptr ptr long ptr ptr)
@ st
dcall D3DXCreateEffectCompilerFromResourceW(long wstr ptr ptr long ptr ptr)
@ stdcall D3DXCreateEffectEx(ptr ptr long ptr ptr ptr long ptr ptr ptr)
@ stub D3DXCreateEffectFromFileA
@ stub D3DXCreateEffectFromFileExA
...
...
dlls/d3dx9_36/effect.c
View file @
b3523a44
...
...
@@ -998,3 +998,100 @@ HRESULT WINAPI D3DXCreateEffectPool(LPD3DXEFFECTPOOL* pool)
return
S_OK
;
}
HRESULT
WINAPI
D3DXCreateEffectCompilerFromFileW
(
LPCWSTR
srcfile
,
const
D3DXMACRO
*
defines
,
LPD3DXINCLUDE
include
,
DWORD
flags
,
LPD3DXEFFECTCOMPILER
*
effectcompiler
,
LPD3DXBUFFER
*
parseerrors
)
{
LPVOID
buffer
;
HRESULT
ret
;
DWORD
size
;
TRACE
(
"(%s): relay
\n
"
,
debugstr_w
(
srcfile
));
if
(
!
srcfile
||
!
defines
)
return
D3DERR_INVALIDCALL
;
ret
=
map_view_of_file
(
srcfile
,
&
buffer
,
&
size
);
if
(
FAILED
(
ret
))
return
D3DXERR_INVALIDDATA
;
ret
=
D3DXCreateEffectCompiler
(
buffer
,
size
,
defines
,
include
,
flags
,
effectcompiler
,
parseerrors
);
UnmapViewOfFile
(
buffer
);
return
ret
;
}
HRESULT
WINAPI
D3DXCreateEffectCompilerFromFileA
(
LPCSTR
srcfile
,
const
D3DXMACRO
*
defines
,
LPD3DXINCLUDE
include
,
DWORD
flags
,
LPD3DXEFFECTCOMPILER
*
effectcompiler
,
LPD3DXBUFFER
*
parseerrors
)
{
LPWSTR
srcfileW
;
HRESULT
ret
;
DWORD
len
;
TRACE
(
"(void): relay
\n
"
);
if
(
!
srcfile
||
!
defines
)
return
D3DERR_INVALIDCALL
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
srcfile
,
-
1
,
NULL
,
0
);
srcfileW
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
srcfile
,
-
1
,
srcfileW
,
len
);
ret
=
D3DXCreateEffectCompilerFromFileW
(
srcfileW
,
defines
,
include
,
flags
,
effectcompiler
,
parseerrors
);
HeapFree
(
GetProcessHeap
(),
0
,
srcfileW
);
return
ret
;
}
HRESULT
WINAPI
D3DXCreateEffectCompilerFromResourceA
(
HMODULE
srcmodule
,
LPCSTR
srcresource
,
const
D3DXMACRO
*
defines
,
LPD3DXINCLUDE
include
,
DWORD
flags
,
LPD3DXEFFECTCOMPILER
*
effectcompiler
,
LPD3DXBUFFER
*
parseerrors
)
{
HRSRC
resinfo
;
TRACE
(
"(%p, %s): relay
\n
"
,
srcmodule
,
debugstr_a
(
srcresource
));
resinfo
=
FindResourceA
(
srcmodule
,
srcresource
,
(
LPCSTR
)
RT_RCDATA
);
if
(
resinfo
)
{
LPVOID
buffer
;
HRESULT
ret
;
DWORD
size
;
ret
=
load_resource_into_memory
(
srcmodule
,
resinfo
,
&
buffer
,
&
size
);
if
(
FAILED
(
ret
))
return
D3DXERR_INVALIDDATA
;
return
D3DXCreateEffectCompiler
(
buffer
,
size
,
defines
,
include
,
flags
,
effectcompiler
,
parseerrors
);
}
return
D3DXERR_INVALIDDATA
;
}
HRESULT
WINAPI
D3DXCreateEffectCompilerFromResourceW
(
HMODULE
srcmodule
,
LPCWSTR
srcresource
,
const
D3DXMACRO
*
defines
,
LPD3DXINCLUDE
include
,
DWORD
flags
,
LPD3DXEFFECTCOMPILER
*
effectcompiler
,
LPD3DXBUFFER
*
parseerrors
)
{
HRSRC
resinfo
;
TRACE
(
"(%p, %s): relay
\n
"
,
srcmodule
,
debugstr_w
(
srcresource
));
resinfo
=
FindResourceW
(
srcmodule
,
srcresource
,
(
LPCWSTR
)
RT_RCDATA
);
if
(
resinfo
)
{
LPVOID
buffer
;
HRESULT
ret
;
DWORD
size
;
ret
=
load_resource_into_memory
(
srcmodule
,
resinfo
,
&
buffer
,
&
size
);
if
(
FAILED
(
ret
))
return
D3DXERR_INVALIDDATA
;
return
D3DXCreateEffectCompiler
(
buffer
,
size
,
defines
,
include
,
flags
,
effectcompiler
,
parseerrors
);
}
return
D3DXERR_INVALIDDATA
;
}
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