Rebase against 4083af404b2ef9e0b0928a6f685f2efa8567c80b.

[d3dx9_36-AnimationController]
Removed patch to add stubs for D3DXCreateAnimationController interface
(accepted upstream).
This commit is contained in:
Sebastian Lackner 2016-01-19 05:16:10 +01:00
parent 26e0bddfb4
commit 3815316d5f
9 changed files with 286 additions and 1060 deletions

View File

@ -1,536 +0,0 @@
From 5d2fa4b454acdbcecd8967ca885ae6a8e8557e5c Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Sat, 17 Jan 2015 23:54:14 +0100
Subject: d3dx9_36: Implement D3DXCreateAnimationController with a stubbed
ID3DXAnimationController interface.
---
dlls/d3dx9_36/Makefile.in | 1 +
dlls/d3dx9_36/animation.c | 455 ++++++++++++++++++++++++++++++++++++++++++++
dlls/d3dx9_36/d3dx9_36.spec | 2 +-
include/d3dx9anim.h | 8 +-
4 files changed, 461 insertions(+), 5 deletions(-)
create mode 100644 dlls/d3dx9_36/animation.c
diff --git a/dlls/d3dx9_36/Makefile.in b/dlls/d3dx9_36/Makefile.in
index 5958c57..95e3045 100644
--- a/dlls/d3dx9_36/Makefile.in
+++ b/dlls/d3dx9_36/Makefile.in
@@ -3,6 +3,7 @@ IMPORTLIB = d3dx9
IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d
C_SRCS = \
+ animation.c \
core.c \
d3dx9_36_main.c \
effect.c \
diff --git a/dlls/d3dx9_36/animation.c b/dlls/d3dx9_36/animation.c
new file mode 100644
index 0000000..72f685f
--- /dev/null
+++ b/dlls/d3dx9_36/animation.c
@@ -0,0 +1,455 @@
+/*
+ * Animation Controller operations specific to D3DX9.
+ *
+ * Copyright (C) 2015 Christian Costa
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "wine/debug.h"
+#include "d3dx9_36_private.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
+
+struct d3dx9_animation_controller
+{
+ ID3DXAnimationController ID3DXAnimationController_iface;
+ LONG ref;
+};
+
+static inline struct d3dx9_animation_controller *impl_from_ID3DXAnimationController(ID3DXAnimationController *iface)
+{
+ return CONTAINING_RECORD(iface, struct d3dx9_animation_controller, ID3DXAnimationController_iface);
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_QueryInterface(ID3DXAnimationController *iface, REFIID riid, void **out)
+{
+ TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
+
+ if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_ID3DXAnimationController))
+ {
+ IUnknown_AddRef(iface);
+ *out = iface;
+ return D3D_OK;
+ }
+
+ WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
+
+ *out = NULL;
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI d3dx9_animation_controller_AddRef(ID3DXAnimationController *iface)
+{
+ struct d3dx9_animation_controller *animation = impl_from_ID3DXAnimationController(iface);
+ ULONG refcount = InterlockedIncrement(&animation->ref);
+
+ TRACE("%p increasing refcount to %u.\n", animation, refcount);
+
+ return refcount;
+}
+
+static ULONG WINAPI d3dx9_animation_controller_Release(ID3DXAnimationController *iface)
+{
+ struct d3dx9_animation_controller *animation = impl_from_ID3DXAnimationController(iface);
+ ULONG refcount = InterlockedDecrement(&animation->ref);
+
+ TRACE("%p decreasing refcount to %u.\n", animation, refcount);
+
+ if (!refcount)
+ {
+ HeapFree(GetProcessHeap(), 0, animation);
+ }
+
+ return refcount;
+}
+
+static UINT WINAPI d3dx9_animation_controller_GetMaxNumAnimationOutputs(ID3DXAnimationController *iface)
+{
+ FIXME("iface %p stub.\n", iface);
+
+ return 0;
+}
+
+static UINT WINAPI d3dx9_animation_controller_GetMaxNumAnimationSets(ID3DXAnimationController *iface)
+{
+ FIXME("iface %p stub.\n", iface);
+
+ return 0;
+}
+
+static UINT WINAPI d3dx9_animation_controller_GetMaxNumTracks(ID3DXAnimationController *iface)
+{
+ FIXME("iface %p stub.\n", iface);
+
+ return 0;
+}
+
+static UINT WINAPI d3dx9_animation_controller_GetMaxNumEvents(ID3DXAnimationController *iface)
+{
+ FIXME("iface %p stub.\n", iface);
+
+ return 0;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_RegisterAnimationOutput(ID3DXAnimationController *iface,
+ const char *name, D3DXMATRIX *matrix, D3DXVECTOR3 *scale, D3DXQUATERNION *rotation, D3DXVECTOR3 *translation)
+{
+ FIXME("iface %p, name %s, matrix %p, scale %p, rotation %p, translation %p stub.\n", iface, wine_dbgstr_a(name),
+ matrix, scale, rotation, translation);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_RegisterAnimationSet(ID3DXAnimationController *iface,
+ ID3DXAnimationSet *anim_set)
+{
+ FIXME("iface %p, anim_set %p stub.\n", iface, anim_set);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_UnregisterAnimationSet(ID3DXAnimationController *iface,
+ ID3DXAnimationSet *anim_set)
+{
+ FIXME("iface %p, anim_set %p stub.\n", iface, anim_set);
+
+ return E_NOTIMPL;
+}
+
+static UINT WINAPI d3dx9_animation_controller_GetNumAnimationSets(ID3DXAnimationController *iface)
+{
+ FIXME("iface %p stub.\n", iface);
+
+ return 0;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_GetAnimationSet(ID3DXAnimationController *iface,
+ UINT index, ID3DXAnimationSet **anim_set)
+{
+ FIXME("iface %p, index %u, anim_set %p stub.\n", iface, index, anim_set);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_GetAnimationSetByName(ID3DXAnimationController *iface,
+ const char *name, ID3DXAnimationSet **anim_set)
+{
+ FIXME("iface %p, name %s, anim_set %p stub.\n", iface, wine_dbgstr_a(name), anim_set);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_AdvanceTime(ID3DXAnimationController *iface, DOUBLE time_delta,
+ ID3DXAnimationCallbackHandler **callback_handler)
+{
+ FIXME("iface %p, time_delta %g, callback_handler %p stub.\n", iface, time_delta, callback_handler);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_Reset(ID3DXAnimationController *iface)
+{
+ FIXME("iface %p stub.\n", iface);
+
+ return E_NOTIMPL;
+}
+
+static DOUBLE WINAPI d3dx9_animation_controller_GetTime(ID3DXAnimationController *iface)
+{
+ FIXME("iface %p stub.\n", iface);
+
+ return 0.0;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_SetTrackAnimationSet(ID3DXAnimationController *iface,
+ UINT track, ID3DXAnimationSet *anim_set)
+{
+ FIXME("iface %p, track %u, anim_set %p stub.\n", iface, track, anim_set);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_GetTrackAnimationSet(ID3DXAnimationController *iface,
+ UINT track, ID3DXAnimationSet **anim_set)
+{
+ FIXME("iface %p, track %u, anim_set %p stub.\n", iface, track, anim_set);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_GetTrackPriority(ID3DXAnimationController *iface,
+ UINT track, D3DXPRIORITY_TYPE *priority)
+{
+ FIXME("iface %p, track %u, priority %p stub.\n", iface, track, priority);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_SetTrackSpeed(ID3DXAnimationController *iface,
+ UINT track, FLOAT speed)
+{
+ FIXME("iface %p, track %u, speed %f stub.\n", iface, track, speed);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_SetTrackWeight(ID3DXAnimationController *iface,
+ UINT track, FLOAT weight)
+{
+ FIXME("iface %p, track %u, weight %f stub.\n", iface, track, weight);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_SetTrackPosition(ID3DXAnimationController *iface,
+ UINT track, DOUBLE position)
+{
+ FIXME("iface %p, track %u, position %g stub.\n", iface, track, position);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_SetTrackEnable(ID3DXAnimationController *iface,
+ UINT track, BOOL enable)
+{
+ FIXME("iface %p, track %u, enable %u stub.\n", iface, track, enable);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_SetTrackDesc(ID3DXAnimationController *iface,
+ UINT track, D3DXTRACK_DESC *desc)
+{
+ FIXME("iface %p, track %u, desc %p stub.\n", iface, track, desc);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_GetTrackDesc(ID3DXAnimationController *iface,
+ UINT track, D3DXTRACK_DESC *desc)
+{
+ FIXME("iface %p, track %u, desc %p stub.\n", iface, track, desc);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_SetPriorityBlend(ID3DXAnimationController *iface,
+ FLOAT blend_weight)
+{
+ FIXME("iface %p, blend_weight %f stub.\n", iface, blend_weight);
+
+ return E_NOTIMPL;
+}
+
+static FLOAT WINAPI d3dx9_animation_controller_GetPriorityBlend(ID3DXAnimationController *iface)
+{
+ FIXME("iface %p stub.\n", iface);
+
+ return 0.0;
+}
+
+static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_KeyTrackSpeed(ID3DXAnimationController *iface,
+ UINT track, FLOAT new_speed, DOUBLE start_time, DOUBLE duration, D3DXTRANSITION_TYPE transition)
+{
+ FIXME("iface %p, track %u, new_speed %f, start_time %g, duration %g, transition %u stub.\n", iface,
+ track, new_speed, start_time, duration, transition);
+
+ return 0;
+}
+
+static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_KeyTrackWeight(ID3DXAnimationController *iface,
+ UINT track, FLOAT new_weight, DOUBLE start_time, DOUBLE duration, D3DXTRANSITION_TYPE transition)
+{
+ FIXME("iface %p, track %u, new_weight %f, start_time %g, duration %g, transition %u stub.\n", iface,
+ track, new_weight, start_time, duration, transition);
+
+ return 0;
+}
+
+static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_KeyTrackPosition(ID3DXAnimationController *iface,
+ UINT track, DOUBLE new_position, DOUBLE start_time)
+{
+ FIXME("iface %p, track %u, new_position %g, start_time %g stub.\n", iface,
+ track, new_position, start_time);
+
+ return 0;
+}
+
+static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_KeyTrackEnable(ID3DXAnimationController *iface,
+ UINT track, BOOL new_enable, DOUBLE start_time)
+{
+ FIXME("iface %p, track %u, new_enable %u, start_time %g stub.\n", iface,
+ track, new_enable, start_time);
+
+ return 0;
+}
+
+static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_KeyTrackBlend(ID3DXAnimationController *iface,
+ FLOAT new_blend_weight, DOUBLE start_time, DOUBLE duration, D3DXTRANSITION_TYPE transition)
+{
+ FIXME("iface %p, new_blend_weight %f, start_time %g, duration %g, transition %u stub.\n", iface,
+ new_blend_weight, start_time, duration, transition);
+
+ return 0;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_UnkeyEvent(ID3DXAnimationController *iface, D3DXEVENTHANDLE event)
+{
+ FIXME("iface %p, event %u stub.\n", iface, event);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_UnkeyAllTrackEvents(ID3DXAnimationController *iface, UINT track)
+{
+ FIXME("iface %p, track %u stub.\n", iface, track);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_UnkeyAllPriorityBlends(ID3DXAnimationController *iface)
+{
+ FIXME("iface %p stub.\n", iface);
+
+ return E_NOTIMPL;
+}
+
+static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_GetCurrentTrackEvent(ID3DXAnimationController *iface,
+ UINT track, D3DXEVENT_TYPE event_type)
+{
+ FIXME("iface %p, track %u, event_type %u stub.\n", iface, track, event_type);
+
+ return 0;
+}
+
+static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_GetCurrentPriorityBlend(ID3DXAnimationController *iface)
+{
+ FIXME("iface %p stub.\n", iface);
+
+ return 0;
+}
+
+static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_GetUpcomingTrackEvent(ID3DXAnimationController *iface,
+ UINT track, D3DXEVENTHANDLE event)
+{
+ FIXME("iface %p, track %u, event %u stub.\n", iface, track, event);
+
+ return 0;
+}
+
+static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_GetUpcomingPriorityBlend(ID3DXAnimationController *iface,
+ D3DXEVENTHANDLE handle)
+{
+ FIXME("iface %p, handle %u stub.\n", iface, handle);
+
+ return 0;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_ValidateEvent(ID3DXAnimationController *iface, D3DXEVENTHANDLE event)
+{
+ FIXME("iface %p, event %u stub.\n", iface, event);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_GetEventDesc(ID3DXAnimationController *iface,
+ D3DXEVENTHANDLE event, D3DXEVENT_DESC *desc)
+{
+ FIXME("iface %p, event %u, desc %p stub.\n", iface, event, desc);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3dx9_animation_controller_CloneAnimationController(ID3DXAnimationController *iface, UINT max_num_anim_outputs,
+ UINT max_num_anim_sets, UINT max_num_tracks, UINT max_num_events, ID3DXAnimationController **anim_controller)
+{
+ FIXME("iface %p, max_num_anim_outputs %u, max_num_anim_sets %u, max_num_tracks %u, max_num_events %u, anim_controller %p stub.\n",
+ iface, max_num_anim_outputs, max_num_anim_sets, max_num_tracks, max_num_events, anim_controller);
+
+ return E_NOTIMPL;
+}
+
+static const struct ID3DXAnimationControllerVtbl d3dx9_animation_controller_vtbl =
+{
+ d3dx9_animation_controller_QueryInterface,
+ d3dx9_animation_controller_AddRef,
+ d3dx9_animation_controller_Release,
+ d3dx9_animation_controller_GetMaxNumAnimationOutputs,
+ d3dx9_animation_controller_GetMaxNumAnimationSets,
+ d3dx9_animation_controller_GetMaxNumTracks,
+ d3dx9_animation_controller_GetMaxNumEvents,
+ d3dx9_animation_controller_RegisterAnimationOutput,
+ d3dx9_animation_controller_RegisterAnimationSet,
+ d3dx9_animation_controller_UnregisterAnimationSet,
+ d3dx9_animation_controller_GetNumAnimationSets,
+ d3dx9_animation_controller_GetAnimationSet,
+ d3dx9_animation_controller_GetAnimationSetByName,
+ d3dx9_animation_controller_AdvanceTime,
+ d3dx9_animation_controller_Reset,
+ d3dx9_animation_controller_GetTime,
+ d3dx9_animation_controller_SetTrackAnimationSet,
+ d3dx9_animation_controller_GetTrackAnimationSet,
+ d3dx9_animation_controller_GetTrackPriority,
+ d3dx9_animation_controller_SetTrackSpeed,
+ d3dx9_animation_controller_SetTrackWeight,
+ d3dx9_animation_controller_SetTrackPosition,
+ d3dx9_animation_controller_SetTrackEnable,
+ d3dx9_animation_controller_SetTrackDesc,
+ d3dx9_animation_controller_GetTrackDesc,
+ d3dx9_animation_controller_SetPriorityBlend,
+ d3dx9_animation_controller_GetPriorityBlend,
+ d3dx9_animation_controller_KeyTrackSpeed,
+ d3dx9_animation_controller_KeyTrackWeight,
+ d3dx9_animation_controller_KeyTrackPosition,
+ d3dx9_animation_controller_KeyTrackEnable,
+ d3dx9_animation_controller_KeyTrackBlend,
+ d3dx9_animation_controller_UnkeyEvent,
+ d3dx9_animation_controller_UnkeyAllTrackEvents,
+ d3dx9_animation_controller_UnkeyAllPriorityBlends,
+ d3dx9_animation_controller_GetCurrentTrackEvent,
+ d3dx9_animation_controller_GetCurrentPriorityBlend,
+ d3dx9_animation_controller_GetUpcomingTrackEvent,
+ d3dx9_animation_controller_GetUpcomingPriorityBlend,
+ d3dx9_animation_controller_ValidateEvent,
+ d3dx9_animation_controller_GetEventDesc,
+ d3dx9_animation_controller_CloneAnimationController
+};
+
+/***********************************************************************
+ * D3DXCreateAnimationController (D3DX9_36.@)
+ */
+HRESULT WINAPI D3DXCreateAnimationController(UINT MaxNumAnimationOutputs, UINT MaxNumAnimationSets,
+ UINT MaxNumTracks, UINT MaxNumEvents, ID3DXAnimationController **AnimationController)
+{
+ struct d3dx9_animation_controller* object;
+
+ TRACE("MaxNumAnimationOutputs %u, MaxNumAnimationSets %u, MaxNumTracks %u, MaxNumEvents %u, AnimationController %p.\n",
+ MaxNumAnimationOutputs, MaxNumAnimationSets, MaxNumTracks, MaxNumEvents, AnimationController);
+
+ if (!AnimationController)
+ return D3DERR_INVALIDCALL;
+
+ object = HeapAlloc(GetProcessHeap(), 0, sizeof(*object));
+ if (!object)
+ return E_OUTOFMEMORY;
+
+ object->ID3DXAnimationController_iface.lpVtbl = &d3dx9_animation_controller_vtbl;
+ object->ref = 1;
+
+ *AnimationController = &object->ID3DXAnimationController_iface;
+
+ return D3D_OK;
+}
diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec
index 5eda041..aa7c928 100644
--- a/dlls/d3dx9_36/d3dx9_36.spec
+++ b/dlls/d3dx9_36/d3dx9_36.spec
@@ -30,7 +30,7 @@
@ stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr)
@ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr)
@ stub D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr)
-@ stub D3DXCreateAnimationController(long long long long ptr)
+@ stdcall D3DXCreateAnimationController(long long long long ptr)
@ stdcall D3DXCreateBox(ptr float float float ptr ptr)
@ stdcall D3DXCreateBuffer(long ptr)
@ stub D3DXCreateCompressedAnimationSet(ptr long long ptr long ptr ptr)
diff --git a/include/d3dx9anim.h b/include/d3dx9anim.h
index b5f2232..c4d4d64 100644
--- a/include/d3dx9anim.h
+++ b/include/d3dx9anim.h
@@ -327,7 +327,7 @@ DECLARE_INTERFACE_(ID3DXAnimationController, IUnknown)
STDMETHOD_(UINT, GetNumAnimationSets)(THIS) PURE;
STDMETHOD(GetAnimationSet)(THIS_ UINT index, ID3DXAnimationSet **anim_set) PURE;
STDMETHOD(GetAnimationSetByName)(THIS_ const char *name, ID3DXAnimationSet **anim_set) PURE;
- STDMETHOD(AdvanceTime)(THIS_ double time_delta, ID3DXAnimationCallbackHandler **callback_handler) PURE;
+ STDMETHOD(AdvanceTime)(THIS_ DOUBLE time_delta, ID3DXAnimationCallbackHandler **callback_handler) PURE;
STDMETHOD(ResetTime)(THIS) PURE;
STDMETHOD_(DOUBLE, GetTime)(THIS) PURE;
STDMETHOD(SetTrackAnimationSet)(THIS_ UINT track, ID3DXAnimationSet *anim_set) PURE;
@@ -337,8 +337,8 @@ DECLARE_INTERFACE_(ID3DXAnimationController, IUnknown)
STDMETHOD(SetTrackWeight)(THIS_ UINT track, FLOAT weight) PURE;
STDMETHOD(SetTrackPosition)(THIS_ UINT track, DOUBLE position) PURE;
STDMETHOD(SetTrackEnable)(THIS_ UINT track, BOOL enable) PURE;
- STDMETHOD(SetTrackDesc)(THIS_ UINT track, LPD3DXTRACK_DESC desc) PURE;
- STDMETHOD(GetTrackDesc)(THIS_ UINT track, LPD3DXTRACK_DESC desc) PURE;
+ STDMETHOD(SetTrackDesc)(THIS_ UINT track, D3DXTRACK_DESC *desc) PURE;
+ STDMETHOD(GetTrackDesc)(THIS_ UINT track, D3DXTRACK_DESC *desc) PURE;
STDMETHOD(SetPriorityBlend)(THIS_ FLOAT blend_weight) PURE;
STDMETHOD_(FLOAT, GetPriorityBlend)(THIS) PURE;
STDMETHOD_(D3DXEVENTHANDLE, KeyTrackSpeed)(THIS_ UINT track, FLOAT new_speed,
@@ -357,7 +357,7 @@ DECLARE_INTERFACE_(ID3DXAnimationController, IUnknown)
STDMETHOD_(D3DXEVENTHANDLE, GetUpcomingTrackEvent)(THIS_ UINT track, D3DXEVENTHANDLE event) PURE;
STDMETHOD_(D3DXEVENTHANDLE, GetUpcomingPriorityBlend)(THIS_ D3DXEVENTHANDLE handle) PURE;
STDMETHOD(ValidateEvent)(THIS_ D3DXEVENTHANDLE event) PURE;
- STDMETHOD(GetEventDesc)(THIS_ D3DXEVENTHANDLE event, LPD3DXEVENT_DESC desc) PURE;
+ STDMETHOD(GetEventDesc)(THIS_ D3DXEVENTHANDLE event, D3DXEVENT_DESC *desc) PURE;
STDMETHOD(CloneAnimationController)(THIS_ UINT max_num_anim_outputs, UINT max_num_anim_sets,
UINT max_num_tracks, UINT max_num_events, ID3DXAnimationController **anim_controller) PURE;
};
--
2.6.4

View File

@ -1,120 +0,0 @@
From a719ecc33b789c26eb75b1eb27523f47cb02df5c Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 21 Aug 2015 15:05:51 +1000
Subject: d3dx9_36: Store all values passed to the create and return them in
the correct functions
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/d3dx9_36/animation.c | 47 ++++++++++++++++++++++++++++++++---------------
1 file changed, 32 insertions(+), 15 deletions(-)
diff --git a/dlls/d3dx9_36/animation.c b/dlls/d3dx9_36/animation.c
index 72f685f..042079d 100644
--- a/dlls/d3dx9_36/animation.c
+++ b/dlls/d3dx9_36/animation.c
@@ -27,6 +27,11 @@ struct d3dx9_animation_controller
{
ID3DXAnimationController ID3DXAnimationController_iface;
LONG ref;
+
+ UINT max_outputs;
+ UINT max_sets;
+ UINT max_tracks;
+ UINT max_events;
};
static inline struct d3dx9_animation_controller *impl_from_ID3DXAnimationController(ID3DXAnimationController *iface)
@@ -53,24 +58,24 @@ static HRESULT WINAPI d3dx9_animation_controller_QueryInterface(ID3DXAnimationCo
static ULONG WINAPI d3dx9_animation_controller_AddRef(ID3DXAnimationController *iface)
{
- struct d3dx9_animation_controller *animation = impl_from_ID3DXAnimationController(iface);
- ULONG refcount = InterlockedIncrement(&animation->ref);
+ struct d3dx9_animation_controller *This = impl_from_ID3DXAnimationController(iface);
+ ULONG refcount = InterlockedIncrement(&This->ref);
- TRACE("%p increasing refcount to %u.\n", animation, refcount);
+ TRACE("%p increasing refcount to %u.\n", This, refcount);
return refcount;
}
static ULONG WINAPI d3dx9_animation_controller_Release(ID3DXAnimationController *iface)
{
- struct d3dx9_animation_controller *animation = impl_from_ID3DXAnimationController(iface);
- ULONG refcount = InterlockedDecrement(&animation->ref);
+ struct d3dx9_animation_controller *This = impl_from_ID3DXAnimationController(iface);
+ ULONG refcount = InterlockedDecrement(&This->ref);
- TRACE("%p decreasing refcount to %u.\n", animation, refcount);
+ TRACE("%p decreasing refcount to %u.\n", This, refcount);
if (!refcount)
{
- HeapFree(GetProcessHeap(), 0, animation);
+ HeapFree(GetProcessHeap(), 0, This);
}
return refcount;
@@ -78,30 +83,38 @@ static ULONG WINAPI d3dx9_animation_controller_Release(ID3DXAnimationController
static UINT WINAPI d3dx9_animation_controller_GetMaxNumAnimationOutputs(ID3DXAnimationController *iface)
{
- FIXME("iface %p stub.\n", iface);
+ struct d3dx9_animation_controller *This = impl_from_ID3DXAnimationController(iface);
- return 0;
+ TRACE("iface %p.\n", iface);
+
+ return This->max_outputs;
}
static UINT WINAPI d3dx9_animation_controller_GetMaxNumAnimationSets(ID3DXAnimationController *iface)
{
- FIXME("iface %p stub.\n", iface);
+ struct d3dx9_animation_controller *This = impl_from_ID3DXAnimationController(iface);
- return 0;
+ TRACE("iface %p.\n", iface);
+
+ return This->max_sets;
}
static UINT WINAPI d3dx9_animation_controller_GetMaxNumTracks(ID3DXAnimationController *iface)
{
- FIXME("iface %p stub.\n", iface);
+ struct d3dx9_animation_controller *This = impl_from_ID3DXAnimationController(iface);
- return 0;
+ FIXME("iface %p.\n", iface);
+
+ return This->max_tracks;
}
static UINT WINAPI d3dx9_animation_controller_GetMaxNumEvents(ID3DXAnimationController *iface)
{
- FIXME("iface %p stub.\n", iface);
+ struct d3dx9_animation_controller *This = impl_from_ID3DXAnimationController(iface);
- return 0;
+ FIXME("iface %p.\n", iface);
+
+ return This->max_events;
}
static HRESULT WINAPI d3dx9_animation_controller_RegisterAnimationOutput(ID3DXAnimationController *iface,
@@ -448,6 +461,10 @@ HRESULT WINAPI D3DXCreateAnimationController(UINT MaxNumAnimationOutputs, UINT M
object->ID3DXAnimationController_iface.lpVtbl = &d3dx9_animation_controller_vtbl;
object->ref = 1;
+ object->max_outputs = MaxNumAnimationOutputs;
+ object->max_sets = MaxNumAnimationSets;
+ object->max_tracks = MaxNumTracks;
+ object->max_events = MaxNumEvents;
*AnimationController = &object->ID3DXAnimationController_iface;
--
2.6.1

View File

@ -1,83 +0,0 @@
From 151b9f248ad985bb545541fbc4a0096e53385505 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 25 Aug 2015 14:34:43 +1000
Subject: d3dx9_36: Add D3DXCreateAnimationController tests
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/d3dx9_36/tests/mesh.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c
index 4186e19..fd764df 100644
--- a/dlls/d3dx9_36/tests/mesh.c
+++ b/dlls/d3dx9_36/tests/mesh.c
@@ -10959,6 +10959,57 @@ static void test_compute_normals(void)
free_test_context(test_context);
}
+static void D3DXCreateAnimationControllerTest(void)
+{
+ HRESULT hr;
+ ID3DXAnimationController *animation;
+ UINT value;
+
+ hr = D3DXCreateAnimationController(0, 0, 0, 0, NULL);
+ todo_wine ok(hr == D3D_OK, "D3DXCreateAnimationController returned %#x, expected D3D_OK\n", hr);
+
+if (0) /* Crashes when animation is Released */
+{
+ hr = D3DXCreateAnimationController(0, 0, 0, 0, &animation);
+ ok(hr == D3D_OK, "D3DXCreateAnimationController returned %#x, expected D3D_OK\n", hr);
+ animation->lpVtbl->Release(animation);
+}
+
+ hr = D3DXCreateAnimationController(1, 1, 1, 1, &animation);
+ ok(hr == D3D_OK, "D3DXCreateAnimationController returned %#x, expected D3D_OK\n", hr);
+
+ value = animation->lpVtbl->GetMaxNumAnimationOutputs(animation);
+ ok(value == 1, "returned %u, expected 1\n", value);
+
+ value = animation->lpVtbl->GetMaxNumAnimationSets(animation);
+ ok(value == 1, "returned %u, expected 1\n", value);
+
+ value = animation->lpVtbl->GetMaxNumTracks(animation);
+ ok(value == 1, "returned %u, expected 1\n", value);
+
+ value = animation->lpVtbl->GetMaxNumEvents(animation);
+ ok(value == 1, "returned %u, expected 1\n", value);
+
+ animation->lpVtbl->Release(animation);
+
+ hr = D3DXCreateAnimationController(100, 101, 102, 103, &animation);
+ ok(hr == D3D_OK, "D3DXCreateAnimationController returned %#x, expected D3D_OK\n", hr);
+
+ value = animation->lpVtbl->GetMaxNumAnimationOutputs(animation);
+ ok(value == 100, "returned %u, expected 100\n", value);
+
+ value = animation->lpVtbl->GetMaxNumAnimationSets(animation);
+ ok(value == 101, "returned %u, expected 101\n", value);
+
+ value = animation->lpVtbl->GetMaxNumTracks(animation);
+ ok(value == 102, "returned %u, expected 102\n", value);
+
+ value = animation->lpVtbl->GetMaxNumEvents(animation);
+ ok(value == 103, "returned %u, expected 103\n", value);
+
+ animation->lpVtbl->Release(animation);
+}
+
START_TEST(mesh)
{
D3DXBoundProbeTest();
@@ -10975,6 +11026,7 @@ START_TEST(mesh)
D3DXCreateCylinderTest();
D3DXCreateTextTest();
D3DXCreateTorusTest();
+ D3DXCreateAnimationControllerTest();
test_get_decl_length();
test_get_decl_vertex_size();
test_fvf_decl_conversion();
--
2.6.1

View File

@ -1,3 +0,0 @@
Fixes: Add stubs for D3DXCreateAnimationController interface
Depends: d3dx9_36-DXTn
Category: stable

View File

@ -1,4 +1,4 @@
From 2774478cc69a3305989724186a0b68ca99f1fe61 Mon Sep 17 00:00:00 2001
From ee84dfd270e8bd762acf6589fe697cdcfc6b431b Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Sat, 1 Nov 2014 13:08:05 +0100
Subject: d3dx9_36: Add dxtn support.
@ -10,7 +10,7 @@ Subject: d3dx9_36: Add dxtn support.
3 files changed, 102 insertions(+), 12 deletions(-)
diff --git a/dlls/d3dx9_36/Makefile.in b/dlls/d3dx9_36/Makefile.in
index 5958c57..aa387b5 100644
index 95e3045..fd710c2 100644
--- a/dlls/d3dx9_36/Makefile.in
+++ b/dlls/d3dx9_36/Makefile.in
@@ -1,6 +1,6 @@
@ -20,9 +20,9 @@ index 5958c57..aa387b5 100644
+IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d
C_SRCS = \
core.c \
animation.c \
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
index 295ef63..ed1caff 100644
index 4fa2a76..832698e 100644
--- a/dlls/d3dx9_36/surface.c
+++ b/dlls/d3dx9_36/surface.c
@@ -18,6 +18,7 @@
@ -42,7 +42,7 @@ index 295ef63..ed1caff 100644
WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
@@ -1716,6 +1719,27 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic
@@ -1714,6 +1717,27 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic
}
}
@ -70,7 +70,7 @@ index 295ef63..ed1caff 100644
/************************************************************
* D3DXLoadSurfaceFromMemory
*
@@ -1757,6 +1781,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
@@ -1755,6 +1779,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
D3DSURFACE_DESC surfdesc;
D3DLOCKED_RECT lockrect;
struct volume src_size, dst_size;
@ -78,7 +78,7 @@ index 295ef63..ed1caff 100644
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,
@@ -1838,8 +1863,15 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
@@ -1836,8 +1861,15 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
}
else /* Stretching or format conversion. */
{
@ -96,7 +96,7 @@ index 295ef63..ed1caff 100644
{
FIXME("Format conversion missing %#x -> %#x\n", src_format, surfdesc.Format);
return E_NOTIMPL;
@@ -1848,10 +1880,52 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
@@ -1846,10 +1878,52 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
if (FAILED(IDirect3DSurface9_LockRect(dst_surface, &lockrect, dst_rect, 0)))
return D3DXERR_INVALIDDATA;
@ -151,7 +151,7 @@ index 295ef63..ed1caff 100644
}
else /* if ((filter & 0xf) == D3DX_FILTER_POINT) */
{
@@ -1860,14 +1934,30 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
@@ -1858,14 +1932,30 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
/* Always apply a point filter until D3DX_FILTER_LINEAR,
* D3DX_FILTER_TRIANGLE and D3DX_FILTER_BOX are implemented. */
@ -186,10 +186,10 @@ index 295ef63..ed1caff 100644
/************************************************************
diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c
index 7a4dff8..87c3eb7 100644
index 55e3d88..3c953b0 100644
--- a/dlls/d3dx9_36/tests/surface.c
+++ b/dlls/d3dx9_36/tests/surface.c
@@ -1103,7 +1103,7 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
@@ -1174,7 +1174,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);
@ -198,7 +198,7 @@ index 7a4dff8..87c3eb7 100644
check_release((IUnknown*)newsurf, 1);
check_release((IUnknown*)tex, 0);
}
@@ -1129,7 +1129,7 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
@@ -1200,7 +1200,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);
@ -207,7 +207,7 @@ index 7a4dff8..87c3eb7 100644
check_release((IUnknown*)newsurf, 1);
check_release((IUnknown*)tex, 0);
}
@@ -1142,10 +1142,10 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
@@ -1213,10 +1213,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);
@ -221,5 +221,5 @@ index 7a4dff8..87c3eb7 100644
check_release((IUnknown*)newsurf, 1);
check_release((IUnknown*)tex, 0);
--
2.3.3
2.6.4

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "1eb69be36f176f499b67a16c93a470475bb1b330"
echo "4083af404b2ef9e0b0928a6f685f2efa8567c80b"
}
# Show version information
@ -106,7 +106,6 @@ patch_enable_all ()
enable_d3dx9_25_ID3DXEffect="$1"
enable_d3dx9_26_ID3DXEffect="$1"
enable_d3dx9_33_Share_Source="$1"
enable_d3dx9_36_AnimationController="$1"
enable_d3dx9_36_CloneEffect="$1"
enable_d3dx9_36_D3DXCreateTeapot="$1"
enable_d3dx9_36_D3DXStubs="$1"
@ -451,9 +450,6 @@ patch_enable ()
d3dx9_33-Share_Source)
enable_d3dx9_33_Share_Source="$2"
;;
d3dx9_36-AnimationController)
enable_d3dx9_36_AnimationController="$2"
;;
d3dx9_36-CloneEffect)
enable_d3dx9_36_CloneEffect="$2"
;;
@ -1596,9 +1592,6 @@ if test "$enable_category_stable" -eq 1; then
if test "$enable_d3dx9_26_ID3DXEffect" -gt 1; then
abort "Patchset d3dx9_26-ID3DXEffect disabled, but category-stable depends on that."
fi
if test "$enable_d3dx9_36_AnimationController" -gt 1; then
abort "Patchset d3dx9_36-AnimationController disabled, but category-stable depends on that."
fi
if test "$enable_d3dx9_36_D3DXStubs" -gt 1; then
abort "Patchset d3dx9_36-D3DXStubs disabled, but category-stable depends on that."
fi
@ -1772,7 +1765,6 @@ if test "$enable_category_stable" -eq 1; then
enable_d3dx9_24_ID3DXEffect=1
enable_d3dx9_25_ID3DXEffect=1
enable_d3dx9_26_ID3DXEffect=1
enable_d3dx9_36_AnimationController=1
enable_d3dx9_36_D3DXStubs=1
enable_d3dx9_36_FindNextValidTechnique=1
enable_d3dx9_36_Optimize_Inplace=1
@ -2128,13 +2120,6 @@ if test "$enable_dsound_EAX" -eq 1; then
enable_dsound_Revert_Cleanup=1
fi
if test "$enable_d3dx9_36_AnimationController" -eq 1; then
if test "$enable_d3dx9_36_DXTn" -gt 1; then
abort "Patchset d3dx9_36-DXTn disabled, but d3dx9_36-AnimationController depends on that."
fi
enable_d3dx9_36_DXTn=1
fi
if test "$enable_d3dx9_33_Share_Source" -eq 1; then
if test "$enable_d3dx9_36_D3DXStubs" -gt 1; then
abort "Patchset d3dx9_36-D3DXStubs disabled, but d3dx9_33-Share_Source depends on that."
@ -2908,26 +2893,6 @@ if test "$enable_d3dx9_33_Share_Source" -eq 1; then
) >> "$patchlist"
fi
# Patchset d3dx9_36-AnimationController
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * wined3d-DXTn, d3dx9_36-DXTn
# |
# | Modified files:
# | * dlls/d3dx9_36/Makefile.in, dlls/d3dx9_36/animation.c, dlls/d3dx9_36/d3dx9_36.spec, dlls/d3dx9_36/tests/mesh.c,
# | include/d3dx9anim.h
# |
if test "$enable_d3dx9_36_AnimationController" -eq 1; then
patch_apply d3dx9_36-AnimationController/0001-d3dx9_36-Implement-D3DXCreateAnimationController-wit.patch
patch_apply d3dx9_36-AnimationController/0002-d3dx9_36-Store-all-values-passed-to-the-create-and-r.patch
patch_apply d3dx9_36-AnimationController/0003-d3dx9_36-Add-D3DXCreateAnimationController-tests.patch
(
echo '+ { "Christian Costa", "d3dx9_36: Implement D3DXCreateAnimationController with a stubbed ID3DXAnimationController interface.", 1 },';
echo '+ { "Alistair Leslie-Hughes", "d3dx9_36: Store all values passed to the create and return them in the correct functions.", 1 },';
echo '+ { "Alistair Leslie-Hughes", "d3dx9_36: Add D3DXCreateAnimationController tests.", 1 },';
) >> "$patchlist"
fi
# Patchset d3dx9_36-CloneEffect
# |
# | Modified files:

View File

@ -1,4 +1,4 @@
From 5fd25633a2e78ad336af898e466f4afc2e2ab1a0 Mon Sep 17 00:00:00 2001
From 5cdc790a6ec9c5995f42586d85d3e95e74877c18 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 21 Jan 2014 12:22:30 +0100
Subject: wined3d: Move surface locations into the resource.
@ -12,10 +12,10 @@ Subject: wined3d: Move surface locations into the resource.
5 files changed, 53 insertions(+), 53 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 6851620..28939c0 100644
index 84b85c4..b97ff12 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -7844,7 +7844,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, enum wined3d_blit_
@@ -7855,7 +7855,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, enum wined3d_blit_
/* Now load the surface */
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
@ -25,7 +25,7 @@ index 6851620..28939c0 100644
&& !wined3d_resource_is_offscreen(&src_surface->container->resource))
{
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 057ae18..2312267 100644
index 7c5a4c2..b9b39859 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -236,7 +236,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context
@ -47,7 +47,7 @@ index 057ae18..2312267 100644
ds->ds_current_size.cx,
ds->ds_current_size.cy);
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 3761830..943a829 100644
index ff62850..75489db 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -655,7 +655,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
@ -60,7 +60,7 @@ index 3761830..943a829 100644
else
SetRectEmpty(&current_rect);
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 94934a5..c971031 100644
index ac74457..a04cc1b 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -556,7 +556,7 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface)
@ -72,7 +72,7 @@ index 94934a5..c971031 100644
ERR("Surface without system memory has WINED3D_LOCATION_SYSMEM set.\n");
}
@@ -706,7 +706,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
@@ -682,7 +682,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
}
if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
@ -81,7 +81,7 @@ index 94934a5..c971031 100644
if (surface_use_pbo(surface))
surface->resource.map_binding = WINED3D_LOCATION_BUFFER;
@@ -746,7 +746,7 @@ static void surface_unmap(struct wined3d_surface *surface)
@@ -722,7 +722,7 @@ static void surface_unmap(struct wined3d_surface *surface)
ERR("Unexpected map binding %s.\n", wined3d_debug_location(surface->resource.map_binding));
}
@ -90,7 +90,7 @@ index 94934a5..c971031 100644
{
TRACE("Not dirtified, nothing to do.\n");
return;
@@ -1687,7 +1687,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -1669,7 +1669,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
surface_load_location(dst_surface, context, WINED3D_LOCATION_TEXTURE_RGB);
wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE);
@ -99,7 +99,7 @@ index 94934a5..c971031 100644
wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch);
wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect,
@@ -1810,7 +1810,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
@@ -1792,7 +1792,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
if (surface->resource.pool == WINED3D_POOL_SCRATCH)
ERR("Not supported on scratch surfaces.\n");
@ -108,7 +108,7 @@ index 94934a5..c971031 100644
{
TRACE("surface is already in texture\n");
return;
@@ -2060,7 +2060,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
@@ -2042,7 +2042,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
create_dib = TRUE;
}
@ -117,7 +117,7 @@ index 94934a5..c971031 100644
wined3d_resource_free_sysmem(&surface->resource);
width = texture_resource->width;
@@ -3236,7 +3236,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
@@ -3212,7 +3212,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
checkGLcall("glEnable(texture_target)");
/* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */
@ -126,7 +126,7 @@ index 94934a5..c971031 100644
}
/* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag
@@ -3763,13 +3763,14 @@ void surface_modify_ds_location(struct wined3d_surface *surface,
@@ -3739,13 +3739,14 @@ void surface_modify_ds_location(struct wined3d_surface *surface,
{
TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h);
@ -144,7 +144,7 @@ index 94934a5..c971031 100644
}
/* Context activation is done by the caller. */
@@ -3784,7 +3785,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3760,7 +3761,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
/* TODO: Make this work for modes other than FBO */
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return;
@ -153,15 +153,14 @@ index 94934a5..c971031 100644
{
w = surface->ds_current_size.cx;
h = surface->ds_current_size.cy;
@@ -3810,21 +3811,21 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
return;
@@ -3787,20 +3788,20 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
}
wined3d_surface_prepare(surface, context, location);
- if (surface->locations & WINED3D_LOCATION_DISCARDED)
+ if (surface->resource.locations & WINED3D_LOCATION_DISCARDED)
{
TRACE("Surface was discarded, no need copy data.\n");
wined3d_surface_prepare(surface, context, location);
- surface->locations &= ~WINED3D_LOCATION_DISCARDED;
- surface->locations |= location;
+ surface->resource.locations &= ~WINED3D_LOCATION_DISCARDED;
@ -180,7 +179,7 @@ index 94934a5..c971031 100644
surface->ds_current_size.cx = surface->resource.width;
surface->ds_current_size.cy = surface->resource.height;
return;
@@ -3912,7 +3913,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3888,7 +3889,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
ERR("Invalid location (%#x) specified.\n", location);
}
@ -189,7 +188,7 @@ index 94934a5..c971031 100644
surface->ds_current_size.cx = surface->resource.width;
surface->ds_current_size.cy = surface->resource.height;
}
@@ -3921,7 +3922,7 @@ void surface_validate_location(struct wined3d_surface *surface, DWORD location)
@@ -3897,7 +3898,7 @@ void surface_validate_location(struct wined3d_surface *surface, DWORD location)
{
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
@ -198,7 +197,7 @@ index 94934a5..c971031 100644
}
void surface_invalidate_location(struct wined3d_surface *surface, DWORD location)
@@ -3930,9 +3931,9 @@ void surface_invalidate_location(struct wined3d_surface *surface, DWORD location
@@ -3906,9 +3907,9 @@ void surface_invalidate_location(struct wined3d_surface *surface, DWORD location
if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
wined3d_texture_set_dirty(surface->container);
@ -210,7 +209,7 @@ index 94934a5..c971031 100644
ERR("Surface %p does not have any up to date location.\n", surface);
}
@@ -3968,7 +3969,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
@@ -3944,7 +3945,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
UINT size = surface->resource.size;
surface_get_memory(surface, &dst, location);
@ -219,7 +218,7 @@ index 94934a5..c971031 100644
if (dst.buffer_object)
{
@@ -4001,33 +4002,33 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
@@ -3977,33 +3978,33 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
{
const struct wined3d_gl_info *gl_info = context->gl_info;
@ -259,7 +258,7 @@ index 94934a5..c971031 100644
}
/* Context activation is done by the caller. */
@@ -4067,14 +4068,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4043,14 +4044,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
&& wined3d_resource_is_offscreen(&texture->resource)
@ -276,7 +275,7 @@ index 94934a5..c971031 100644
&& (surface->container->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)
&& fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT,
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format,
@@ -4090,13 +4091,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4066,13 +4067,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
return WINED3D_OK;
}
@ -292,7 +291,7 @@ index 94934a5..c971031 100644
WINED3D_LOCATION_RB_RESOLVED : WINED3D_LOCATION_RB_MULTISAMPLE;
DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB;
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
@@ -4111,7 +4112,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4087,7 +4088,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
if (srgb)
{
@ -301,7 +300,7 @@ index 94934a5..c971031 100644
== WINED3D_LOCATION_TEXTURE_RGB)
{
/* Performance warning... */
@@ -4122,7 +4123,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4098,7 +4099,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
else
{
@ -310,7 +309,7 @@ index 94934a5..c971031 100644
== WINED3D_LOCATION_TEXTURE_SRGB)
{
/* Performance warning... */
@@ -4132,7 +4133,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4108,7 +4109,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
}
@ -319,7 +318,7 @@ index 94934a5..c971031 100644
{
WARN("Trying to load a texture from sysmem, but no simple location is valid.\n");
/* Lets hope we get it from somewhere... */
@@ -4167,7 +4168,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4143,7 +4144,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
surface_remove_pbo(surface, gl_info);
}
@ -328,7 +327,7 @@ index 94934a5..c971031 100644
if (format.convert)
{
/* This code is entered for texture formats which need a fixup. */
@@ -4225,11 +4226,11 @@ static void surface_load_renderbuffer(struct wined3d_surface *surface, struct wi
@@ -4201,11 +4202,11 @@ static void surface_load_renderbuffer(struct wined3d_surface *surface, struct wi
const RECT rect = {0, 0, surface->resource.width, surface->resource.height};
DWORD src_location;
@ -343,7 +342,7 @@ index 94934a5..c971031 100644
src_location = WINED3D_LOCATION_TEXTURE_SRGB;
else /* surface_blt_fbo will load the source location if necessary. */
src_location = WINED3D_LOCATION_TEXTURE_RGB;
@@ -4248,12 +4249,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4224,12 +4225,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
{
if (location == WINED3D_LOCATION_TEXTURE_RGB
@ -358,7 +357,7 @@ index 94934a5..c971031 100644
&& surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE)
{
/* Already up to date, nothing to do. */
@@ -4262,12 +4263,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4238,12 +4239,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
else
{
FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n",
@ -373,7 +372,7 @@ index 94934a5..c971031 100644
{
TRACE("Location already up to date.\n");
return;
@@ -4281,7 +4282,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4257,7 +4258,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
required_access, surface->resource.access_flags);
}
@ -382,7 +381,7 @@ index 94934a5..c971031 100644
{
ERR("Surface %p does not have any up to date location.\n", surface);
return;
@@ -4320,7 +4321,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4296,7 +4297,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
surface_validate_location(surface, location);
@ -391,7 +390,7 @@ index 94934a5..c971031 100644
surface_evict_sysmem(surface);
return;
@@ -5382,8 +5383,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5358,8 +5359,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
/* In principle this would apply to depth blits as well, but we don't
* implement those in the CPU blitter at the moment. */
@ -402,7 +401,7 @@ index 94934a5..c971031 100644
{
if (scale)
TRACE("Not doing sysmem blit because of scaling.\n");
@@ -5427,8 +5428,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5403,8 +5404,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
{
blit_op = WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST;
}
@ -414,10 +413,10 @@ index 94934a5..c971031 100644
/* Upload */
if (scale)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 93ede78..91a5495 100644
index b759426..1a39f97 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2409,7 +2409,6 @@ struct wined3d_surface
@@ -2422,7 +2422,6 @@ struct wined3d_surface
const struct wined3d_surface_ops *surface_ops;
struct wined3d_texture *container;
void *user_memory;
@ -426,5 +425,5 @@ index 93ede78..91a5495 100644
DWORD flags;
--
2.6.2
2.6.4

View File

@ -1,4 +1,4 @@
From 229f5e781649be372e0c19c65009bd776677b251 Mon Sep 17 00:00:00 2001
From 412b76a791b762e2ce9b5da8587a1595f3137c0f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 19 Sep 2013 14:55:00 +0200
Subject: wined3d: Move check_block_align to resource.c
@ -11,10 +11,10 @@ Subject: wined3d: Move check_block_align to resource.c
4 files changed, 32 insertions(+), 46 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 40267e7..c8bbf3d 100644
index 5e46b84..b47536a 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -689,3 +689,31 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru
@@ -705,3 +705,31 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru
return FALSE;
}
}
@ -47,10 +47,10 @@ index 40267e7..c8bbf3d 100644
+ return TRUE;
+}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 469790e..4e17620 100644
index 6630ce5..7ac4867 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1477,23 +1477,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w
@@ -1448,29 +1448,13 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w
static BOOL surface_check_block_align(struct wined3d_surface *surface, const struct wined3d_box *box)
{
@ -61,6 +61,12 @@ index 469790e..4e17620 100644
- && box->bottom == surface->resource.height)
- return TRUE;
-
if ((box->left >= box->right)
|| (box->top >= box->bottom)
|| (box->right > surface->resource.width)
|| (box->bottom > surface->resource.height))
return FALSE;
- /* This assumes power of two block sizes, but NPOT block sizes would be
- * silly anyway. */
- width_mask = surface->resource.format->block_width - 1;
@ -76,10 +82,10 @@ index 469790e..4e17620 100644
static BOOL surface_check_block_align_rect(struct wined3d_surface *surface, const RECT *rect)
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index f12d8d6..d182a46 100644
index ce702d2..fde518a 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -346,34 +346,6 @@ static void volume_unload(struct wined3d_resource *resource)
@@ -343,34 +343,6 @@ static void volume_unload(struct wined3d_resource *resource)
resource_unload(resource);
}
@ -114,7 +120,7 @@ index f12d8d6..d182a46 100644
static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *volume,
const struct wined3d_box *box)
{
@@ -424,7 +396,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume,
@@ -421,7 +393,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume,
WARN("Map box is invalid.\n");
return WINED3DERR_INVALIDCALL;
}
@ -124,10 +130,10 @@ index f12d8d6..d182a46 100644
WARN("Map box is misaligned for %ux%u blocks.\n",
format->block_width, format->block_height);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index b97d1d9..0cc48d8 100644
index 6402c42..8d49949 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2203,6 +2203,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
@@ -2241,6 +2241,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN;
BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
@ -137,5 +143,5 @@ index b97d1d9..0cc48d8 100644
BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource,
const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN;
--
2.6.0
2.6.4

File diff suppressed because it is too large Load Diff