~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/d3d8/volumetexture.c

Version: ~ [ wine-1.5.31 ] ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /*
  2  * IDirect3DVolumeTexture8 implementation
  3  *
  4  * Copyright 2005 Oliver Stieber
  5  *
  6  * This library is free software; you can redistribute it and/or
  7  * modify it under the terms of the GNU Lesser General Public
  8  * License as published by the Free Software Foundation; either
  9  * version 2.1 of the License, or (at your option) any later version.
 10  *
 11  * This library is distributed in the hope that it will be useful,
 12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 14  * Lesser General Public License for more details.
 15  *
 16  * You should have received a copy of the GNU Lesser General Public
 17  * License along with this library; if not, write to the Free Software
 18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 19  */
 20 
 21 #include "config.h"
 22 #include "d3d8_private.h"
 23 
 24 WINE_DEFAULT_DEBUG_CHANNEL(d3d8);
 25 
 26 /* IDirect3DVolumeTexture8 IUnknown parts follow: */
 27 static HRESULT WINAPI IDirect3DVolumeTexture8Impl_QueryInterface(LPDIRECT3DVOLUMETEXTURE8 iface, REFIID riid, LPVOID *ppobj) {
 28     IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
 29 
 30     if (IsEqualGUID(riid, &IID_IUnknown)
 31     || IsEqualGUID(riid, &IID_IDirect3DResource8)
 32     || IsEqualGUID(riid, &IID_IDirect3DBaseTexture8)
 33     || IsEqualGUID(riid, &IID_IDirect3DVolumeTexture8)) {
 34         IUnknown_AddRef(iface);
 35         *ppobj = This;
 36         return S_OK;
 37     }
 38 
 39     WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
 40     *ppobj = NULL;
 41     return E_NOINTERFACE;
 42 }
 43 
 44 static ULONG WINAPI IDirect3DVolumeTexture8Impl_AddRef(LPDIRECT3DVOLUMETEXTURE8 iface) {
 45     IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
 46     ULONG ref = InterlockedIncrement(&This->ref);
 47 
 48     TRACE("(%p) : AddRef from %d\n", This, ref - 1);
 49 
 50     return ref;
 51 }
 52 
 53 static ULONG WINAPI IDirect3DVolumeTexture8Impl_Release(LPDIRECT3DVOLUMETEXTURE8 iface) {
 54     IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
 55     ULONG ref = InterlockedDecrement(&This->ref);
 56 
 57     TRACE("(%p) : ReleaseRef to %d\n", This, ref);
 58 
 59     if (ref == 0) {
 60         EnterCriticalSection(&d3d8_cs);
 61         IWineD3DVolumeTexture_Destroy(This->wineD3DVolumeTexture, D3D8CB_DestroyVolume);
 62         LeaveCriticalSection(&d3d8_cs);
 63         IUnknown_Release(This->parentDevice);
 64         HeapFree(GetProcessHeap(), 0, This);
 65     }
 66     return ref;
 67 }
 68 
 69 /* IDirect3DVolumeTexture8 IDirect3DResource8 Interface follow: */
 70 static HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetDevice(LPDIRECT3DVOLUMETEXTURE8 iface, IDirect3DDevice8 **ppDevice) {
 71     IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
 72     IWineD3DDevice *wined3d_device;
 73     HRESULT hr;
 74     TRACE("(%p) Relay\n", This);
 75 
 76     EnterCriticalSection(&d3d8_cs);
 77     hr = IWineD3DVolumeTexture_GetDevice(This->wineD3DVolumeTexture, &wined3d_device);
 78     if (SUCCEEDED(hr))
 79     {
 80         IWineD3DDevice_GetParent(wined3d_device, (IUnknown **)ppDevice);
 81         IWineD3DDevice_Release(wined3d_device);
 82     }
 83     LeaveCriticalSection(&d3d8_cs);
 84     return hr;
 85 }
 86 
 87 static HRESULT WINAPI IDirect3DVolumeTexture8Impl_SetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
 88     IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
 89     HRESULT hr;
 90     TRACE("(%p) Relay\n", This);
 91 
 92     EnterCriticalSection(&d3d8_cs);
 93     hr = IWineD3DVolumeTexture_SetPrivateData(This->wineD3DVolumeTexture, refguid, pData, SizeOfData, Flags);
 94     LeaveCriticalSection(&d3d8_cs);
 95     return hr;
 96 }
 97 
 98 static HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid, void *pData, DWORD *pSizeOfData) {
 99     IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
100     HRESULT hr;
101     TRACE("(%p) Relay\n", This);
102 
103     EnterCriticalSection(&d3d8_cs);
104     hr = IWineD3DVolumeTexture_GetPrivateData(This->wineD3DVolumeTexture, refguid, pData, pSizeOfData);
105     LeaveCriticalSection(&d3d8_cs);
106     return hr;
107 }
108 
109 static HRESULT WINAPI IDirect3DVolumeTexture8Impl_FreePrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid) {
110     IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
111     HRESULT hr;
112     TRACE("(%p) Relay\n", This);
113 
114     EnterCriticalSection(&d3d8_cs);
115     hr = IWineD3DVolumeTexture_FreePrivateData(This->wineD3DVolumeTexture, refguid);
116     LeaveCriticalSection(&d3d8_cs);
117     return hr;
118 }
119 
120 static DWORD WINAPI IDirect3DVolumeTexture8Impl_SetPriority(LPDIRECT3DVOLUMETEXTURE8 iface, DWORD PriorityNew) {
121     IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
122     DWORD ret;
123     TRACE("(%p) Relay\n", This);
124 
125     EnterCriticalSection(&d3d8_cs);
126     ret = IWineD3DVolumeTexture_SetPriority(This->wineD3DVolumeTexture, PriorityNew);
127     LeaveCriticalSection(&d3d8_cs);
128     return ret;
129 }
130 
131 static DWORD WINAPI IDirect3DVolumeTexture8Impl_GetPriority(LPDIRECT3DVOLUMETEXTURE8 iface) {
132     IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
133     DWORD ret;
134     TRACE("(%p) Relay\n", This);
135 
136     EnterCriticalSection(&d3d8_cs);
137     ret = IWineD3DVolumeTexture_GetPriority(This->wineD3DVolumeTexture);
138     LeaveCriticalSection(&d3d8_cs);
139     return ret;
140 }
141 
142 static void WINAPI IDirect3DVolumeTexture8Impl_PreLoad(LPDIRECT3DVOLUMETEXTURE8 iface) {
143     IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
144     TRACE("(%p) Relay\n", This);
145 
146     EnterCriticalSection(&d3d8_cs);
147     IWineD3DVolumeTexture_PreLoad(This->wineD3DVolumeTexture);
148     LeaveCriticalSection(&d3d8_cs);
149 }
150 
151 static D3DRESOURCETYPE WINAPI IDirect3DVolumeTexture8Impl_GetType(LPDIRECT3DVOLUMETEXTURE8 iface) {
152     IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
153     D3DRESOURCETYPE type;
154     TRACE("(%p) Relay\n", This);
155 
156     EnterCriticalSection(&d3d8_cs);
157     type = IWineD3DVolumeTexture_GetType(This->wineD3DVolumeTexture);
158     LeaveCriticalSection(&d3d8_cs);
159     return type;
160 }
161 
162 /* IDirect3DVolumeTexture8 IDirect3DBaseTexture8 Interface follow: */
163 static DWORD WINAPI IDirect3DVolumeTexture8Impl_SetLOD(LPDIRECT3DVOLUMETEXTURE8 iface, DWORD LODNew) {
164     IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
165     DWORD ret;
166     TRACE("(%p) Relay\n", This);
167 
168     EnterCriticalSection(&d3d8_cs);
169     ret = IWineD3DVolumeTexture_SetLOD(This->wineD3DVolumeTexture, LODNew);
170     LeaveCriticalSection(&d3d8_cs);
171     return ret;
172 }
173 
174 static DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLOD(LPDIRECT3DVOLUMETEXTURE8 iface) {
175     IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
176     DWORD ret;
177     TRACE("(%p) Relay\n", This);
178 
179     EnterCriticalSection(&d3d8_cs);
180     ret = IWineD3DVolumeTexture_GetLOD(This->wineD3DVolumeTexture);
181     LeaveCriticalSection(&d3d8_cs);
182     return ret;
183 }
184 
185 static DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLevelCount(LPDIRECT3DVOLUMETEXTURE8 iface) {
186     IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
187     DWORD ret;
188     TRACE("(%p) Relay\n", This);
189 
190     EnterCriticalSection(&d3d8_cs);
191     ret = IWineD3DVolumeTexture_GetLevelCount(This->wineD3DVolumeTexture);
192     LeaveCriticalSection(&d3d8_cs);
193     return ret;
194 }
195 
196 /* IDirect3DVolumeTexture8 Interface follow: */
197 static HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetLevelDesc(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, D3DVOLUME_DESC* pDesc) {
198     IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
199     WINED3DVOLUME_DESC     wined3ddesc;
200     HRESULT hr;
201 
202     TRACE("(%p) Relay\n", This);
203 
204     EnterCriticalSection(&d3d8_cs);
205     hr = IWineD3DVolumeTexture_GetLevelDesc(This->wineD3DVolumeTexture, Level, &wined3ddesc);
206     LeaveCriticalSection(&d3d8_cs);
207 
208     if (SUCCEEDED(hr))
209     {
210         pDesc->Format = d3dformat_from_wined3dformat(wined3ddesc.Format);
211         pDesc->Type = wined3ddesc.Type;
212         pDesc->Usage = wined3ddesc.Usage;
213         pDesc->Pool = wined3ddesc.Pool;
214         pDesc->Size = wined3ddesc.Size;
215         pDesc->Width = wined3ddesc.Width;
216         pDesc->Height = wined3ddesc.Height;
217         pDesc->Depth = wined3ddesc.Depth;
218     }
219 
220     return hr;
221 }
222 
223 static HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetVolumeLevel(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, IDirect3DVolume8 **ppVolumeLevel) {
224     IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
225     HRESULT hrc = D3D_OK;
226     IWineD3DVolume *myVolume = NULL;
227 
228     TRACE("(%p) Relay\n", This);
229 
230     EnterCriticalSection(&d3d8_cs);
231     hrc = IWineD3DVolumeTexture_GetVolumeLevel(This->wineD3DVolumeTexture, Level, &myVolume);
232     if (hrc == D3D_OK && NULL != ppVolumeLevel) {
233        IWineD3DVolumeTexture_GetParent(myVolume, (IUnknown **)ppVolumeLevel);
234        IWineD3DVolumeTexture_Release(myVolume);
235     }
236     LeaveCriticalSection(&d3d8_cs);
237     return hrc;
238 }
239 
240 static HRESULT WINAPI IDirect3DVolumeTexture8Impl_LockBox(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, D3DLOCKED_BOX *pLockedVolume, CONST D3DBOX *pBox, DWORD Flags) {
241     IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
242     HRESULT hr;
243     TRACE("(%p) Relay %p %p %p %d\n", This, This->wineD3DVolumeTexture, pLockedVolume, pBox,Flags);
244 
245     EnterCriticalSection(&d3d8_cs);
246     hr = IWineD3DVolumeTexture_LockBox(This->wineD3DVolumeTexture, Level, (WINED3DLOCKED_BOX *) pLockedVolume, (CONST WINED3DBOX *) pBox, Flags);
247     LeaveCriticalSection(&d3d8_cs);
248     return hr;
249 }
250 
251 static HRESULT WINAPI IDirect3DVolumeTexture8Impl_UnlockBox(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level) {
252     IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
253     HRESULT hr;
254     TRACE("(%p) Relay %p %d\n", This, This->wineD3DVolumeTexture, Level);
255 
256     EnterCriticalSection(&d3d8_cs);
257     hr = IWineD3DVolumeTexture_UnlockBox(This->wineD3DVolumeTexture, Level);
258     LeaveCriticalSection(&d3d8_cs);
259     return hr;
260 }
261 
262 static HRESULT WINAPI IDirect3DVolumeTexture8Impl_AddDirtyBox(LPDIRECT3DVOLUMETEXTURE8 iface, CONST D3DBOX *pDirtyBox) {
263     IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
264     HRESULT hr;
265     TRACE("(%p) Relay\n", This);
266 
267     EnterCriticalSection(&d3d8_cs);
268     hr = IWineD3DVolumeTexture_AddDirtyBox(This->wineD3DVolumeTexture, (CONST WINED3DBOX *) pDirtyBox);
269     LeaveCriticalSection(&d3d8_cs);
270     return hr;
271 }
272 
273 
274 const IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl =
275 {
276     /* IUnknown */
277     IDirect3DVolumeTexture8Impl_QueryInterface,
278     IDirect3DVolumeTexture8Impl_AddRef,
279     IDirect3DVolumeTexture8Impl_Release,
280     /* IDirect3DResource8 */
281     IDirect3DVolumeTexture8Impl_GetDevice,
282     IDirect3DVolumeTexture8Impl_SetPrivateData,
283     IDirect3DVolumeTexture8Impl_GetPrivateData,
284     IDirect3DVolumeTexture8Impl_FreePrivateData,
285     IDirect3DVolumeTexture8Impl_SetPriority,
286     IDirect3DVolumeTexture8Impl_GetPriority,
287     IDirect3DVolumeTexture8Impl_PreLoad,
288     IDirect3DVolumeTexture8Impl_GetType,
289     /* IDirect3DBaseTexture8 */
290     IDirect3DVolumeTexture8Impl_SetLOD,
291     IDirect3DVolumeTexture8Impl_GetLOD,
292     IDirect3DVolumeTexture8Impl_GetLevelCount,
293     /* IDirect3DVolumeTexture8 */
294     IDirect3DVolumeTexture8Impl_GetLevelDesc,
295     IDirect3DVolumeTexture8Impl_GetVolumeLevel,
296     IDirect3DVolumeTexture8Impl_LockBox,
297     IDirect3DVolumeTexture8Impl_UnlockBox,
298     IDirect3DVolumeTexture8Impl_AddDirtyBox
299 };
300 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.