[WINESYNC]: revert wine-staging patchset for d3dx9

This commit is contained in:
Jérôme Gardou 2020-02-01 17:57:23 +01:00 committed by Jérôme Gardou
parent c3ad01e3b2
commit 8cc1ec1b82
61 changed files with 117 additions and 4638 deletions

View file

@ -20,7 +20,7 @@
@ stdcall D3DXComputeBoundingSphere(ptr long long ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -226,7 +226,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -256,7 +256,7 @@
@ stdcall D3DXSHEvalSphericalLight(long ptr float float float float ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -20,7 +20,7 @@
@ stdcall D3DXComputeBoundingSphere(ptr long long ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -226,7 +226,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -256,7 +256,7 @@
@ stdcall D3DXSHEvalSphericalLight(long ptr float float float float ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -230,7 +230,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -260,7 +260,7 @@
@ stdcall D3DXSHEvalSphericalLight(long ptr float float float float ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -230,7 +230,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -260,7 +260,7 @@
@ stdcall D3DXSHEvalSphericalLight(long ptr float float float float ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -230,7 +230,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -265,7 +265,7 @@
@ stdcall D3DXSHEvalSphericalLight(long ptr float float float float ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -230,7 +230,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -265,7 +265,7 @@
@ stdcall D3DXSHEvalSphericalLight(long ptr float float float float ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -230,7 +230,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -265,7 +265,7 @@
@ stdcall D3DXSHEvalSphericalLight(long ptr float float float float ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -227,7 +227,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -262,7 +262,7 @@
@ stdcall D3DXSHEvalSphericalLight(long ptr float float float float ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -227,7 +227,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -267,7 +267,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -227,7 +227,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -267,7 +267,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -227,7 +227,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -267,7 +267,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -227,7 +227,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -267,7 +267,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -35,7 +35,7 @@ function(add_d3dx9_target __version)
set_module_type(${module} win32dll)
add_dependencies(${module} d3d_idl_headers)
target_link_libraries(${module} dxguid wine)
add_importlibs(${module} d3dcompiler_43 d3dxof d3dwine user32 ole32 gdi32 msvcrt kernel32 ntdll)
add_importlibs(${module} d3dcompiler_43 d3dxof user32 ole32 gdi32 msvcrt kernel32 ntdll)
add_delay_importlibs(${module} windowscodecs)
add_pch(${module} ../d3dx9_36/precomp.h SOURCE)
add_cd_file(TARGET ${module} DESTINATION reactos/system32 FOR all)

View file

@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -229,7 +229,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -269,7 +269,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -125,8 +125,6 @@ HRESULT lock_surface(IDirect3DSurface9 *surface, D3DLOCKED_RECT *lock,
IDirect3DSurface9 **temp_surface, BOOL write) DECLSPEC_HIDDEN;
HRESULT unlock_surface(IDirect3DSurface9 *surface, D3DLOCKED_RECT *lock,
IDirect3DSurface9 *temp_surface, BOOL update) DECLSPEC_HIDDEN;
HRESULT save_dds_texture_to_memory(ID3DXBuffer **dst_buffer, IDirect3DBaseTexture9 *src_texture,
const PALETTEENTRY *src_palette) DECLSPEC_HIDDEN;
unsigned short float_32_to_16(const float in) DECLSPEC_HIDDEN;
float float_16_to_32(const unsigned short in) DECLSPEC_HIDDEN;
@ -410,6 +408,4 @@ struct ctab_constant {
const struct ctab_constant *d3dx_shader_get_ctab_constant(ID3DXConstantTable *iface,
D3DXHANDLE constant) DECLSPEC_HIDDEN;
HRESULT create_dummy_skin(ID3DXSkinInfo **iface) DECLSPEC_HIDDEN;
#endif /* __WINE_D3DX9_PRIVATE_H */

View file

@ -4511,9 +4511,7 @@ static HRESULT WINAPI ID3DXEffectImpl_CloneEffect(ID3DXEffect *iface,
if (!device)
return D3DERR_INVALIDCALL;
iface->lpVtbl->AddRef(iface);
*effect = iface;
return S_OK;
return E_NOTIMPL;
}
#if D3DX_SDK_VERSION >= 27

View file

@ -35,29 +35,8 @@ struct d3dx_font
HDC hdc;
HFONT hfont;
UINT tex_width;
UINT tex_height;
IDirect3DTexture9 *texture;
HBITMAP bitmap;
BYTE *bits;
};
/* Returns the smallest power of 2 which is greater than or equal to num */
static UINT make_pow2(UINT num)
{
UINT result = 1;
/* In the unlikely event somebody passes a large value, make sure we don't enter an infinite loop */
if (num >= 0x80000000)
return 0x80000000;
while (result < num)
result <<= 1;
return result;
}
static inline struct d3dx_font *impl_from_ID3DXFont(ID3DXFont *iface)
{
return CONTAINING_RECORD(iface, struct d3dx_font, ID3DXFont_iface);
@ -84,27 +63,19 @@ static HRESULT WINAPI ID3DXFontImpl_QueryInterface(ID3DXFont *iface, REFIID riid
static ULONG WINAPI ID3DXFontImpl_AddRef(ID3DXFont *iface)
{
struct d3dx_font *This = impl_from_ID3DXFont(iface);
ULONG ref = InterlockedIncrement(&This->ref);
ULONG ref=InterlockedIncrement(&This->ref);
TRACE("%p increasing refcount to %u\n", iface, ref);
return ref;
}
static ULONG WINAPI ID3DXFontImpl_Release(ID3DXFont *iface)
{
struct d3dx_font *This = impl_from_ID3DXFont(iface);
ULONG ref = InterlockedDecrement(&This->ref);
ULONG ref=InterlockedDecrement(&This->ref);
TRACE("%p decreasing refcount to %u\n", iface, ref);
if (!ref)
{
if (This->texture)
{
IDirect3DTexture9_Release(This->texture);
DeleteObject(This->bitmap);
}
if(ref==0) {
DeleteObject(This->hfont);
DeleteDC(This->hdc);
IDirect3DDevice9_Release(This->device);
@ -207,187 +178,17 @@ static HRESULT WINAPI ID3DXFontImpl_PreloadTextW(ID3DXFont *iface, const WCHAR *
static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, ID3DXSprite *sprite,
const char *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
{
LPWSTR stringW;
INT countW, ret = 0;
TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
FIXME("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x stub!\n",
iface, sprite, debugstr_a(string), count, wine_dbgstr_rect(rect), format, color);
if (!string || count == 0)
return 0;
if (count < 0)
count = -1;
countW = MultiByteToWideChar(CP_ACP, 0, string, count, NULL, 0);
stringW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR));
if (stringW)
{
MultiByteToWideChar(CP_ACP, 0, string, count, stringW, countW);
ret = ID3DXFont_DrawTextW(iface, sprite, stringW, countW, rect, format, color);
HeapFree(GetProcessHeap(), 0, stringW);
}
return ret;
return 1;
}
static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
const WCHAR *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
{
struct d3dx_font *This = impl_from_ID3DXFont(iface);
RECT calc_rect;
INT height;
TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
FIXME("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x stub!\n",
iface, sprite, debugstr_w(string), count, wine_dbgstr_rect(rect), format, color);
if (!string || count == 0)
return 0;
if (count < 0)
count = lstrlenW(string);
/* Strip terminating NULL characters */
while (count > 0 && !string[count-1])
count--;
if (rect)
calc_rect = *rect;
height = DrawTextW(This->hdc, string, count, &calc_rect, format | DT_CALCRECT);
if (format & DT_CALCRECT)
{
if (rect)
*rect = calc_rect;
return height;
}
if (format & DT_CENTER)
{
UINT new_width = calc_rect.right - calc_rect.left;
calc_rect.left = (rect->right + rect->left - new_width) / 2;
calc_rect.right = calc_rect.left + new_width;
}
if (height && (calc_rect.left < calc_rect.right))
{
D3DLOCKED_RECT locked_rect;
D3DXVECTOR3 position;
UINT text_width, text_height;
RECT text_rect;
ID3DXSprite *target = sprite;
HRESULT hr;
int i, j;
/* Get rect position and dimensions */
position.x = calc_rect.left;
position.y = calc_rect.top;
position.z = 0;
text_width = calc_rect.right - calc_rect.left;
text_height = calc_rect.bottom - calc_rect.top;
text_rect.left = 0;
text_rect.top = 0;
text_rect.right = text_width;
text_rect.bottom = text_height;
/* We need to flush as it seems all draws in the begin/end sequence use only the latest updated texture */
if (sprite)
ID3DXSprite_Flush(sprite);
/* Extend texture and DIB section to contain text */
if ((text_width > This->tex_width) || (text_height > This->tex_height))
{
BITMAPINFOHEADER header;
if (text_width > This->tex_width)
This->tex_width = make_pow2(text_width);
if (text_height > This->tex_height)
This->tex_height = make_pow2(text_height);
if (This->texture)
{
IDirect3DTexture9_Release(This->texture);
DeleteObject(This->bitmap);
}
hr = D3DXCreateTexture(This->device, This->tex_width, This->tex_height, 1, 0,
D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &This->texture);
if (FAILED(hr))
{
This->texture = NULL;
return 0;
}
header.biSize = sizeof(header);
header.biWidth = This->tex_width;
header.biHeight = -This->tex_height;
header.biPlanes = 1;
header.biBitCount = 32;
header.biCompression = BI_RGB;
header.biSizeImage = sizeof(DWORD) * This->tex_width * This->tex_height;
header.biXPelsPerMeter = 0;
header.biYPelsPerMeter = 0;
header.biClrUsed = 0;
header.biClrImportant = 0;
This->bitmap = CreateDIBSection(This->hdc, (const BITMAPINFO*)&header,
DIB_RGB_COLORS, (void**)&This->bits, NULL, 0);
if (!This->bitmap)
{
IDirect3DTexture9_Release(This->texture);
This->texture = NULL;
return 0;
}
SelectObject(This->hdc, This->bitmap);
}
if (FAILED(IDirect3DTexture9_LockRect(This->texture, 0, &locked_rect, &text_rect, D3DLOCK_DISCARD)))
return 0;
/* Clear rect */
for (i = 0; i < text_height; i++)
memset(This->bits + i * This->tex_width * sizeof(DWORD), 0,
text_width * sizeof(DWORD));
DrawTextW(This->hdc, string, count, &text_rect, format);
/* All RGB components are equal so take one as alpha and set RGB
* color to white, so it can be modulated with color parameter */
for (i = 0; i < text_height; i++)
{
DWORD *src = (DWORD *)This->bits + i * This->tex_width;
DWORD *dst = (DWORD *)((BYTE *)locked_rect.pBits + i * locked_rect.Pitch);
for (j = 0; j < text_width; j++)
{
*dst++ = (*src++ << 24) | 0xFFFFFF;
}
}
IDirect3DTexture9_UnlockRect(This->texture, 0);
if (!sprite)
{
hr = D3DXCreateSprite(This->device, &target);
if (FAILED(hr))
return 0;
ID3DXSprite_Begin(target, 0);
}
hr = target->lpVtbl->Draw(target, This->texture, &text_rect, NULL, &position, color);
if (!sprite)
{
ID3DXSprite_End(target);
ID3DXSprite_Release(target);
}
if (FAILED(hr))
return 0;
}
return height;
return 1;
}
static HRESULT WINAPI ID3DXFontImpl_OnLostDevice(ID3DXFont *iface)
@ -500,55 +301,46 @@ HRESULT WINAPI D3DXCreateFontIndirectW(IDirect3DDevice9 *device, const D3DXFONT_
TRACE("(%p, %p, %p)\n", device, desc, font);
if (!device || !desc || !font) return D3DERR_INVALIDCALL;
if( !device || !desc || !font ) return D3DERR_INVALIDCALL;
TRACE("desc: %d %d %d %d %d %d %d %d %d %s\n", desc->Height, desc->Width, desc->Weight, desc->MipLevels, desc->Italic,
desc->CharSet, desc->OutputPrecision, desc->Quality, desc->PitchAndFamily, debugstr_w(desc->FaceName));
/* The device MUST support D3DFMT_A8R8G8B8 */
/* the device MUST support D3DFMT_A8R8G8B8 */
IDirect3DDevice9_GetDirect3D(device, &d3d);
IDirect3DDevice9_GetCreationParameters(device, &cpars);
IDirect3DDevice9_GetDisplayMode(device, 0, &mode);
hr = IDirect3D9_CheckDeviceFormat(d3d, cpars.AdapterOrdinal, cpars.DeviceType, mode.Format, 0, D3DRTYPE_TEXTURE, D3DFMT_A8R8G8B8);
if (FAILED(hr))
{
if(FAILED(hr)) {
IDirect3D9_Release(d3d);
return D3DXERR_INVALIDDATA;
}
IDirect3D9_Release(d3d);
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct d3dx_font));
if (!object)
{
*font = NULL;
object = HeapAlloc(GetProcessHeap(), 0, sizeof(struct d3dx_font));
if(object==NULL) {
*font=NULL;
return E_OUTOFMEMORY;
}
object->ID3DXFont_iface.lpVtbl = &D3DXFont_Vtbl;
object->ref = 1;
object->device = device;
object->desc = *desc;
object->ref=1;
object->device=device;
object->desc=*desc;
object->hdc = CreateCompatibleDC(NULL);
if (!object->hdc)
{
if( !object->hdc ) {
HeapFree(GetProcessHeap(), 0, object);
return D3DXERR_INVALIDDATA;
}
object->hfont = CreateFontW(desc->Height, desc->Width, 0, 0, desc->Weight, desc->Italic, FALSE, FALSE, desc->CharSet,
desc->OutputPrecision, CLIP_DEFAULT_PRECIS, desc->Quality, desc->PitchAndFamily, desc->FaceName);
if (!object->hfont)
{
if( !object->hfont ) {
DeleteDC(object->hdc);
HeapFree(GetProcessHeap(), 0, object);
return D3DXERR_INVALIDDATA;
}
SelectObject(object->hdc, object->hfont);
SetTextColor(object->hdc, 0x00ffffff);
SetBkColor(object->hdc, 0x00000000);
IDirect3DDevice9_AddRef(device);
*font = &object->ID3DXFont_iface;
*font=&object->ID3DXFont_iface;
return D3D_OK;
}

View file

@ -2969,20 +2969,6 @@ static void rotate_X(FLOAT *out, UINT order, FLOAT a, FLOAT *in)
out[35] = 0.9057110548f * in[31] - 0.4192627370f * in[33] + 0.0624999329f * in[35];
}
HRESULT WINAPI D3DXSHProjectCubeMap(UINT order, IDirect3DCubeTexture9 *cubemap, FLOAT *rout, FLOAT *gout, FLOAT *bout)
{
FIXME("order %u, cubemap %p, rout %p, gout %p, bout %p: stub!\n", order, cubemap, rout, gout, bout);
if(!cubemap || order < D3DXSH_MINORDER || order > D3DXSH_MAXORDER)
return D3DERR_INVALIDCALL;
*rout = 0.0f;
*gout = 0.0f;
*bout = 0.0f;
return D3D_OK;
}
FLOAT* WINAPI D3DXSHRotate(FLOAT *out, UINT order, const D3DXMATRIX *matrix, const FLOAT *in)
{
FLOAT alpha, beta, gamma, sinb, temp[36], temp1[36];

View file

@ -1695,7 +1695,11 @@ static HRESULT WINAPI d3dx9_mesh_OptimizeInplace(ID3DXMesh *iface, DWORD flags,
if (FAILED(hr)) goto cleanup;
} else if (flags & D3DXMESHOPT_ATTRSORT) {
if (!(flags & D3DXMESHOPT_IGNOREVERTS))
{
FIXME("D3DXMESHOPT_ATTRSORT vertex reordering not implemented.\n");
hr = E_NOTIMPL;
goto cleanup;
}
hr = iface->lpVtbl->LockAttributeBuffer(iface, 0, &attrib_buffer);
if (FAILED(hr)) goto cleanup;
@ -3328,13 +3332,6 @@ static HRESULT parse_mesh(ID3DXFileData *filedata, struct mesh_data *mesh_data,
goto end;
}
if ((provide_flags & PROVIDE_SKININFO) && !mesh_data->skin_info)
{
hr = create_dummy_skin(&mesh_data->skin_info);
if (FAILED(hr))
goto end;
}
hr = D3D_OK;
end:
@ -7189,33 +7186,6 @@ cleanup:
return hr;
}
/*************************************************************************
* D3DXOptimizeVertices (D3DX9_36.@)
*/
HRESULT WINAPI D3DXOptimizeVertices(const void *indices, UINT num_faces,
UINT num_vertices, BOOL indices_are_32bit, DWORD *vertex_remap)
{
UINT i;
FIXME("indices %p, num_faces %u, num_vertices %u, indices_are_32bit %#x, vertex_remap %p semi-stub.\n",
indices, num_faces, num_vertices, indices_are_32bit, vertex_remap);
if (!vertex_remap)
{
WARN("vertex remap pointer is NULL.\n");
return D3DERR_INVALIDCALL;
}
for (i = 0; i < num_vertices; i++)
{
vertex_remap[i] = i;
}
return D3D_OK;
}
/*************************************************************************
* D3DXOptimizeFaces (D3DX9_36.@)
*
@ -7539,24 +7509,6 @@ done:
return hr;
}
/*************************************************************************
* D3DXComputeTangent (D3DX9_36.@)
*/
HRESULT WINAPI D3DXComputeTangent(ID3DXMesh *mesh, DWORD stage_idx, DWORD tangent_idx,
DWORD binorm_idx, DWORD wrap, const DWORD *adjacency)
{
TRACE("mesh %p, stage_idx %d, tangent_idx %d, binorm_idx %d, wrap %d, adjacency %p.\n",
mesh, stage_idx, tangent_idx, binorm_idx, wrap, adjacency);
return D3DXComputeTangentFrameEx( mesh, D3DDECLUSAGE_TEXCOORD, stage_idx,
( binorm_idx == D3DX_DEFAULT ) ? D3DX_DEFAULT : D3DDECLUSAGE_BINORMAL,
binorm_idx,
( tangent_idx == D3DX_DEFAULT ) ? D3DX_DEFAULT : D3DDECLUSAGE_TANGENT,
tangent_idx, D3DX_DEFAULT, 0,
( wrap ? D3DXTANGENT_WRAP_UV : 0 ) | D3DXTANGENT_GENERATE_IN_PLACE | D3DXTANGENT_ORTHOGONALIZE_FROM_U,
adjacency, -1.01f, -0.01f, -1.01f, NULL, NULL);
}
/*************************************************************************
* D3DXComputeNormals (D3DX9_36.@)
*/

View file

@ -1,7 +1,6 @@
/*
* Copyright 2008 Luis Busquets
* Copyright 2009 Matteo Bruni
* Copyright 2010, 2013, 2016 Christian Costa
* Copyright 2011 Travis Athougies
*
* This library is free software; you can redistribute it and/or
@ -21,7 +20,6 @@
#include "config.h"
#include "wine/port.h"
#include <stdio.h>
#include "d3dx9_private.h"
#include "d3dcommon.h"
@ -441,41 +439,6 @@ HRESULT WINAPI D3DXCompileShader(const char *data, UINT length, const D3DXMACRO
}
}
/* Filter out D3DCompile warning messages that are not present with D3DCompileShader */
if (SUCCEEDED(hr) && error_msgs && *error_msgs)
{
char *messages = ID3DXBuffer_GetBufferPointer(*error_msgs);
DWORD size = ID3DXBuffer_GetBufferSize(*error_msgs);
/* Ensure messages are null terminated for safe processing */
if (size) messages[size - 1] = 0;
while (size > 1)
{
char *prev, *next;
/* Warning has the form "warning X3206: ... implicit truncation of vector type"
but we only search for "X3206:" in case d3dcompiler_43 has localization */
prev = next = strstr(messages, "X3206:");
if (!prev) break;
/* get pointer to beginning and end of current line */
while (prev > messages && *(prev - 1) != '\n') prev--;
while (next < messages + size - 1 && *next != '\n') next++;
if (next < messages + size - 1 && *next == '\n') next++;
memmove(prev, next, messages + size - next);
size -= (next - prev);
}
/* Only return a buffer if the resulting string is not empty as some apps depend on that */
if (size <= 1)
{
ID3DXBuffer_Release(*error_msgs);
*error_msgs = NULL;
}
}
return hr;
}
@ -2177,334 +2140,10 @@ HRESULT WINAPI D3DXGetShaderSamplers(const DWORD *byte_code, const char **sample
return D3D_OK;
}
static const char *decl_usage[] = { "position", "blendweight", "blendindices", "normal", "psize", "texcoord",
"tangent", "binormal", "tessfactor", "positiont", "color" };
static const char *tex_type[] = { "", "1d", "2d", "cube", "volume" };
static int add_modifier(char *buffer, DWORD param)
{
char *buf = buffer;
DWORD dst_mod = param & D3DSP_DSTMOD_MASK;
if (dst_mod & D3DSPDM_SATURATE)
buf += sprintf(buf, "_sat");
if (dst_mod & D3DSPDM_PARTIALPRECISION)
buf += sprintf(buf, "_pp");
if (dst_mod & D3DSPDM_MSAMPCENTROID)
buf += sprintf(buf, "_centroid");
return buf - buffer;
}
static int add_register(char *buffer, DWORD param, BOOL dst, BOOL ps)
{
char *buf = buffer;
DWORD reg_type = ((param & D3DSP_REGTYPE_MASK2) >> D3DSP_REGTYPE_SHIFT2)
| ((param & D3DSP_REGTYPE_MASK) >> D3DSP_REGTYPE_SHIFT);
DWORD reg_num = param & D3DSP_REGNUM_MASK;
if (reg_type == D3DSPR_INPUT)
buf += sprintf(buf, "v%d", reg_num);
else if (reg_type == D3DSPR_CONST)
buf += sprintf(buf, "c%d", reg_num);
else if (reg_type == D3DSPR_TEMP)
buf += sprintf(buf, "r%d", reg_num);
else if (reg_type == D3DSPR_ADDR)
buf += sprintf(buf, "%s%d", ps ? "t" : "a", reg_num);
else if (reg_type == D3DSPR_SAMPLER)
buf += sprintf(buf, "s%d", reg_num);
else if (reg_type == D3DSPR_RASTOUT)
buf += sprintf(buf, "oPos");
else if (reg_type == D3DSPR_COLOROUT)
buf += sprintf(buf, "oC%d", reg_num);
else if (reg_type == D3DSPR_TEXCRDOUT)
buf += sprintf(buf, "oT%d", reg_num);
else if (reg_type == D3DSPR_ATTROUT)
buf += sprintf(buf, "oD%d", reg_num);
else
buf += sprintf(buf, "? (%d)", reg_type);
if (dst)
{
if ((param & D3DSP_WRITEMASK_ALL) != D3DSP_WRITEMASK_ALL)
{
buf += sprintf(buf, ".%s%s%s%s", param & D3DSP_WRITEMASK_0 ? "x" : "",
param & D3DSP_WRITEMASK_1 ? "y" : "",
param & D3DSP_WRITEMASK_2 ? "z" : "",
param & D3DSP_WRITEMASK_3 ? "w" : "");
}
}
else
{
if ((param & D3DVS_SWIZZLE_MASK) != D3DVS_NOSWIZZLE)
{
if ( ((param & D3DSP_SWIZZLE_MASK) == (D3DVS_X_X | D3DVS_Y_X | D3DVS_Z_X | D3DVS_W_X)) ||
((param & D3DSP_SWIZZLE_MASK) == (D3DVS_X_Y | D3DVS_Y_Y | D3DVS_Z_Y | D3DVS_W_Y)) ||
((param & D3DSP_SWIZZLE_MASK) == (D3DVS_X_Z | D3DVS_Y_Z | D3DVS_Z_Z | D3DVS_W_Z)) ||
((param & D3DSP_SWIZZLE_MASK) == (D3DVS_X_W | D3DVS_Y_W | D3DVS_Z_W | D3DVS_W_W)) )
buf += sprintf(buf, ".%c", 'w' + (((param >> D3DVS_SWIZZLE_SHIFT) + 1) & 0x3));
else
buf += sprintf(buf, ".%c%c%c%c", 'w' + (((param >> (D3DVS_SWIZZLE_SHIFT+0)) + 1) & 0x3),
'w' + (((param >> (D3DVS_SWIZZLE_SHIFT+2)) + 1) & 0x3),
'w' + (((param >> (D3DVS_SWIZZLE_SHIFT+4)) + 1) & 0x3),
'w' + (((param >> (D3DVS_SWIZZLE_SHIFT+6)) + 1) & 0x3));
}
}
return buf - buffer;
}
struct instr_info
{
DWORD opcode;
const char *name;
int length;
int (*function)(const struct instr_info *info, DWORD **ptr, char *buffer, BOOL ps);
WORD min_version;
WORD max_version;
};
static int instr_comment(const struct instr_info *info, DWORD **ptr, char *buffer, BOOL ps)
{
*ptr += 1 + ((**ptr & D3DSI_COMMENTSIZE_MASK) >> D3DSI_COMMENTSIZE_SHIFT);
return 0;
}
static int instr_def(const struct instr_info *info, DWORD **ptr, char *buffer, BOOL ps)
{
int len = sprintf(buffer, " def c%d, %g, %g, %g, %g\n", *(*ptr+1) & D3DSP_REGNUM_MASK,
(double)*(float*)(*ptr+2), (double)*(float*)(*ptr+3),
(double)*(float*)(*ptr+4), (double)*(float*)(*ptr+5));
*ptr += 6;
return len;
}
static int instr_dcl(const struct instr_info *info, DWORD **ptr, char *buffer, BOOL ps)
{
DWORD param1 = *++*ptr;
DWORD param2 = *++*ptr;
DWORD usage = (param1 & D3DSP_DCL_USAGE_MASK) >> D3DSP_DCL_USAGE_SHIFT;
DWORD usage_index = (param1 & D3DSP_DCL_USAGEINDEX_MASK) >> D3DSP_DCL_USAGEINDEX_SHIFT;
char *buf = buffer;
buf += sprintf(buf, " dcl");
if (ps)
{
if (param1 & D3DSP_TEXTURETYPE_MASK)
buf += sprintf(buf, "_%s", (usage <= D3DSTT_VOLUME) ?
tex_type[(param1 & D3DSP_TEXTURETYPE_MASK) >> D3DSP_TEXTURETYPE_SHIFT] : "???");
}
else
{
buf += sprintf(buf, "_%s", (usage <= D3DDECLUSAGE_COLOR) ? decl_usage[usage] : "???");
if (usage_index)
buf += sprintf(buf, "%d", usage_index);
}
buf += add_modifier(buf, param2);
buf += sprintf(buf, " ");
buf += add_register(buf, param2, TRUE, TRUE);
buf += sprintf(buf, "\n");
(*ptr)++;
return buf - buffer;
}
static int instr_generic(const struct instr_info *info, DWORD **ptr, char *buffer, BOOL ps)
{
char *buf = buffer;
int j;
buf += sprintf(buf, " %s", info->name);
(*ptr)++;
if (info->length)
{
buf += add_modifier(buf, **ptr);
for (j = 0; j < info->length; j++)
{
buf += sprintf(buf, "%s ", j ? "," : "");
if ((j != 0) && ((**ptr & D3DSP_SRCMOD_MASK) != D3DSPSM_NONE))
{
if ((**ptr & D3DSP_SRCMOD_MASK) == D3DSPSM_NEG)
buf += sprintf(buf, "-");
else
buf += sprintf(buf, "*");
}
buf += add_register(buf, **ptr, j == 0, ps);
if (*(*ptr)++ & D3DVS_ADDRESSMODE_MASK)
{
buf += sprintf(buf, "[");
buf += add_register(buf, **ptr, FALSE, FALSE);
buf += sprintf(buf, "]");
(*ptr)++;
}
}
}
buf += sprintf(buf, "\n");
return buf - buffer;
}
const struct instr_info instructions[] =
{
{ D3DSIO_NOP, "nop", 0, instr_generic, 0x0100, 0xFFFF },
{ D3DSIO_MOV, "mov", 2, instr_generic, 0x0100, 0xFFFF },
{ D3DSIO_ADD, "add", 3, instr_generic, 0x0100, 0xFFFF },
{ D3DSIO_SUB, "sub", 3, instr_generic, 0x0100, 0xFFFF },
{ D3DSIO_MAD, "mad", 4, instr_generic, 0x0100, 0xFFFF },
{ D3DSIO_MUL, "mul", 3, instr_generic, 0x0100, 0xFFFF },
{ D3DSIO_RCP, "rcp", 2, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
{ D3DSIO_RSQ, "rsq", 2, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
{ D3DSIO_DP3, "dp3", 3, instr_generic, 0x0100, 0xFFFF },
{ D3DSIO_DP4, "dp4", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 1.2 for PS */
{ D3DSIO_MIN, "min", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
{ D3DSIO_MAX, "max", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
{ D3DSIO_SLT, "slt", 3, instr_generic, 0x0100, 0xFFFF },
{ D3DSIO_SGE, "sge", 3, instr_generic, 0x0100, 0xFFFF }, /* VS only */
{ D3DSIO_EXP, "exp", 2, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
{ D3DSIO_LOG, "log", 2, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
{ D3DSIO_LIT, "lit", 2, instr_generic, 0x0100, 0xFFFF }, /* VS only */
{ D3DSIO_DST, "dst", 3, instr_generic, 0x0100, 0xFFFF }, /* VS only */
{ D3DSIO_LRP, "lrp", 4, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for VS */
{ D3DSIO_FRC, "frc", 2, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
{ D3DSIO_M4x4, "m4x4", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
{ D3DSIO_M4x3, "m4x3", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
{ D3DSIO_M3x4, "m3x4", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
{ D3DSIO_M3x3, "m3x3", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
{ D3DSIO_M3x2, "m3x2", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
{ D3DSIO_CALL, "call", 1, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
{ D3DSIO_CALLNZ, "callnz", 2, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
{ D3DSIO_LOOP, "loop", 2, instr_generic, 0x0200, 0xFFFF }, /* >= 3.0 for PS */
{ D3DSIO_RET, "ret", 0, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
{ D3DSIO_ENDLOOP, "endloop", 1, instr_generic, 0x0200, 0xFFFF }, /* >= 3.0 for PS */
{ D3DSIO_LABEL, "label", 1, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
{ D3DSIO_DCL, "dcl", 1, instr_dcl, 0x0100, 0xFFFF },
{ D3DSIO_POW, "pow", 3, instr_generic, 0x0200, 0xFFFF },
{ D3DSIO_CRS, "crs", 3, instr_generic, 0x0200, 0xFFFF },
{ D3DSIO_SGN, "sgn", 4, instr_generic, 0x0200, 0xFFFF }, /* VS only */
{ D3DSIO_ABS, "abs", 2, instr_generic, 0x0200, 0xFFFF },
{ D3DSIO_NRM, "nrm", 2, instr_generic, 0x0200, 0xFFFF },
{ D3DSIO_SINCOS, "sincos", 4, instr_generic, 0x0200, 0x02FF },
{ D3DSIO_SINCOS, "sincos", 2, instr_generic, 0x0300, 0xFFFF },
{ D3DSIO_REP, "rep", 1, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
{ D3DSIO_ENDREP, "endrep", 0, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
{ D3DSIO_IF, "if", 1, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
{ D3DSIO_IFC, "if_comp", 2, instr_generic, 0x0200, 0xFFFF },
{ D3DSIO_ELSE, "else", 0, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
{ D3DSIO_ENDIF, "endif", 0, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
{ D3DSIO_BREAK, "break", 0, instr_generic, 0x0201, 0xFFFF },
{ D3DSIO_BREAKC, "break_comp", 2, instr_generic, 0x0201, 0xFFFF },
{ D3DSIO_MOVA, "mova", 2, instr_generic, 0x0200, 0xFFFF }, /* VS only */
{ D3DSIO_DEFB, "defb", 2, instr_generic, 0x0100, 0xFFFF },
{ D3DSIO_DEFI, "defi", 2, instr_generic, 0x0100, 0xFFFF },
{ D3DSIO_TEXCOORD, "texcoord", 1, instr_generic, 0x0100, 0x0103 }, /* PS only */
{ D3DSIO_TEXCOORD, "texcrd", 2, instr_generic, 0x0104, 0x0104 }, /* PS only */
{ D3DSIO_TEXKILL, "texkill", 1, instr_generic, 0x0100, 0xFFFF }, /* PS only */
{ D3DSIO_TEX, "tex", 1, instr_generic, 0x0100, 0x0103 }, /* PS only */
{ D3DSIO_TEX, "texld", 2, instr_generic, 0x0104, 0x0104 }, /* PS only */
{ D3DSIO_TEX, "texld", 3, instr_generic, 0x0200, 0xFFFF }, /* PS only */
{ D3DSIO_TEXBEM, "texbem", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
{ D3DSIO_TEXBEML, "texbeml", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
{ D3DSIO_TEXREG2AR, "texreg2ar", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
{ D3DSIO_TEXREG2GB, "texreg2gb", 2, instr_generic, 0x0102, 0x0103 }, /* PS only */
{ D3DSIO_TEXM3x2PAD, "texm3x2pad", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
{ D3DSIO_TEXM3x2TEX, "texm3x2tex", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
{ D3DSIO_TEXM3x3PAD, "texm3x3pad", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
{ D3DSIO_TEXM3x3TEX, "texm3x3tex", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
{ D3DSIO_TEXM3x3DIFF, "texm3x3diff", 2, instr_generic, 0x0100, 0xFFFF }, /* PS only - Not documented */
{ D3DSIO_TEXM3x3SPEC, "texm3x3spec", 3, instr_generic, 0x0100, 0x0103 }, /* PS only */
{ D3DSIO_TEXM3x3VSPEC, "texm3x3vspec", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
{ D3DSIO_EXPP, "expp", 2, instr_generic, 0x0100, 0xFFFF }, /* VS only */
{ D3DSIO_LOGP, "logp", 2, instr_generic, 0x0100, 0xFFFF }, /* VS only */
{ D3DSIO_CND, "cnd", 4, instr_generic, 0x0100, 0x0104 }, /* PS only */
{ D3DSIO_DEF, "def", 5, instr_def, 0x0100, 0xFFFF },
{ D3DSIO_TEXREG2RGB, "texreg2rgb", 2, instr_generic, 0x0102, 0x0103 }, /* PS only */
{ D3DSIO_TEXDP3TEX, "texdp3tex", 2, instr_generic, 0x0102, 0x0103 }, /* PS only */
{ D3DSIO_TEXM3x2DEPTH, "texm3x2depth", 2, instr_generic, 0x0103, 0x0103 }, /* PS only */
{ D3DSIO_TEXDP3, "texdp3", 2, instr_generic, 0x0102, 0x0103 }, /* PS only */
{ D3DSIO_TEXM3x3, "texm3x3", 2, instr_generic, 0x0102, 0x0103 }, /* PS only */
{ D3DSIO_TEXDEPTH, "texdepth", 1, instr_generic, 0x0104, 0x0104 }, /* PS only */
{ D3DSIO_CMP, "cmp", 4, instr_generic, 0x0102, 0xFFFF }, /* PS only */
{ D3DSIO_BEM, "bem", 3, instr_generic, 0x0104, 0x0104 }, /* PS only */
{ D3DSIO_DP2ADD, "dp2add", 4, instr_generic, 0x0200, 0xFFFF }, /* PS only */
{ D3DSIO_DSX, "dsx", 2, instr_generic, 0x0201, 0xFFFF }, /* PS only */
{ D3DSIO_DSY, "dsy", 2, instr_generic, 0x0201, 0xFFFF }, /* PS only */
{ D3DSIO_TEXLDD, "texldd", 5, instr_generic, 0x0201, 0xFFFF }, /* PS only - not existing for 2.b */
{ D3DSIO_SETP, "setp_comp", 3, instr_generic, 0x0201, 0xFFFF },
{ D3DSIO_TEXLDL, "texldl", 3, instr_generic, 0x0300, 0xFFFF },
{ D3DSIO_BREAKP, "breakp", 1, instr_generic, 0x0201, 0xFFFF },
{ D3DSIO_PHASE, "phase", 0, instr_generic, 0x0104, 0x0104 }, /* PS only */
{ D3DSIO_COMMENT, "", 0, instr_comment, 0x0100, 0xFFFF }
};
HRESULT WINAPI D3DXDisassembleShader(const DWORD *shader, BOOL colorcode, const char *comments, ID3DXBuffer **disassembly)
{
DWORD *ptr = (DWORD *)shader;
char *buffer, *buf;
UINT capacity = 4096;
BOOL ps;
WORD version;
HRESULT hr;
TRACE("%p %d %s %p\n", shader, colorcode, debugstr_a(comments), disassembly);
if (!shader || !disassembly)
return D3DERR_INVALIDCALL;
buf = buffer = HeapAlloc(GetProcessHeap(), 0, capacity);
if (!buffer)
return E_OUTOFMEMORY;
ps = (*ptr >> 16) & 1;
version = *ptr & 0xFFFF;
buf += sprintf(buf, " %s_%d_%d\n", ps ? "ps" : "vs", D3DSHADER_VERSION_MAJOR(*ptr), D3DSHADER_VERSION_MINOR(*ptr));
ptr++;
while (*ptr != D3DSIO_END)
{
DWORD index;
if ((buf - buffer + 128) > capacity)
{
UINT count = buf - buffer;
char *new_buffer = HeapReAlloc(GetProcessHeap(), 0, buffer, capacity * 2);
if (!new_buffer)
{
HeapFree(GetProcessHeap(), 0, buffer);
return E_OUTOFMEMORY;
}
capacity *= 2;
buffer = new_buffer;
buf = buffer + count;
}
for (index = 0; index < sizeof(instructions)/sizeof(instructions[0]); index++)
if (((*ptr & D3DSI_OPCODE_MASK) == instructions[index].opcode) &&
(version >= instructions[index].min_version) && (version <= instructions[index].max_version))
break;
if (index != sizeof(instructions)/sizeof(instructions[0]))
{
buf += instructions[index].function(&(instructions[index]), &ptr, buf, ps);
}
else
{
buf += sprintf(buf, " ??? (Unknown opcode %x)\n", *ptr);
while (*++ptr & (1u << 31));
}
}
hr = D3DXCreateBuffer(buf - buffer + 1 , disassembly);
if (SUCCEEDED(hr))
strcpy(ID3DXBuffer_GetBufferPointer(*disassembly), buffer);
HeapFree(GetProcessHeap(), 0, buffer);
return hr;
FIXME("%p %d %s %p: stub\n", shader, colorcode, debugstr_a(comments), disassembly);
return E_OUTOFMEMORY;
}
struct d3dx9_texture_shader

View file

@ -2,7 +2,6 @@
* Skin Info operations specific to D3DX9.
*
* Copyright (C) 2011 Dylan Smith
* Copyright (C) 2013 Christian Costa
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -95,7 +94,7 @@ static ULONG WINAPI d3dx9_skin_info_Release(ID3DXSkinInfo *iface)
HeapFree(GetProcessHeap(), 0, skin->bones[i].vertices);
HeapFree(GetProcessHeap(), 0, skin->bones[i].weights);
}
if (skin->bones) HeapFree(GetProcessHeap(), 0, skin->bones);
HeapFree(GetProcessHeap(), 0, skin->bones);
HeapFree(GetProcessHeap(), 0, skin);
}
@ -378,89 +377,10 @@ static HRESULT WINAPI d3dx9_skin_info_GetDeclaration(ID3DXSkinInfo *iface,
static HRESULT WINAPI d3dx9_skin_info_UpdateSkinnedMesh(ID3DXSkinInfo *iface, const D3DXMATRIX *bone_transforms,
const D3DXMATRIX *bone_inv_transpose_transforms, const void *src_vertices, void *dst_vertices)
{
struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface);
DWORD size = D3DXGetFVFVertexSize(skin->fvf);
DWORD i, j;
FIXME("iface %p, bone_transforms %p, bone_inv_transpose_transforms %p, src_vertices %p, dst_vertices %p stub!\n",
iface, bone_transforms, bone_inv_transpose_transforms, src_vertices, dst_vertices);
TRACE("iface %p, bone_transforms %p, bone_inv_transpose_transforms %p, src_vertices %p, dst_vertices %p\n",
skin, bone_transforms, bone_inv_transpose_transforms, src_vertices, dst_vertices);
if (bone_inv_transpose_transforms)
FIXME("Skinning vertices with two position elements not supported\n");
if ((skin->fvf & D3DFVF_POSITION_MASK) != D3DFVF_XYZ) {
FIXME("Vertex type %#x not supported\n", skin->fvf & D3DFVF_POSITION_MASK);
return E_FAIL;
}
/* Reset all positions */
for (i = 0; i < skin->num_vertices; i++) {
D3DXVECTOR3 *position = (D3DXVECTOR3*)((BYTE*)dst_vertices + size * i);
position->x = 0.0f;
position->y = 0.0f;
position->z = 0.0f;
}
/* Update positions that are influenced by bones */
for (i = 0; i < skin->num_bones; i++) {
D3DXMATRIX bone_inverse, matrix;
D3DXMatrixInverse(&bone_inverse, NULL, &skin->bones[i].transform);
D3DXMatrixMultiply(&matrix, &bone_transforms[i], &bone_inverse);
D3DXMatrixMultiply(&matrix, &matrix, &skin->bones[i].transform);
for (j = 0; j < skin->bones[i].num_influences; j++) {
D3DXVECTOR3 position;
D3DXVECTOR3 *position_src = (D3DXVECTOR3*)((BYTE*)src_vertices + size * skin->bones[i].vertices[j]);
D3DXVECTOR3 *position_dest = (D3DXVECTOR3*)((BYTE*)dst_vertices + size * skin->bones[i].vertices[j]);
FLOAT weight = skin->bones[i].weights[j];
D3DXVec3TransformCoord(&position, position_src, &matrix);
position_dest->x += weight * position.x;
position_dest->y += weight * position.y;
position_dest->z += weight * position.z;
}
}
if (skin->fvf & D3DFVF_NORMAL) {
/* Reset all normals */
for (i = 0; i < skin->num_vertices; i++) {
D3DXVECTOR3 *normal = (D3DXVECTOR3*)((BYTE*)dst_vertices + size * i + sizeof(D3DXVECTOR3));
normal->x = 0.0f;
normal->y = 0.0f;
normal->z = 0.0f;
}
/* Update normals that are influenced by bones */
for (i = 0; i < skin->num_bones; i++) {
D3DXMATRIX bone_inverse, matrix;
D3DXMatrixInverse(&bone_inverse, NULL, &skin->bones[i].transform);
D3DXMatrixMultiply(&matrix, &skin->bones[i].transform, &bone_transforms[i]);
for (j = 0; j < skin->bones[i].num_influences; j++) {
D3DXVECTOR3 normal;
D3DXVECTOR3 *normal_src = (D3DXVECTOR3*)((BYTE*)src_vertices + size * skin->bones[i].vertices[j] + sizeof(D3DXVECTOR3));
D3DXVECTOR3 *normal_dest = (D3DXVECTOR3*)((BYTE*)dst_vertices + size * skin->bones[i].vertices[j] + sizeof(D3DXVECTOR3));
FLOAT weight = skin->bones[i].weights[j];
D3DXVec3TransformNormal(&normal, normal_src, &bone_inverse);
D3DXVec3TransformNormal(&normal, &normal, &matrix);
normal_dest->x += weight * normal.x;
normal_dest->y += weight * normal.y;
normal_dest->z += weight * normal.z;
}
}
/* Normalize all normals that are influenced by bones*/
for (i = 0; i < skin->num_vertices; i++) {
D3DXVECTOR3 *normal_dest = (D3DXVECTOR3*)((BYTE*)dst_vertices + (i * size) + sizeof(D3DXVECTOR3));
if ((normal_dest->x != 0.0f) && (normal_dest->y != 0.0f) && (normal_dest->z != 0.0f))
D3DXVec3Normalize(normal_dest, normal_dest);
}
}
return D3D_OK;
return E_NOTIMPL;
}
static HRESULT WINAPI d3dx9_skin_info_ConvertToBlendedMesh(ID3DXSkinInfo *iface, ID3DXMesh *mesh_in,
@ -575,23 +495,3 @@ HRESULT WINAPI D3DXCreateSkinInfoFVF(DWORD num_vertices, DWORD fvf, DWORD num_bo
return D3DXCreateSkinInfo(num_vertices, declaration, num_bones, skin_info);
}
HRESULT create_dummy_skin(ID3DXSkinInfo **iface)
{
static const D3DVERTEXELEMENT9 empty_declaration = D3DDECL_END();
struct d3dx9_skin_info *object = NULL;
object = HeapAlloc(GetProcessHeap(), 0, sizeof(*object));
if (!object) return E_OUTOFMEMORY;
object->ID3DXSkinInfo_iface.lpVtbl = &d3dx9_skin_info_vtbl;
object->ref = 1;
object->num_vertices = 0;
object->num_bones = 0;
object->vertex_declaration[0] = empty_declaration;
object->fvf = 0;
object->bones = NULL;
*iface = &object->ID3DXSkinInfo_iface;
return D3D_OK;
}

View file

@ -27,8 +27,6 @@
#include "ole2.h"
#include "wincodec.h"
#include "wine/wined3d.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT, IWICImagingFactory**);
@ -113,7 +111,6 @@ static const GUID *d3dformat_to_wic_guid(D3DFORMAT format)
#define DDS_PF_RGB 0x40
#define DDS_PF_YUV 0x200
#define DDS_PF_LUMINANCE 0x20000
#define DDS_PF_BUMPLUMINANCE 0x40000
#define DDS_PF_BUMPDUDV 0x80000
struct dds_pixel_format
@ -337,17 +334,6 @@ static D3DFORMAT dds_bump_to_d3dformat(const struct dds_pixel_format *pixel_form
return D3DFMT_UNKNOWN;
}
static D3DFORMAT dds_bump_luminance_to_d3dformat(const struct dds_pixel_format *pixel_format)
{
if (pixel_format->bpp == 32 && pixel_format->rmask == 0x000000ff && pixel_format->gmask == 0x0000ff00
&& pixel_format->bmask == 0x00ff0000)
return D3DFMT_X8L8V8U8;
WARN("Unknown bump pixel format (%u, %#x, %#x, %#x, %#x)\n", pixel_format->bpp,
pixel_format->rmask, pixel_format->gmask, pixel_format->bmask, pixel_format->amask);
return D3DFMT_UNKNOWN;
}
static D3DFORMAT dds_pixel_format_to_d3dformat(const struct dds_pixel_format *pixel_format)
{
TRACE("pixel_format: size %u, flags %#x, fourcc %#x, bpp %u.\n", pixel_format->size,
@ -365,8 +351,6 @@ static D3DFORMAT dds_pixel_format_to_d3dformat(const struct dds_pixel_format *pi
return dds_alpha_to_d3dformat(pixel_format);
if (pixel_format->flags & DDS_PF_BUMPDUDV)
return dds_bump_to_d3dformat(pixel_format);
if (pixel_format->flags & DDS_PF_BUMPLUMINANCE)
return dds_bump_luminance_to_d3dformat(pixel_format);
WARN("Unknown pixel format (flags %#x, fourcc %#x, bpp %u, r %#x, g %#x, b %#x, a %#x)\n",
pixel_format->flags, pixel_format->fourcc, pixel_format->bpp,
@ -397,14 +381,6 @@ static HRESULT d3dformat_to_dds_pixel_format(struct dds_pixel_format *pixel_form
}
}
/* Reuse dds_fourcc_to_d3dformat as D3DFORMAT and FOURCC are DWORD with same values */
if (dds_fourcc_to_d3dformat(d3dformat) != D3DFMT_UNKNOWN)
{
pixel_format->flags |= DDS_PF_FOURCC;
pixel_format->fourcc = d3dformat;
return D3D_OK;
}
WARN("Unknown pixel format %#x\n", d3dformat);
return E_NOTIMPL;
}
@ -614,68 +590,6 @@ static HRESULT save_dds_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSur
return D3D_OK;
}
static HRESULT get_surface(D3DRESOURCETYPE type, struct IDirect3DBaseTexture9 *tex,
int face, UINT level, struct IDirect3DSurface9 **surf)
{
switch (type)
{
case D3DRTYPE_TEXTURE:
return IDirect3DTexture9_GetSurfaceLevel((IDirect3DTexture9*) tex, level, surf);
case D3DRTYPE_CUBETEXTURE:
return IDirect3DCubeTexture9_GetCubeMapSurface((IDirect3DCubeTexture9*) tex, face, level, surf);
default:
ERR("Unexpected texture type\n");
return E_NOTIMPL;
}
}
HRESULT save_dds_texture_to_memory(ID3DXBuffer **dst_buffer, IDirect3DBaseTexture9 *src_texture, const PALETTEENTRY *src_palette)
{
HRESULT hr;
D3DRESOURCETYPE type;
UINT mip_levels;
IDirect3DSurface9 *surface;
type = IDirect3DBaseTexture9_GetType(src_texture);
if ((type != D3DRTYPE_TEXTURE) && (type != D3DRTYPE_CUBETEXTURE) && (type != D3DRTYPE_VOLUMETEXTURE))
return D3DERR_INVALIDCALL;
if (type == D3DRTYPE_CUBETEXTURE)
{
FIXME("Cube texture not supported yet\n");
return E_NOTIMPL;
}
else if (type == D3DRTYPE_VOLUMETEXTURE)
{
FIXME("Volume texture not supported yet\n");
return E_NOTIMPL;
}
mip_levels = IDirect3DTexture9_GetLevelCount(src_texture);
if (mip_levels > 1)
{
FIXME("Mipmap not supported yet\n");
return E_NOTIMPL;
}
if (src_palette)
{
FIXME("Saving surfaces with palettized pixel formats not implemented yet\n");
return E_NOTIMPL;
}
hr = get_surface(type, src_texture, D3DCUBEMAP_FACE_POSITIVE_X, 0, &surface);
if (SUCCEEDED(hr))
{
hr = save_dds_surface_to_memory(dst_buffer, surface, NULL);
IDirect3DSurface9_Release(surface);
}
return hr;
}
HRESULT load_volume_from_dds(IDirect3DVolume9 *dst_volume, const PALETTEENTRY *dst_palette,
const D3DBOX *dst_box, const void *src_data, const D3DBOX *src_box, DWORD filter, D3DCOLOR color_key,
const D3DXIMAGE_INFO *src_info)
@ -1040,24 +954,6 @@ HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(const void *data, UINT datasize,
}
}
/* For 32 bpp BMP, windowscodecs.dll never returns a format with alpha while
* d3dx9_xx.dll returns one if at least 1 pixel has a non zero alpha component */
if (SUCCEEDED(hr) && (info->Format == D3DFMT_X8R8G8B8) && (info->ImageFileFormat == D3DXIFF_BMP)) {
DWORD size = sizeof(DWORD) * info->Width * info->Height;
BYTE *buffer = HeapAlloc(GetProcessHeap(), 0, size);
hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, sizeof(DWORD) * info->Width, size, buffer);
if (SUCCEEDED(hr)) {
DWORD i;
for (i = 0; i < info->Width * info->Height; i++) {
if (buffer[i*4+3]) {
info->Format = D3DFMT_A8R8G8B8;
break;
}
}
}
HeapFree(GetProcessHeap(), 0, buffer);
}
if (frame)
IWICBitmapFrameDecode_Release(frame);
@ -1878,24 +1774,6 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic
}
}
typedef BOOL (*dxtn_conversion_func)(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out,
enum wined3d_format_id format, unsigned int w, unsigned int h);
static dxtn_conversion_func get_dxtn_conversion_func(D3DFORMAT format, BOOL encode)
{
switch (format)
{
case D3DFMT_DXT1:
return encode ? wined3d_dxt1_encode : wined3d_dxt1_decode;
case D3DFMT_DXT3:
return encode ? wined3d_dxt3_encode : wined3d_dxt3_decode;
case D3DFMT_DXT5:
return encode ? wined3d_dxt5_encode : wined3d_dxt5_decode;
default:
return NULL;
}
}
/************************************************************
* D3DXLoadSurfaceFromMemory
*
@ -1935,12 +1813,10 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
{
const struct pixel_format_desc *srcformatdesc, *destformatdesc;
IDirect3DSurface9 *surface;
void *tmp_src_memory = NULL, *tmp_dst_memory = NULL;
dxtn_conversion_func pre_convert = NULL, post_convert = NULL;
D3DSURFACE_DESC surfdesc;
D3DLOCKED_RECT lockrect;
struct volume src_size, dst_size;
HRESULT hr = D3D_OK;
HRESULT hr;
TRACE("(%p, %p, %s, %p, %#x, %u, %p, %s, %#x, 0x%08x)\n",
dst_surface, dst_palette, wine_dbgstr_rect(dst_rect), src_memory, src_format,
@ -2021,65 +1897,18 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
}
else /* Stretching or format conversion. */
{
UINT tmp_src_pitch, tmp_dst_pitch;
pre_convert = get_dxtn_conversion_func(srcformatdesc->format, FALSE);
post_convert = get_dxtn_conversion_func(destformatdesc->format, TRUE);
if ((!pre_convert && !is_conversion_from_supported(srcformatdesc)) ||
(!post_convert && !is_conversion_to_supported(destformatdesc)))
if (!is_conversion_from_supported(srcformatdesc)
|| !is_conversion_to_supported(destformatdesc))
{
FIXME("Unsupported format conversion %#x -> %#x.\n", src_format, surfdesc.Format);
unlock_surface(dst_surface, &lockrect, surface, FALSE);
return E_NOTIMPL;
}
/* handle pre-conversion */
if (pre_convert)
{
tmp_src_memory = HeapAlloc(GetProcessHeap(), 0, src_size.width * src_size.height * sizeof(DWORD));
if (!tmp_src_memory)
{
hr = E_OUTOFMEMORY;
goto done;
}
tmp_src_pitch = src_size.width * sizeof(DWORD);
if (!pre_convert(src_memory, tmp_src_memory, src_pitch, tmp_src_pitch,
WINED3DFMT_B8G8R8A8_UNORM, src_size.width, src_size.height))
{
hr = E_FAIL;
goto done;
}
srcformatdesc = get_format_info(D3DFMT_A8R8G8B8);
}
else
{
tmp_src_memory = (void *)src_memory;
tmp_src_pitch = src_pitch;
}
/* handle post-conversion */
if (post_convert)
{
tmp_dst_memory = HeapAlloc(GetProcessHeap(), 0, dst_size.width * dst_size.height * sizeof(DWORD));
if (!tmp_dst_memory)
{
hr = E_OUTOFMEMORY;
goto done;
}
tmp_dst_pitch = dst_size.width * sizeof(DWORD);
destformatdesc = get_format_info(D3DFMT_A8R8G8B8);
}
else
{
tmp_dst_memory = lockrect.pBits;
tmp_dst_pitch = lockrect.Pitch;
}
if ((filter & 0xf) == D3DX_FILTER_NONE)
{
convert_argb_pixels(tmp_src_memory, tmp_src_pitch, 0, &src_size, srcformatdesc,
tmp_dst_memory, tmp_dst_pitch, 0, &dst_size, destformatdesc, color_key, src_palette);
convert_argb_pixels(src_memory, src_pitch, 0, &src_size, srcformatdesc,
lockrect.pBits, lockrect.Pitch, 0, &dst_size, destformatdesc, color_key, src_palette);
}
else /* if ((filter & 0xf) == D3DX_FILTER_POINT) */
{
@ -2088,29 +1917,12 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
/* Always apply a point filter until D3DX_FILTER_LINEAR,
* D3DX_FILTER_TRIANGLE and D3DX_FILTER_BOX are implemented. */
point_filter_argb_pixels(tmp_src_memory, tmp_src_pitch, 0, &src_size, srcformatdesc,
tmp_dst_memory, tmp_dst_pitch, 0, &dst_size, destformatdesc, color_key, src_palette);
}
/* handle post-conversion */
if (post_convert)
{
if (!post_convert(tmp_dst_memory, lockrect.pBits, tmp_dst_pitch, lockrect.Pitch,
WINED3DFMT_B8G8R8A8_UNORM, dst_size.width, dst_size.height))
{
hr = E_FAIL;
}
point_filter_argb_pixels(src_memory, src_pitch, 0, &src_size, srcformatdesc,
lockrect.pBits, lockrect.Pitch, 0, &dst_size, destformatdesc, color_key, src_palette);
}
}
done:
if (pre_convert)
HeapFree(GetProcessHeap(), 0, tmp_src_memory);
if (post_convert)
HeapFree(GetProcessHeap(), 0, tmp_dst_memory);
unlock_surface(dst_surface, &lockrect, surface, TRUE);
return hr;
return unlock_surface(dst_surface, &lockrect, surface, TRUE);
}
/************************************************************

View file

@ -335,10 +335,10 @@ HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UIN
if (fmt->block_width != 1 || fmt->block_height != 1)
{
if (w % fmt->block_width)
w += fmt->block_width - w % fmt->block_width;
if (h % fmt->block_height)
h += fmt->block_height - h % fmt->block_height;
if (w < fmt->block_width)
w = fmt->block_width;
if (h < fmt->block_height)
h = fmt->block_height;
}
if ((caps.TextureCaps & D3DPTEXTURECAPS_POW2) && (!is_pow2(w)))
@ -1906,7 +1906,10 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
if (!dst_buffer || !src_texture) return D3DERR_INVALIDCALL;
if (file_format == D3DXIFF_DDS)
return save_dds_texture_to_memory(dst_buffer, src_texture, src_palette);
{
FIXME("DDS file format isn't supported yet\n");
return E_NOTIMPL;
}
type = IDirect3DBaseTexture9_GetType(src_texture);
switch (type)

View file

@ -90,7 +90,6 @@ static const struct pixel_format_desc formats[] =
{D3DFMT_G32R32F, { 0, 32, 32, 0}, { 0, 0, 32, 0}, 8, 1, 1, 8, FORMAT_ARGBF, NULL, NULL },
{D3DFMT_A32B32G32R32F, {32, 32, 32, 32}, {96, 0, 32, 64}, 16, 1, 1, 16, FORMAT_ARGBF, NULL, NULL },
{D3DFMT_P8, { 8, 8, 8, 8}, { 0, 0, 0, 0}, 1, 1, 1, 1, FORMAT_INDEX, NULL, index_to_rgba},
{D3DFMT_X8L8V8U8, { 0, 8, 8, 8}, { 0, 0, 8, 16}, 4, 1, 1, 4, FORMAT_ARGB, NULL, NULL },
/* marks last element */
{D3DFMT_UNKNOWN, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 0, 1, 1, 0, FORMAT_UNKNOWN, NULL, NULL },
};

View file

@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -229,7 +229,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -269,7 +269,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -229,7 +229,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -269,7 +269,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -229,7 +229,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -269,7 +269,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -229,7 +229,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -269,7 +269,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -229,7 +229,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -269,7 +269,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -222,7 +222,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -262,7 +262,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ -222,7 +222,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ -262,7 +262,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)

View file

@ -306,7 +306,6 @@ static void test_ID3DXSprite(IDirect3DDevice9 *device)
static void test_ID3DXFont(IDirect3DDevice9 *device)
{
static const WCHAR testW[] = {'t','e','s','t',0};
static const char testA[] = "test";
static const struct
{
int font_height;
@ -638,67 +637,6 @@ static void test_ID3DXFont(IDirect3DDevice9 *device)
ID3DXFont_Release(font);
}
/* ID3DXFont_DrawTextA, ID3DXFont_DrawTextW */
hr = D3DXCreateFontA(device, 12, 0, FW_DONTCARE, 0, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Arial", &font);
if (SUCCEEDED(hr)) {
RECT rect;
int height;
SetRect(&rect, 10, 10, 200, 200);
height = ID3DXFont_DrawTextA(font, NULL, testA, -2, &rect, 0, 0xFF00FF);
ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
height = ID3DXFont_DrawTextA(font, NULL, testA, -1, &rect, 0, 0xFF00FF);
ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
height = ID3DXFont_DrawTextA(font, NULL, testA, 0, &rect, 0, 0xFF00FF);
ok(height == 0, "DrawTextA returned %d, expected 0.\n", height);
height = ID3DXFont_DrawTextA(font, NULL, testA, 1, &rect, 0, 0xFF00FF);
ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
height = ID3DXFont_DrawTextA(font, NULL, testA, 2, &rect, 0, 0xFF00FF);
ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
height = ID3DXFont_DrawTextA(font, NULL, testA, -1, NULL, 0, 0xFF00FF);
ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
height = ID3DXFont_DrawTextA(font, NULL, testA, -1, NULL, DT_CALCRECT, 0xFF00FF);
ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
height = ID3DXFont_DrawTextA(font, NULL, NULL, -1, NULL, 0, 0xFF00FF);
ok(height == 0, "DrawTextA returned %d, expected 0.\n", height);
if (0) { /* Causes a lockup on windows 7. */
height = ID3DXFont_DrawTextW(font, NULL, testW, -2, &rect, 0, 0xFF00FF);
ok(height == 12, "DrawTextW returned %d, expected 12.\n", height);
}
height = ID3DXFont_DrawTextW(font, NULL, testW, -1, &rect, 0, 0xFF00FF);
ok(height == 12, "DrawTextW returned %d, expected 12.\n", height);
height = ID3DXFont_DrawTextW(font, NULL, testW, 0, &rect, 0, 0xFF00FF);
ok(height == 0, "DrawTextW returned %d, expected 0.\n", height);
height = ID3DXFont_DrawTextW(font, NULL, testW, 1, &rect, 0, 0xFF00FF);
ok(height == 12, "DrawTextW returned %d, expected 12.\n", height);
height = ID3DXFont_DrawTextW(font, NULL, testW, 2, &rect, 0, 0xFF00FF);
ok(height == 12, "DrawTextW returned %d, expected 12.\n", height);
height = ID3DXFont_DrawTextW(font, NULL, testW, -1, NULL, 0, 0xFF00FF);
ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
height = ID3DXFont_DrawTextW(font, NULL, testW, -1, NULL, DT_CALCRECT, 0xFF00FF);
ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
height = ID3DXFont_DrawTextW(font, NULL, NULL, -1, NULL, 0, 0xFF00FF);
ok(height == 0, "DrawTextA returned %d, expected 0.\n", height);
ID3DXFont_Release(font);
}
}
static void test_D3DXCreateRenderToSurface(IDirect3DDevice9 *device)

View file

@ -25,9 +25,6 @@
#include <limits.h>
#include "wine/test.h"
#include "d3dx9.h"
#include "initguid.h"
#include "rmxftmpl.h"
#include "rmxfguid.h"
#ifndef NAN
/* From wine/port.h */
@ -2547,129 +2544,6 @@ static void D3DXLoadMeshTest(void)
free_test_context(test_context);
}
static ID3DXFileData *get_mesh_data(const char *memory, SIZE_T length)
{
D3DXF_FILELOADMEMORY source;
ID3DXFileEnumObject *enumobj = NULL;
ID3DXFileData *filedata = NULL;
ID3DXFileData *ret = NULL;
ID3DXFile *d3dxfile = NULL;
SIZE_T i, nb_children;
HRESULT hr;
GUID guid;
hr = D3DXFileCreate(&d3dxfile);
if (FAILED(hr)) return NULL;
hr = d3dxfile->lpVtbl->RegisterTemplates(d3dxfile, D3DRM_XTEMPLATES, D3DRM_XTEMPLATE_BYTES);
if (FAILED(hr)) goto cleanup;
source.lpMemory = (void *)memory;
source.dSize = length;
hr = d3dxfile->lpVtbl->CreateEnumObject(d3dxfile, &source, D3DXF_FILELOAD_FROMMEMORY, &enumobj);
if (FAILED(hr)) goto cleanup;
hr = enumobj->lpVtbl->GetChildren(enumobj, &nb_children);
if (FAILED(hr)) goto cleanup;
for (i = 0; i < nb_children; i++)
{
hr = enumobj->lpVtbl->GetChild(enumobj, i, &filedata);
if (FAILED(hr)) goto cleanup;
hr = filedata->lpVtbl->GetType(filedata, &guid);
if (SUCCEEDED(hr) && IsEqualGUID(&guid, &TID_D3DRMMesh))
{
ret = filedata;
break;
}
else
filedata->lpVtbl->Release(filedata);
}
cleanup:
if (enumobj) enumobj->lpVtbl->Release(enumobj);
if (d3dxfile) d3dxfile->lpVtbl->Release(d3dxfile);
return ret;
}
static void D3DXLoadSkinMeshFromXofTest(void)
{
static const char simple_xfile[] =
"xof 0303txt 0032"
"Mesh {"
"3;"
"0.0; 0.0; 0.0;,"
"0.0; 1.0; 0.0;,"
"1.0; 1.0; 0.0;;"
"1;"
"3; 0, 1, 2;;"
"}";
ID3DXBuffer *adjacency, *materials, *effects;
D3DPRESENT_PARAMETERS d3dpp;
IDirect3DDevice9 *device;
ID3DXFileData *filedata;
ID3DXSkinInfo *skininfo;
ID3DXMesh *mesh;
IDirect3D9 *d3d;
DWORD mat_count;
HRESULT hr;
HWND hwnd;
if (!(hwnd = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
640, 480, NULL, NULL, NULL, NULL)))
{
skip("Couldn't create application window\n");
return;
}
d3d = Direct3DCreate9(D3D_SDK_VERSION);
if (!d3d)
{
skip("Couldn't create IDirect3D9 object\n");
DestroyWindow(hwnd);
return;
}
ZeroMemory(&d3dpp, sizeof(d3dpp));
d3dpp.Windowed = TRUE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device);
IDirect3D9_Release(d3d);
if (FAILED(hr))
{
skip("Failed to create IDirect3DDevice9 object %#x\n", hr);
DestroyWindow(hwnd);
return;
}
filedata = get_mesh_data(simple_xfile, sizeof(simple_xfile) - 1);
ok(filedata != NULL, "Failed to load mesh data\n");
adjacency = materials = effects = NULL;
skininfo = NULL;
mesh = NULL;
hr = D3DXLoadSkinMeshFromXof(filedata, 0, device, &adjacency, &materials, &effects, &mat_count, &skininfo, &mesh);
ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
ok(skininfo != NULL, "Expected non-null skininfo\n");
/* FIXME: Add additional tests for skininfo interface. */
if (adjacency) adjacency->lpVtbl->Release(adjacency);
if (materials) materials->lpVtbl->Release(materials);
if (effects) effects->lpVtbl->Release(effects);
if (skininfo) skininfo->lpVtbl->Release(skininfo);
if (mesh) mesh->lpVtbl->Release(mesh);
filedata->lpVtbl->Release(filedata);
IDirect3DDevice9_Release(device);
DestroyWindow(hwnd);
}
static BOOL compute_box(struct mesh *mesh, float width, float height, float depth)
{
unsigned int i, face;
@ -5316,88 +5190,6 @@ static void test_create_skin_info(void)
ok(hr == D3DERR_INVALIDCALL, "Expected D3DERR_INVALIDCALL, got %#x\n", hr);
}
static void test_update_skinned_mesh(void)
{
static DWORD bone0_vertices[2] = { 1, 3 };
static FLOAT bone0_weights[2] = { 1.0f, 0.5f };
static DWORD bone1_vertices[2] = { 2, 3 };
static FLOAT bone1_weights[2] = { 1.0f, 0.5f };
static D3DMATRIX bones_matrix[2] =
{ { { {
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
2.0f, 2.0f, 4.0f, 1.0f
} } },
{ { {
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
-4.0f, -4.0f, 4.0f, 1.0f
} } } };
static D3DVECTOR vertices_src[] = {{ 1.0f, 1.0f, 1.0f },
{ 1.0f, 0.0f, 0.0f },
{ 1.0f, 1.0f, -1.0f },
{ 0.0f, 1.0f, 0.0f },
{ -1.0f, -1.0f, 1.0f },
{ 0.0f, 0.0f, 1.0f },
{ -1.0f, -1.0f, -1.0f },
{ -1.0f, 0.0f, 0.0f },
};
static D3DVECTOR vertices_ref[] = {{ 0.0f, 0.0f, 0.0f },
{ 0.0f, 0.0f, 0.0f },
{ 3.0f, 3.0f, 3.0f },
{ 0.0f, 1.0f, 0.0f },
{ -5.0f, -5.0f, 5.0f },
{ 0.0f, 0.0f, 1.0f },
{ -2.0f, -2.0f, 3.0f },
{ -1.0f, 0.0f, 0.0f },
};
D3DVECTOR vertices_dest[8];
HRESULT hr;
ID3DXSkinInfo *skin_info;
D3DXMATRIX matrix;
int i;
D3DXMatrixIdentity(&matrix);
for (i = 0; i < 8; i++)
{
vertices_dest[i].x = 10000.0f;
vertices_dest[i].y = 10000.0f;
vertices_dest[i].z = 10000.0f;
}
hr = D3DXCreateSkinInfoFVF(4, D3DFVF_XYZ | D3DFVF_NORMAL, 2, &skin_info);
ok(hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr);
skin_info->lpVtbl->SetBoneInfluence(skin_info, 0, 2, bone0_vertices, bone0_weights);
ok(hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr);
skin_info->lpVtbl->SetBoneOffsetMatrix(skin_info, 0, &matrix);
ok(hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr);
skin_info->lpVtbl->SetBoneInfluence(skin_info, 1, 2, bone1_vertices, bone1_weights);
ok(hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr);
skin_info->lpVtbl->SetBoneOffsetMatrix(skin_info, 1, &matrix);
ok(hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr);
skin_info->lpVtbl->UpdateSkinnedMesh(skin_info, bones_matrix, NULL, vertices_src, vertices_dest);
ok(hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr);
for (i = 0; i < 4; i++)
{
ok(compare(vertices_dest[i*2].x, vertices_ref[i*2].x), "Vertex[%d].position.x: got %g, expected %g\n",
i, vertices_dest[i*2].x, vertices_ref[i*2].x);
ok(compare(vertices_dest[i*2].y, vertices_ref[i*2].y), "Vertex[%d].position.y: got %g, expected %g\n",
i, vertices_dest[i*2].y, vertices_ref[i*2].y);
ok(compare(vertices_dest[i*2].z, vertices_ref[i*2].z), "Vertex[%d].position.z: got %g, expected %g\n",
i, vertices_dest[i*2].z, vertices_ref[i*2].z);
ok(compare(vertices_dest[i*2+1].x, vertices_ref[i*2+1].x), "Vertex[%d].normal.x: got %g, expected %g\n",
i, vertices_dest[i*2+1].x, vertices_ref[i*2+1].x);
ok(compare(vertices_dest[i*2+1].y, vertices_ref[i*2+1].y), "Vertex[%d].normal.y: got %g, expected %g\n",
i, vertices_dest[i*2+1].y, vertices_ref[i*2+1].y);
ok(compare(vertices_dest[i*2+1].z, vertices_ref[i*2+1].z), "Vertex[%d].normal.z: got %g, expected %g\n",
i, vertices_dest[i*2+1].z, vertices_ref[i*2+1].z);
}
skin_info->lpVtbl->Release(skin_info);
}
static void test_convert_adjacency_to_point_reps(void)
{
HRESULT hr;
@ -10362,10 +10154,10 @@ static void test_clone_mesh(void)
hr = mesh->lpVtbl->CloneMesh(mesh, tc[i].clone_options, tc[i].new_declaration,
test_context->device, &mesh_clone);
ok(hr == D3D_OK, "CloneMesh test case %d failed. Got %x, expected D3D_OK.\n", i, hr);
ok(hr == D3D_OK, "CloneMesh test case %d failed. Got %x\n, expected D3D_OK\n", i, hr);
hr = mesh_clone->lpVtbl->GetDeclaration(mesh_clone, new_declaration);
ok(hr == D3D_OK, "GetDeclaration test case %d failed. Got %x, expected D3D_OK.\n", i, hr);
ok(hr == D3D_OK, "GetDeclaration test case %d failed. Got %x\n, expected D3D_OK\n", i, hr);
/* Check declaration elements */
for (j = 0; tc[i].new_declaration[j].Stream != 0xFF; j++)
{
@ -10552,7 +10344,7 @@ static void test_valid_mesh(void)
hr = D3DXValidMesh(mesh, tc[i].adjacency, &errors_and_warnings);
todo_wine ok(hr == tc[i].exp_hr, "D3DXValidMesh test case %d failed. "
"Got %x, expected %x.\n", i, hr, tc[i].exp_hr);
"Got %x\n, expected %x\n", i, hr, tc[i].exp_hr);
/* Note errors_and_warnings is deliberately not checked because that
* would require copying wast amounts of the text output. */
@ -10570,27 +10362,6 @@ cleanup:
free_test_context(test_context);
}
static void test_optimize_vertices(void)
{
HRESULT hr;
DWORD vertex_remap[3];
const DWORD indices[] = {0, 1, 2};
const UINT num_faces = 1;
const UINT num_vertices = 3;
hr = D3DXOptimizeVertices(indices, num_faces,
num_vertices, FALSE,
vertex_remap);
ok(hr == D3D_OK, "D3DXOptimizeVertices failed. Got %x, expected D3D_OK.\n", hr);
/* vertex_remap must not be NULL */
hr = D3DXOptimizeVertices(indices, num_faces,
num_vertices, FALSE,
NULL);
ok(hr == D3DERR_INVALIDCALL, "D3DXOptimizeVertices passed NULL vertex_remap "
"pointer. Got %x, expected D3DERR_INVALIDCALL.\n", hr);
}
static void test_optimize_faces(void)
{
HRESULT hr;
@ -10717,7 +10488,7 @@ static void test_optimize_faces(void)
tc[i].num_vertices, tc[i].indices_are_32bit,
face_remap);
ok(hr == D3D_OK, "D3DXOptimizeFaces test case %d failed. "
"Got %x, expected D3D_OK.\n", i, hr);
"Got %x\n, expected D3D_OK\n", i, hr);
/* Compare face remap with expected face remap */
for (j = 0; j < tc[i].num_faces; j++)
@ -10735,14 +10506,14 @@ static void test_optimize_faces(void)
tc[0].num_vertices, tc[0].indices_are_32bit,
NULL);
ok(hr == D3DERR_INVALIDCALL, "D3DXOptimizeFaces passed NULL face_remap "
"pointer. Got %x, expected D3DERR_INVALIDCALL.\n", hr);
"pointer. Got %x\n, expected D3DERR_INVALIDCALL\n", hr);
/* Number of faces must be smaller than 2^15 */
hr = D3DXOptimizeFaces(tc[0].indices, 2 << 15,
tc[0].num_vertices, FALSE,
&smallest_face_remap);
ok(hr == D3DERR_INVALIDCALL, "D3DXOptimizeFaces should not accept 2^15 "
"faces when using 16-bit indices. Got %x, expected D3DERR_INVALIDCALL.\n", hr);
"faces when using 16-bit indices. Got %x\n, expected D3DERR_INVALIDCALL\n", hr);
}
static HRESULT clear_normals(ID3DXMesh *mesh)
@ -11461,7 +11232,6 @@ START_TEST(mesh)
D3DXCreateMeshTest();
D3DXCreateMeshFVFTest();
D3DXLoadMeshTest();
D3DXLoadSkinMeshFromXofTest();
D3DXCreateBoxTest();
D3DXCreatePolygonTest();
D3DXCreateSphereTest();
@ -11475,13 +11245,11 @@ START_TEST(mesh)
D3DXGenerateAdjacencyTest();
test_update_semantics();
test_create_skin_info();
test_update_skinned_mesh();
test_convert_adjacency_to_point_reps();
test_convert_point_reps_to_adjacency();
test_weld_vertices();
test_clone_mesh();
test_valid_mesh();
test_optimize_vertices();
test_optimize_faces();
test_compute_normals();
test_D3DXFrameFind();

View file

@ -6575,214 +6575,6 @@ static void test_shader_semantics(void)
}
}
static const DWORD ps_tex[] = {
0xffff0103, /* ps_1_3 */
0x00000042, 0xb00f0000, /* tex t0 */
0x00000000, /* nop */
0x0000ffff};
static const DWORD ps_texld_1_4[] = {
0xffff0104, /* ps_1_4 */
0x00000042, 0xb00f0000, 0xa0e40000, /* texld t0, c0 */
0x00000000, /* nop */
0x0000ffff};
static const DWORD ps_texld_2_0[] = {
0xffff0200, /* ps_2_0 */
0x00000042, 0xb00f0000, 0xa0e40000, 0xa0e40001, /* texld t0, c0, c1 */
0x00000000, /* nop */
0x0000ffff};
static const DWORD ps_texcoord[] = {
0xffff0103, /* ps_1_4 */
0x00000040, 0xb00f0000, /* texcoord t0 */
0x00000000, /* nop */
0x0000ffff};
static const DWORD ps_texcrd[] = {
0xffff0104, /* ps_2_0 */
0x00000040, 0xb00f0000, 0xa0e40000, /* texcrd t0, c0 */
0x00000000, /* nop */
0x0000ffff};
static const DWORD ps_sincos_2_0[] = {
0xffff0200, /* ps_2_0 */
0x00000025, 0xb00f0000, 0xa0e40000, 0xa0e40001, 0xa0e40002, /* sincos t0, c0, c1, c2 */
0x00000000, /* nop */
0x0000ffff};
static const DWORD ps_sincos_3_0[] = {
0xffff0300, /* ps_3_0 */
0x00000025, 0xb00f0000, 0xa0e40000, /* sincos t0, c0 */
0x00000000, /* nop */
0x0000ffff};
static const DWORD vs_sincos_2_0[] = {
0xfffe0200, /* vs_2_0 */
0x00000025, 0xb00f0000, 0xa0e40000, 0xa0e40001, 0xa0e40002, /* sincos a0, c0, c1, c2 */
0x00000000, /* nop */
0x0000ffff};
static const DWORD vs_sincos_3_0[] = {
0xfffe0300, /* vs_3_0 */
0x00000025, 0xb00f0000, 0xa0e40000, /* sincos a0, c0 */
0x00000000, /* nop */
0x0000ffff};
static void test_disassemble_shader(void)
{
static const char disasm_vs[] = " vs_1_1\n"
" dcl_position v0\n"
" dp4 oPos.x, v0, c0\n"
" dp4 oPos.y, v0, c1\n"
" dp4 oPos.z, v0, c2\n"
" dp4 oPos.w, v0, c3\n";
static const char disasm_ps[] = " ps_1_1\n"
" def c1, 1, 0, 0, 0\n"
" tex t0\n"
" dp3 r0, c1, c0\n"
" mul r0, v0, r0\n"
" mul r0, t0, r0\n";
static const char disasm_ps_tex[] = " ps_1_3\n"
" tex t0\n"
" nop\n";
static const char disasm_ps_texld_1_4[] = " ps_1_4\n"
" texld t0, c0\n"
" nop\n";
static const char disasm_ps_texld_2_0[] = " ps_2_0\n"
" texld t0, c0, c1\n"
" nop\n";
static const char disasm_ps_texcoord[] = " ps_1_3\n"
" texcoord t0\n"
" nop\n";
static const char disasm_ps_texcrd[] = " ps_1_4\n"
" texcrd t0, c0\n"
" nop\n";
static const char disasm_ps_sincos_2_0[] = " ps_2_0\n"
" sincos t0, c0, c1, c2\n"
" nop\n";
static const char disasm_ps_sincos_3_0[] = " ps_3_0\n"
" sincos t0, c0\n"
" nop\n";
static const char disasm_vs_sincos_2_0[] = " vs_2_0\n"
" sincos a0, c0, c1, c2\n"
" nop\n";
static const char disasm_vs_sincos_3_0[] = " vs_3_0\n"
" sincos a0, c0\n"
" nop\n";
ID3DXBuffer *disassembly;
HRESULT ret;
char *ptr;
/* Check wrong parameters */
ret = D3DXDisassembleShader(NULL, FALSE, NULL, NULL);
ok(ret == D3DERR_INVALIDCALL, "Returned %#x, expected %#x\n", ret, D3DERR_INVALIDCALL);
ret = D3DXDisassembleShader(NULL, FALSE, NULL, &disassembly);
ok(ret == D3DERR_INVALIDCALL, "Returned %#x, expected %#x\n", ret, D3DERR_INVALIDCALL);
ret = D3DXDisassembleShader(simple_vs, FALSE, NULL, NULL);
ok(ret == D3DERR_INVALIDCALL, "Returned %#x, expected %#x\n", ret, D3DERR_INVALIDCALL);
/* Test with vertex shader */
disassembly = (void *)0xdeadbeef;
ret = D3DXDisassembleShader(simple_vs, FALSE, NULL, &disassembly);
ok(ret == D3D_OK, "Failed with %#x\n", ret);
ptr = ID3DXBuffer_GetBufferPointer(disassembly);
ok(!memcmp(ptr, disasm_vs, sizeof(disasm_vs) - 1), /* compare beginning */
"Returned '%s', expected '%s'\n", ptr, disasm_vs);
ID3DXBuffer_Release(disassembly);
/* Test with pixel shader */
disassembly = (void *)0xdeadbeef;
ret = D3DXDisassembleShader(simple_ps, FALSE, NULL, &disassembly);
ok(ret == D3D_OK, "Failed with %#x\n", ret);
ptr = ID3DXBuffer_GetBufferPointer(disassembly);
ok(!memcmp(ptr, disasm_ps, sizeof(disasm_ps) - 1), /* compare beginning */
"Returned '%s', expected '%s'\n", ptr, disasm_ps);
ID3DXBuffer_Release(disassembly);
/* Test tex instruction with pixel shader 1.3 */
disassembly = (void *)0xdeadbeef;
ret = D3DXDisassembleShader(ps_tex, FALSE, NULL, &disassembly);
ok(ret == D3D_OK, "Failed with %#x\n", ret);
ptr = ID3DXBuffer_GetBufferPointer(disassembly);
ok(!memcmp(ptr, disasm_ps_tex, sizeof(disasm_ps_tex) - 1), /* compare beginning */
"Returned '%s', expected '%s'\n", ptr, disasm_ps_tex);
ID3DXBuffer_Release(disassembly);
/* Test texld instruction with pixel shader 1.4 */
disassembly = (void *)0xdeadbeef;
ret = D3DXDisassembleShader(ps_texld_1_4, FALSE, NULL, &disassembly);
ok(ret == D3D_OK, "Failed with %#x\n", ret);
ptr = ID3DXBuffer_GetBufferPointer(disassembly);
ok(!memcmp(ptr, disasm_ps_texld_1_4, sizeof(disasm_ps_texld_1_4) - 1), /* compare beginning */
"Returned '%s', expected '%s'\n", ptr, disasm_ps_texld_1_4);
ID3DXBuffer_Release(disassembly);
/* Test texld instruction with pixel shader 2.0 */
disassembly = (void *)0xdeadbeef;
ret = D3DXDisassembleShader(ps_texld_2_0, FALSE, NULL, &disassembly);
ok(ret == D3D_OK, "Failed with %#x\n", ret);
ptr = ID3DXBuffer_GetBufferPointer(disassembly);
ok(!memcmp(ptr, disasm_ps_texld_2_0, sizeof(disasm_ps_texld_2_0) - 1), /* compare beginning */
"Returned '%s', expected '%s'\n", ptr, disasm_ps_texld_2_0);
ID3DXBuffer_Release(disassembly);
/* Test texcoord instruction with pixel shader 1.3 */
disassembly = (void *)0xdeadbeef;
ret = D3DXDisassembleShader(ps_texcoord, FALSE, NULL, &disassembly);
ok(ret == D3D_OK, "Failed with %#x\n", ret);
ptr = ID3DXBuffer_GetBufferPointer(disassembly);
ok(!memcmp(ptr, disasm_ps_texcoord, sizeof(disasm_ps_texcoord) - 1), /* compare beginning */
"Returned '%s', expected '%s'\n", ptr, disasm_ps_texcoord);
ID3DXBuffer_Release(disassembly);
/* Test texcrd instruction with pixel shader 1.4 */
disassembly = (void *)0xdeadbeef;
ret = D3DXDisassembleShader(ps_texcrd, FALSE, NULL, &disassembly);
ok(ret == D3D_OK, "Failed with %#x\n", ret);
ptr = ID3DXBuffer_GetBufferPointer(disassembly);
ok(!memcmp(ptr, disasm_ps_texcrd, sizeof(disasm_ps_texcrd) - 1), /* compare beginning */
"Returned '%s', expected '%s'\n", ptr, disasm_ps_texcrd);
ID3DXBuffer_Release(disassembly);
/* Test sincos instruction pixel shader 2.0 */
disassembly = (void *)0xdeadbeef;
ret = D3DXDisassembleShader(ps_sincos_2_0, FALSE, NULL, &disassembly);
ok(ret == D3D_OK, "Failed with %#x\n", ret);
ptr = ID3DXBuffer_GetBufferPointer(disassembly);
ok(!memcmp(ptr, disasm_ps_sincos_2_0, sizeof(disasm_ps_sincos_2_0) - 1), /* compare beginning */
"Returned '%s', expected '%s'\n", ptr, disasm_ps_sincos_2_0);
ID3DXBuffer_Release(disassembly);
/* Test sincos instruction with pixel shader 3.0 */
disassembly = (void *)0xdeadbeef;
ret = D3DXDisassembleShader(ps_sincos_3_0, FALSE, NULL, &disassembly);
ok(ret == D3D_OK, "Failed with %#x\n", ret);
ptr = ID3DXBuffer_GetBufferPointer(disassembly);
ok(!memcmp(ptr, disasm_ps_sincos_3_0, sizeof(disasm_ps_sincos_3_0) - 1), /* compare beginning */
"Returned '%s', expected '%s'\n", ptr, disasm_ps_sincos_3_0);
ID3DXBuffer_Release(disassembly);
/* Test sincos instruction with pixel shader 2.0 */
disassembly = (void *)0xdeadbeef;
ret = D3DXDisassembleShader(vs_sincos_2_0, FALSE, NULL, &disassembly);
ok(ret == D3D_OK, "Failed with %#x\n", ret);
ptr = ID3DXBuffer_GetBufferPointer(disassembly);
ok(!memcmp(ptr, disasm_vs_sincos_2_0, sizeof(disasm_vs_sincos_2_0) - 1), /* compare beginning */
"Returned '%s', expected '%s'\n", ptr, disasm_vs_sincos_2_0);
ID3DXBuffer_Release(disassembly);
/* Test sincos instruction with pixel shader 3.0 */
disassembly = (void *)0xdeadbeef;
ret = D3DXDisassembleShader(vs_sincos_3_0, FALSE, NULL, &disassembly);
ok(ret == D3D_OK, "Failed with %#x\n", ret);
ptr = ID3DXBuffer_GetBufferPointer(disassembly);
ok(!memcmp(ptr, disasm_vs_sincos_3_0, sizeof(disasm_vs_sincos_3_0) - 1), /* compare beginning */
"Returned '%s', expected '%s'\n", ptr, disasm_vs_sincos_3_0);
ID3DXBuffer_Release(disassembly);
}
START_TEST(shader)
{
test_get_shader_size();
@ -6797,5 +6589,4 @@ START_TEST(shader)
test_registerset();
test_registerset_defaults();
test_shader_semantics();
test_disassemble_shader();
}

View file

@ -67,24 +67,6 @@ static const unsigned char bmp_8bpp[] = {
0x00,0x00
};
/* 2x2 bmp (32 bpp XRGB) */
static const unsigned char bmp_32bpp_xrgb[] = {
0x42,0x4d,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x00,0x00,0x00,0x28,0x00,
0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x20,0x00,0x00,0x00,
0x00,0x00,0x10,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0xb0,0xc0,0x00,0xa1,0xb1,0xc1,0x00,0xa2,0xb2,
0xc2,0x00,0xa3,0xb3,0xc3,0x00
};
/* 2x2 bmp (32 bpp ARGB) */
static const unsigned char bmp_32bpp_argb[] = {
0x42,0x4d,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x00,0x00,0x00,0x28,0x00,
0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x20,0x00,0x00,0x00,
0x00,0x00,0x10,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0xb0,0xc0,0x00,0xa1,0xb1,0xc1,0x00,0xa2,0xb2,
0xc2,0x00,0xa3,0xb3,0xc3,0x01
};
static const unsigned char png_grayscale[] =
{
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49,
@ -577,14 +559,6 @@ static void test_D3DXGetImageInfo(void)
ok(hr == D3D_OK, "D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n", hr, D3D_OK);
ok(info.Depth == 1, "Got depth %u, expected 1\n", info.Depth);
ok(info.Format == D3DFMT_P8, "Got format %u, expected %u\n", info.Format, D3DFMT_P8);
hr = D3DXGetImageInfoFromFileInMemory(bmp_32bpp_xrgb, sizeof(bmp_32bpp_xrgb), &info);
ok(hr == D3D_OK, "D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n", hr, D3D_OK);
ok(info.Depth == 1, "Got depth %u, expected 1\n", info.Depth);
ok(info.Format == D3DFMT_X8R8G8B8, "Got format %u, expected %u\n", info.Format, D3DFMT_X8R8G8B8);
hr = D3DXGetImageInfoFromFileInMemory(bmp_32bpp_argb, sizeof(bmp_32bpp_argb), &info);
ok(hr == D3D_OK, "D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n", hr, D3D_OK);
ok(info.Depth == 1, "Got depth %u, expected 1\n", info.Depth);
ok(info.Format == D3DFMT_A8R8G8B8, "Got format %u, expected %u\n", info.Format, D3DFMT_A8R8G8B8);
/* Grayscale PNG */
hr = D3DXGetImageInfoFromFileInMemory(png_grayscale, sizeof(png_grayscale), &info);
@ -1224,7 +1198,7 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
hr = IDirect3DTexture9_GetSurfaceLevel(tex, 0, &newsurf);
ok(SUCCEEDED(hr), "Failed to get the surface, hr %#x.\n", hr);
hr = D3DXLoadSurfaceFromSurface(newsurf, NULL, NULL, surf, NULL, NULL, D3DX_FILTER_NONE, 0);
ok(SUCCEEDED(hr), "Failed to convert pixels to DXT3 format.\n");
todo_wine ok(SUCCEEDED(hr), "Failed to convert pixels to DXT3 format.\n");
check_release((IUnknown*)newsurf, 1);
check_release((IUnknown*)tex, 0);
}
@ -1250,7 +1224,7 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
hr = IDirect3DTexture9_GetSurfaceLevel(tex, 0, &newsurf);
ok(SUCCEEDED(hr), "Failed to get the surface, hr %#x.\n", hr);
hr = D3DXLoadSurfaceFromSurface(newsurf, NULL, NULL, surf, NULL, NULL, D3DX_FILTER_NONE, 0);
ok(SUCCEEDED(hr), "Failed to convert pixels to DXT5 format.\n");
todo_wine ok(SUCCEEDED(hr), "Failed to convert pixels to DXT5 format.\n");
check_release((IUnknown*)newsurf, 1);
check_release((IUnknown*)tex, 0);
}
@ -1263,10 +1237,10 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
hr = IDirect3DTexture9_GetSurfaceLevel(tex, 0, &newsurf);
ok(SUCCEEDED(hr), "Failed to get the surface, hr %#x.\n", hr);
hr = D3DXLoadSurfaceFromSurface(newsurf, NULL, NULL, surf, NULL, NULL, D3DX_FILTER_NONE, 0);
ok(SUCCEEDED(hr), "Failed to convert pixels to DXT1 format.\n");
todo_wine ok(SUCCEEDED(hr), "Failed to convert pixels to DXT1 format.\n");
hr = D3DXLoadSurfaceFromSurface(surf, NULL, NULL, newsurf, NULL, NULL, D3DX_FILTER_NONE, 0);
ok(SUCCEEDED(hr), "Failed to convert pixels from DXT1 format.\n");
todo_wine ok(SUCCEEDED(hr), "Failed to convert pixels from DXT1 format.\n");
check_release((IUnknown*)newsurf, 1);
check_release((IUnknown*)tex, 0);

View file

@ -400,16 +400,6 @@ static void test_D3DXCheckTextureRequirements(IDirect3DDevice9 *device)
ok(height == 4, "Returned height %d, expected %d\n", height, 4);
ok(mipmaps == 1, "Returned mipmaps %d, expected %d\n", mipmaps, 1);
ok(format == D3DFMT_DXT5, "Returned format %u, expected %u\n", format, D3DFMT_DXT5);
format = D3DFMT_DXT5;
width = 5; height = 5;
mipmaps = 1;
hr = D3DXCheckTextureRequirements(device, &width, &height, &mipmaps, 0, &format, D3DPOOL_DEFAULT);
ok(hr == D3D_OK, "D3DXCheckTextureRequirements returned %#x, expected %#x\n", hr, D3D_OK);
ok(width == 8, "Returned width %d, expected %d\n", width, 8);
ok(height == 8, "Returned height %d, expected %d\n", height, 8);
ok(mipmaps == 1, "Returned mipmaps %d, expected %d\n", mipmaps, 1);
ok(format == D3DFMT_DXT5, "Returned format %u, expected %u\n", format, D3DFMT_DXT5);
}
else
{

View file

@ -396,7 +396,6 @@ HRESULT WINAPI D3DXSHEvalSphericalLight(UINT order, const D3DXVECTOR3 *dir, FLOA
FLOAT* WINAPI D3DXSHMultiply2(FLOAT *out, const FLOAT *a, const FLOAT *b);
FLOAT* WINAPI D3DXSHMultiply3(FLOAT *out, const FLOAT *a, const FLOAT *b);
FLOAT* WINAPI D3DXSHMultiply4(FLOAT *out, const FLOAT *a, const FLOAT *b);
HRESULT WINAPI D3DXSHProjectCubeMap(UINT order, IDirect3DCubeTexture9 *cubemap, FLOAT *rout, FLOAT *gout, FLOAT *bout);
FLOAT* WINAPI D3DXSHRotate(FLOAT *out, UINT order, const D3DXMATRIX *matrix, const FLOAT *in);
FLOAT* WINAPI D3DXSHRotateZ(FLOAT *out, UINT order, FLOAT angle, const FLOAT *in);
FLOAT* WINAPI D3DXSHScale(FLOAT *out, UINT order, const FLOAT *a, const FLOAT scale);

View file

@ -1,73 +0,0 @@
diff --git a/dll/directx/wine/d3dx9_36/surface.c b/dll/directx/wine/d3dx9_36/surface.c
index cf8286e..6e2c10a 100644
--- a/dll/directx/wine/d3dx9_36/surface.c
+++ b/dll/directx/wine/d3dx9_36/surface.c
@@ -954,6 +954,24 @@ HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(const void *data, UINT datasize,
}
}
+ /* For 32 bpp BMP, windowscodecs.dll never returns a format with alpha while
+ * d3dx9_xx.dll returns one if at least 1 pixel has a non zero alpha component */
+ if (SUCCEEDED(hr) && (info->Format == D3DFMT_X8R8G8B8) && (info->ImageFileFormat == D3DXIFF_BMP)) {
+ DWORD size = sizeof(DWORD) * info->Width * info->Height;
+ BYTE *buffer = HeapAlloc(GetProcessHeap(), 0, size);
+ hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, sizeof(DWORD) * info->Width, size, buffer);
+ if (SUCCEEDED(hr)) {
+ DWORD i;
+ for (i = 0; i < info->Width * info->Height; i++) {
+ if (buffer[i*4+3]) {
+ info->Format = D3DFMT_A8R8G8B8;
+ break;
+ }
+ }
+ }
+ HeapFree(GetProcessHeap(), 0, buffer);
+ }
+
if (frame)
IWICBitmapFrameDecode_Release(frame);
diff --git a/modules/rostests/winetests/d3dx9_36/surface.c b/modules/rostests/winetests/d3dx9_36/surface.c
index b7c52a2..2c83dc2 100644
--- a/modules/rostests/winetests/d3dx9_36/surface.c
+++ b/modules/rostests/winetests/d3dx9_36/surface.c
@@ -67,6 +67,24 @@ static const unsigned char bmp_8bpp[] = {
0x00,0x00
};
+/* 2x2 bmp (32 bpp XRGB) */
+static const unsigned char bmp_32bpp_xrgb[] = {
+0x42,0x4d,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x00,0x00,0x00,0x28,0x00,
+0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x20,0x00,0x00,0x00,
+0x00,0x00,0x10,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0xb0,0xc0,0x00,0xa1,0xb1,0xc1,0x00,0xa2,0xb2,
+0xc2,0x00,0xa3,0xb3,0xc3,0x00
+};
+
+/* 2x2 bmp (32 bpp ARGB) */
+static const unsigned char bmp_32bpp_argb[] = {
+0x42,0x4d,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x00,0x00,0x00,0x28,0x00,
+0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x20,0x00,0x00,0x00,
+0x00,0x00,0x10,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0xb0,0xc0,0x00,0xa1,0xb1,0xc1,0x00,0xa2,0xb2,
+0xc2,0x00,0xa3,0xb3,0xc3,0x01
+};
+
static const unsigned char png_grayscale[] =
{
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49,
@@ -559,6 +577,14 @@ static void test_D3DXGetImageInfo(void)
ok(hr == D3D_OK, "D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n", hr, D3D_OK);
ok(info.Depth == 1, "Got depth %u, expected 1\n", info.Depth);
ok(info.Format == D3DFMT_P8, "Got format %u, expected %u\n", info.Format, D3DFMT_P8);
+ hr = D3DXGetImageInfoFromFileInMemory(bmp_32bpp_xrgb, sizeof(bmp_32bpp_xrgb), &info);
+ ok(hr == D3D_OK, "D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n", hr, D3D_OK);
+ ok(info.Depth == 1, "Got depth %u, expected 1\n", info.Depth);
+ ok(info.Format == D3DFMT_X8R8G8B8, "Got format %u, expected %u\n", info.Format, D3DFMT_X8R8G8B8);
+ hr = D3DXGetImageInfoFromFileInMemory(bmp_32bpp_argb, sizeof(bmp_32bpp_argb), &info);
+ ok(hr == D3D_OK, "D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n", hr, D3D_OK);
+ ok(info.Depth == 1, "Got depth %u, expected 1\n", info.Depth);
+ ok(info.Format == D3DFMT_A8R8G8B8, "Got format %u, expected %u\n", info.Format, D3DFMT_A8R8G8B8);
/* Grayscale PNG */
hr = D3DXGetImageInfoFromFileInMemory(png_grayscale, sizeof(png_grayscale), &info);

View file

@ -1,39 +0,0 @@
diff --git a/dll/directx/wine/d3dx9_36/surface.c b/dll/directx/wine/d3dx9_36/surface.c
index 6e2c10a..01729ea 100644
--- a/dll/directx/wine/d3dx9_36/surface.c
+++ b/dll/directx/wine/d3dx9_36/surface.c
@@ -111,6 +111,7 @@ static const GUID *d3dformat_to_wic_guid(D3DFORMAT format)
#define DDS_PF_RGB 0x40
#define DDS_PF_YUV 0x200
#define DDS_PF_LUMINANCE 0x20000
+#define DDS_PF_BUMPLUMINANCE 0x40000
#define DDS_PF_BUMPDUDV 0x80000
struct dds_pixel_format
@@ -334,6 +335,17 @@ static D3DFORMAT dds_bump_to_d3dformat(const struct dds_pixel_format *pixel_form
return D3DFMT_UNKNOWN;
}
+static D3DFORMAT dds_bump_luminance_to_d3dformat(const struct dds_pixel_format *pixel_format)
+{
+ if (pixel_format->bpp == 32 && pixel_format->rmask == 0x000000ff && pixel_format->gmask == 0x0000ff00
+ && pixel_format->bmask == 0x00ff0000)
+ return D3DFMT_X8L8V8U8;
+
+ WARN("Unknown bump pixel format (%u, %#x, %#x, %#x, %#x)\n", pixel_format->bpp,
+ pixel_format->rmask, pixel_format->gmask, pixel_format->bmask, pixel_format->amask);
+ return D3DFMT_UNKNOWN;
+}
+
static D3DFORMAT dds_pixel_format_to_d3dformat(const struct dds_pixel_format *pixel_format)
{
TRACE("pixel_format: size %u, flags %#x, fourcc %#x, bpp %u.\n", pixel_format->size,
@@ -351,6 +363,8 @@ static D3DFORMAT dds_pixel_format_to_d3dformat(const struct dds_pixel_format *pi
return dds_alpha_to_d3dformat(pixel_format);
if (pixel_format->flags & DDS_PF_BUMPDUDV)
return dds_bump_to_d3dformat(pixel_format);
+ if (pixel_format->flags & DDS_PF_BUMPLUMINANCE)
+ return dds_bump_luminance_to_d3dformat(pixel_format);
WARN("Unknown pixel format (flags %#x, fourcc %#x, bpp %u, r %#x, g %#x, b %#x, a %#x)\n",
pixel_format->flags, pixel_format->fourcc, pixel_format->bpp,

View file

@ -1,12 +0,0 @@
diff --git a/dll/directx/wine/d3dx9_36/util.c b/dll/directx/wine/d3dx9_36/util.c
index af71250..029e500 100644
--- a/dll/directx/wine/d3dx9_36/util.c
+++ b/dll/directx/wine/d3dx9_36/util.c
@@ -90,6 +90,7 @@ static const struct pixel_format_desc formats[] =
{D3DFMT_G32R32F, { 0, 32, 32, 0}, { 0, 0, 32, 0}, 8, 1, 1, 8, FORMAT_ARGBF, NULL, NULL },
{D3DFMT_A32B32G32R32F, {32, 32, 32, 32}, {96, 0, 32, 64}, 16, 1, 1, 16, FORMAT_ARGBF, NULL, NULL },
{D3DFMT_P8, { 8, 8, 8, 8}, { 0, 0, 0, 0}, 1, 1, 1, 1, FORMAT_INDEX, NULL, index_to_rgba},
+ {D3DFMT_X8L8V8U8, { 0, 8, 8, 8}, { 0, 0, 8, 16}, 4, 1, 1, 4, FORMAT_ARGB, NULL, NULL },
/* marks last element */
{D3DFMT_UNKNOWN, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 0, 1, 1, 0, FORMAT_UNKNOWN, NULL, NULL },
};

View file

@ -1,15 +0,0 @@
diff --git a/dll/directx/wine/d3dx9_36/effect.c b/dll/directx/wine/d3dx9_36/effect.c
index 33197de..8c2b499 100644
--- a/dll/directx/wine/d3dx9_36/effect.c
+++ b/dll/directx/wine/d3dx9_36/effect.c
@@ -4511,7 +4511,9 @@ static HRESULT WINAPI ID3DXEffectImpl_CloneEffect(ID3DXEffect *iface,
if (!device)
return D3DERR_INVALIDCALL;
- return E_NOTIMPL;
+ iface->lpVtbl->AddRef(iface);
+ *effect = iface;
+ return S_OK;
}
#if D3DX_SDK_VERSION >= 27

View file

@ -1,357 +0,0 @@
diff --git a/dll/directx/wine/d3dx9_36/shader.c b/dll/directx/wine/d3dx9_36/shader.c
index e8ce3dd..7a23867 100644
--- a/dll/directx/wine/d3dx9_36/shader.c
+++ b/dll/directx/wine/d3dx9_36/shader.c
@@ -1,6 +1,7 @@
/*
* Copyright 2008 Luis Busquets
* Copyright 2009 Matteo Bruni
+ * Copyright 2010, 2013, 2016 Christian Costa
* Copyright 2011 Travis Athougies
*
* This library is free software; you can redistribute it and/or
@@ -20,6 +21,7 @@
#include "config.h"
#include "wine/port.h"
+#include <stdio.h>
#include "d3dx9_private.h"
#include "d3dcommon.h"
@@ -2140,10 +2142,334 @@ HRESULT WINAPI D3DXGetShaderSamplers(const DWORD *byte_code, const char **sample
return D3D_OK;
}
+
+static const char *decl_usage[] = { "position", "blendweight", "blendindices", "normal", "psize", "texcoord",
+ "tangent", "binormal", "tessfactor", "positiont", "color" };
+
+static const char *tex_type[] = { "", "1d", "2d", "cube", "volume" };
+
+static int add_modifier(char *buffer, DWORD param)
+{
+ char *buf = buffer;
+ DWORD dst_mod = param & D3DSP_DSTMOD_MASK;
+
+ if (dst_mod & D3DSPDM_SATURATE)
+ buf += sprintf(buf, "_sat");
+ if (dst_mod & D3DSPDM_PARTIALPRECISION)
+ buf += sprintf(buf, "_pp");
+ if (dst_mod & D3DSPDM_MSAMPCENTROID)
+ buf += sprintf(buf, "_centroid");
+
+ return buf - buffer;
+}
+
+static int add_register(char *buffer, DWORD param, BOOL dst, BOOL ps)
+{
+ char *buf = buffer;
+ DWORD reg_type = ((param & D3DSP_REGTYPE_MASK2) >> D3DSP_REGTYPE_SHIFT2)
+ | ((param & D3DSP_REGTYPE_MASK) >> D3DSP_REGTYPE_SHIFT);
+ DWORD reg_num = param & D3DSP_REGNUM_MASK;
+
+ if (reg_type == D3DSPR_INPUT)
+ buf += sprintf(buf, "v%d", reg_num);
+ else if (reg_type == D3DSPR_CONST)
+ buf += sprintf(buf, "c%d", reg_num);
+ else if (reg_type == D3DSPR_TEMP)
+ buf += sprintf(buf, "r%d", reg_num);
+ else if (reg_type == D3DSPR_ADDR)
+ buf += sprintf(buf, "%s%d", ps ? "t" : "a", reg_num);
+ else if (reg_type == D3DSPR_SAMPLER)
+ buf += sprintf(buf, "s%d", reg_num);
+ else if (reg_type == D3DSPR_RASTOUT)
+ buf += sprintf(buf, "oPos");
+ else if (reg_type == D3DSPR_COLOROUT)
+ buf += sprintf(buf, "oC%d", reg_num);
+ else if (reg_type == D3DSPR_TEXCRDOUT)
+ buf += sprintf(buf, "oT%d", reg_num);
+ else if (reg_type == D3DSPR_ATTROUT)
+ buf += sprintf(buf, "oD%d", reg_num);
+ else
+ buf += sprintf(buf, "? (%d)", reg_type);
+
+ if (dst)
+ {
+ if ((param & D3DSP_WRITEMASK_ALL) != D3DSP_WRITEMASK_ALL)
+ {
+ buf += sprintf(buf, ".%s%s%s%s", param & D3DSP_WRITEMASK_0 ? "x" : "",
+ param & D3DSP_WRITEMASK_1 ? "y" : "",
+ param & D3DSP_WRITEMASK_2 ? "z" : "",
+ param & D3DSP_WRITEMASK_3 ? "w" : "");
+ }
+ }
+ else
+ {
+ if ((param & D3DVS_SWIZZLE_MASK) != D3DVS_NOSWIZZLE)
+ {
+ if ( ((param & D3DSP_SWIZZLE_MASK) == (D3DVS_X_X | D3DVS_Y_X | D3DVS_Z_X | D3DVS_W_X)) ||
+ ((param & D3DSP_SWIZZLE_MASK) == (D3DVS_X_Y | D3DVS_Y_Y | D3DVS_Z_Y | D3DVS_W_Y)) ||
+ ((param & D3DSP_SWIZZLE_MASK) == (D3DVS_X_Z | D3DVS_Y_Z | D3DVS_Z_Z | D3DVS_W_Z)) ||
+ ((param & D3DSP_SWIZZLE_MASK) == (D3DVS_X_W | D3DVS_Y_W | D3DVS_Z_W | D3DVS_W_W)) )
+ buf += sprintf(buf, ".%c", 'w' + (((param >> D3DVS_SWIZZLE_SHIFT) + 1) & 0x3));
+ else
+ buf += sprintf(buf, ".%c%c%c%c", 'w' + (((param >> (D3DVS_SWIZZLE_SHIFT+0)) + 1) & 0x3),
+ 'w' + (((param >> (D3DVS_SWIZZLE_SHIFT+2)) + 1) & 0x3),
+ 'w' + (((param >> (D3DVS_SWIZZLE_SHIFT+4)) + 1) & 0x3),
+ 'w' + (((param >> (D3DVS_SWIZZLE_SHIFT+6)) + 1) & 0x3));
+ }
+ }
+
+ return buf - buffer;
+}
+
+struct instr_info
+{
+ DWORD opcode;
+ const char *name;
+ int length;
+ int (*function)(const struct instr_info *info, DWORD **ptr, char *buffer, BOOL ps);
+ WORD min_version;
+ WORD max_version;
+};
+
+static int instr_comment(const struct instr_info *info, DWORD **ptr, char *buffer, BOOL ps)
+{
+ *ptr += 1 + ((**ptr & D3DSI_COMMENTSIZE_MASK) >> D3DSI_COMMENTSIZE_SHIFT);
+ return 0;
+}
+
+static int instr_def(const struct instr_info *info, DWORD **ptr, char *buffer, BOOL ps)
+{
+ int len = sprintf(buffer, " def c%d, %g, %g, %g, %g\n", *(*ptr+1) & D3DSP_REGNUM_MASK,
+ (double)*(float*)(*ptr+2), (double)*(float*)(*ptr+3),
+ (double)*(float*)(*ptr+4), (double)*(float*)(*ptr+5));
+ *ptr += 6;
+ return len;
+}
+
+static int instr_dcl(const struct instr_info *info, DWORD **ptr, char *buffer, BOOL ps)
+{
+ DWORD param1 = *++*ptr;
+ DWORD param2 = *++*ptr;
+ DWORD usage = (param1 & D3DSP_DCL_USAGE_MASK) >> D3DSP_DCL_USAGE_SHIFT;
+ DWORD usage_index = (param1 & D3DSP_DCL_USAGEINDEX_MASK) >> D3DSP_DCL_USAGEINDEX_SHIFT;
+ char *buf = buffer;
+
+ buf += sprintf(buf, " dcl");
+ if (ps)
+ {
+ if (param1 & D3DSP_TEXTURETYPE_MASK)
+ buf += sprintf(buf, "_%s", (usage <= D3DSTT_VOLUME) ?
+ tex_type[(param1 & D3DSP_TEXTURETYPE_MASK) >> D3DSP_TEXTURETYPE_SHIFT] : "???");
+ }
+ else
+ {
+ buf += sprintf(buf, "_%s", (usage <= D3DDECLUSAGE_COLOR) ? decl_usage[usage] : "???");
+ if (usage_index)
+ buf += sprintf(buf, "%d", usage_index);
+ }
+
+ buf += add_modifier(buf, param2);
+ buf += sprintf(buf, " ");
+ buf += add_register(buf, param2, TRUE, TRUE);
+ buf += sprintf(buf, "\n");
+ (*ptr)++;
+ return buf - buffer;
+}
+
+static int instr_generic(const struct instr_info *info, DWORD **ptr, char *buffer, BOOL ps)
+{
+ char *buf = buffer;
+ int j;
+
+ buf += sprintf(buf, " %s", info->name);
+ (*ptr)++;
+
+ if (info->length)
+ {
+ buf += add_modifier(buf, **ptr);
+
+ for (j = 0; j < info->length; j++)
+ {
+ buf += sprintf(buf, "%s ", j ? "," : "");
+
+ if ((j != 0) && ((**ptr & D3DSP_SRCMOD_MASK) != D3DSPSM_NONE))
+ {
+ if ((**ptr & D3DSP_SRCMOD_MASK) == D3DSPSM_NEG)
+ buf += sprintf(buf, "-");
+ else
+ buf += sprintf(buf, "*");
+ }
+
+ buf += add_register(buf, **ptr, j == 0, ps);
+
+ if (*(*ptr)++ & D3DVS_ADDRESSMODE_MASK)
+ {
+ buf += sprintf(buf, "[");
+ buf += add_register(buf, **ptr, FALSE, FALSE);
+ buf += sprintf(buf, "]");
+ (*ptr)++;
+ }
+ }
+ }
+ buf += sprintf(buf, "\n");
+ return buf - buffer;
+}
+
+const struct instr_info instructions[] =
+{
+ { D3DSIO_NOP, "nop", 0, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_MOV, "mov", 2, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_ADD, "add", 3, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_SUB, "sub", 3, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_MAD, "mad", 4, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_MUL, "mul", 3, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_RCP, "rcp", 2, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_RSQ, "rsq", 2, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_DP3, "dp3", 3, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_DP4, "dp4", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 1.2 for PS */
+ { D3DSIO_MIN, "min", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_MAX, "max", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_SLT, "slt", 3, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_SGE, "sge", 3, instr_generic, 0x0100, 0xFFFF }, /* VS only */
+ { D3DSIO_EXP, "exp", 2, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_LOG, "log", 2, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_LIT, "lit", 2, instr_generic, 0x0100, 0xFFFF }, /* VS only */
+ { D3DSIO_DST, "dst", 3, instr_generic, 0x0100, 0xFFFF }, /* VS only */
+ { D3DSIO_LRP, "lrp", 4, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for VS */
+ { D3DSIO_FRC, "frc", 2, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_M4x4, "m4x4", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_M4x3, "m4x3", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_M3x4, "m3x4", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_M3x3, "m3x3", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_M3x2, "m3x2", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_CALL, "call", 1, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
+ { D3DSIO_CALLNZ, "callnz", 2, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
+ { D3DSIO_LOOP, "loop", 2, instr_generic, 0x0200, 0xFFFF }, /* >= 3.0 for PS */
+ { D3DSIO_RET, "ret", 0, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
+ { D3DSIO_ENDLOOP, "endloop", 1, instr_generic, 0x0200, 0xFFFF }, /* >= 3.0 for PS */
+ { D3DSIO_LABEL, "label", 1, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
+ { D3DSIO_DCL, "dcl", 1, instr_dcl, 0x0100, 0xFFFF },
+ { D3DSIO_POW, "pow", 3, instr_generic, 0x0200, 0xFFFF },
+ { D3DSIO_CRS, "crs", 3, instr_generic, 0x0200, 0xFFFF },
+ { D3DSIO_SGN, "sgn", 4, instr_generic, 0x0200, 0xFFFF }, /* VS only */
+ { D3DSIO_ABS, "abs", 2, instr_generic, 0x0200, 0xFFFF },
+ { D3DSIO_NRM, "nrm", 2, instr_generic, 0x0200, 0xFFFF },
+ { D3DSIO_SINCOS, "sincos", 4, instr_generic, 0x0200, 0x02FF },
+ { D3DSIO_SINCOS, "sincos", 2, instr_generic, 0x0300, 0xFFFF },
+ { D3DSIO_REP, "rep", 1, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
+ { D3DSIO_ENDREP, "endrep", 0, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
+ { D3DSIO_IF, "if", 1, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
+ { D3DSIO_IFC, "if_comp", 2, instr_generic, 0x0200, 0xFFFF },
+ { D3DSIO_ELSE, "else", 0, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
+ { D3DSIO_ENDIF, "endif", 0, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
+ { D3DSIO_BREAK, "break", 0, instr_generic, 0x0201, 0xFFFF },
+ { D3DSIO_BREAKC, "break_comp", 2, instr_generic, 0x0201, 0xFFFF },
+ { D3DSIO_MOVA, "mova", 2, instr_generic, 0x0200, 0xFFFF }, /* VS only */
+ { D3DSIO_DEFB, "defb", 2, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_DEFI, "defi", 2, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_TEXCOORD, "texcoord", 1, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEXCOORD, "texcrd", 2, instr_generic, 0x0104, 0x0104 }, /* PS only */
+ { D3DSIO_TEXKILL, "texkill", 1, instr_generic, 0x0100, 0xFFFF }, /* PS only */
+ { D3DSIO_TEX, "tex", 1, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEX, "texld", 2, instr_generic, 0x0104, 0x0104 }, /* PS only */
+ { D3DSIO_TEX, "texld", 3, instr_generic, 0x0200, 0xFFFF }, /* PS only */
+ { D3DSIO_TEXBEM, "texbem", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEXBEML, "texbeml", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEXREG2AR, "texreg2ar", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEXREG2GB, "texreg2gb", 2, instr_generic, 0x0102, 0x0103 }, /* PS only */
+ { D3DSIO_TEXM3x2PAD, "texm3x2pad", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEXM3x2TEX, "texm3x2tex", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEXM3x3PAD, "texm3x3pad", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEXM3x3TEX, "texm3x3tex", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEXM3x3DIFF, "texm3x3diff", 2, instr_generic, 0x0100, 0xFFFF }, /* PS only - Not documented */
+ { D3DSIO_TEXM3x3SPEC, "texm3x3spec", 3, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEXM3x3VSPEC, "texm3x3vspec", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_EXPP, "expp", 2, instr_generic, 0x0100, 0xFFFF }, /* VS only */
+ { D3DSIO_LOGP, "logp", 2, instr_generic, 0x0100, 0xFFFF }, /* VS only */
+ { D3DSIO_CND, "cnd", 4, instr_generic, 0x0100, 0x0104 }, /* PS only */
+ { D3DSIO_DEF, "def", 5, instr_def, 0x0100, 0xFFFF },
+ { D3DSIO_TEXREG2RGB, "texreg2rgb", 2, instr_generic, 0x0102, 0x0103 }, /* PS only */
+ { D3DSIO_TEXDP3TEX, "texdp3tex", 2, instr_generic, 0x0102, 0x0103 }, /* PS only */
+ { D3DSIO_TEXM3x2DEPTH, "texm3x2depth", 2, instr_generic, 0x0103, 0x0103 }, /* PS only */
+ { D3DSIO_TEXDP3, "texdp3", 2, instr_generic, 0x0102, 0x0103 }, /* PS only */
+ { D3DSIO_TEXM3x3, "texm3x3", 2, instr_generic, 0x0102, 0x0103 }, /* PS only */
+ { D3DSIO_TEXDEPTH, "texdepth", 1, instr_generic, 0x0104, 0x0104 }, /* PS only */
+ { D3DSIO_CMP, "cmp", 4, instr_generic, 0x0102, 0xFFFF }, /* PS only */
+ { D3DSIO_BEM, "bem", 3, instr_generic, 0x0104, 0x0104 }, /* PS only */
+ { D3DSIO_DP2ADD, "dp2add", 4, instr_generic, 0x0200, 0xFFFF }, /* PS only */
+ { D3DSIO_DSX, "dsx", 2, instr_generic, 0x0201, 0xFFFF }, /* PS only */
+ { D3DSIO_DSY, "dsy", 2, instr_generic, 0x0201, 0xFFFF }, /* PS only */
+ { D3DSIO_TEXLDD, "texldd", 5, instr_generic, 0x0201, 0xFFFF }, /* PS only - not existing for 2.b */
+ { D3DSIO_SETP, "setp_comp", 3, instr_generic, 0x0201, 0xFFFF },
+ { D3DSIO_TEXLDL, "texldl", 3, instr_generic, 0x0300, 0xFFFF },
+ { D3DSIO_BREAKP, "breakp", 1, instr_generic, 0x0201, 0xFFFF },
+ { D3DSIO_PHASE, "phase", 0, instr_generic, 0x0104, 0x0104 }, /* PS only */
+ { D3DSIO_COMMENT, "", 0, instr_comment, 0x0100, 0xFFFF }
+};
+
HRESULT WINAPI D3DXDisassembleShader(const DWORD *shader, BOOL colorcode, const char *comments, ID3DXBuffer **disassembly)
{
- FIXME("%p %d %s %p: stub\n", shader, colorcode, debugstr_a(comments), disassembly);
- return E_OUTOFMEMORY;
+ DWORD *ptr = (DWORD *)shader;
+ char *buffer, *buf;
+ UINT capacity = 4096;
+ BOOL ps;
+ WORD version;
+ HRESULT hr;
+
+ TRACE("%p %d %s %p\n", shader, colorcode, debugstr_a(comments), disassembly);
+
+ if (!shader || !disassembly)
+ return D3DERR_INVALIDCALL;
+
+ buf = buffer = HeapAlloc(GetProcessHeap(), 0, capacity);
+ if (!buffer)
+ return E_OUTOFMEMORY;
+
+ ps = (*ptr >> 16) & 1;
+ version = *ptr & 0xFFFF;
+ buf += sprintf(buf, " %s_%d_%d\n", ps ? "ps" : "vs", D3DSHADER_VERSION_MAJOR(*ptr), D3DSHADER_VERSION_MINOR(*ptr));
+ ptr++;
+
+ while (*ptr != D3DSIO_END)
+ {
+ DWORD index;
+
+ if ((buf - buffer + 128) > capacity)
+ {
+ UINT count = buf - buffer;
+ char *new_buffer = HeapReAlloc(GetProcessHeap(), 0, buffer, capacity * 2);
+ if (!new_buffer)
+ {
+ HeapFree(GetProcessHeap(), 0, buffer);
+ return E_OUTOFMEMORY;
+ }
+ capacity *= 2;
+ buffer = new_buffer;
+ buf = buffer + count;
+ }
+
+ for (index = 0; index < sizeof(instructions)/sizeof(instructions[0]); index++)
+ if (((*ptr & D3DSI_OPCODE_MASK) == instructions[index].opcode) &&
+ (version >= instructions[index].min_version) && (version <= instructions[index].max_version))
+ break;
+
+ if (index != sizeof(instructions)/sizeof(instructions[0]))
+ {
+ buf += instructions[index].function(&(instructions[index]), &ptr, buf, ps);
+ }
+ else
+ {
+ buf += sprintf(buf, " ??? (Unknown opcode %x)\n", *ptr);
+ while (*++ptr & (1u << 31));
+ }
+ }
+
+ hr = D3DXCreateBuffer(buf - buffer + 1 , disassembly);
+ if (SUCCEEDED(hr))
+ strcpy(ID3DXBuffer_GetBufferPointer(*disassembly), buffer);
+ HeapFree(GetProcessHeap(), 0, buffer);
+
+ return hr;
}
struct d3dx9_texture_shader

View file

@ -1,62 +0,0 @@
diff --git a/modules/rostests/winetests/d3dx9_36/shader.c b/modules/rostests/winetests/d3dx9_36/shader.c
index b67ffb2..02675c6 100644
--- a/modules/rostests/winetests/d3dx9_36/shader.c
+++ b/modules/rostests/winetests/d3dx9_36/shader.c
@@ -6575,6 +6575,51 @@ static void test_shader_semantics(void)
}
}
+static void test_disassemble_shader(void)
+{
+ static const char disasm_vs[] = " vs_1_1\n"
+ " dcl_position v0\n"
+ " dp4 oPos.x, v0, c0\n"
+ " dp4 oPos.y, v0, c1\n"
+ " dp4 oPos.z, v0, c2\n"
+ " dp4 oPos.w, v0, c3\n";
+ static const char disasm_ps[] = " ps_1_1\n"
+ " def c1, 1, 0, 0, 0\n"
+ " tex t0\n"
+ " dp3 r0, c1, c0\n"
+ " mul r0, v0, r0\n"
+ " mul r0, t0, r0\n";
+ ID3DXBuffer *disassembly;
+ HRESULT ret;
+ char *ptr;
+
+ /* Check wrong parameters */
+ ret = D3DXDisassembleShader(NULL, FALSE, NULL, NULL);
+ ok(ret == D3DERR_INVALIDCALL, "Returned %#x, expected %#x\n", ret, D3DERR_INVALIDCALL);
+ ret = D3DXDisassembleShader(NULL, FALSE, NULL, &disassembly);
+ ok(ret == D3DERR_INVALIDCALL, "Returned %#x, expected %#x\n", ret, D3DERR_INVALIDCALL);
+ ret = D3DXDisassembleShader(simple_vs, FALSE, NULL, NULL);
+ ok(ret == D3DERR_INVALIDCALL, "Returned %#x, expected %#x\n", ret, D3DERR_INVALIDCALL);
+
+ /* Test with vertex shader */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(simple_vs, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_vs, sizeof(disasm_vs) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_vs);
+ ID3DXBuffer_Release(disassembly);
+
+ /* Test with pixel shader */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(simple_ps, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_ps, sizeof(disasm_ps) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_ps);
+ ID3DXBuffer_Release(disassembly);
+}
+
START_TEST(shader)
{
test_get_shader_size();
@@ -6589,4 +6634,5 @@ START_TEST(shader)
test_registerset();
test_registerset_defaults();
test_shader_semantics();
+ test_disassemble_shader();
}

View file

@ -1,188 +0,0 @@
diff --git a/modules/rostests/winetests/d3dx9_36/shader.c b/modules/rostests/winetests/d3dx9_36/shader.c
index 02675c6..0d7dcc3 100644
--- a/modules/rostests/winetests/d3dx9_36/shader.c
+++ b/modules/rostests/winetests/d3dx9_36/shader.c
@@ -6575,6 +6575,60 @@ static void test_shader_semantics(void)
}
}
+static const DWORD ps_tex[] = {
+ 0xffff0103, /* ps_1_3 */
+ 0x00000042, 0xb00f0000, /* tex t0 */
+ 0x00000000, /* nop */
+ 0x0000ffff};
+
+static const DWORD ps_texld_1_4[] = {
+ 0xffff0104, /* ps_1_4 */
+ 0x00000042, 0xb00f0000, 0xa0e40000, /* texld t0, c0 */
+ 0x00000000, /* nop */
+ 0x0000ffff};
+
+static const DWORD ps_texld_2_0[] = {
+ 0xffff0200, /* ps_2_0 */
+ 0x00000042, 0xb00f0000, 0xa0e40000, 0xa0e40001, /* texld t0, c0, c1 */
+ 0x00000000, /* nop */
+ 0x0000ffff};
+
+static const DWORD ps_texcoord[] = {
+ 0xffff0103, /* ps_1_4 */
+ 0x00000040, 0xb00f0000, /* texcoord t0 */
+ 0x00000000, /* nop */
+ 0x0000ffff};
+
+static const DWORD ps_texcrd[] = {
+ 0xffff0104, /* ps_2_0 */
+ 0x00000040, 0xb00f0000, 0xa0e40000, /* texcrd t0, c0 */
+ 0x00000000, /* nop */
+ 0x0000ffff};
+
+static const DWORD ps_sincos_2_0[] = {
+ 0xffff0200, /* ps_2_0 */
+ 0x00000025, 0xb00f0000, 0xa0e40000, 0xa0e40001, 0xa0e40002, /* sincos t0, c0, c1, c2 */
+ 0x00000000, /* nop */
+ 0x0000ffff};
+
+static const DWORD ps_sincos_3_0[] = {
+ 0xffff0300, /* ps_3_0 */
+ 0x00000025, 0xb00f0000, 0xa0e40000, /* sincos t0, c0 */
+ 0x00000000, /* nop */
+ 0x0000ffff};
+
+static const DWORD vs_sincos_2_0[] = {
+ 0xfffe0200, /* vs_2_0 */
+ 0x00000025, 0xb00f0000, 0xa0e40000, 0xa0e40001, 0xa0e40002, /* sincos a0, c0, c1, c2 */
+ 0x00000000, /* nop */
+ 0x0000ffff};
+
+static const DWORD vs_sincos_3_0[] = {
+ 0xfffe0300, /* vs_3_0 */
+ 0x00000025, 0xb00f0000, 0xa0e40000, /* sincos a0, c0 */
+ 0x00000000, /* nop */
+ 0x0000ffff};
+
static void test_disassemble_shader(void)
{
static const char disasm_vs[] = " vs_1_1\n"
@@ -6589,6 +6643,33 @@ static void test_disassemble_shader(void)
" dp3 r0, c1, c0\n"
" mul r0, v0, r0\n"
" mul r0, t0, r0\n";
+ static const char disasm_ps_tex[] = " ps_1_3\n"
+ " tex t0\n"
+ " nop\n";
+ static const char disasm_ps_texld_1_4[] = " ps_1_4\n"
+ " texld t0, c0\n"
+ " nop\n";
+ static const char disasm_ps_texld_2_0[] = " ps_2_0\n"
+ " texld t0, c0, c1\n"
+ " nop\n";
+ static const char disasm_ps_texcoord[] = " ps_1_3\n"
+ " texcoord t0\n"
+ " nop\n";
+ static const char disasm_ps_texcrd[] = " ps_1_4\n"
+ " texcrd t0, c0\n"
+ " nop\n";
+ static const char disasm_ps_sincos_2_0[] = " ps_2_0\n"
+ " sincos t0, c0, c1, c2\n"
+ " nop\n";
+ static const char disasm_ps_sincos_3_0[] = " ps_3_0\n"
+ " sincos t0, c0\n"
+ " nop\n";
+ static const char disasm_vs_sincos_2_0[] = " vs_2_0\n"
+ " sincos a0, c0, c1, c2\n"
+ " nop\n";
+ static const char disasm_vs_sincos_3_0[] = " vs_3_0\n"
+ " sincos a0, c0\n"
+ " nop\n";
ID3DXBuffer *disassembly;
HRESULT ret;
char *ptr;
@@ -6618,6 +6699,88 @@ static void test_disassemble_shader(void)
ok(!memcmp(ptr, disasm_ps, sizeof(disasm_ps) - 1), /* compare beginning */
"Returned '%s', expected '%s'\n", ptr, disasm_ps);
ID3DXBuffer_Release(disassembly);
+
+ /* Test tex instruction with pixel shader 1.3 */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(ps_tex, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_ps_tex, sizeof(disasm_ps_tex) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_ps_tex);
+ ID3DXBuffer_Release(disassembly);
+
+ /* Test texld instruction with pixel shader 1.4 */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(ps_texld_1_4, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_ps_texld_1_4, sizeof(disasm_ps_texld_1_4) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_ps_texld_1_4);
+ ID3DXBuffer_Release(disassembly);
+
+ /* Test texld instruction with pixel shader 2.0 */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(ps_texld_2_0, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_ps_texld_2_0, sizeof(disasm_ps_texld_2_0) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_ps_texld_2_0);
+ ID3DXBuffer_Release(disassembly);
+
+ /* Test texcoord instruction with pixel shader 1.3 */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(ps_texcoord, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_ps_texcoord, sizeof(disasm_ps_texcoord) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_ps_texcoord);
+ ID3DXBuffer_Release(disassembly);
+
+ /* Test texcrd instruction with pixel shader 1.4 */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(ps_texcrd, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_ps_texcrd, sizeof(disasm_ps_texcrd) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_ps_texcrd);
+ ID3DXBuffer_Release(disassembly);
+
+ /* Test sincos instruction pixel shader 2.0 */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(ps_sincos_2_0, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_ps_sincos_2_0, sizeof(disasm_ps_sincos_2_0) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_ps_sincos_2_0);
+ ID3DXBuffer_Release(disassembly);
+
+ /* Test sincos instruction with pixel shader 3.0 */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(ps_sincos_3_0, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_ps_sincos_3_0, sizeof(disasm_ps_sincos_3_0) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_ps_sincos_3_0);
+ ID3DXBuffer_Release(disassembly);
+
+ /* Test sincos instruction with pixel shader 2.0 */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(vs_sincos_2_0, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_vs_sincos_2_0, sizeof(disasm_vs_sincos_2_0) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_vs_sincos_2_0);
+ ID3DXBuffer_Release(disassembly);
+
+ /* Test sincos instruction with pixel shader 3.0 */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(vs_sincos_3_0, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_vs_sincos_3_0, sizeof(disasm_vs_sincos_3_0) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_vs_sincos_3_0);
+ ID3DXBuffer_Release(disassembly);
+
}
START_TEST(shader)

View file

@ -1,52 +0,0 @@
diff --git a/modules/rostests/winetests/d3dx9_36/mesh.c b/modules/rostests/winetests/d3dx9_36/mesh.c
index 3fcd65f..5cb000a 100644
--- a/modules/rostests/winetests/d3dx9_36/mesh.c
+++ b/modules/rostests/winetests/d3dx9_36/mesh.c
@@ -10123,10 +10123,10 @@ static void test_clone_mesh(void)
hr = mesh->lpVtbl->CloneMesh(mesh, tc[i].clone_options, tc[i].new_declaration,
test_context->device, &mesh_clone);
- ok(hr == D3D_OK, "CloneMesh test case %d failed. Got %x\n, expected D3D_OK\n", i, hr);
+ ok(hr == D3D_OK, "CloneMesh test case %d failed. Got %x, expected D3D_OK.\n", i, hr);
hr = mesh_clone->lpVtbl->GetDeclaration(mesh_clone, new_declaration);
- ok(hr == D3D_OK, "GetDeclaration test case %d failed. Got %x\n, expected D3D_OK\n", i, hr);
+ ok(hr == D3D_OK, "GetDeclaration test case %d failed. Got %x, expected D3D_OK.\n", i, hr);
/* Check declaration elements */
for (j = 0; tc[i].new_declaration[j].Stream != 0xFF; j++)
{
@@ -10313,7 +10313,7 @@ static void test_valid_mesh(void)
hr = D3DXValidMesh(mesh, tc[i].adjacency, &errors_and_warnings);
todo_wine ok(hr == tc[i].exp_hr, "D3DXValidMesh test case %d failed. "
- "Got %x\n, expected %x\n", i, hr, tc[i].exp_hr);
+ "Got %x, expected %x.\n", i, hr, tc[i].exp_hr);
/* Note errors_and_warnings is deliberately not checked because that
* would require copying wast amounts of the text output. */
@@ -10457,7 +10457,7 @@ static void test_optimize_faces(void)
tc[i].num_vertices, tc[i].indices_are_32bit,
face_remap);
ok(hr == D3D_OK, "D3DXOptimizeFaces test case %d failed. "
- "Got %x\n, expected D3D_OK\n", i, hr);
+ "Got %x, expected D3D_OK.\n", i, hr);
/* Compare face remap with expected face remap */
for (j = 0; j < tc[i].num_faces; j++)
@@ -10475,14 +10475,14 @@ static void test_optimize_faces(void)
tc[0].num_vertices, tc[0].indices_are_32bit,
NULL);
ok(hr == D3DERR_INVALIDCALL, "D3DXOptimizeFaces passed NULL face_remap "
- "pointer. Got %x\n, expected D3DERR_INVALIDCALL\n", hr);
+ "pointer. Got %x, expected D3DERR_INVALIDCALL.\n", hr);
/* Number of faces must be smaller than 2^15 */
hr = D3DXOptimizeFaces(tc[0].indices, 2 << 15,
tc[0].num_vertices, FALSE,
&smallest_face_remap);
ok(hr == D3DERR_INVALIDCALL, "D3DXOptimizeFaces should not accept 2^15 "
- "faces when using 16-bit indices. Got %x\n, expected D3DERR_INVALIDCALL\n", hr);
+ "faces when using 16-bit indices. Got %x, expected D3DERR_INVALIDCALL.\n", hr);
}
static HRESULT clear_normals(ID3DXMesh *mesh)

View file

@ -1,338 +0,0 @@
diff --git a/dll/directx/wine/d3dx9_24/d3dx9_24.spec b/dll/directx/wine/d3dx9_24/d3dx9_24.spec
index d4e74188..b7d81740 100644
--- a/dll/directx/wine/d3dx9_24/d3dx9_24.spec
+++ b/dll/directx/wine/d3dx9_24/d3dx9_24.spec
@@ -226,7 +226,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_25/d3dx9_25.spec b/dll/directx/wine/d3dx9_25/d3dx9_25.spec
index 5375c076..9a86cb84 100644
--- a/dll/directx/wine/d3dx9_25/d3dx9_25.spec
+++ b/dll/directx/wine/d3dx9_25/d3dx9_25.spec
@@ -226,7 +226,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_26/d3dx9_26.spec b/dll/directx/wine/d3dx9_26/d3dx9_26.spec
index c17f97f0..85d2c340 100644
--- a/dll/directx/wine/d3dx9_26/d3dx9_26.spec
+++ b/dll/directx/wine/d3dx9_26/d3dx9_26.spec
@@ -230,7 +230,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_27/d3dx9_27.spec b/dll/directx/wine/d3dx9_27/d3dx9_27.spec
index c17f97f0..85d2c340 100644
--- a/dll/directx/wine/d3dx9_27/d3dx9_27.spec
+++ b/dll/directx/wine/d3dx9_27/d3dx9_27.spec
@@ -230,7 +230,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_28/d3dx9_28.spec b/dll/directx/wine/d3dx9_28/d3dx9_28.spec
index 5b267c14..95b6bc51 100644
--- a/dll/directx/wine/d3dx9_28/d3dx9_28.spec
+++ b/dll/directx/wine/d3dx9_28/d3dx9_28.spec
@@ -230,7 +230,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_29/d3dx9_29.spec b/dll/directx/wine/d3dx9_29/d3dx9_29.spec
index 5b267c14..95b6bc51 100644
--- a/dll/directx/wine/d3dx9_29/d3dx9_29.spec
+++ b/dll/directx/wine/d3dx9_29/d3dx9_29.spec
@@ -230,7 +230,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_30/d3dx9_30.spec b/dll/directx/wine/d3dx9_30/d3dx9_30.spec
index dc9ea939..ed6cb55e 100644
--- a/dll/directx/wine/d3dx9_30/d3dx9_30.spec
+++ b/dll/directx/wine/d3dx9_30/d3dx9_30.spec
@@ -230,7 +230,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_31/d3dx9_31.spec b/dll/directx/wine/d3dx9_31/d3dx9_31.spec
index 4dec8f58..ecd12b65 100644
--- a/dll/directx/wine/d3dx9_31/d3dx9_31.spec
+++ b/dll/directx/wine/d3dx9_31/d3dx9_31.spec
@@ -227,7 +227,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_32/d3dx9_32.spec b/dll/directx/wine/d3dx9_32/d3dx9_32.spec
index 7b6d62df..3e5fb3f3 100644
--- a/dll/directx/wine/d3dx9_32/d3dx9_32.spec
+++ b/dll/directx/wine/d3dx9_32/d3dx9_32.spec
@@ -227,7 +227,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_33/d3dx9_33.spec b/dll/directx/wine/d3dx9_33/d3dx9_33.spec
index 7b6d62df..3e5fb3f3 100644
--- a/dll/directx/wine/d3dx9_33/d3dx9_33.spec
+++ b/dll/directx/wine/d3dx9_33/d3dx9_33.spec
@@ -227,7 +227,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_34/d3dx9_34.spec b/dll/directx/wine/d3dx9_34/d3dx9_34.spec
index 7b6d62df..3e5fb3f3 100644
--- a/dll/directx/wine/d3dx9_34/d3dx9_34.spec
+++ b/dll/directx/wine/d3dx9_34/d3dx9_34.spec
@@ -227,7 +227,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_35/d3dx9_35.spec b/dll/directx/wine/d3dx9_35/d3dx9_35.spec
index 7b6d62df..3e5fb3f3 100644
--- a/dll/directx/wine/d3dx9_35/d3dx9_35.spec
+++ b/dll/directx/wine/d3dx9_35/d3dx9_35.spec
@@ -227,7 +227,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_36/d3dx9_36.spec b/dll/directx/wine/d3dx9_36/d3dx9_36.spec
index 692321d9..544b744b 100644
--- a/dll/directx/wine/d3dx9_36/d3dx9_36.spec
+++ b/dll/directx/wine/d3dx9_36/d3dx9_36.spec
@@ -229,7 +229,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_36/mesh.c b/dll/directx/wine/d3dx9_36/mesh.c
index acbb2477..a392a5b5 100644
--- a/dll/directx/wine/d3dx9_36/mesh.c
+++ b/dll/directx/wine/d3dx9_36/mesh.c
@@ -7186,6 +7186,33 @@ cleanup:
return hr;
}
+
+/*************************************************************************
+ * D3DXOptimizeVertices (D3DX9_36.@)
+ */
+HRESULT WINAPI D3DXOptimizeVertices(const void *indices, UINT num_faces,
+ UINT num_vertices, BOOL indices_are_32bit, DWORD *vertex_remap)
+{
+ UINT i;
+
+ FIXME("indices %p, num_faces %u, num_vertices %u, indices_are_32bit %#x, vertex_remap %p semi-stub.\n",
+ indices, num_faces, num_vertices, indices_are_32bit, vertex_remap);
+
+ if (!vertex_remap)
+ {
+ WARN("vertex remap pointer is NULL.\n");
+ return D3DERR_INVALIDCALL;
+ }
+
+ for (i = 0; i < num_vertices; i++)
+ {
+ vertex_remap[i] = i;
+ }
+
+ return D3D_OK;
+}
+
+
/*************************************************************************
* D3DXOptimizeFaces (D3DX9_36.@)
*
diff --git a/dll/directx/wine/d3dx9_37/d3dx9_37.spec b/dll/directx/wine/d3dx9_37/d3dx9_37.spec
index 692321d9..544b744b 100644
--- a/dll/directx/wine/d3dx9_37/d3dx9_37.spec
+++ b/dll/directx/wine/d3dx9_37/d3dx9_37.spec
@@ -229,7 +229,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_38/d3dx9_38.spec b/dll/directx/wine/d3dx9_38/d3dx9_38.spec
index 692321d9..544b744b 100644
--- a/dll/directx/wine/d3dx9_38/d3dx9_38.spec
+++ b/dll/directx/wine/d3dx9_38/d3dx9_38.spec
@@ -229,7 +229,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_39/d3dx9_39.spec b/dll/directx/wine/d3dx9_39/d3dx9_39.spec
index 692321d9..544b744b 100644
--- a/dll/directx/wine/d3dx9_39/d3dx9_39.spec
+++ b/dll/directx/wine/d3dx9_39/d3dx9_39.spec
@@ -229,7 +229,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_40/d3dx9_40.spec b/dll/directx/wine/d3dx9_40/d3dx9_40.spec
index 692321d9..544b744b 100644
--- a/dll/directx/wine/d3dx9_40/d3dx9_40.spec
+++ b/dll/directx/wine/d3dx9_40/d3dx9_40.spec
@@ -229,7 +229,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_41/d3dx9_41.spec b/dll/directx/wine/d3dx9_41/d3dx9_41.spec
index 692321d9..544b744b 100644
--- a/dll/directx/wine/d3dx9_41/d3dx9_41.spec
+++ b/dll/directx/wine/d3dx9_41/d3dx9_41.spec
@@ -229,7 +229,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_42/d3dx9_42.spec b/dll/directx/wine/d3dx9_42/d3dx9_42.spec
index 936ae902..f4e70364 100644
--- a/dll/directx/wine/d3dx9_42/d3dx9_42.spec
+++ b/dll/directx/wine/d3dx9_42/d3dx9_42.spec
@@ -222,7 +222,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_43/d3dx9_43.spec b/dll/directx/wine/d3dx9_43/d3dx9_43.spec
index 936ae902..f4e70364 100644
--- a/dll/directx/wine/d3dx9_43/d3dx9_43.spec
+++ b/dll/directx/wine/d3dx9_43/d3dx9_43.spec
@@ -222,7 +222,7 @@
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
-@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr)
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
diff --git a/modules/rostests/winetests/d3dx9_36/mesh.c b/modules/rostests/winetests/d3dx9_36/mesh.c
index 5cb000a5..904a4524 100644
--- a/modules/rostests/winetests/d3dx9_36/mesh.c
+++ b/modules/rostests/winetests/d3dx9_36/mesh.c
@@ -10331,6 +10331,27 @@ cleanup:
free_test_context(test_context);
}
+static void test_optimize_vertices(void)
+{
+ HRESULT hr;
+ DWORD vertex_remap[3];
+ const DWORD indices[] = {0, 1, 2};
+ const UINT num_faces = 1;
+ const UINT num_vertices = 3;
+
+ hr = D3DXOptimizeVertices(indices, num_faces,
+ num_vertices, FALSE,
+ vertex_remap);
+ ok(hr == D3D_OK, "D3DXOptimizeVertices failed. Got %x, expected D3D_OK.\n", hr);
+
+ /* vertex_remap must not be NULL */
+ hr = D3DXOptimizeVertices(indices, num_faces,
+ num_vertices, FALSE,
+ NULL);
+ ok(hr == D3DERR_INVALIDCALL, "D3DXOptimizeVertices passed NULL vertex_remap "
+ "pointer. Got %x, expected D3DERR_INVALIDCALL.\n", hr);
+}
+
static void test_optimize_faces(void)
{
HRESULT hr;
@@ -11219,6 +11240,7 @@ START_TEST(mesh)
test_weld_vertices();
test_clone_mesh();
test_valid_mesh();
+ test_optimize_vertices();
test_optimize_faces();
test_compute_normals();
test_D3DXFrameFind();

View file

@ -1,297 +0,0 @@
diff --git a/dll/directx/wine/d3dx9_24/d3dx9_24.spec b/dll/directx/wine/d3dx9_24/d3dx9_24.spec
index b7d81740..ad3ea3a0 100644
--- a/dll/directx/wine/d3dx9_24/d3dx9_24.spec
+++ b/dll/directx/wine/d3dx9_24/d3dx9_24.spec
@@ -256,7 +256,7 @@
@ stdcall D3DXSHEvalSphericalLight(long ptr float float float float ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/dll/directx/wine/d3dx9_25/d3dx9_25.spec b/dll/directx/wine/d3dx9_25/d3dx9_25.spec
index 9a86cb84..b54a8e16 100644
--- a/dll/directx/wine/d3dx9_25/d3dx9_25.spec
+++ b/dll/directx/wine/d3dx9_25/d3dx9_25.spec
@@ -256,7 +256,7 @@
@ stdcall D3DXSHEvalSphericalLight(long ptr float float float float ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/dll/directx/wine/d3dx9_26/d3dx9_26.spec b/dll/directx/wine/d3dx9_26/d3dx9_26.spec
index 85d2c340..03542f07 100644
--- a/dll/directx/wine/d3dx9_26/d3dx9_26.spec
+++ b/dll/directx/wine/d3dx9_26/d3dx9_26.spec
@@ -260,7 +260,7 @@
@ stdcall D3DXSHEvalSphericalLight(long ptr float float float float ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/dll/directx/wine/d3dx9_27/d3dx9_27.spec b/dll/directx/wine/d3dx9_27/d3dx9_27.spec
index 85d2c340..03542f07 100644
--- a/dll/directx/wine/d3dx9_27/d3dx9_27.spec
+++ b/dll/directx/wine/d3dx9_27/d3dx9_27.spec
@@ -260,7 +260,7 @@
@ stdcall D3DXSHEvalSphericalLight(long ptr float float float float ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/dll/directx/wine/d3dx9_28/d3dx9_28.spec b/dll/directx/wine/d3dx9_28/d3dx9_28.spec
index 95b6bc51..b470fb33 100644
--- a/dll/directx/wine/d3dx9_28/d3dx9_28.spec
+++ b/dll/directx/wine/d3dx9_28/d3dx9_28.spec
@@ -265,7 +265,7 @@
@ stdcall D3DXSHEvalSphericalLight(long ptr float float float float ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/dll/directx/wine/d3dx9_29/d3dx9_29.spec b/dll/directx/wine/d3dx9_29/d3dx9_29.spec
index 95b6bc51..b470fb33 100644
--- a/dll/directx/wine/d3dx9_29/d3dx9_29.spec
+++ b/dll/directx/wine/d3dx9_29/d3dx9_29.spec
@@ -265,7 +265,7 @@
@ stdcall D3DXSHEvalSphericalLight(long ptr float float float float ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/dll/directx/wine/d3dx9_30/d3dx9_30.spec b/dll/directx/wine/d3dx9_30/d3dx9_30.spec
index ed6cb55e..e90185a5 100644
--- a/dll/directx/wine/d3dx9_30/d3dx9_30.spec
+++ b/dll/directx/wine/d3dx9_30/d3dx9_30.spec
@@ -265,7 +265,7 @@
@ stdcall D3DXSHEvalSphericalLight(long ptr float float float float ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/dll/directx/wine/d3dx9_31/d3dx9_31.spec b/dll/directx/wine/d3dx9_31/d3dx9_31.spec
index ecd12b65..b926ad5e 100644
--- a/dll/directx/wine/d3dx9_31/d3dx9_31.spec
+++ b/dll/directx/wine/d3dx9_31/d3dx9_31.spec
@@ -262,7 +262,7 @@
@ stdcall D3DXSHEvalSphericalLight(long ptr float float float float ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/dll/directx/wine/d3dx9_32/d3dx9_32.spec b/dll/directx/wine/d3dx9_32/d3dx9_32.spec
index 3e5fb3f3..a4d698bd 100644
--- a/dll/directx/wine/d3dx9_32/d3dx9_32.spec
+++ b/dll/directx/wine/d3dx9_32/d3dx9_32.spec
@@ -267,7 +267,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/dll/directx/wine/d3dx9_33/d3dx9_33.spec b/dll/directx/wine/d3dx9_33/d3dx9_33.spec
index 3e5fb3f3..a4d698bd 100644
--- a/dll/directx/wine/d3dx9_33/d3dx9_33.spec
+++ b/dll/directx/wine/d3dx9_33/d3dx9_33.spec
@@ -267,7 +267,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/dll/directx/wine/d3dx9_34/d3dx9_34.spec b/dll/directx/wine/d3dx9_34/d3dx9_34.spec
index 3e5fb3f3..a4d698bd 100644
--- a/dll/directx/wine/d3dx9_34/d3dx9_34.spec
+++ b/dll/directx/wine/d3dx9_34/d3dx9_34.spec
@@ -267,7 +267,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/dll/directx/wine/d3dx9_35/d3dx9_35.spec b/dll/directx/wine/d3dx9_35/d3dx9_35.spec
index 3e5fb3f3..a4d698bd 100644
--- a/dll/directx/wine/d3dx9_35/d3dx9_35.spec
+++ b/dll/directx/wine/d3dx9_35/d3dx9_35.spec
@@ -267,7 +267,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/dll/directx/wine/d3dx9_36/d3dx9_36.spec b/dll/directx/wine/d3dx9_36/d3dx9_36.spec
index 544b744b..3b5fdcc4 100644
--- a/dll/directx/wine/d3dx9_36/d3dx9_36.spec
+++ b/dll/directx/wine/d3dx9_36/d3dx9_36.spec
@@ -269,7 +269,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/dll/directx/wine/d3dx9_36/math.c b/dll/directx/wine/d3dx9_36/math.c
index 08e51b76..976610c1 100644
--- a/dll/directx/wine/d3dx9_36/math.c
+++ b/dll/directx/wine/d3dx9_36/math.c
@@ -2969,6 +2969,20 @@ static void rotate_X(FLOAT *out, UINT order, FLOAT a, FLOAT *in)
out[35] = 0.9057110548f * in[31] - 0.4192627370f * in[33] + 0.0624999329f * in[35];
}
+HRESULT WINAPI D3DXSHProjectCubeMap(UINT order, IDirect3DCubeTexture9 *cubemap, FLOAT *rout, FLOAT *gout, FLOAT *bout)
+{
+ FIXME("order %u, cubemap %p, rout %p, gout %p, bout %p: stub!\n", order, cubemap, rout, gout, bout);
+
+ if(!cubemap || order < D3DXSH_MINORDER || order > D3DXSH_MAXORDER)
+ return D3DERR_INVALIDCALL;
+
+ *rout = 0.0f;
+ *gout = 0.0f;
+ *bout = 0.0f;
+
+ return D3D_OK;
+}
+
FLOAT* WINAPI D3DXSHRotate(FLOAT *out, UINT order, const D3DXMATRIX *matrix, const FLOAT *in)
{
FLOAT alpha, beta, gamma, sinb, temp[36], temp1[36];
diff --git a/dll/directx/wine/d3dx9_37/d3dx9_37.spec b/dll/directx/wine/d3dx9_37/d3dx9_37.spec
index 544b744b..3b5fdcc4 100644
--- a/dll/directx/wine/d3dx9_37/d3dx9_37.spec
+++ b/dll/directx/wine/d3dx9_37/d3dx9_37.spec
@@ -269,7 +269,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/dll/directx/wine/d3dx9_38/d3dx9_38.spec b/dll/directx/wine/d3dx9_38/d3dx9_38.spec
index 544b744b..3b5fdcc4 100644
--- a/dll/directx/wine/d3dx9_38/d3dx9_38.spec
+++ b/dll/directx/wine/d3dx9_38/d3dx9_38.spec
@@ -269,7 +269,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/dll/directx/wine/d3dx9_39/d3dx9_39.spec b/dll/directx/wine/d3dx9_39/d3dx9_39.spec
index 544b744b..3b5fdcc4 100644
--- a/dll/directx/wine/d3dx9_39/d3dx9_39.spec
+++ b/dll/directx/wine/d3dx9_39/d3dx9_39.spec
@@ -269,7 +269,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/dll/directx/wine/d3dx9_40/d3dx9_40.spec b/dll/directx/wine/d3dx9_40/d3dx9_40.spec
index 544b744b..3b5fdcc4 100644
--- a/dll/directx/wine/d3dx9_40/d3dx9_40.spec
+++ b/dll/directx/wine/d3dx9_40/d3dx9_40.spec
@@ -269,7 +269,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/dll/directx/wine/d3dx9_41/d3dx9_41.spec b/dll/directx/wine/d3dx9_41/d3dx9_41.spec
index 544b744b..3b5fdcc4 100644
--- a/dll/directx/wine/d3dx9_41/d3dx9_41.spec
+++ b/dll/directx/wine/d3dx9_41/d3dx9_41.spec
@@ -269,7 +269,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/dll/directx/wine/d3dx9_42/d3dx9_42.spec b/dll/directx/wine/d3dx9_42/d3dx9_42.spec
index f4e70364..3a681e3e 100644
--- a/dll/directx/wine/d3dx9_42/d3dx9_42.spec
+++ b/dll/directx/wine/d3dx9_42/d3dx9_42.spec
@@ -262,7 +262,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/dll/directx/wine/d3dx9_43/d3dx9_43.spec b/dll/directx/wine/d3dx9_43/d3dx9_43.spec
index f4e70364..3a681e3e 100644
--- a/dll/directx/wine/d3dx9_43/d3dx9_43.spec
+++ b/dll/directx/wine/d3dx9_43/d3dx9_43.spec
@@ -262,7 +262,7 @@
@ stdcall -stub D3DXSHMultiply6(ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr)
-@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
+@ stdcall D3DXSHProjectCubeMap(long ptr ptr ptr ptr)
@ stdcall D3DXSHRotate(ptr long ptr ptr)
@ stdcall D3DXSHRotateZ(ptr long float ptr)
@ stdcall D3DXSHScale(ptr long ptr float)
diff --git a/sdk/include/dxsdk/d3dx9math.h b/sdk/include/dxsdk/d3dx9math.h
index 2c41b73d..7aed21e3 100644
--- a/sdk/include/dxsdk/d3dx9math.h
+++ b/sdk/include/dxsdk/d3dx9math.h
@@ -396,6 +396,7 @@ HRESULT WINAPI D3DXSHEvalSphericalLight(UINT order, const D3DXVECTOR3 *dir, FLOA
FLOAT* WINAPI D3DXSHMultiply2(FLOAT *out, const FLOAT *a, const FLOAT *b);
FLOAT* WINAPI D3DXSHMultiply3(FLOAT *out, const FLOAT *a, const FLOAT *b);
FLOAT* WINAPI D3DXSHMultiply4(FLOAT *out, const FLOAT *a, const FLOAT *b);
+HRESULT WINAPI D3DXSHProjectCubeMap(UINT order, IDirect3DCubeTexture9 *cubemap, FLOAT *rout, FLOAT *gout, FLOAT *bout);
FLOAT* WINAPI D3DXSHRotate(FLOAT *out, UINT order, const D3DXMATRIX *matrix, const FLOAT *in);
FLOAT* WINAPI D3DXSHRotateZ(FLOAT *out, UINT order, FLOAT angle, const FLOAT *in);
FLOAT* WINAPI D3DXSHScale(FLOAT *out, UINT order, const FLOAT *a, const FLOAT scale);

View file

@ -1,289 +0,0 @@
diff --git a/dll/directx/wine/d3dx9_24/d3dx9_24.spec b/dll/directx/wine/d3dx9_24/d3dx9_24.spec
index ad3ea3a0..3cf044c1 100644
--- a/dll/directx/wine/d3dx9_24/d3dx9_24.spec
+++ b/dll/directx/wine/d3dx9_24/d3dx9_24.spec
@@ -20,7 +20,7 @@
@ stdcall D3DXComputeBoundingSphere(ptr long long ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_25/d3dx9_25.spec b/dll/directx/wine/d3dx9_25/d3dx9_25.spec
index b54a8e16..f311bbf1 100644
--- a/dll/directx/wine/d3dx9_25/d3dx9_25.spec
+++ b/dll/directx/wine/d3dx9_25/d3dx9_25.spec
@@ -20,7 +20,7 @@
@ stdcall D3DXComputeBoundingSphere(ptr long long ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_26/d3dx9_26.spec b/dll/directx/wine/d3dx9_26/d3dx9_26.spec
index 03542f07..aa560e4e 100644
--- a/dll/directx/wine/d3dx9_26/d3dx9_26.spec
+++ b/dll/directx/wine/d3dx9_26/d3dx9_26.spec
@@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_27/d3dx9_27.spec b/dll/directx/wine/d3dx9_27/d3dx9_27.spec
index 03542f07..aa560e4e 100644
--- a/dll/directx/wine/d3dx9_27/d3dx9_27.spec
+++ b/dll/directx/wine/d3dx9_27/d3dx9_27.spec
@@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_28/d3dx9_28.spec b/dll/directx/wine/d3dx9_28/d3dx9_28.spec
index b470fb33..fb57152b 100644
--- a/dll/directx/wine/d3dx9_28/d3dx9_28.spec
+++ b/dll/directx/wine/d3dx9_28/d3dx9_28.spec
@@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_29/d3dx9_29.spec b/dll/directx/wine/d3dx9_29/d3dx9_29.spec
index b470fb33..fb57152b 100644
--- a/dll/directx/wine/d3dx9_29/d3dx9_29.spec
+++ b/dll/directx/wine/d3dx9_29/d3dx9_29.spec
@@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_30/d3dx9_30.spec b/dll/directx/wine/d3dx9_30/d3dx9_30.spec
index e90185a5..129e2a04 100644
--- a/dll/directx/wine/d3dx9_30/d3dx9_30.spec
+++ b/dll/directx/wine/d3dx9_30/d3dx9_30.spec
@@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_31/d3dx9_31.spec b/dll/directx/wine/d3dx9_31/d3dx9_31.spec
index b926ad5e..2e4456a4 100644
--- a/dll/directx/wine/d3dx9_31/d3dx9_31.spec
+++ b/dll/directx/wine/d3dx9_31/d3dx9_31.spec
@@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_32/d3dx9_32.spec b/dll/directx/wine/d3dx9_32/d3dx9_32.spec
index a4d698bd..d0d3631d 100644
--- a/dll/directx/wine/d3dx9_32/d3dx9_32.spec
+++ b/dll/directx/wine/d3dx9_32/d3dx9_32.spec
@@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_33/d3dx9_33.spec b/dll/directx/wine/d3dx9_33/d3dx9_33.spec
index a4d698bd..d0d3631d 100644
--- a/dll/directx/wine/d3dx9_33/d3dx9_33.spec
+++ b/dll/directx/wine/d3dx9_33/d3dx9_33.spec
@@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_34/d3dx9_34.spec b/dll/directx/wine/d3dx9_34/d3dx9_34.spec
index a4d698bd..d0d3631d 100644
--- a/dll/directx/wine/d3dx9_34/d3dx9_34.spec
+++ b/dll/directx/wine/d3dx9_34/d3dx9_34.spec
@@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_35/d3dx9_35.spec b/dll/directx/wine/d3dx9_35/d3dx9_35.spec
index a4d698bd..d0d3631d 100644
--- a/dll/directx/wine/d3dx9_35/d3dx9_35.spec
+++ b/dll/directx/wine/d3dx9_35/d3dx9_35.spec
@@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_36/d3dx9_36.spec b/dll/directx/wine/d3dx9_36/d3dx9_36.spec
index 3b5fdcc4..9ef3581b 100644
--- a/dll/directx/wine/d3dx9_36/d3dx9_36.spec
+++ b/dll/directx/wine/d3dx9_36/d3dx9_36.spec
@@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_36/mesh.c b/dll/directx/wine/d3dx9_36/mesh.c
index a392a5b5..2a9ee062 100644
--- a/dll/directx/wine/d3dx9_36/mesh.c
+++ b/dll/directx/wine/d3dx9_36/mesh.c
@@ -7536,6 +7536,24 @@ done:
return hr;
}
+/*************************************************************************
+ * D3DXComputeTangent (D3DX9_36.@)
+ */
+HRESULT WINAPI D3DXComputeTangent(ID3DXMesh *mesh, DWORD stage_idx, DWORD tangent_idx,
+ DWORD binorm_idx, DWORD wrap, const DWORD *adjacency)
+{
+ TRACE("mesh %p, stage_idx %d, tangent_idx %d, binorm_idx %d, wrap %d, adjacency %p.\n",
+ mesh, stage_idx, tangent_idx, binorm_idx, wrap, adjacency);
+
+ return D3DXComputeTangentFrameEx( mesh, D3DDECLUSAGE_TEXCOORD, stage_idx,
+ ( binorm_idx == D3DX_DEFAULT ) ? D3DX_DEFAULT : D3DDECLUSAGE_BINORMAL,
+ binorm_idx,
+ ( tangent_idx == D3DX_DEFAULT ) ? D3DX_DEFAULT : D3DDECLUSAGE_TANGENT,
+ tangent_idx, D3DX_DEFAULT, 0,
+ ( wrap ? D3DXTANGENT_WRAP_UV : 0 ) | D3DXTANGENT_GENERATE_IN_PLACE | D3DXTANGENT_ORTHOGONALIZE_FROM_U,
+ adjacency, -1.01f, -0.01f, -1.01f, NULL, NULL);
+}
+
/*************************************************************************
* D3DXComputeNormals (D3DX9_36.@)
*/
diff --git a/dll/directx/wine/d3dx9_37/d3dx9_37.spec b/dll/directx/wine/d3dx9_37/d3dx9_37.spec
index 3b5fdcc4..9ef3581b 100644
--- a/dll/directx/wine/d3dx9_37/d3dx9_37.spec
+++ b/dll/directx/wine/d3dx9_37/d3dx9_37.spec
@@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_38/d3dx9_38.spec b/dll/directx/wine/d3dx9_38/d3dx9_38.spec
index 3b5fdcc4..9ef3581b 100644
--- a/dll/directx/wine/d3dx9_38/d3dx9_38.spec
+++ b/dll/directx/wine/d3dx9_38/d3dx9_38.spec
@@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_39/d3dx9_39.spec b/dll/directx/wine/d3dx9_39/d3dx9_39.spec
index 3b5fdcc4..9ef3581b 100644
--- a/dll/directx/wine/d3dx9_39/d3dx9_39.spec
+++ b/dll/directx/wine/d3dx9_39/d3dx9_39.spec
@@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_40/d3dx9_40.spec b/dll/directx/wine/d3dx9_40/d3dx9_40.spec
index 3b5fdcc4..9ef3581b 100644
--- a/dll/directx/wine/d3dx9_40/d3dx9_40.spec
+++ b/dll/directx/wine/d3dx9_40/d3dx9_40.spec
@@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_41/d3dx9_41.spec b/dll/directx/wine/d3dx9_41/d3dx9_41.spec
index 3b5fdcc4..9ef3581b 100644
--- a/dll/directx/wine/d3dx9_41/d3dx9_41.spec
+++ b/dll/directx/wine/d3dx9_41/d3dx9_41.spec
@@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_42/d3dx9_42.spec b/dll/directx/wine/d3dx9_42/d3dx9_42.spec
index 3a681e3e..c1f0104d 100644
--- a/dll/directx/wine/d3dx9_42/d3dx9_42.spec
+++ b/dll/directx/wine/d3dx9_42/d3dx9_42.spec
@@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
diff --git a/dll/directx/wine/d3dx9_43/d3dx9_43.spec b/dll/directx/wine/d3dx9_43/d3dx9_43.spec
index 3a681e3e..c1f0104d 100644
--- a/dll/directx/wine/d3dx9_43/d3dx9_43.spec
+++ b/dll/directx/wine/d3dx9_43/d3dx9_43.spec
@@ -24,7 +24,7 @@
@ stdcall -stub D3DXComputeIMTFromTexture(ptr ptr long long ptr ptr ptr)
@ stdcall D3DXComputeNormalMap(ptr ptr ptr long long float)
@ stdcall D3DXComputeNormals(ptr ptr)
-@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr)
+@ stdcall D3DXComputeTangent(ptr long long long long ptr)
@ stdcall -stub D3DXComputeTangentFrame(ptr long)
@ stdcall D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr float float float ptr ptr)
@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)

View file

@ -1,19 +0,0 @@
diff --git a/dll/directx/wine/d3dx9_36/surface.c b/dll/directx/wine/d3dx9_36/surface.c
index 01729ea..185d4f4 100644
--- a/dll/directx/wine/d3dx9_36/surface.c
+++ b/dll/directx/wine/d3dx9_36/surface.c
@@ -395,6 +395,14 @@ static HRESULT d3dformat_to_dds_pixel_format(struct dds_pixel_format *pixel_form
}
}
+ /* Reuse dds_fourcc_to_d3dformat as D3DFORMAT and FOURCC are DWORD with same values */
+ if (dds_fourcc_to_d3dformat(d3dformat) != D3DFMT_UNKNOWN)
+ {
+ pixel_format->flags |= DDS_PF_FOURCC;
+ pixel_format->fourcc = d3dformat;
+ return D3D_OK;
+ }
+
WARN("Unknown pixel format %#x\n", d3dformat);
return E_NOTIMPL;
}

View file

@ -1,102 +0,0 @@
diff --git a/dll/directx/wine/d3dx9_36/d3dx9_private.h b/dll/directx/wine/d3dx9_36/d3dx9_private.h
index 5a28f2e..158aae3 100644
--- a/dll/directx/wine/d3dx9_36/d3dx9_private.h
+++ b/dll/directx/wine/d3dx9_36/d3dx9_private.h
@@ -125,6 +125,8 @@ HRESULT lock_surface(IDirect3DSurface9 *surface, D3DLOCKED_RECT *lock,
IDirect3DSurface9 **temp_surface, BOOL write) DECLSPEC_HIDDEN;
HRESULT unlock_surface(IDirect3DSurface9 *surface, D3DLOCKED_RECT *lock,
IDirect3DSurface9 *temp_surface, BOOL update) DECLSPEC_HIDDEN;
+HRESULT save_dds_texture_to_memory(ID3DXBuffer **dst_buffer, IDirect3DBaseTexture9 *src_texture,
+ const PALETTEENTRY *src_palette) DECLSPEC_HIDDEN;
unsigned short float_32_to_16(const float in) DECLSPEC_HIDDEN;
float float_16_to_32(const unsigned short in) DECLSPEC_HIDDEN;
diff --git a/dll/directx/wine/d3dx9_36/surface.c b/dll/directx/wine/d3dx9_36/surface.c
index 185d4f4..d236feb 100644
--- a/dll/directx/wine/d3dx9_36/surface.c
+++ b/dll/directx/wine/d3dx9_36/surface.c
@@ -612,6 +612,68 @@ static HRESULT save_dds_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSur
return D3D_OK;
}
+static HRESULT get_surface(D3DRESOURCETYPE type, struct IDirect3DBaseTexture9 *tex,
+ int face, UINT level, struct IDirect3DSurface9 **surf)
+{
+ switch (type)
+ {
+ case D3DRTYPE_TEXTURE:
+ return IDirect3DTexture9_GetSurfaceLevel((IDirect3DTexture9*) tex, level, surf);
+ case D3DRTYPE_CUBETEXTURE:
+ return IDirect3DCubeTexture9_GetCubeMapSurface((IDirect3DCubeTexture9*) tex, face, level, surf);
+ default:
+ ERR("Unexpected texture type\n");
+ return E_NOTIMPL;
+ }
+}
+
+HRESULT save_dds_texture_to_memory(ID3DXBuffer **dst_buffer, IDirect3DBaseTexture9 *src_texture, const PALETTEENTRY *src_palette)
+{
+ HRESULT hr;
+ D3DRESOURCETYPE type;
+ UINT mip_levels;
+ IDirect3DSurface9 *surface;
+
+ type = IDirect3DBaseTexture9_GetType(src_texture);
+
+ if ((type != D3DRTYPE_TEXTURE) && (type != D3DRTYPE_CUBETEXTURE) && (type != D3DRTYPE_VOLUMETEXTURE))
+ return D3DERR_INVALIDCALL;
+
+ if (type == D3DRTYPE_CUBETEXTURE)
+ {
+ FIXME("Cube texture not supported yet\n");
+ return E_NOTIMPL;
+ }
+ else if (type == D3DRTYPE_VOLUMETEXTURE)
+ {
+ FIXME("Volume texture not supported yet\n");
+ return E_NOTIMPL;
+ }
+
+ mip_levels = IDirect3DTexture9_GetLevelCount(src_texture);
+
+ if (mip_levels > 1)
+ {
+ FIXME("Mipmap not supported yet\n");
+ return E_NOTIMPL;
+ }
+
+ if (src_palette)
+ {
+ FIXME("Saving surfaces with palettized pixel formats not implemented yet\n");
+ return E_NOTIMPL;
+ }
+
+ hr = get_surface(type, src_texture, D3DCUBEMAP_FACE_POSITIVE_X, 0, &surface);
+
+ if (SUCCEEDED(hr))
+ {
+ hr = save_dds_surface_to_memory(dst_buffer, surface, NULL);
+ IDirect3DSurface9_Release(surface);
+ }
+
+ return hr;
+}
HRESULT load_volume_from_dds(IDirect3DVolume9 *dst_volume, const PALETTEENTRY *dst_palette,
const D3DBOX *dst_box, const void *src_data, const D3DBOX *src_box, DWORD filter, D3DCOLOR color_key,
const D3DXIMAGE_INFO *src_info)
diff --git a/dll/directx/wine/d3dx9_36/texture.c b/dll/directx/wine/d3dx9_36/texture.c
index e2dfab8..9f0e541 100644
--- a/dll/directx/wine/d3dx9_36/texture.c
+++ b/dll/directx/wine/d3dx9_36/texture.c
@@ -1906,10 +1906,7 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
if (!dst_buffer || !src_texture) return D3DERR_INVALIDCALL;
if (file_format == D3DXIFF_DDS)
- {
- FIXME("DDS file format isn't supported yet\n");
- return E_NOTIMPL;
- }
+ return save_dds_texture_to_memory(dst_buffer, src_texture, src_palette);
type = IDirect3DBaseTexture9_GetType(src_texture);
switch (type)

View file

@ -1,203 +0,0 @@
diff --git a/dll/directx/wine/d3dx9_36/d3dx9.cmake b/dll/directx/wine/d3dx9_36/d3dx9.cmake
index 77dd1cde..900a8bfe 100644
--- a/dll/directx/wine/d3dx9_36/d3dx9.cmake
+++ b/dll/directx/wine/d3dx9_36/d3dx9.cmake
@@ -35,7 +35,7 @@ function(add_d3dx9_target __version)
set_module_type(${module} win32dll)
add_dependencies(${module} d3d_idl_headers)
target_link_libraries(${module} dxguid wine)
- add_importlibs(${module} d3dcompiler_43 d3dxof user32 ole32 gdi32 msvcrt kernel32 ntdll)
+ add_importlibs(${module} d3dcompiler_43 d3dxof d3dwine user32 ole32 gdi32 msvcrt kernel32 ntdll)
add_delay_importlibs(${module} windowscodecs)
add_pch(${module} ../d3dx9_36/precomp.h SOURCE)
add_cd_file(TARGET ${module} DESTINATION reactos/system32 FOR all)
diff --git a/dll/directx/wine/d3dx9_36/surface.c b/dll/directx/wine/d3dx9_36/surface.c
index d236feb0..3c308d36 100644
--- a/dll/directx/wine/d3dx9_36/surface.c
+++ b/dll/directx/wine/d3dx9_36/surface.c
@@ -27,6 +27,8 @@
#include "ole2.h"
#include "wincodec.h"
+#include "wine/wined3d.h"
+
WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT, IWICImagingFactory**);
@@ -1876,6 +1878,24 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic
}
}
+typedef BOOL (*dxtn_conversion_func)(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out,
+ enum wined3d_format_id format, unsigned int w, unsigned int h);
+
+static dxtn_conversion_func get_dxtn_conversion_func(D3DFORMAT format, BOOL encode)
+{
+ switch (format)
+ {
+ case D3DFMT_DXT1:
+ return encode ? wined3d_dxt1_encode : wined3d_dxt1_decode;
+ case D3DFMT_DXT3:
+ return encode ? wined3d_dxt3_encode : wined3d_dxt3_decode;
+ case D3DFMT_DXT5:
+ return encode ? wined3d_dxt5_encode : wined3d_dxt5_decode;
+ default:
+ return NULL;
+ }
+}
+
/************************************************************
* D3DXLoadSurfaceFromMemory
*
@@ -1915,10 +1935,12 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
{
const struct pixel_format_desc *srcformatdesc, *destformatdesc;
IDirect3DSurface9 *surface;
+ void *tmp_src_memory = NULL, *tmp_dst_memory = NULL;
+ dxtn_conversion_func pre_convert = NULL, post_convert = NULL;
D3DSURFACE_DESC surfdesc;
D3DLOCKED_RECT lockrect;
struct volume src_size, dst_size;
- HRESULT hr;
+ HRESULT hr = D3D_OK;
TRACE("(%p, %p, %s, %p, %#x, %u, %p, %s, %#x, 0x%08x)\n",
dst_surface, dst_palette, wine_dbgstr_rect(dst_rect), src_memory, src_format,
@@ -1999,18 +2021,65 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
}
else /* Stretching or format conversion. */
{
- if (!is_conversion_from_supported(srcformatdesc)
- || !is_conversion_to_supported(destformatdesc))
+ UINT tmp_src_pitch, tmp_dst_pitch;
+
+ pre_convert = get_dxtn_conversion_func(srcformatdesc->format, FALSE);
+ post_convert = get_dxtn_conversion_func(destformatdesc->format, TRUE);
+
+ if ((!pre_convert && !is_conversion_from_supported(srcformatdesc)) ||
+ (!post_convert && !is_conversion_to_supported(destformatdesc)))
{
FIXME("Unsupported format conversion %#x -> %#x.\n", src_format, surfdesc.Format);
unlock_surface(dst_surface, &lockrect, surface, FALSE);
return E_NOTIMPL;
}
+ /* handle pre-conversion */
+ if (pre_convert)
+ {
+ tmp_src_memory = HeapAlloc(GetProcessHeap(), 0, src_size.width * src_size.height * sizeof(DWORD));
+ if (!tmp_src_memory)
+ {
+ hr = E_OUTOFMEMORY;
+ goto done;
+ }
+ tmp_src_pitch = src_size.width * sizeof(DWORD);
+ if (!pre_convert(src_memory, tmp_src_memory, src_pitch, tmp_src_pitch,
+ WINED3DFMT_B8G8R8A8_UNORM, src_size.width, src_size.height))
+ {
+ hr = E_FAIL;
+ goto done;
+ }
+ srcformatdesc = get_format_info(D3DFMT_A8R8G8B8);
+ }
+ else
+ {
+ tmp_src_memory = (void *)src_memory;
+ tmp_src_pitch = src_pitch;
+ }
+
+ /* handle post-conversion */
+ if (post_convert)
+ {
+ tmp_dst_memory = HeapAlloc(GetProcessHeap(), 0, dst_size.width * dst_size.height * sizeof(DWORD));
+ if (!tmp_dst_memory)
+ {
+ hr = E_OUTOFMEMORY;
+ goto done;
+ }
+ tmp_dst_pitch = dst_size.width * sizeof(DWORD);
+ destformatdesc = get_format_info(D3DFMT_A8R8G8B8);
+ }
+ else
+ {
+ tmp_dst_memory = lockrect.pBits;
+ tmp_dst_pitch = lockrect.Pitch;
+ }
+
if ((filter & 0xf) == D3DX_FILTER_NONE)
{
- convert_argb_pixels(src_memory, src_pitch, 0, &src_size, srcformatdesc,
- lockrect.pBits, lockrect.Pitch, 0, &dst_size, destformatdesc, color_key, src_palette);
+ convert_argb_pixels(tmp_src_memory, tmp_src_pitch, 0, &src_size, srcformatdesc,
+ tmp_dst_memory, tmp_dst_pitch, 0, &dst_size, destformatdesc, color_key, src_palette);
}
else /* if ((filter & 0xf) == D3DX_FILTER_POINT) */
{
@@ -2019,12 +2088,29 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
/* Always apply a point filter until D3DX_FILTER_LINEAR,
* D3DX_FILTER_TRIANGLE and D3DX_FILTER_BOX are implemented. */
- point_filter_argb_pixels(src_memory, src_pitch, 0, &src_size, srcformatdesc,
- lockrect.pBits, lockrect.Pitch, 0, &dst_size, destformatdesc, color_key, src_palette);
+ point_filter_argb_pixels(tmp_src_memory, tmp_src_pitch, 0, &src_size, srcformatdesc,
+ tmp_dst_memory, tmp_dst_pitch, 0, &dst_size, destformatdesc, color_key, src_palette);
+ }
+
+ /* handle post-conversion */
+ if (post_convert)
+ {
+ if (!post_convert(tmp_dst_memory, lockrect.pBits, tmp_dst_pitch, lockrect.Pitch,
+ WINED3DFMT_B8G8R8A8_UNORM, dst_size.width, dst_size.height))
+ {
+ hr = E_FAIL;
+ }
}
}
- return unlock_surface(dst_surface, &lockrect, surface, TRUE);
+done:
+ if (pre_convert)
+ HeapFree(GetProcessHeap(), 0, tmp_src_memory);
+ if (post_convert)
+ HeapFree(GetProcessHeap(), 0, tmp_dst_memory);
+
+ unlock_surface(dst_surface, &lockrect, surface, TRUE);
+ return hr;
}
/************************************************************
diff --git a/modules/rostests/winetests/d3dx9_36/surface.c b/modules/rostests/winetests/d3dx9_36/surface.c
index 2c83dc23..95b64a0f 100644
--- a/modules/rostests/winetests/d3dx9_36/surface.c
+++ b/modules/rostests/winetests/d3dx9_36/surface.c
@@ -1224,7 +1224,7 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
hr = IDirect3DTexture9_GetSurfaceLevel(tex, 0, &newsurf);
ok(SUCCEEDED(hr), "Failed to get the surface, hr %#x.\n", hr);
hr = D3DXLoadSurfaceFromSurface(newsurf, NULL, NULL, surf, NULL, NULL, D3DX_FILTER_NONE, 0);
- todo_wine ok(SUCCEEDED(hr), "Failed to convert pixels to DXT3 format.\n");
+ ok(SUCCEEDED(hr), "Failed to convert pixels to DXT3 format.\n");
check_release((IUnknown*)newsurf, 1);
check_release((IUnknown*)tex, 0);
}
@@ -1250,7 +1250,7 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
hr = IDirect3DTexture9_GetSurfaceLevel(tex, 0, &newsurf);
ok(SUCCEEDED(hr), "Failed to get the surface, hr %#x.\n", hr);
hr = D3DXLoadSurfaceFromSurface(newsurf, NULL, NULL, surf, NULL, NULL, D3DX_FILTER_NONE, 0);
- todo_wine ok(SUCCEEDED(hr), "Failed to convert pixels to DXT5 format.\n");
+ ok(SUCCEEDED(hr), "Failed to convert pixels to DXT5 format.\n");
check_release((IUnknown*)newsurf, 1);
check_release((IUnknown*)tex, 0);
}
@@ -1263,10 +1263,10 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
hr = IDirect3DTexture9_GetSurfaceLevel(tex, 0, &newsurf);
ok(SUCCEEDED(hr), "Failed to get the surface, hr %#x.\n", hr);
hr = D3DXLoadSurfaceFromSurface(newsurf, NULL, NULL, surf, NULL, NULL, D3DX_FILTER_NONE, 0);
- todo_wine ok(SUCCEEDED(hr), "Failed to convert pixels to DXT1 format.\n");
+ ok(SUCCEEDED(hr), "Failed to convert pixels to DXT1 format.\n");
hr = D3DXLoadSurfaceFromSurface(surf, NULL, NULL, newsurf, NULL, NULL, D3DX_FILTER_NONE, 0);
- todo_wine ok(SUCCEEDED(hr), "Failed to convert pixels from DXT1 format.\n");
+ ok(SUCCEEDED(hr), "Failed to convert pixels from DXT1 format.\n");
check_release((IUnknown*)newsurf, 1);
check_release((IUnknown*)tex, 0);

View file

@ -1,308 +0,0 @@
diff --git a/dll/directx/wine/d3dx9_36/font.c b/dll/directx/wine/d3dx9_36/font.c
index 418a3be..2e2f696 100644
--- a/dll/directx/wine/d3dx9_36/font.c
+++ b/dll/directx/wine/d3dx9_36/font.c
@@ -35,8 +35,29 @@ struct d3dx_font
HDC hdc;
HFONT hfont;
+
+ UINT tex_width;
+ UINT tex_height;
+ IDirect3DTexture9 *texture;
+ HBITMAP bitmap;
+ BYTE *bits;
};
+/* Returns the smallest power of 2 which is greater than or equal to num */
+static UINT make_pow2(UINT num)
+{
+ UINT result = 1;
+
+ /* In the unlikely event somebody passes a large value, make sure we don't enter an infinite loop */
+ if (num >= 0x80000000)
+ return 0x80000000;
+
+ while (result < num)
+ result <<= 1;
+
+ return result;
+}
+
static inline struct d3dx_font *impl_from_ID3DXFont(ID3DXFont *iface)
{
return CONTAINING_RECORD(iface, struct d3dx_font, ID3DXFont_iface);
@@ -63,19 +84,27 @@ static HRESULT WINAPI ID3DXFontImpl_QueryInterface(ID3DXFont *iface, REFIID riid
static ULONG WINAPI ID3DXFontImpl_AddRef(ID3DXFont *iface)
{
struct d3dx_font *This = impl_from_ID3DXFont(iface);
- ULONG ref=InterlockedIncrement(&This->ref);
+ ULONG ref = InterlockedIncrement(&This->ref);
+
TRACE("%p increasing refcount to %u\n", iface, ref);
+
return ref;
}
static ULONG WINAPI ID3DXFontImpl_Release(ID3DXFont *iface)
{
struct d3dx_font *This = impl_from_ID3DXFont(iface);
- ULONG ref=InterlockedDecrement(&This->ref);
+ ULONG ref = InterlockedDecrement(&This->ref);
TRACE("%p decreasing refcount to %u\n", iface, ref);
- if(ref==0) {
+ if (!ref)
+ {
+ if (This->texture)
+ {
+ IDirect3DTexture9_Release(This->texture);
+ DeleteObject(This->bitmap);
+ }
DeleteObject(This->hfont);
DeleteDC(This->hdc);
IDirect3DDevice9_Release(This->device);
@@ -178,17 +207,170 @@ static HRESULT WINAPI ID3DXFontImpl_PreloadTextW(ID3DXFont *iface, const WCHAR *
static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, ID3DXSprite *sprite,
const char *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
{
- FIXME("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x stub!\n",
+ LPWSTR stringW;
+ INT countW, ret = 0;
+
+ TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
iface, sprite, debugstr_a(string), count, wine_dbgstr_rect(rect), format, color);
- return 1;
+
+ if (!string || count <= 0)
+ return 0;
+
+ countW = MultiByteToWideChar(CP_ACP, 0, string, count, NULL, 0);
+ stringW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR));
+ if (stringW)
+ {
+ MultiByteToWideChar(CP_ACP, 0, string, count, stringW, countW);
+ ret = ID3DXFont_DrawTextW(iface, sprite, stringW, countW, rect, format, color);
+ HeapFree(GetProcessHeap(), 0, stringW);
+ }
+
+ return ret;
}
static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
const WCHAR *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
{
- FIXME("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x stub!\n",
+ struct d3dx_font *This = impl_from_ID3DXFont(iface);
+ RECT calc_rect = *rect;
+ INT height;
+
+ TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
iface, sprite, debugstr_w(string), count, wine_dbgstr_rect(rect), format, color);
- return 1;
+
+ if (!string || count <= 0)
+ return 0;
+
+ /* Strip terminating NULL characters */
+ while (count > 0 && !string[count-1])
+ count--;
+
+ height = DrawTextW(This->hdc, string, count, &calc_rect, format | DT_CALCRECT);
+
+ if (format & DT_CALCRECT)
+ {
+ *rect = calc_rect;
+ return height;
+ }
+
+ if (height && (calc_rect.left < calc_rect.right))
+ {
+ D3DLOCKED_RECT locked_rect;
+ D3DXVECTOR3 position;
+ UINT text_width, text_height;
+ RECT text_rect;
+ ID3DXSprite *target = sprite;
+ HRESULT hr;
+ int i, j;
+
+ /* Get rect position and dimensions */
+ position.x = calc_rect.left;
+ position.y = calc_rect.top;
+ position.z = 0;
+ text_width = calc_rect.right - calc_rect.left;
+ text_height = calc_rect.bottom - calc_rect.top;
+ text_rect.left = 0;
+ text_rect.top = 0;
+ text_rect.right = text_width;
+ text_rect.bottom = text_height;
+
+ /* We need to flush as it seems all draws in the begin/end sequence use only the latest updated texture */
+ if (sprite)
+ ID3DXSprite_Flush(sprite);
+
+ /* Extend texture and DIB section to contain text */
+ if ((text_width > This->tex_width) || (text_height > This->tex_height))
+ {
+ BITMAPINFOHEADER header;
+
+ if (text_width > This->tex_width)
+ This->tex_width = make_pow2(text_width);
+ if (text_height > This->tex_height)
+ This->tex_height = make_pow2(text_height);
+
+ if (This->texture)
+ {
+ IDirect3DTexture9_Release(This->texture);
+ DeleteObject(This->bitmap);
+ }
+
+ hr = D3DXCreateTexture(This->device, This->tex_width, This->tex_height, 1, 0,
+ D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &This->texture);
+ if (FAILED(hr))
+ {
+ This->texture = NULL;
+ return 0;
+ }
+
+ header.biSize = sizeof(header);
+ header.biWidth = This->tex_width;
+ header.biHeight = -This->tex_height;
+ header.biPlanes = 1;
+ header.biBitCount = 32;
+ header.biCompression = BI_RGB;
+ header.biSizeImage = sizeof(DWORD) * This->tex_width * This->tex_height;
+ header.biXPelsPerMeter = 0;
+ header.biYPelsPerMeter = 0;
+ header.biClrUsed = 0;
+ header.biClrImportant = 0;
+
+ This->bitmap = CreateDIBSection(This->hdc, (const BITMAPINFO*)&header,
+ DIB_RGB_COLORS, (void**)&This->bits, NULL, 0);
+ if (!This->bitmap)
+ {
+ IDirect3DTexture9_Release(This->texture);
+ This->texture = NULL;
+ return 0;
+ }
+
+ SelectObject(This->hdc, This->bitmap);
+ }
+
+ if (FAILED(IDirect3DTexture9_LockRect(This->texture, 0, &locked_rect, &text_rect, D3DLOCK_DISCARD)))
+ return 0;
+
+ /* Clear rect */
+ for (i = 0; i < text_height; i++)
+ memset(This->bits + i * This->tex_width * sizeof(DWORD), 0,
+ text_width * sizeof(DWORD));
+
+ DrawTextW(This->hdc, string, count, &text_rect, format);
+
+ /* All RGB components are equal so take one as alpha and set RGB
+ * color to white, so it can be modulated with color parameter */
+ for (i = 0; i < text_height; i++)
+ {
+ DWORD *src = (DWORD *)This->bits + i * This->tex_width;
+ DWORD *dst = (DWORD *)((BYTE *)locked_rect.pBits + i * locked_rect.Pitch);
+ for (j = 0; j < text_width; j++)
+ {
+ *dst++ = (*src++ << 24) | 0xFFFFFF;
+ }
+ }
+
+ IDirect3DTexture9_UnlockRect(This->texture, 0);
+
+ if (!sprite)
+ {
+ hr = D3DXCreateSprite(This->device, &target);
+ if (FAILED(hr))
+ return 0;
+ ID3DXSprite_Begin(target, 0);
+ }
+
+ hr = target->lpVtbl->Draw(target, This->texture, &text_rect, NULL, &position, color);
+
+ if (!sprite)
+ {
+ ID3DXSprite_End(target);
+ ID3DXSprite_Release(target);
+ }
+
+ if (FAILED(hr))
+ return 0;
+ }
+
+ return height;
}
static HRESULT WINAPI ID3DXFontImpl_OnLostDevice(ID3DXFont *iface)
@@ -301,46 +483,55 @@ HRESULT WINAPI D3DXCreateFontIndirectW(IDirect3DDevice9 *device, const D3DXFONT_
TRACE("(%p, %p, %p)\n", device, desc, font);
- if( !device || !desc || !font ) return D3DERR_INVALIDCALL;
+ if (!device || !desc || !font) return D3DERR_INVALIDCALL;
+
+ TRACE("desc: %d %d %d %d %d %d %d %d %d %s\n", desc->Height, desc->Width, desc->Weight, desc->MipLevels, desc->Italic,
+ desc->CharSet, desc->OutputPrecision, desc->Quality, desc->PitchAndFamily, debugstr_w(desc->FaceName));
- /* the device MUST support D3DFMT_A8R8G8B8 */
+ /* The device MUST support D3DFMT_A8R8G8B8 */
IDirect3DDevice9_GetDirect3D(device, &d3d);
IDirect3DDevice9_GetCreationParameters(device, &cpars);
IDirect3DDevice9_GetDisplayMode(device, 0, &mode);
hr = IDirect3D9_CheckDeviceFormat(d3d, cpars.AdapterOrdinal, cpars.DeviceType, mode.Format, 0, D3DRTYPE_TEXTURE, D3DFMT_A8R8G8B8);
- if(FAILED(hr)) {
+ if (FAILED(hr))
+ {
IDirect3D9_Release(d3d);
return D3DXERR_INVALIDDATA;
}
IDirect3D9_Release(d3d);
- object = HeapAlloc(GetProcessHeap(), 0, sizeof(struct d3dx_font));
- if(object==NULL) {
- *font=NULL;
+ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct d3dx_font));
+ if (!object)
+ {
+ *font = NULL;
return E_OUTOFMEMORY;
}
object->ID3DXFont_iface.lpVtbl = &D3DXFont_Vtbl;
- object->ref=1;
- object->device=device;
- object->desc=*desc;
+ object->ref = 1;
+ object->device = device;
+ object->desc = *desc;
object->hdc = CreateCompatibleDC(NULL);
- if( !object->hdc ) {
+ if (!object->hdc)
+ {
HeapFree(GetProcessHeap(), 0, object);
return D3DXERR_INVALIDDATA;
}
object->hfont = CreateFontW(desc->Height, desc->Width, 0, 0, desc->Weight, desc->Italic, FALSE, FALSE, desc->CharSet,
desc->OutputPrecision, CLIP_DEFAULT_PRECIS, desc->Quality, desc->PitchAndFamily, desc->FaceName);
- if( !object->hfont ) {
+ if (!object->hfont)
+ {
DeleteDC(object->hdc);
HeapFree(GetProcessHeap(), 0, object);
return D3DXERR_INVALIDDATA;
}
SelectObject(object->hdc, object->hfont);
+ SetTextColor(object->hdc, 0x00ffffff);
+ SetBkColor(object->hdc, 0x00000000);
IDirect3DDevice9_AddRef(device);
- *font=&object->ID3DXFont_iface;
+ *font = &object->ID3DXFont_iface;
return D3D_OK;
}

View file

@ -1,18 +0,0 @@
diff --git a/dll/directx/wine/d3dx9_36/font.c b/dll/directx/wine/d3dx9_36/font.c
index 2e2f696..e8689bb 100644
--- a/dll/directx/wine/d3dx9_36/font.c
+++ b/dll/directx/wine/d3dx9_36/font.c
@@ -253,6 +253,13 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
return height;
}
+ if (format & DT_CENTER)
+ {
+ UINT new_width = calc_rect.right - calc_rect.left;
+ calc_rect.left = (rect->right + rect->left - new_width) / 2;
+ calc_rect.right = calc_rect.left + new_width;
+ }
+
if (height && (calc_rect.left < calc_rect.right))
{
D3DLOCKED_RECT locked_rect;

View file

@ -1,94 +0,0 @@
diff --git a/dll/directx/wine/d3dx9_36/font.c b/dll/directx/wine/d3dx9_36/font.c
index e8689bb..89005ce 100644
--- a/dll/directx/wine/d3dx9_36/font.c
+++ b/dll/directx/wine/d3dx9_36/font.c
@@ -213,9 +213,12 @@ static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, ID3DXSprite *sprite,
TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
iface, sprite, debugstr_a(string), count, wine_dbgstr_rect(rect), format, color);
- if (!string || count <= 0)
+ if (!string || count == 0)
return 0;
+ if (count < 0)
+ count = -1;
+
countW = MultiByteToWideChar(CP_ACP, 0, string, count, NULL, 0);
stringW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR));
if (stringW)
@@ -238,9 +241,12 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
iface, sprite, debugstr_w(string), count, wine_dbgstr_rect(rect), format, color);
- if (!string || count <= 0)
+ if (!string || count == 0)
return 0;
+ if (count < 0)
+ count = lstrlenW(string);
+
/* Strip terminating NULL characters */
while (count > 0 && !string[count-1])
count--;
diff --git a/modules/rostests/winetests/d3dx9_36/core.c b/modules/rostests/winetests/d3dx9_36/core.c
index fa874a5..841d07e 100644
--- a/modules/rostests/winetests/d3dx9_36/core.c
+++ b/modules/rostests/winetests/d3dx9_36/core.c
@@ -306,6 +306,7 @@ static void test_ID3DXSprite(IDirect3DDevice9 *device)
static void test_ID3DXFont(IDirect3DDevice9 *device)
{
static const WCHAR testW[] = {'t','e','s','t',0};
+ static const char testA[] = "test";
static const struct
{
int font_height;
@@ -637,6 +638,49 @@ static void test_ID3DXFont(IDirect3DDevice9 *device)
ID3DXFont_Release(font);
}
+
+ /* ID3DXFont_DrawTextA, ID3DXFont_DrawTextW */
+ hr = D3DXCreateFontA(device, 12, 0, FW_DONTCARE, 0, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Arial", &font);
+ if (SUCCEEDED(hr)) {
+ RECT rect;
+ int height;
+
+ SetRect(&rect, 10, 10, 200, 200);
+
+ height = ID3DXFont_DrawTextA(font, NULL, testA, -2, &rect, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextA(font, NULL, testA, -1, &rect, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextA(font, NULL, testA, 0, &rect, 0, 0xFF00FF);
+ ok(height == 0, "DrawTextA returned %d, expected 0.\n", height);
+
+ height = ID3DXFont_DrawTextA(font, NULL, testA, 1, &rect, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextA(font, NULL, testA, 2, &rect, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
+
+if (0) { /* Causes a lockup on windows 7. */
+ height = ID3DXFont_DrawTextW(font, NULL, testW, -2, &rect, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextW returned %d, expected 12.\n", height);
+}
+
+ height = ID3DXFont_DrawTextW(font, NULL, testW, -1, &rect, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextW returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextW(font, NULL, testW, 0, &rect, 0, 0xFF00FF);
+ ok(height == 0, "DrawTextW returned %d, expected 0.\n", height);
+
+ height = ID3DXFont_DrawTextW(font, NULL, testW, 1, &rect, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextW returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextW(font, NULL, testW, 2, &rect, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextW returned %d, expected 12.\n", height);
+
+ ID3DXFont_Release(font);
+ }
}
static void test_D3DXCreateRenderToSurface(IDirect3DDevice9 *device)

View file

@ -1,66 +0,0 @@
diff --git a/dll/directx/wine/d3dx9_36/font.c b/dll/directx/wine/d3dx9_36/font.c
index 89005ce..05e490f 100644
--- a/dll/directx/wine/d3dx9_36/font.c
+++ b/dll/directx/wine/d3dx9_36/font.c
@@ -235,7 +235,7 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
const WCHAR *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
{
struct d3dx_font *This = impl_from_ID3DXFont(iface);
- RECT calc_rect = *rect;
+ RECT calc_rect;
INT height;
TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
@@ -251,11 +251,15 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
while (count > 0 && !string[count-1])
count--;
+ if (rect)
+ calc_rect = *rect;
+
height = DrawTextW(This->hdc, string, count, &calc_rect, format | DT_CALCRECT);
if (format & DT_CALCRECT)
{
- *rect = calc_rect;
+ if (rect)
+ *rect = calc_rect;
return height;
}
diff --git a/modules/rostests/winetests/d3dx9_36/core.c b/modules/rostests/winetests/d3dx9_36/core.c
index 841d07e..a5abb79 100644
--- a/modules/rostests/winetests/d3dx9_36/core.c
+++ b/modules/rostests/winetests/d3dx9_36/core.c
@@ -662,6 +662,15 @@ static void test_ID3DXFont(IDirect3DDevice9 *device)
height = ID3DXFont_DrawTextA(font, NULL, testA, 2, &rect, 0, 0xFF00FF);
ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
+ height = ID3DXFont_DrawTextA(font, NULL, testA, -1, NULL, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextA(font, NULL, testA, -1, NULL, DT_CALCRECT, 0xFF00FF);
+ ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextA(font, NULL, NULL, -1, NULL, 0, 0xFF00FF);
+ ok(height == 0, "DrawTextA returned %d, expected 0.\n", height);
+
if (0) { /* Causes a lockup on windows 7. */
height = ID3DXFont_DrawTextW(font, NULL, testW, -2, &rect, 0, 0xFF00FF);
ok(height == 12, "DrawTextW returned %d, expected 12.\n", height);
@@ -679,6 +688,15 @@ if (0) { /* Causes a lockup on windows 7. */
height = ID3DXFont_DrawTextW(font, NULL, testW, 2, &rect, 0, 0xFF00FF);
ok(height == 12, "DrawTextW returned %d, expected 12.\n", height);
+ height = ID3DXFont_DrawTextW(font, NULL, testW, -1, NULL, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextW(font, NULL, testW, -1, NULL, DT_CALCRECT, 0xFF00FF);
+ ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextW(font, NULL, NULL, -1, NULL, 0, 0xFF00FF);
+ ok(height == 0, "DrawTextA returned %d, expected 0.\n", height);
+
ID3DXFont_Release(font);
}
}

View file

@ -1,66 +0,0 @@
diff --git a/dll/directx/wine/d3dx9_36/d3dx9_private.h b/dll/directx/wine/d3dx9_36/d3dx9_private.h
index 158aae3..7a3d1cb 100644
--- a/dll/directx/wine/d3dx9_36/d3dx9_private.h
+++ b/dll/directx/wine/d3dx9_36/d3dx9_private.h
@@ -404,4 +404,6 @@ struct ctab_constant {
const struct ctab_constant *d3dx_shader_get_ctab_constant(ID3DXConstantTable *iface,
D3DXHANDLE constant) DECLSPEC_HIDDEN;
+HRESULT create_dummy_skin(ID3DXSkinInfo **iface) DECLSPEC_HIDDEN;
+
#endif /* __WINE_D3DX9_PRIVATE_H */
diff --git a/dll/directx/wine/d3dx9_36/mesh.c b/dll/directx/wine/d3dx9_36/mesh.c
index 2a9ee06..898a88c 100644
--- a/dll/directx/wine/d3dx9_36/mesh.c
+++ b/dll/directx/wine/d3dx9_36/mesh.c
@@ -3332,6 +3332,13 @@ static HRESULT parse_mesh(ID3DXFileData *filedata, struct mesh_data *mesh_data,
goto end;
}
+ if ((provide_flags & PROVIDE_SKININFO) && !mesh_data->skin_info)
+ {
+ hr = create_dummy_skin(&mesh_data->skin_info);
+ if (FAILED(hr))
+ goto end;
+ }
+
hr = D3D_OK;
end:
diff --git a/dll/directx/wine/d3dx9_36/skin.c b/dll/directx/wine/d3dx9_36/skin.c
index f197d33..bed4b9f 100644
--- a/dll/directx/wine/d3dx9_36/skin.c
+++ b/dll/directx/wine/d3dx9_36/skin.c
@@ -94,7 +94,7 @@ static ULONG WINAPI d3dx9_skin_info_Release(ID3DXSkinInfo *iface)
HeapFree(GetProcessHeap(), 0, skin->bones[i].vertices);
HeapFree(GetProcessHeap(), 0, skin->bones[i].weights);
}
- HeapFree(GetProcessHeap(), 0, skin->bones);
+ if (skin->bones) HeapFree(GetProcessHeap(), 0, skin->bones);
HeapFree(GetProcessHeap(), 0, skin);
}
@@ -495,3 +495,23 @@ HRESULT WINAPI D3DXCreateSkinInfoFVF(DWORD num_vertices, DWORD fvf, DWORD num_bo
return D3DXCreateSkinInfo(num_vertices, declaration, num_bones, skin_info);
}
+
+HRESULT create_dummy_skin(ID3DXSkinInfo **iface)
+{
+ static const D3DVERTEXELEMENT9 empty_declaration = D3DDECL_END();
+ struct d3dx9_skin_info *object = NULL;
+
+ object = HeapAlloc(GetProcessHeap(), 0, sizeof(*object));
+ if (!object) return E_OUTOFMEMORY;
+
+ object->ID3DXSkinInfo_iface.lpVtbl = &d3dx9_skin_info_vtbl;
+ object->ref = 1;
+ object->num_vertices = 0;
+ object->num_bones = 0;
+ object->vertex_declaration[0] = empty_declaration;
+ object->fvf = 0;
+ object->bones = NULL;
+
+ *iface = &object->ID3DXSkinInfo_iface;
+ return D3D_OK;
+}

View file

@ -1,152 +0,0 @@
diff --git a/modules/rostests/winetests/d3dx9_36/mesh.c b/modules/rostests/winetests/d3dx9_36/mesh.c
index 904a452..ea0b867 100644
--- a/modules/rostests/winetests/d3dx9_36/mesh.c
+++ b/modules/rostests/winetests/d3dx9_36/mesh.c
@@ -25,6 +25,9 @@
#include <limits.h>
#include "wine/test.h"
#include "d3dx9.h"
+#include "initguid.h"
+#include "rmxftmpl.h"
+#include "rmxfguid.h"
#ifndef NAN
/* From wine/port.h */
@@ -2544,6 +2547,129 @@ static void D3DXLoadMeshTest(void)
free_test_context(test_context);
}
+static ID3DXFileData *get_mesh_data(const char *memory, SIZE_T length)
+{
+ D3DXF_FILELOADMEMORY source;
+ ID3DXFileEnumObject *enumobj = NULL;
+ ID3DXFileData *filedata = NULL;
+ ID3DXFileData *ret = NULL;
+ ID3DXFile *d3dxfile = NULL;
+ SIZE_T i, nb_children;
+ HRESULT hr;
+ GUID guid;
+
+ hr = D3DXFileCreate(&d3dxfile);
+ if (FAILED(hr)) return NULL;
+
+ hr = d3dxfile->lpVtbl->RegisterTemplates(d3dxfile, D3DRM_XTEMPLATES, D3DRM_XTEMPLATE_BYTES);
+ if (FAILED(hr)) goto cleanup;
+
+ source.lpMemory = (void *)memory;
+ source.dSize = length;
+
+ hr = d3dxfile->lpVtbl->CreateEnumObject(d3dxfile, &source, D3DXF_FILELOAD_FROMMEMORY, &enumobj);
+ if (FAILED(hr)) goto cleanup;
+
+ hr = enumobj->lpVtbl->GetChildren(enumobj, &nb_children);
+ if (FAILED(hr)) goto cleanup;
+
+ for (i = 0; i < nb_children; i++)
+ {
+ hr = enumobj->lpVtbl->GetChild(enumobj, i, &filedata);
+ if (FAILED(hr)) goto cleanup;
+
+ hr = filedata->lpVtbl->GetType(filedata, &guid);
+ if (SUCCEEDED(hr) && IsEqualGUID(&guid, &TID_D3DRMMesh))
+ {
+ ret = filedata;
+ break;
+ }
+ else
+ filedata->lpVtbl->Release(filedata);
+ }
+
+cleanup:
+ if (enumobj) enumobj->lpVtbl->Release(enumobj);
+ if (d3dxfile) d3dxfile->lpVtbl->Release(d3dxfile);
+
+ return ret;
+}
+
+static void D3DXLoadSkinMeshFromXofTest(void)
+{
+ static const char simple_xfile[] =
+ "xof 0303txt 0032"
+ "Mesh {"
+ "3;"
+ "0.0; 0.0; 0.0;,"
+ "0.0; 1.0; 0.0;,"
+ "1.0; 1.0; 0.0;;"
+ "1;"
+ "3; 0, 1, 2;;"
+ "}";
+ ID3DXBuffer *adjacency, *materials, *effects;
+ D3DPRESENT_PARAMETERS d3dpp;
+ IDirect3DDevice9 *device;
+ ID3DXFileData *filedata;
+ ID3DXSkinInfo *skininfo;
+ ID3DXMesh *mesh;
+ IDirect3D9 *d3d;
+ DWORD mat_count;
+ HRESULT hr;
+ HWND hwnd;
+
+ if (!(hwnd = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
+ 640, 480, NULL, NULL, NULL, NULL)))
+ {
+ skip("Couldn't create application window\n");
+ return;
+ }
+
+ d3d = Direct3DCreate9(D3D_SDK_VERSION);
+ if (!d3d)
+ {
+ skip("Couldn't create IDirect3D9 object\n");
+ DestroyWindow(hwnd);
+ return;
+ }
+
+ ZeroMemory(&d3dpp, sizeof(d3dpp));
+ d3dpp.Windowed = TRUE;
+ d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
+
+ hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device);
+ IDirect3D9_Release(d3d);
+ if (FAILED(hr))
+ {
+ skip("Failed to create IDirect3DDevice9 object %#x\n", hr);
+ DestroyWindow(hwnd);
+ return;
+ }
+
+ filedata = get_mesh_data(simple_xfile, sizeof(simple_xfile) - 1);
+ ok(filedata != NULL, "Failed to load mesh data\n");
+
+ adjacency = materials = effects = NULL;
+ skininfo = NULL;
+ mesh = NULL;
+
+ hr = D3DXLoadSkinMeshFromXof(filedata, 0, device, &adjacency, &materials, &effects, &mat_count, &skininfo, &mesh);
+ ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
+ ok(skininfo != NULL, "Expected non-null skininfo\n");
+
+ /* FIXME: Add additional tests for skininfo interface. */
+
+ if (adjacency) adjacency->lpVtbl->Release(adjacency);
+ if (materials) materials->lpVtbl->Release(materials);
+ if (effects) effects->lpVtbl->Release(effects);
+ if (skininfo) skininfo->lpVtbl->Release(skininfo);
+ if (mesh) mesh->lpVtbl->Release(mesh);
+
+ filedata->lpVtbl->Release(filedata);
+ IDirect3DDevice9_Release(device);
+ DestroyWindow(hwnd);
+}
+
static BOOL compute_box(struct mesh *mesh, float width, float height, float depth)
{
unsigned int i, face;
@@ -11222,6 +11348,7 @@ START_TEST(mesh)
D3DXCreateMeshTest();
D3DXCreateMeshFVFTest();
D3DXLoadMeshTest();
+ D3DXLoadSkinMeshFromXofTest();
D3DXCreateBoxTest();
D3DXCreatePolygonTest();
D3DXCreateSphereTest();

View file

@ -1,46 +0,0 @@
diff --git a/dll/directx/wine/d3dx9_36/shader.c b/dll/directx/wine/d3dx9_36/shader.c
index 7a23867..fc0f503 100644
--- a/dll/directx/wine/d3dx9_36/shader.c
+++ b/dll/directx/wine/d3dx9_36/shader.c
@@ -441,6 +441,41 @@ HRESULT WINAPI D3DXCompileShader(const char *data, UINT length, const D3DXMACRO
}
}
+ /* Filter out D3DCompile warning messages that are not present with D3DCompileShader */
+ if (SUCCEEDED(hr) && error_msgs && *error_msgs)
+ {
+ char *messages = ID3DXBuffer_GetBufferPointer(*error_msgs);
+ DWORD size = ID3DXBuffer_GetBufferSize(*error_msgs);
+
+ /* Ensure messages are null terminated for safe processing */
+ if (size) messages[size - 1] = 0;
+
+ while (size > 1)
+ {
+ char *prev, *next;
+
+ /* Warning has the form "warning X3206: ... implicit truncation of vector type"
+ but we only search for "X3206:" in case d3dcompiler_43 has localization */
+ prev = next = strstr(messages, "X3206:");
+ if (!prev) break;
+
+ /* get pointer to beginning and end of current line */
+ while (prev > messages && *(prev - 1) != '\n') prev--;
+ while (next < messages + size - 1 && *next != '\n') next++;
+ if (next < messages + size - 1 && *next == '\n') next++;
+
+ memmove(prev, next, messages + size - next);
+ size -= (next - prev);
+ }
+
+ /* Only return a buffer if the resulting string is not empty as some apps depend on that */
+ if (size <= 1)
+ {
+ ID3DXBuffer_Release(*error_msgs);
+ *error_msgs = NULL;
+ }
+ }
+
return hr;
}

View file

@ -1,16 +0,0 @@
diff --git a/dll/directx/wine/d3dx9_36/mesh.c b/dll/directx/wine/d3dx9_36/mesh.c
index 898a88c..b1d9f68 100644
--- a/dll/directx/wine/d3dx9_36/mesh.c
+++ b/dll/directx/wine/d3dx9_36/mesh.c
@@ -1695,11 +1695,7 @@ static HRESULT WINAPI d3dx9_mesh_OptimizeInplace(ID3DXMesh *iface, DWORD flags,
if (FAILED(hr)) goto cleanup;
} else if (flags & D3DXMESHOPT_ATTRSORT) {
if (!(flags & D3DXMESHOPT_IGNOREVERTS))
- {
FIXME("D3DXMESHOPT_ATTRSORT vertex reordering not implemented.\n");
- hr = E_NOTIMPL;
- goto cleanup;
- }
hr = iface->lpVtbl->LockAttributeBuffer(iface, 0, &attrib_buffer);
if (FAILED(hr)) goto cleanup;

View file

@ -1,40 +0,0 @@
diff --git a/modules/rostests/winetests/d3dx9_36/texture.c b/modules/rostests/winetests/d3dx9_36/texture.c
index 6c25a15..98a9fc3 100644
--- a/modules/rostests/winetests/d3dx9_36/texture.c
+++ b/modules/rostests/winetests/d3dx9_36/texture.c
@@ -400,6 +400,16 @@ static void test_D3DXCheckTextureRequirements(IDirect3DDevice9 *device)
ok(height == 4, "Returned height %d, expected %d\n", height, 4);
ok(mipmaps == 1, "Returned mipmaps %d, expected %d\n", mipmaps, 1);
ok(format == D3DFMT_DXT5, "Returned format %u, expected %u\n", format, D3DFMT_DXT5);
+
+ format = D3DFMT_DXT5;
+ width = 5; height = 5;
+ mipmaps = 1;
+ hr = D3DXCheckTextureRequirements(device, &width, &height, &mipmaps, 0, &format, D3DPOOL_DEFAULT);
+ ok(hr == D3D_OK, "D3DXCheckTextureRequirements returned %#x, expected %#x\n", hr, D3D_OK);
+ ok(width == 8, "Returned width %d, expected %d\n", width, 8);
+ ok(height == 8, "Returned height %d, expected %d\n", height, 8);
+ ok(mipmaps == 1, "Returned mipmaps %d, expected %d\n", mipmaps, 1);
+ ok(format == D3DFMT_DXT5, "Returned format %u, expected %u\n", format, D3DFMT_DXT5);
}
else
{
diff --git a/dll/directx/wine/d3dx9_36/texture.c b/dll/directx/wine/d3dx9_36/texture.c
index 9f0e541..552d02a 100644
--- a/dll/directx/wine/d3dx9_36/texture.c
+++ b/dll/directx/wine/d3dx9_36/texture.c
@@ -335,10 +335,10 @@ HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UIN
if (fmt->block_width != 1 || fmt->block_height != 1)
{
- if (w < fmt->block_width)
- w = fmt->block_width;
- if (h < fmt->block_height)
- h = fmt->block_height;
+ if (w % fmt->block_width)
+ w += fmt->block_width - w % fmt->block_width;
+ if (h % fmt->block_height)
+ h += fmt->block_height - h % fmt->block_height;
}
if ((caps.TextureCaps & D3DPTEXTURECAPS_POW2) && (!is_pow2(w)))

View file

@ -1,206 +0,0 @@
diff --git a/dll/directx/wine/d3dx9_36/skin.c b/dll/directx/wine/d3dx9_36/skin.c
index bed4b9f..0a305a9 100644
--- a/dll/directx/wine/d3dx9_36/skin.c
+++ b/dll/directx/wine/d3dx9_36/skin.c
@@ -2,6 +2,7 @@
* Skin Info operations specific to D3DX9.
*
* Copyright (C) 2011 Dylan Smith
+ * Copyright (C) 2013 Christian Costa
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -377,10 +378,89 @@ static HRESULT WINAPI d3dx9_skin_info_GetDeclaration(ID3DXSkinInfo *iface,
static HRESULT WINAPI d3dx9_skin_info_UpdateSkinnedMesh(ID3DXSkinInfo *iface, const D3DXMATRIX *bone_transforms,
const D3DXMATRIX *bone_inv_transpose_transforms, const void *src_vertices, void *dst_vertices)
{
- FIXME("iface %p, bone_transforms %p, bone_inv_transpose_transforms %p, src_vertices %p, dst_vertices %p stub!\n",
- iface, bone_transforms, bone_inv_transpose_transforms, src_vertices, dst_vertices);
+ struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface);
+ DWORD size = D3DXGetFVFVertexSize(skin->fvf);
+ DWORD i, j;
- return E_NOTIMPL;
+ TRACE("iface %p, bone_transforms %p, bone_inv_transpose_transforms %p, src_vertices %p, dst_vertices %p\n",
+ skin, bone_transforms, bone_inv_transpose_transforms, src_vertices, dst_vertices);
+
+ if (bone_inv_transpose_transforms)
+ FIXME("Skinning vertices with two position elements not supported\n");
+
+ if ((skin->fvf & D3DFVF_POSITION_MASK) != D3DFVF_XYZ) {
+ FIXME("Vertex type %#x not supported\n", skin->fvf & D3DFVF_POSITION_MASK);
+ return E_FAIL;
+ }
+
+ /* Reset all positions */
+ for (i = 0; i < skin->num_vertices; i++) {
+ D3DXVECTOR3 *position = (D3DXVECTOR3*)((BYTE*)dst_vertices + size * i);
+ position->x = 0.0f;
+ position->y = 0.0f;
+ position->z = 0.0f;
+ }
+
+ /* Update positions that are influenced by bones */
+ for (i = 0; i < skin->num_bones; i++) {
+ D3DXMATRIX bone_inverse, matrix;
+
+ D3DXMatrixInverse(&bone_inverse, NULL, &skin->bones[i].transform);
+ D3DXMatrixMultiply(&matrix, &bone_transforms[i], &bone_inverse);
+ D3DXMatrixMultiply(&matrix, &matrix, &skin->bones[i].transform);
+
+ for (j = 0; j < skin->bones[i].num_influences; j++) {
+ D3DXVECTOR3 position;
+ D3DXVECTOR3 *position_src = (D3DXVECTOR3*)((BYTE*)src_vertices + size * skin->bones[i].vertices[j]);
+ D3DXVECTOR3 *position_dest = (D3DXVECTOR3*)((BYTE*)dst_vertices + size * skin->bones[i].vertices[j]);
+ FLOAT weight = skin->bones[i].weights[j];
+
+ D3DXVec3TransformCoord(&position, position_src, &matrix);
+ position_dest->x += weight * position.x;
+ position_dest->y += weight * position.y;
+ position_dest->z += weight * position.z;
+ }
+ }
+
+ if (skin->fvf & D3DFVF_NORMAL) {
+ /* Reset all normals */
+ for (i = 0; i < skin->num_vertices; i++) {
+ D3DXVECTOR3 *normal = (D3DXVECTOR3*)((BYTE*)dst_vertices + size * i + sizeof(D3DXVECTOR3));
+ normal->x = 0.0f;
+ normal->y = 0.0f;
+ normal->z = 0.0f;
+ }
+
+ /* Update normals that are influenced by bones */
+ for (i = 0; i < skin->num_bones; i++) {
+ D3DXMATRIX bone_inverse, matrix;
+
+ D3DXMatrixInverse(&bone_inverse, NULL, &skin->bones[i].transform);
+ D3DXMatrixMultiply(&matrix, &skin->bones[i].transform, &bone_transforms[i]);
+
+ for (j = 0; j < skin->bones[i].num_influences; j++) {
+ D3DXVECTOR3 normal;
+ D3DXVECTOR3 *normal_src = (D3DXVECTOR3*)((BYTE*)src_vertices + size * skin->bones[i].vertices[j] + sizeof(D3DXVECTOR3));
+ D3DXVECTOR3 *normal_dest = (D3DXVECTOR3*)((BYTE*)dst_vertices + size * skin->bones[i].vertices[j] + sizeof(D3DXVECTOR3));
+ FLOAT weight = skin->bones[i].weights[j];
+
+ D3DXVec3TransformNormal(&normal, normal_src, &bone_inverse);
+ D3DXVec3TransformNormal(&normal, &normal, &matrix);
+ normal_dest->x += weight * normal.x;
+ normal_dest->y += weight * normal.y;
+ normal_dest->z += weight * normal.z;
+ }
+ }
+
+ /* Normalize all normals that are influenced by bones*/
+ for (i = 0; i < skin->num_vertices; i++) {
+ D3DXVECTOR3 *normal_dest = (D3DXVECTOR3*)((BYTE*)dst_vertices + (i * size) + sizeof(D3DXVECTOR3));
+ if ((normal_dest->x != 0.0f) && (normal_dest->y != 0.0f) && (normal_dest->z != 0.0f))
+ D3DXVec3Normalize(normal_dest, normal_dest);
+ }
+ }
+
+ return D3D_OK;
}
static HRESULT WINAPI d3dx9_skin_info_ConvertToBlendedMesh(ID3DXSkinInfo *iface, ID3DXMesh *mesh_in,
diff --git a/modules/rostests/winetests/d3dx9_36/mesh.c b/modules/rostests/winetests/d3dx9_36/mesh.c
index ea0b867..c12bf60 100644
--- a/modules/rostests/winetests/d3dx9_36/mesh.c
+++ b/modules/rostests/winetests/d3dx9_36/mesh.c
@@ -5316,6 +5316,88 @@ static void test_create_skin_info(void)
ok(hr == D3DERR_INVALIDCALL, "Expected D3DERR_INVALIDCALL, got %#x\n", hr);
}
+static void test_update_skinned_mesh(void)
+{
+ static DWORD bone0_vertices[2] = { 1, 3 };
+ static FLOAT bone0_weights[2] = { 1.0f, 0.5f };
+ static DWORD bone1_vertices[2] = { 2, 3 };
+ static FLOAT bone1_weights[2] = { 1.0f, 0.5f };
+ static D3DMATRIX bones_matrix[2] =
+ { { { {
+ 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ 2.0f, 2.0f, 4.0f, 1.0f
+ } } },
+ { { {
+ 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ -4.0f, -4.0f, 4.0f, 1.0f
+ } } } };
+ static D3DVECTOR vertices_src[] = {{ 1.0f, 1.0f, 1.0f },
+ { 1.0f, 0.0f, 0.0f },
+ { 1.0f, 1.0f, -1.0f },
+ { 0.0f, 1.0f, 0.0f },
+ { -1.0f, -1.0f, 1.0f },
+ { 0.0f, 0.0f, 1.0f },
+ { -1.0f, -1.0f, -1.0f },
+ { -1.0f, 0.0f, 0.0f },
+ };
+ static D3DVECTOR vertices_ref[] = {{ 0.0f, 0.0f, 0.0f },
+ { 0.0f, 0.0f, 0.0f },
+ { 3.0f, 3.0f, 3.0f },
+ { 0.0f, 1.0f, 0.0f },
+ { -5.0f, -5.0f, 5.0f },
+ { 0.0f, 0.0f, 1.0f },
+ { -2.0f, -2.0f, 3.0f },
+ { -1.0f, 0.0f, 0.0f },
+ };
+ D3DVECTOR vertices_dest[8];
+ HRESULT hr;
+ ID3DXSkinInfo *skin_info;
+ D3DXMATRIX matrix;
+ int i;
+
+ D3DXMatrixIdentity(&matrix);
+ for (i = 0; i < 8; i++)
+ {
+ vertices_dest[i].x = 10000.0f;
+ vertices_dest[i].y = 10000.0f;
+ vertices_dest[i].z = 10000.0f;
+ }
+
+ hr = D3DXCreateSkinInfoFVF(4, D3DFVF_XYZ | D3DFVF_NORMAL, 2, &skin_info);
+ ok(hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr);
+
+ skin_info->lpVtbl->SetBoneInfluence(skin_info, 0, 2, bone0_vertices, bone0_weights);
+ ok(hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr);
+ skin_info->lpVtbl->SetBoneOffsetMatrix(skin_info, 0, &matrix);
+ ok(hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr);
+ skin_info->lpVtbl->SetBoneInfluence(skin_info, 1, 2, bone1_vertices, bone1_weights);
+ ok(hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr);
+ skin_info->lpVtbl->SetBoneOffsetMatrix(skin_info, 1, &matrix);
+ ok(hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr);
+ skin_info->lpVtbl->UpdateSkinnedMesh(skin_info, bones_matrix, NULL, vertices_src, vertices_dest);
+ ok(hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr);
+ for (i = 0; i < 4; i++)
+ {
+ ok(compare(vertices_dest[i*2].x, vertices_ref[i*2].x), "Vertex[%d].position.x: got %g, expected %g\n",
+ i, vertices_dest[i*2].x, vertices_ref[i*2].x);
+ ok(compare(vertices_dest[i*2].y, vertices_ref[i*2].y), "Vertex[%d].position.y: got %g, expected %g\n",
+ i, vertices_dest[i*2].y, vertices_ref[i*2].y);
+ ok(compare(vertices_dest[i*2].z, vertices_ref[i*2].z), "Vertex[%d].position.z: got %g, expected %g\n",
+ i, vertices_dest[i*2].z, vertices_ref[i*2].z);
+ ok(compare(vertices_dest[i*2+1].x, vertices_ref[i*2+1].x), "Vertex[%d].normal.x: got %g, expected %g\n",
+ i, vertices_dest[i*2+1].x, vertices_ref[i*2+1].x);
+ ok(compare(vertices_dest[i*2+1].y, vertices_ref[i*2+1].y), "Vertex[%d].normal.y: got %g, expected %g\n",
+ i, vertices_dest[i*2+1].y, vertices_ref[i*2+1].y);
+ ok(compare(vertices_dest[i*2+1].z, vertices_ref[i*2+1].z), "Vertex[%d].normal.z: got %g, expected %g\n",
+ i, vertices_dest[i*2+1].z, vertices_ref[i*2+1].z);
+ }
+ skin_info->lpVtbl->Release(skin_info);
+}
+
static void test_convert_adjacency_to_point_reps(void)
{
HRESULT hr;
@@ -11362,6 +11444,7 @@ START_TEST(mesh)
D3DXGenerateAdjacencyTest();
test_update_semantics();
test_create_skin_info();
+ test_update_skinned_mesh();
test_convert_adjacency_to_point_reps();
test_convert_point_reps_to_adjacency();
test_weld_vertices();