diff --git a/dll/directx/wine/CMakeLists.txt b/dll/directx/wine/CMakeLists.txt index a58fb6a59ec..e62d321600c 100644 --- a/dll/directx/wine/CMakeLists.txt +++ b/dll/directx/wine/CMakeLists.txt @@ -3,6 +3,7 @@ add_subdirectory(amstream) add_subdirectory(d3d8) add_subdirectory(d3d9) add_subdirectory(d3dcompiler_43) +add_subdirectory(d3drm) add_subdirectory(d3dx9_24) add_subdirectory(d3dx9_25) add_subdirectory(d3dx9_26) diff --git a/dll/directx/wine/d3drm/CMakeLists.txt b/dll/directx/wine/d3drm/CMakeLists.txt new file mode 100644 index 00000000000..bc3bc9fba3f --- /dev/null +++ b/dll/directx/wine/d3drm/CMakeLists.txt @@ -0,0 +1,35 @@ + +add_definitions(-D__WINESRC__) +include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) +spec2def(d3drm.dll d3drm.spec) + +list(APPEND SOURCE + d3drm.c + d3drm_main.c + device.c + face.c + frame.c + light.c + material.c + math.c + meshbuilder.c + texture.c + viewport.c + d3drm_private.h) + +add_library(d3drm SHARED + ${SOURCE} + version.rc + ${CMAKE_CURRENT_BINARY_DIR}/d3drm_stubs.c + ${CMAKE_CURRENT_BINARY_DIR}/d3drm.def) + +set_module_type(d3drm win32dll UNICODE) +target_link_libraries(d3drm dxguid uuid wine) + +if(CMAKE_C_COMPILER_ID STREQUAL "Clang") + target_link_libraries(d3drm mingwex) +endif() + +add_importlibs(d3drm d3dxof msvcrt kernel32 ntdll) +add_pch(d3drm d3drm_private.h SOURCE) +add_cd_file(TARGET d3drm DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/d3drm/d3drm.c b/dll/directx/wine/d3drm/d3drm.c new file mode 100644 index 00000000000..b1d2e69d456 --- /dev/null +++ b/dll/directx/wine/d3drm/d3drm.c @@ -0,0 +1,1489 @@ +/* + * Implementation of IDirect3DRM Interface + * + * Copyright 2010, 2012 Christian Costa + * Copyright 2011 AndrĂ© Hentschel + * + * 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 "d3drm_private.h" + +static const char* get_IID_string(const GUID* guid) +{ + if (IsEqualGUID(guid, &IID_IDirect3DRMFrame)) + return "IID_IDirect3DRMFrame"; + else if (IsEqualGUID(guid, &IID_IDirect3DRMFrame2)) + return "IID_IDirect3DRMFrame2"; + else if (IsEqualGUID(guid, &IID_IDirect3DRMFrame3)) + return "IID_IDirect3DRMFrame3"; + else if (IsEqualGUID(guid, &IID_IDirect3DRMMeshBuilder)) + return "IID_IDirect3DRMMeshBuilder"; + else if (IsEqualGUID(guid, &IID_IDirect3DRMMeshBuilder2)) + return "IID_IDirect3DRMMeshBuilder2"; + else if (IsEqualGUID(guid, &IID_IDirect3DRMMeshBuilder3)) + return "IID_IDirect3DRMMeshBuilder3"; + + return "?"; +} + +struct d3drm +{ + IDirect3DRM IDirect3DRM_iface; + IDirect3DRM2 IDirect3DRM2_iface; + IDirect3DRM3 IDirect3DRM3_iface; + LONG ref; +}; + +static inline struct d3drm *impl_from_IDirect3DRM(IDirect3DRM *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm, IDirect3DRM_iface); +} + +static inline struct d3drm *impl_from_IDirect3DRM2(IDirect3DRM2 *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm, IDirect3DRM2_iface); +} + +static inline struct d3drm *impl_from_IDirect3DRM3(IDirect3DRM3 *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm, IDirect3DRM3_iface); +} + +static HRESULT WINAPI d3drm1_QueryInterface(IDirect3DRM *iface, REFIID riid, void **out) +{ + struct d3drm *d3drm = impl_from_IDirect3DRM(iface); + + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualGUID(riid, &IID_IDirect3DRM) + || IsEqualGUID(riid, &IID_IUnknown)) + { + *out = &d3drm->IDirect3DRM_iface; + } + else if (IsEqualGUID(riid, &IID_IDirect3DRM2)) + { + *out = &d3drm->IDirect3DRM2_iface; + } + else if (IsEqualGUID(riid, &IID_IDirect3DRM3)) + { + *out = &d3drm->IDirect3DRM3_iface; + } + else + { + *out = NULL; + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static ULONG WINAPI d3drm1_AddRef(IDirect3DRM *iface) +{ + struct d3drm *d3drm = impl_from_IDirect3DRM(iface); + ULONG refcount = InterlockedIncrement(&d3drm->ref); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI d3drm1_Release(IDirect3DRM *iface) +{ + struct d3drm *d3drm = impl_from_IDirect3DRM(iface); + ULONG refcount = InterlockedDecrement(&d3drm->ref); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + HeapFree(GetProcessHeap(), 0, d3drm); + + return refcount; +} + +static HRESULT WINAPI d3drm1_CreateObject(IDirect3DRM *iface, + REFCLSID clsid, IUnknown *outer, REFIID iid, void **out) +{ + FIXME("iface %p, clsid %s, outer %p, iid %s, out %p stub!\n", + iface, debugstr_guid(clsid), outer, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm1_CreateFrame(IDirect3DRM *iface, + IDirect3DRMFrame *parent_frame, IDirect3DRMFrame **frame) +{ + TRACE("iface %p, parent_frame %p, frame %p.\n", iface, parent_frame, frame); + + return Direct3DRMFrame_create(&IID_IDirect3DRMFrame, (IUnknown *)parent_frame, (IUnknown **)frame); +} + +static HRESULT WINAPI d3drm1_CreateMesh(IDirect3DRM *iface, IDirect3DRMMesh **mesh) +{ + struct d3drm *d3drm = impl_from_IDirect3DRM(iface); + + TRACE("iface %p, mesh %p.\n", iface, mesh); + + return IDirect3DRM3_CreateMesh(&d3drm->IDirect3DRM3_iface, mesh); +} + +static HRESULT WINAPI d3drm1_CreateMeshBuilder(IDirect3DRM *iface, IDirect3DRMMeshBuilder **mesh_builder) +{ + TRACE("iface %p, mesh_builder %p.\n", iface, mesh_builder); + + return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder, (IUnknown **)mesh_builder); +} + +static HRESULT WINAPI d3drm1_CreateFace(IDirect3DRM *iface, IDirect3DRMFace **face) +{ + TRACE("iface %p, face %p.\n", iface, face); + + return Direct3DRMFace_create(&IID_IDirect3DRMFace, (IUnknown **)face); +} + +static HRESULT WINAPI d3drm1_CreateAnimation(IDirect3DRM *iface, IDirect3DRMAnimation **animation) +{ + FIXME("iface %p, animation %p stub!\n", iface, animation); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm1_CreateAnimationSet(IDirect3DRM *iface, IDirect3DRMAnimationSet **set) +{ + FIXME("iface %p, set %p stub!\n", iface, set); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm1_CreateTexture(IDirect3DRM *iface, + D3DRMIMAGE *image, IDirect3DRMTexture **texture) +{ + FIXME("iface %p, image %p, texture %p partial stub.\n", iface, image, texture); + + return Direct3DRMTexture_create(&IID_IDirect3DRMTexture, (IUnknown **)texture); +} + +static HRESULT WINAPI d3drm1_CreateLight(IDirect3DRM *iface, + D3DRMLIGHTTYPE type, D3DCOLOR color, IDirect3DRMLight **light) +{ + struct d3drm *d3drm = impl_from_IDirect3DRM(iface); + + TRACE("iface %p, type %#x, color 0x%08x, light %p.\n", iface, type, color, light); + + return IDirect3DRM3_CreateLight(&d3drm->IDirect3DRM3_iface, type, color, light); +} + +static HRESULT WINAPI d3drm1_CreateLightRGB(IDirect3DRM *iface, D3DRMLIGHTTYPE type, + D3DVALUE red, D3DVALUE green, D3DVALUE blue, IDirect3DRMLight **light) +{ + struct d3drm *d3drm = impl_from_IDirect3DRM(iface); + + TRACE("iface %p, type %#x, red %.8e, green %.8e, blue %.8e, light %p.\n", + iface, type, red, green, blue, light); + + return IDirect3DRM3_CreateLightRGB(&d3drm->IDirect3DRM3_iface, type, red, green, blue, light); +} + +static HRESULT WINAPI d3drm1_CreateMaterial(IDirect3DRM *iface, + D3DVALUE power, IDirect3DRMMaterial **material) +{ + struct d3drm *d3drm = impl_from_IDirect3DRM(iface); + + TRACE("iface %p, power %.8e, material %p.\n", iface, power, material); + + return IDirect3DRM3_CreateMaterial(&d3drm->IDirect3DRM3_iface, power, (IDirect3DRMMaterial2 **)material); +} + +static HRESULT WINAPI d3drm1_CreateDevice(IDirect3DRM *iface, + DWORD width, DWORD height, IDirect3DRMDevice **device) +{ + FIXME("iface %p, width %u, height %u, device %p partial stub!\n", iface, width, height, device); + + return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown **)device); +} + +static HRESULT WINAPI d3drm1_CreateDeviceFromSurface(IDirect3DRM *iface, GUID *guid, + IDirectDraw *ddraw, IDirectDrawSurface *backbuffer, IDirect3DRMDevice **device) +{ + FIXME("iface %p, guid %s, ddraw %p, backbuffer %p, device %p partial stub.\n", + iface, debugstr_guid(guid), ddraw, backbuffer, device); + + return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown **)device); +} + +static HRESULT WINAPI d3drm1_CreateDeviceFromD3D(IDirect3DRM *iface, + IDirect3D *d3d, IDirect3DDevice *d3d_device, IDirect3DRMDevice **device) +{ + FIXME("iface %p, d3d %p, d3d_device %p, device %p partial stub.\n", + iface, d3d, d3d_device, device); + + return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown **)device); +} + +static HRESULT WINAPI d3drm1_CreateDeviceFromClipper(IDirect3DRM *iface, + IDirectDrawClipper *clipper, GUID *guid, int width, int height, + IDirect3DRMDevice **device) +{ + FIXME("iface %p, clipper %p, guid %s, width %d, height %d, device %p.\n", + iface, clipper, debugstr_guid(guid), width, height, device); + + return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown **)device); +} + +static HRESULT WINAPI d3drm1_CreateTextureFromSurface(IDirect3DRM *iface, + IDirectDrawSurface *surface, IDirect3DRMTexture **texture) +{ + FIXME("iface %p, surface %p, texture %p stub!\n", iface, surface, texture); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm1_CreateShadow(IDirect3DRM *iface, IDirect3DRMVisual *visual, + IDirect3DRMLight *light, D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, + IDirect3DRMVisual **shadow) +{ + FIXME("iface %p, visual %p, light %p, px %.8e, py %.8e, pz %.8e, nx %.8e, ny %.8e, nz %.8e, shadow %p stub!\n", + iface, visual, light, px, py, pz, nx, ny, nz, shadow); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm1_CreateViewport(IDirect3DRM *iface, IDirect3DRMDevice *device, + IDirect3DRMFrame *camera, DWORD x, DWORD y, DWORD width, DWORD height, IDirect3DRMViewport **viewport) +{ + FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u, viewport %p partial stub!\n", + iface, device, camera, x, y, width, height, viewport); + + return Direct3DRMViewport_create(&IID_IDirect3DRMViewport, (IUnknown **)viewport); +} + +static HRESULT WINAPI d3drm1_CreateWrap(IDirect3DRM *iface, D3DRMWRAPTYPE type, IDirect3DRMFrame *frame, + D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, + D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov, D3DVALUE su, D3DVALUE sv, + IDirect3DRMWrap **wrap) +{ + FIXME("iface %p, type %#x, frame %p, ox %.8e, oy %.8e, oz %.8e, dx %.8e, dy %.8e, dz %.8e, " + "ux %.8e, uy %.8e, uz %.8e, ou %.8e, ov %.8e, su %.8e, sv %.8e, wrap %p stub!\n", + iface, type, frame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, wrap); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm1_CreateUserVisual(IDirect3DRM *iface, + D3DRMUSERVISUALCALLBACK cb, void *ctx, IDirect3DRMUserVisual **visual) +{ + FIXME("iface %p, cb %p, ctx %p visual %p stub!\n", iface, cb, ctx, visual); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm1_LoadTexture(IDirect3DRM *iface, + const char *filename, IDirect3DRMTexture **texture) +{ + FIXME("iface %p, filename %s, texture %p stub!\n", iface, debugstr_a(filename), texture); + + return Direct3DRMTexture_create(&IID_IDirect3DRMTexture, (IUnknown **)texture); +} + +static HRESULT WINAPI d3drm1_LoadTextureFromResource(IDirect3DRM *iface, + HRSRC resource, IDirect3DRMTexture **texture) +{ + FIXME("iface %p, resource %p, texture %p stub!\n", iface, resource, texture); + + return Direct3DRMTexture_create(&IID_IDirect3DRMTexture, (IUnknown **)texture); +} + +static HRESULT WINAPI d3drm1_SetSearchPath(IDirect3DRM *iface, const char *path) +{ + FIXME("iface %p, path %s stub!\n", iface, debugstr_a(path)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm1_AddSearchPath(IDirect3DRM *iface, const char *path) +{ + FIXME("iface %p, path %s stub!\n", iface, debugstr_a(path)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm1_GetSearchPath(IDirect3DRM *iface, DWORD *size, char *path) +{ + FIXME("iface %p, size %p, path %p stub!\n", iface, size, path); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm1_SetDefaultTextureColors(IDirect3DRM *iface, DWORD color_count) +{ + FIXME("iface %p, color_count %u stub!\n", iface, color_count); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm1_SetDefaultTextureShades(IDirect3DRM *iface, DWORD shade_count) +{ + FIXME("iface %p, shade_count %u stub!\n", iface, shade_count); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm1_GetDevices(IDirect3DRM *iface, IDirect3DRMDeviceArray **array) +{ + FIXME("iface %p, array %p stub!\n", iface, array); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm1_GetNamedObject(IDirect3DRM *iface, + const char *name, IDirect3DRMObject **object) +{ + FIXME("iface %p, name %s, object %p stub!\n", iface, debugstr_a(name), object); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm1_EnumerateObjects(IDirect3DRM *iface, D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm1_Load(IDirect3DRM *iface, void *source, void *object_id, IID **iids, + DWORD iid_count, D3DRMLOADOPTIONS flags, D3DRMLOADCALLBACK load_cb, void *load_ctx, + D3DRMLOADTEXTURECALLBACK load_tex_cb, void *load_tex_ctx, IDirect3DRMFrame *parent_frame) +{ + struct d3drm *d3drm = impl_from_IDirect3DRM(iface); + IDirect3DRMFrame3 *parent_frame3 = NULL; + HRESULT hr = D3DRM_OK; + + TRACE("iface %p, source %p, object_id %p, iids %p, iid_count %u, flags %#x, " + "load_cb %p, load_ctx %p, load_tex_cb %p, load_tex_ctx %p, parent_frame %p.\n", + iface, source, object_id, iids, iid_count, flags, + load_cb, load_ctx, load_tex_cb, load_tex_ctx, parent_frame); + + if (parent_frame) + hr = IDirect3DRMFrame_QueryInterface(parent_frame, &IID_IDirect3DRMFrame3, (void **)&parent_frame3); + if (SUCCEEDED(hr)) + hr = IDirect3DRM3_Load(&d3drm->IDirect3DRM3_iface, source, object_id, iids, iid_count, + flags, load_cb, load_ctx, load_tex_cb, load_tex_ctx, parent_frame3); + if (parent_frame3) + IDirect3DRMFrame3_Release(parent_frame3); + + return hr; +} + +static HRESULT WINAPI d3drm1_Tick(IDirect3DRM *iface, D3DVALUE tick) +{ + FIXME("iface %p, tick %.8e stub!\n", iface, tick); + + return E_NOTIMPL; +} + +static const struct IDirect3DRMVtbl d3drm1_vtbl = +{ + d3drm1_QueryInterface, + d3drm1_AddRef, + d3drm1_Release, + d3drm1_CreateObject, + d3drm1_CreateFrame, + d3drm1_CreateMesh, + d3drm1_CreateMeshBuilder, + d3drm1_CreateFace, + d3drm1_CreateAnimation, + d3drm1_CreateAnimationSet, + d3drm1_CreateTexture, + d3drm1_CreateLight, + d3drm1_CreateLightRGB, + d3drm1_CreateMaterial, + d3drm1_CreateDevice, + d3drm1_CreateDeviceFromSurface, + d3drm1_CreateDeviceFromD3D, + d3drm1_CreateDeviceFromClipper, + d3drm1_CreateTextureFromSurface, + d3drm1_CreateShadow, + d3drm1_CreateViewport, + d3drm1_CreateWrap, + d3drm1_CreateUserVisual, + d3drm1_LoadTexture, + d3drm1_LoadTextureFromResource, + d3drm1_SetSearchPath, + d3drm1_AddSearchPath, + d3drm1_GetSearchPath, + d3drm1_SetDefaultTextureColors, + d3drm1_SetDefaultTextureShades, + d3drm1_GetDevices, + d3drm1_GetNamedObject, + d3drm1_EnumerateObjects, + d3drm1_Load, + d3drm1_Tick, +}; + +static HRESULT WINAPI d3drm2_QueryInterface(IDirect3DRM2 *iface, REFIID riid, void **out) +{ + struct d3drm *d3drm = impl_from_IDirect3DRM2(iface); + + return d3drm1_QueryInterface(&d3drm->IDirect3DRM_iface, riid, out); +} + +static ULONG WINAPI d3drm2_AddRef(IDirect3DRM2 *iface) +{ + struct d3drm *d3drm = impl_from_IDirect3DRM2(iface); + + return d3drm1_AddRef(&d3drm->IDirect3DRM_iface); +} + +static ULONG WINAPI d3drm2_Release(IDirect3DRM2 *iface) +{ + struct d3drm *d3drm = impl_from_IDirect3DRM2(iface); + + return d3drm1_Release(&d3drm->IDirect3DRM_iface); +} + +static HRESULT WINAPI d3drm2_CreateObject(IDirect3DRM2 *iface, + REFCLSID clsid, IUnknown *outer, REFIID iid, void **out) +{ + FIXME("iface %p, clsid %s, outer %p, iid %s, out %p stub!\n", + iface, debugstr_guid(clsid), outer, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm2_CreateFrame(IDirect3DRM2 *iface, + IDirect3DRMFrame *parent_frame, IDirect3DRMFrame2 **frame) +{ + TRACE("iface %p, parent_frame %p, frame %p.\n", iface, parent_frame, frame); + + return Direct3DRMFrame_create(&IID_IDirect3DRMFrame2, (IUnknown*)parent_frame, (IUnknown**)frame); +} + +static HRESULT WINAPI d3drm2_CreateMesh(IDirect3DRM2 *iface, IDirect3DRMMesh **mesh) +{ + struct d3drm *d3drm = impl_from_IDirect3DRM2(iface); + + TRACE("iface %p, mesh %p.\n", iface, mesh); + + return IDirect3DRM3_CreateMesh(&d3drm->IDirect3DRM3_iface, mesh); +} + +static HRESULT WINAPI d3drm2_CreateMeshBuilder(IDirect3DRM2 *iface, IDirect3DRMMeshBuilder2 **mesh_builder) +{ + TRACE("iface %p, mesh_builder %p.\n", iface, mesh_builder); + + return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder2, (IUnknown **)mesh_builder); +} + +static HRESULT WINAPI d3drm2_CreateFace(IDirect3DRM2 *iface, IDirect3DRMFace **face) +{ + TRACE("iface %p, face %p.\n", iface, face); + + return Direct3DRMFace_create(&IID_IDirect3DRMFace, (IUnknown **)face); +} + +static HRESULT WINAPI d3drm2_CreateAnimation(IDirect3DRM2 *iface, IDirect3DRMAnimation **animation) +{ + FIXME("iface %p, animation %p stub!\n", iface, animation); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm2_CreateAnimationSet(IDirect3DRM2 *iface, IDirect3DRMAnimationSet **set) +{ + FIXME("iface %p, set %p stub!\n", iface, set); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm2_CreateTexture(IDirect3DRM2 *iface, + D3DRMIMAGE *image, IDirect3DRMTexture2 **texture) +{ + FIXME("iface %p, image %p, texture %p partial stub.\n", iface, image, texture); + + return Direct3DRMTexture_create(&IID_IDirect3DRMTexture2, (IUnknown **)texture); +} + +static HRESULT WINAPI d3drm2_CreateLight(IDirect3DRM2 *iface, + D3DRMLIGHTTYPE type, D3DCOLOR color, IDirect3DRMLight **light) +{ + struct d3drm *d3drm = impl_from_IDirect3DRM2(iface); + + TRACE("iface %p, type %#x, color 0x%08x, light %p.\n", iface, type, color, light); + + return IDirect3DRM3_CreateLight(&d3drm->IDirect3DRM3_iface, type, color, light); +} + +static HRESULT WINAPI d3drm2_CreateLightRGB(IDirect3DRM2 *iface, D3DRMLIGHTTYPE type, + D3DVALUE red, D3DVALUE green, D3DVALUE blue, IDirect3DRMLight **light) +{ + struct d3drm *d3drm = impl_from_IDirect3DRM2(iface); + + TRACE("iface %p, type %#x, red %.8e, green %.8e, blue %.8e, light %p.\n", + iface, type, red, green, blue, light); + + return IDirect3DRM3_CreateLightRGB(&d3drm->IDirect3DRM3_iface, type, red, green, blue, light); +} + +static HRESULT WINAPI d3drm2_CreateMaterial(IDirect3DRM2 *iface, + D3DVALUE power, IDirect3DRMMaterial **material) +{ + struct d3drm *d3drm = impl_from_IDirect3DRM2(iface); + + TRACE("iface %p, power %.8e, material %p.\n", iface, power, material); + + return IDirect3DRM3_CreateMaterial(&d3drm->IDirect3DRM3_iface, power, (IDirect3DRMMaterial2 **)material); +} + +static HRESULT WINAPI d3drm2_CreateDevice(IDirect3DRM2 *iface, + DWORD width, DWORD height, IDirect3DRMDevice2 **device) +{ + FIXME("iface %p, width %u, height %u, device %p.\n", iface, width, height, device); + + return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown **)device); +} + +static HRESULT WINAPI d3drm2_CreateDeviceFromSurface(IDirect3DRM2 *iface, GUID *guid, + IDirectDraw *ddraw, IDirectDrawSurface *backbuffer, IDirect3DRMDevice2 **device) +{ + FIXME("iface %p, guid %s, ddraw %p, backbuffer %p, device %p partial stub.\n", + iface, debugstr_guid(guid), ddraw, backbuffer, device); + + return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown **)device); +} + +static HRESULT WINAPI d3drm2_CreateDeviceFromD3D(IDirect3DRM2 *iface, + IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device, IDirect3DRMDevice2 **device) +{ + FIXME("iface %p, d3d %p, d3d_device %p, device %p partial stub.\n", + iface, d3d, d3d_device, device); + + return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown **)device); +} + +static HRESULT WINAPI d3drm2_CreateDeviceFromClipper(IDirect3DRM2 *iface, + IDirectDrawClipper *clipper, GUID *guid, int width, int height, + IDirect3DRMDevice2 **device) +{ + FIXME("iface %p, clipper %p, guid %s, width %d, height %d, device %p partial stub.\n", + iface, clipper, debugstr_guid(guid), width, height, device); + + return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown **)device); +} + +static HRESULT WINAPI d3drm2_CreateTextureFromSurface(IDirect3DRM2 *iface, + IDirectDrawSurface *surface, IDirect3DRMTexture2 **texture) +{ + FIXME("iface %p, surface %p, texture %p stub!\n", iface, surface, texture); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm2_CreateShadow(IDirect3DRM2 *iface, IDirect3DRMVisual *visual, + IDirect3DRMLight *light, D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, + IDirect3DRMVisual **shadow) +{ + FIXME("iface %p, visual %p, light %p, px %.8e, py %.8e, pz %.8e, nx %.8e, ny %.8e, nz %.8e, shadow %p stub!\n", + iface, visual, light, px, py, pz, nx, ny, nz, shadow); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm2_CreateViewport(IDirect3DRM2 *iface, IDirect3DRMDevice *device, + IDirect3DRMFrame *camera, DWORD x, DWORD y, DWORD width, DWORD height, IDirect3DRMViewport **viewport) +{ + FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u, viewport %p partial stub!\n", + iface, device, camera, x, y, width, height, viewport); + + return Direct3DRMViewport_create(&IID_IDirect3DRMViewport, (IUnknown **)viewport); +} + +static HRESULT WINAPI d3drm2_CreateWrap(IDirect3DRM2 *iface, D3DRMWRAPTYPE type, IDirect3DRMFrame *frame, + D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, + D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov, D3DVALUE su, D3DVALUE sv, + IDirect3DRMWrap **wrap) +{ + FIXME("iface %p, type %#x, frame %p, ox %.8e, oy %.8e, oz %.8e, dx %.8e, dy %.8e, dz %.8e, " + "ux %.8e, uy %.8e, uz %.8e, ou %.8e, ov %.8e, su %.8e, sv %.8e, wrap %p stub!\n", + iface, type, frame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, wrap); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm2_CreateUserVisual(IDirect3DRM2 *iface, + D3DRMUSERVISUALCALLBACK cb, void *ctx, IDirect3DRMUserVisual **visual) +{ + FIXME("iface %p, cb %p, ctx %p, visual %p stub!\n", iface, cb, ctx, visual); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm2_LoadTexture(IDirect3DRM2 *iface, + const char *filename, IDirect3DRMTexture2 **texture) +{ + FIXME("iface %p, filename %s, texture %p stub!\n", iface, debugstr_a(filename), texture); + + return Direct3DRMTexture_create(&IID_IDirect3DRMTexture2, (IUnknown **)texture); +} + +static HRESULT WINAPI d3drm2_LoadTextureFromResource(IDirect3DRM2 *iface, HMODULE module, + const char *resource_name, const char *resource_type, IDirect3DRMTexture2 **texture) +{ + FIXME("iface %p, resource_name %s, resource_type %s, texture %p stub!\n", + iface, debugstr_a(resource_name), debugstr_a(resource_type), texture); + + return Direct3DRMTexture_create(&IID_IDirect3DRMTexture2, (IUnknown **)texture); +} + +static HRESULT WINAPI d3drm2_SetSearchPath(IDirect3DRM2 *iface, const char *path) +{ + FIXME("iface %p, path %s stub!\n", iface, debugstr_a(path)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm2_AddSearchPath(IDirect3DRM2 *iface, const char *path) +{ + FIXME("iface %p, path %s stub!\n", iface, debugstr_a(path)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm2_GetSearchPath(IDirect3DRM2 *iface, DWORD *size, char *path) +{ + FIXME("iface %p, size %p, path %p stub!\n", iface, size, path); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm2_SetDefaultTextureColors(IDirect3DRM2 *iface, DWORD color_count) +{ + FIXME("iface %p, color_count %u stub!\n", iface, color_count); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm2_SetDefaultTextureShades(IDirect3DRM2 *iface, DWORD shade_count) +{ + FIXME("iface %p, shade_count %u stub!\n", iface, shade_count); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm2_GetDevices(IDirect3DRM2 *iface, IDirect3DRMDeviceArray **array) +{ + FIXME("iface %p, array %p stub!\n", iface, array); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm2_GetNamedObject(IDirect3DRM2 *iface, + const char *name, IDirect3DRMObject **object) +{ + FIXME("iface %p, name %s, object %p stub!\n", iface, debugstr_a(name), object); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm2_EnumerateObjects(IDirect3DRM2 *iface, D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm2_Load(IDirect3DRM2 *iface, void *source, void *object_id, IID **iids, + DWORD iid_count, D3DRMLOADOPTIONS flags, D3DRMLOADCALLBACK load_cb, void *load_ctx, + D3DRMLOADTEXTURECALLBACK load_tex_cb, void *load_tex_ctx, IDirect3DRMFrame *parent_frame) +{ + struct d3drm *d3drm = impl_from_IDirect3DRM2(iface); + IDirect3DRMFrame3 *parent_frame3 = NULL; + HRESULT hr = D3DRM_OK; + + TRACE("iface %p, source %p, object_id %p, iids %p, iid_count %u, flags %#x, " + "load_cb %p, load_ctx %p, load_tex_cb %p, load_tex_ctx %p, parent_frame %p.\n", + iface, source, object_id, iids, iid_count, flags, + load_cb, load_ctx, load_tex_cb, load_tex_ctx, parent_frame); + + if (parent_frame) + hr = IDirect3DRMFrame_QueryInterface(parent_frame, &IID_IDirect3DRMFrame3, (void **)&parent_frame3); + if (SUCCEEDED(hr)) + hr = IDirect3DRM3_Load(&d3drm->IDirect3DRM3_iface, source, object_id, iids, iid_count, + flags, load_cb, load_ctx, load_tex_cb, load_tex_ctx, parent_frame3); + if (parent_frame3) + IDirect3DRMFrame3_Release(parent_frame3); + + return hr; +} + +static HRESULT WINAPI d3drm2_Tick(IDirect3DRM2 *iface, D3DVALUE tick) +{ + FIXME("iface %p, tick %.8e stub!\n", iface, tick); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm2_CreateProgressiveMesh(IDirect3DRM2 *iface, IDirect3DRMProgressiveMesh **mesh) +{ + FIXME("iface %p, mesh %p stub!\n", iface, mesh); + + return E_NOTIMPL; +} + +static const struct IDirect3DRM2Vtbl d3drm2_vtbl = +{ + d3drm2_QueryInterface, + d3drm2_AddRef, + d3drm2_Release, + d3drm2_CreateObject, + d3drm2_CreateFrame, + d3drm2_CreateMesh, + d3drm2_CreateMeshBuilder, + d3drm2_CreateFace, + d3drm2_CreateAnimation, + d3drm2_CreateAnimationSet, + d3drm2_CreateTexture, + d3drm2_CreateLight, + d3drm2_CreateLightRGB, + d3drm2_CreateMaterial, + d3drm2_CreateDevice, + d3drm2_CreateDeviceFromSurface, + d3drm2_CreateDeviceFromD3D, + d3drm2_CreateDeviceFromClipper, + d3drm2_CreateTextureFromSurface, + d3drm2_CreateShadow, + d3drm2_CreateViewport, + d3drm2_CreateWrap, + d3drm2_CreateUserVisual, + d3drm2_LoadTexture, + d3drm2_LoadTextureFromResource, + d3drm2_SetSearchPath, + d3drm2_AddSearchPath, + d3drm2_GetSearchPath, + d3drm2_SetDefaultTextureColors, + d3drm2_SetDefaultTextureShades, + d3drm2_GetDevices, + d3drm2_GetNamedObject, + d3drm2_EnumerateObjects, + d3drm2_Load, + d3drm2_Tick, + d3drm2_CreateProgressiveMesh, +}; + +static HRESULT WINAPI d3drm3_QueryInterface(IDirect3DRM3 *iface, REFIID riid, void **out) +{ + struct d3drm *d3drm = impl_from_IDirect3DRM3(iface); + + return d3drm1_QueryInterface(&d3drm->IDirect3DRM_iface, riid, out); +} + +static ULONG WINAPI d3drm3_AddRef(IDirect3DRM3 *iface) +{ + struct d3drm *d3drm = impl_from_IDirect3DRM3(iface); + + return d3drm1_AddRef(&d3drm->IDirect3DRM_iface); +} + +static ULONG WINAPI d3drm3_Release(IDirect3DRM3 *iface) +{ + struct d3drm *d3drm = impl_from_IDirect3DRM3(iface); + + return d3drm1_Release(&d3drm->IDirect3DRM_iface); +} + +static HRESULT WINAPI d3drm3_CreateObject(IDirect3DRM3 *iface, + REFCLSID clsid, IUnknown *outer, REFIID iid, void **out) +{ + FIXME("iface %p, clsid %s, outer %p, iid %s, out %p stub!\n", + iface, debugstr_guid(clsid), outer, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_CreateFrame(IDirect3DRM3 *iface, + IDirect3DRMFrame3 *parent, IDirect3DRMFrame3 **frame) +{ + TRACE("iface %p, parent %p, frame %p.\n", iface, parent, frame); + + return Direct3DRMFrame_create(&IID_IDirect3DRMFrame3, (IUnknown *)parent, (IUnknown **)frame); +} + +static HRESULT WINAPI d3drm3_CreateMesh(IDirect3DRM3 *iface, IDirect3DRMMesh **mesh) +{ + TRACE("iface %p, mesh %p.\n", iface, mesh); + + return Direct3DRMMesh_create(mesh); +} + +static HRESULT WINAPI d3drm3_CreateMeshBuilder(IDirect3DRM3 *iface, IDirect3DRMMeshBuilder3 **mesh_builder) +{ + TRACE("iface %p, mesh_builder %p.\n", iface, mesh_builder); + + return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder3, (IUnknown **)mesh_builder); +} + +static HRESULT WINAPI d3drm3_CreateFace(IDirect3DRM3 *iface, IDirect3DRMFace2 **face) +{ + TRACE("iface %p, face %p.\n", iface, face); + + return Direct3DRMFace_create(&IID_IDirect3DRMFace2, (IUnknown **)face); +} + +static HRESULT WINAPI d3drm3_CreateAnimation(IDirect3DRM3 *iface, IDirect3DRMAnimation2 **animation) +{ + FIXME("iface %p, animation %p stub!\n", iface, animation); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_CreateAnimationSet(IDirect3DRM3 *iface, IDirect3DRMAnimationSet2 **set) +{ + FIXME("iface %p, set %p stub!\n", iface, set); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_CreateTexture(IDirect3DRM3 *iface, + D3DRMIMAGE *image, IDirect3DRMTexture3 **texture) +{ + FIXME("iface %p, image %p, texture %p partial stub.\n", iface, image, texture); + + return Direct3DRMTexture_create(&IID_IDirect3DRMTexture3, (IUnknown **)texture); +} + +static HRESULT WINAPI d3drm3_CreateLight(IDirect3DRM3 *iface, + D3DRMLIGHTTYPE type, D3DCOLOR color, IDirect3DRMLight **light) +{ + HRESULT hr; + + FIXME("iface %p, type %#x, color 0x%08x, light %p partial stub!\n", iface, type, color, light); + + if (SUCCEEDED(hr = Direct3DRMLight_create((IUnknown **)light))) + { + IDirect3DRMLight_SetType(*light, type); + IDirect3DRMLight_SetColor(*light, color); + } + + return hr; +} + +static HRESULT WINAPI d3drm3_CreateLightRGB(IDirect3DRM3 *iface, D3DRMLIGHTTYPE type, + D3DVALUE red, D3DVALUE green, D3DVALUE blue, IDirect3DRMLight **light) +{ + HRESULT hr; + + FIXME("iface %p, type %#x, red %.8e, green %.8e, blue %.8e, light %p partial stub!\n", + iface, type, red, green, blue, light); + + if (SUCCEEDED(hr = Direct3DRMLight_create((IUnknown **)light))) + { + IDirect3DRMLight_SetType(*light, type); + IDirect3DRMLight_SetColorRGB(*light, red, green, blue); + } + + return hr; +} + +static HRESULT WINAPI d3drm3_CreateMaterial(IDirect3DRM3 *iface, + D3DVALUE power, IDirect3DRMMaterial2 **material) +{ + HRESULT hr; + + TRACE("iface %p, power %.8e, material %p.\n", iface, power, material); + + if (SUCCEEDED(hr = Direct3DRMMaterial_create(material))) + IDirect3DRMMaterial2_SetPower(*material, power); + + return hr; +} + +static HRESULT WINAPI d3drm3_CreateDevice(IDirect3DRM3 *iface, + DWORD width, DWORD height, IDirect3DRMDevice3 **device) +{ + FIXME("iface %p, width %u, height %u, device %p partial stub!\n", iface, width, height, device); + + return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown **)device); +} + +static HRESULT WINAPI d3drm3_CreateDeviceFromSurface(IDirect3DRM3 *iface, GUID *guid, + IDirectDraw *ddraw, IDirectDrawSurface *backbuffer, IDirect3DRMDevice3 **device) +{ + FIXME("iface %p, guid %s, ddraw %p, backbuffer %p, device %p partial stub.\n", + iface, debugstr_guid(guid), ddraw, backbuffer, device); + + return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown **)device); +} + +static HRESULT WINAPI d3drm3_CreateDeviceFromD3D(IDirect3DRM3 *iface, + IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device, IDirect3DRMDevice3 **device) +{ + FIXME("iface %p, d3d %p, d3d_device %p, device %p partial stub.\n", + iface, d3d, d3d_device, device); + + return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown **)device); +} + +static HRESULT WINAPI d3drm3_CreateDeviceFromClipper(IDirect3DRM3 *iface, + IDirectDrawClipper *clipper, GUID *guid, int width, int height, + IDirect3DRMDevice3 **device) +{ + FIXME("iface %p, clipper %p, guid %s, width %d, height %d, device %p partial stub.\n", + iface, clipper, debugstr_guid(guid), width, height, device); + + return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown **)device); +} + +static HRESULT WINAPI d3drm3_CreateShadow(IDirect3DRM3 *iface, IUnknown *object, IDirect3DRMLight *light, + D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, IDirect3DRMShadow2 **shadow) +{ + FIXME("iface %p, object %p, light %p, px %.8e, py %.8e, pz %.8e, nx %.8e, ny %.8e, nz %.8e, shadow %p stub!\n", + iface, object, light, px, py, pz, nx, ny, nz, shadow); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_CreateTextureFromSurface(IDirect3DRM3 *iface, + IDirectDrawSurface *surface, IDirect3DRMTexture3 **texture) +{ + FIXME("iface %p, surface %p, texture %p stub!\n", iface, surface, texture); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_CreateViewport(IDirect3DRM3 *iface, IDirect3DRMDevice3 *device, + IDirect3DRMFrame3 *camera, DWORD x, DWORD y, DWORD width, DWORD height, IDirect3DRMViewport2 **viewport) +{ + FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u, viewport %p partial stub!\n", + iface, device, camera, x, y, width, height, viewport); + + return Direct3DRMViewport_create(&IID_IDirect3DRMViewport2, (IUnknown **)viewport); +} + +static HRESULT WINAPI d3drm3_CreateWrap(IDirect3DRM3 *iface, D3DRMWRAPTYPE type, IDirect3DRMFrame3 *frame, + D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, + D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov, D3DVALUE su, D3DVALUE sv, + IDirect3DRMWrap **wrap) +{ + FIXME("iface %p, type %#x, frame %p, ox %.8e, oy %.8e, oz %.8e, dx %.8e, dy %.8e, dz %.8e, " + "ux %.8e, uy %.8e, uz %.8e, ou %.8e, ov %.8e, su %.8e, sv %.8e, wrap %p stub!\n", + iface, type, frame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, wrap); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_CreateUserVisual(IDirect3DRM3 *iface, + D3DRMUSERVISUALCALLBACK cb, void *ctx, IDirect3DRMUserVisual **visual) +{ + FIXME("iface %p, cb %p, ctx %p, visual %p stub!\n", iface, cb, ctx, visual); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_LoadTexture(IDirect3DRM3 *iface, + const char *filename, IDirect3DRMTexture3 **texture) +{ + FIXME("iface %p, filename %s, texture %p stub!\n", iface, debugstr_a(filename), texture); + + return Direct3DRMTexture_create(&IID_IDirect3DRMTexture3, (IUnknown **)texture); +} + +static HRESULT WINAPI d3drm3_LoadTextureFromResource(IDirect3DRM3 *iface, HMODULE module, + const char *resource_name, const char *resource_type, IDirect3DRMTexture3 **texture) +{ + FIXME("iface %p, module %p, resource_name %s, resource_type %s, texture %p stub!\n", + iface, module, debugstr_a(resource_name), debugstr_a(resource_type), texture); + + return Direct3DRMTexture_create(&IID_IDirect3DRMTexture3, (IUnknown **)texture); +} + +static HRESULT WINAPI d3drm3_SetSearchPath(IDirect3DRM3 *iface, const char *path) +{ + FIXME("iface %p, path %s stub!\n", iface, debugstr_a(path)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_AddSearchPath(IDirect3DRM3 *iface, const char *path) +{ + FIXME("iface %p, path %s stub!\n", iface, debugstr_a(path)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_GetSearchPath(IDirect3DRM3 *iface, DWORD *size, char *path) +{ + FIXME("iface %p, size %p, path %p stub!\n", iface, size, path); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_SetDefaultTextureColors(IDirect3DRM3 *iface, DWORD color_count) +{ + FIXME("iface %p, color_count %u stub!\n", iface, color_count); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_SetDefaultTextureShades(IDirect3DRM3 *iface, DWORD shade_count) +{ + FIXME("iface %p, shade_count %u stub!\n", iface, shade_count); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_GetDevices(IDirect3DRM3 *iface, IDirect3DRMDeviceArray **array) +{ + FIXME("iface %p, array %p stub!\n", iface, array); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_GetNamedObject(IDirect3DRM3 *iface, + const char *name, IDirect3DRMObject **object) +{ + FIXME("iface %p, name %s, object %p stub!\n", iface, debugstr_a(name), object); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_EnumerateObjects(IDirect3DRM3 *iface, D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT load_data(IDirect3DRM3 *iface, IDirectXFileData *data_object, IID **GUIDs, DWORD nb_GUIDs, D3DRMLOADCALLBACK LoadProc, + void *ArgLP, D3DRMLOADTEXTURECALLBACK LoadTextureProc, void *ArgLTP, IDirect3DRMFrame3 *parent_frame) +{ + HRESULT ret = D3DRMERR_BADOBJECT; + HRESULT hr; + const GUID* guid; + DWORD i; + BOOL requested = FALSE; + + hr = IDirectXFileData_GetType(data_object, &guid); + if (hr != DXFILE_OK) + goto end; + + TRACE("Found object type whose GUID = %s\n", debugstr_guid(guid)); + + /* Load object only if it is top level and requested or if it is part of another object */ + + if (IsEqualGUID(guid, &TID_D3DRMMesh)) + { + TRACE("Found TID_D3DRMMesh\n"); + + for (i = 0; i < nb_GUIDs; i++) + if (IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMeshBuilder) || + IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMeshBuilder2) || + IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMeshBuilder3)) + { + requested = TRUE; + break; + } + + if (requested || parent_frame) + { + IDirect3DRMMeshBuilder3 *meshbuilder; + + TRACE("Load mesh data\n"); + + hr = IDirect3DRM3_CreateMeshBuilder(iface, &meshbuilder); + if (SUCCEEDED(hr)) + { + hr = load_mesh_data(meshbuilder, data_object, LoadTextureProc, ArgLTP); + if (SUCCEEDED(hr)) + { + /* Only top level objects are notified */ + if (!parent_frame) + { + IDirect3DRMObject *object; + + hr = IDirect3DRMMeshBuilder3_QueryInterface(meshbuilder, GUIDs[i], (void**)&object); + if (SUCCEEDED(hr)) + { + LoadProc(object, GUIDs[i], ArgLP); + IDirect3DRMObject_Release(object); + } + } + else + { + IDirect3DRMFrame3_AddVisual(parent_frame, (IUnknown*)meshbuilder); + } + } + IDirect3DRMMeshBuilder3_Release(meshbuilder); + } + + if (FAILED(hr)) + ERR("Cannot process mesh\n"); + } + } + else if (IsEqualGUID(guid, &TID_D3DRMFrame)) + { + TRACE("Found TID_D3DRMFrame\n"); + + for (i = 0; i < nb_GUIDs; i++) + if (IsEqualGUID(GUIDs[i], &IID_IDirect3DRMFrame) || + IsEqualGUID(GUIDs[i], &IID_IDirect3DRMFrame2) || + IsEqualGUID(GUIDs[i], &IID_IDirect3DRMFrame3)) + { + requested = TRUE; + break; + } + + if (requested || parent_frame) + { + IDirect3DRMFrame3 *frame; + + TRACE("Load frame data\n"); + + hr = IDirect3DRM3_CreateFrame(iface, parent_frame, &frame); + if (SUCCEEDED(hr)) + { + IDirectXFileObject *child; + + while (SUCCEEDED(hr = IDirectXFileData_GetNextObject(data_object, &child))) + { + IDirectXFileData *data; + IDirectXFileDataReference *reference; + IDirectXFileBinary *binary; + + hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileBinary, (void **)&binary); + if (SUCCEEDED(hr)) + { + FIXME("Binary Object not supported yet\n"); + IDirectXFileBinary_Release(binary); + continue; + } + + hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileData, (void **)&data); + if (SUCCEEDED(hr)) + { + TRACE("Found Data Object\n"); + hr = load_data(iface, data, GUIDs, nb_GUIDs, LoadProc, ArgLP, LoadTextureProc, ArgLTP, frame); + IDirectXFileData_Release(data); + continue; + } + hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileDataReference, (void **)&reference); + if (SUCCEEDED(hr)) + { + TRACE("Found Data Object Reference\n"); + IDirectXFileDataReference_Resolve(reference, &data); + hr = load_data(iface, data, GUIDs, nb_GUIDs, LoadProc, ArgLP, LoadTextureProc, ArgLTP, frame); + IDirectXFileData_Release(data); + IDirectXFileDataReference_Release(reference); + continue; + } + } + + if (hr != DXFILEERR_NOMOREOBJECTS) + { + IDirect3DRMFrame3_Release(frame); + goto end; + } + hr = S_OK; + + /* Only top level objects are notified */ + if (!parent_frame) + { + IDirect3DRMObject *object; + + hr = IDirect3DRMFrame3_QueryInterface(frame, GUIDs[i], (void**)&object); + if (SUCCEEDED(hr)) + { + LoadProc(object, GUIDs[i], ArgLP); + IDirect3DRMObject_Release(object); + } + } + IDirect3DRMFrame3_Release(frame); + } + + if (FAILED(hr)) + ERR("Cannot process frame\n"); + } + } + else if (IsEqualGUID(guid, &TID_D3DRMMaterial)) + { + TRACE("Found TID_D3DRMMaterial\n"); + + /* Cannot be requested so nothing to do */ + } + else if (IsEqualGUID(guid, &TID_D3DRMFrameTransformMatrix)) + { + TRACE("Found TID_D3DRMFrameTransformMatrix\n"); + + /* Cannot be requested */ + if (parent_frame) + { + D3DRMMATRIX4D matrix; + DWORD size; + + TRACE("Load Frame Transform Matrix data\n"); + + size = sizeof(matrix); + hr = IDirectXFileData_GetData(data_object, NULL, &size, (void**)matrix); + if ((hr != DXFILE_OK) || (size != sizeof(matrix))) + goto end; + + hr = IDirect3DRMFrame3_AddTransform(parent_frame, D3DRMCOMBINE_REPLACE, matrix); + if (FAILED(hr)) + goto end; + } + } + else + { + FIXME("Found unknown TID %s\n", debugstr_guid(guid)); + } + + ret = D3DRM_OK; + +end: + + return ret; +} + +static HRESULT WINAPI d3drm3_Load(IDirect3DRM3 *iface, void *source, void *object_id, IID **iids, + DWORD iid_count, D3DRMLOADOPTIONS flags, D3DRMLOADCALLBACK load_cb, void *load_ctx, + D3DRMLOADTEXTURECALLBACK load_tex_cb, void *load_tex_ctx, IDirect3DRMFrame3 *parent_frame) +{ + DXFILELOADOPTIONS load_options; + IDirectXFile *file = NULL; + IDirectXFileEnumObject *enum_object = NULL; + IDirectXFileData *data = NULL; + HRESULT hr; + const GUID* pGuid; + DWORD size; + struct d3drm_file_header *header; + HRESULT ret = D3DRMERR_BADOBJECT; + DWORD i; + + TRACE("iface %p, source %p, object_id %p, iids %p, iid_count %u, flags %#x, " + "load_cb %p, load_ctx %p, load_tex_cb %p, load_tex_ctx %p, parent_frame %p.\n", + iface, source, object_id, iids, iid_count, flags, + load_cb, load_ctx, load_tex_cb, load_tex_ctx, parent_frame); + + TRACE("Looking for GUIDs:\n"); + for (i = 0; i < iid_count; ++i) + TRACE("- %s (%s)\n", debugstr_guid(iids[i]), get_IID_string(iids[i])); + + if (flags == D3DRMLOAD_FROMMEMORY) + { + load_options = DXFILELOAD_FROMMEMORY; + } + else if (flags == D3DRMLOAD_FROMFILE) + { + load_options = DXFILELOAD_FROMFILE; + TRACE("Loading from file %s\n", debugstr_a(source)); + } + else + { + FIXME("Load options %#x not supported yet.\n", flags); + return E_NOTIMPL; + } + + hr = DirectXFileCreate(&file); + if (hr != DXFILE_OK) + goto end; + + hr = IDirectXFile_RegisterTemplates(file, templates, strlen(templates)); + if (hr != DXFILE_OK) + goto end; + + hr = IDirectXFile_CreateEnumObject(file, source, load_options, &enum_object); + if (hr != DXFILE_OK) + goto end; + + hr = IDirectXFileEnumObject_GetNextDataObject(enum_object, &data); + if (hr != DXFILE_OK) + goto end; + + hr = IDirectXFileData_GetType(data, &pGuid); + if (hr != DXFILE_OK) + goto end; + + TRACE("Found object type whose GUID = %s\n", debugstr_guid(pGuid)); + + if (!IsEqualGUID(pGuid, &TID_DXFILEHeader)) + { + ret = D3DRMERR_BADFILE; + goto end; + } + + hr = IDirectXFileData_GetData(data, NULL, &size, (void **)&header); + if ((hr != DXFILE_OK) || (size != sizeof(*header))) + goto end; + + TRACE("Version is %u.%u, flags %#x.\n", header->major, header->minor, header->flags); + + /* Version must be 1.0.x */ + if ((header->major != 1) || (header->minor != 0)) + { + ret = D3DRMERR_BADFILE; + goto end; + } + + IDirectXFileData_Release(data); + data = NULL; + + while (1) + { + hr = IDirectXFileEnumObject_GetNextDataObject(enum_object, &data); + if (hr == DXFILEERR_NOMOREOBJECTS) + { + TRACE("No more object\n"); + break; + } + else if (hr != DXFILE_OK) + { + ret = D3DRMERR_BADFILE; + goto end; + } + + ret = load_data(iface, data, iids, iid_count, load_cb, load_ctx, load_tex_cb, load_tex_ctx, parent_frame); + if (ret != D3DRM_OK) + goto end; + + IDirectXFileData_Release(data); + data = NULL; + } + + ret = D3DRM_OK; + +end: + if (data) + IDirectXFileData_Release(data); + if (enum_object) + IDirectXFileEnumObject_Release(enum_object); + if (file) + IDirectXFile_Release(file); + + return ret; +} + +static HRESULT WINAPI d3drm3_Tick(IDirect3DRM3 *iface, D3DVALUE tick) +{ + FIXME("iface %p, tick %.8e stub!\n", iface, tick); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_CreateProgressiveMesh(IDirect3DRM3 *iface, IDirect3DRMProgressiveMesh **mesh) +{ + FIXME("iface %p, mesh %p stub!\n", iface, mesh); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_RegisterClient(IDirect3DRM3 *iface, REFGUID guid, DWORD *id) +{ + FIXME("iface %p, guid %s, id %p stub!\n", iface, debugstr_guid(guid), id); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_UnregisterClient(IDirect3DRM3 *iface, REFGUID guid) +{ + FIXME("iface %p, guid %s stub!\n", iface, debugstr_guid(guid)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_CreateClippedVisual(IDirect3DRM3 *iface, + IDirect3DRMVisual *visual, IDirect3DRMClippedVisual **clipped_visual) +{ + FIXME("iface %p, visual %p, clipped_visual %p stub!\n", iface, visual, clipped_visual); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_SetOptions(IDirect3DRM3 *iface, DWORD flags) +{ + FIXME("iface %p, flags %#x stub!\n", iface, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm3_GetOptions(IDirect3DRM3 *iface, DWORD *flags) +{ + FIXME("iface %p, flags %p stub!\n", iface, flags); + + return E_NOTIMPL; +} + +static const struct IDirect3DRM3Vtbl d3drm3_vtbl = +{ + d3drm3_QueryInterface, + d3drm3_AddRef, + d3drm3_Release, + d3drm3_CreateObject, + d3drm3_CreateFrame, + d3drm3_CreateMesh, + d3drm3_CreateMeshBuilder, + d3drm3_CreateFace, + d3drm3_CreateAnimation, + d3drm3_CreateAnimationSet, + d3drm3_CreateTexture, + d3drm3_CreateLight, + d3drm3_CreateLightRGB, + d3drm3_CreateMaterial, + d3drm3_CreateDevice, + d3drm3_CreateDeviceFromSurface, + d3drm3_CreateDeviceFromD3D, + d3drm3_CreateDeviceFromClipper, + d3drm3_CreateTextureFromSurface, + d3drm3_CreateShadow, + d3drm3_CreateViewport, + d3drm3_CreateWrap, + d3drm3_CreateUserVisual, + d3drm3_LoadTexture, + d3drm3_LoadTextureFromResource, + d3drm3_SetSearchPath, + d3drm3_AddSearchPath, + d3drm3_GetSearchPath, + d3drm3_SetDefaultTextureColors, + d3drm3_SetDefaultTextureShades, + d3drm3_GetDevices, + d3drm3_GetNamedObject, + d3drm3_EnumerateObjects, + d3drm3_Load, + d3drm3_Tick, + d3drm3_CreateProgressiveMesh, + d3drm3_RegisterClient, + d3drm3_UnregisterClient, + d3drm3_CreateClippedVisual, + d3drm3_SetOptions, + d3drm3_GetOptions, +}; + +HRESULT WINAPI Direct3DRMCreate(IDirect3DRM **d3drm) +{ + struct d3drm *object; + + TRACE("d3drm %p.\n", d3drm); + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + object->IDirect3DRM_iface.lpVtbl = &d3drm1_vtbl; + object->IDirect3DRM2_iface.lpVtbl = &d3drm2_vtbl; + object->IDirect3DRM3_iface.lpVtbl = &d3drm3_vtbl; + object->ref = 1; + + *d3drm = &object->IDirect3DRM_iface; + + return S_OK; +} diff --git a/dll/directx/wine/d3drm/d3drm.spec b/dll/directx/wine/d3drm/d3drm.spec new file mode 100644 index 00000000000..4108a72eed0 --- /dev/null +++ b/dll/directx/wine/d3drm/d3drm.spec @@ -0,0 +1,23 @@ +@ stdcall D3DRMColorGetAlpha(long) +@ stdcall D3DRMColorGetBlue(long) +@ stdcall D3DRMColorGetGreen(long) +@ stdcall D3DRMColorGetRed(long) +@ stdcall D3DRMCreateColorRGB(float float float) +@ stdcall D3DRMCreateColorRGBA(float float float float) +@ stdcall D3DRMMatrixFromQuaternion(ptr ptr) +@ stdcall D3DRMQuaternionFromRotation(ptr ptr float) +@ stdcall D3DRMQuaternionMultiply(ptr ptr ptr) +@ stdcall D3DRMQuaternionSlerp(ptr ptr ptr float) +@ stdcall D3DRMVectorAdd(ptr ptr ptr) +@ stdcall D3DRMVectorCrossProduct(ptr ptr ptr) +@ stdcall D3DRMVectorDotProduct(ptr ptr) +@ stdcall D3DRMVectorModulus(ptr) +@ stdcall D3DRMVectorNormalize(ptr) +@ stdcall D3DRMVectorRandom(ptr) +@ stdcall D3DRMVectorReflect(ptr ptr ptr) +@ stdcall D3DRMVectorRotate(ptr ptr ptr float) +@ stdcall D3DRMVectorScale(ptr ptr float) +@ stdcall D3DRMVectorSubtract(ptr ptr ptr) +@ stdcall Direct3DRMCreate(ptr) +@ stub DllCanUnloadNow +@ stub DllGetClassObject diff --git a/dll/directx/wine/d3drm/d3drm_main.c b/dll/directx/wine/d3drm/d3drm_main.c new file mode 100644 index 00000000000..888d8661dc1 --- /dev/null +++ b/dll/directx/wine/d3drm/d3drm_main.c @@ -0,0 +1,36 @@ +/* + * Copyright 2004 Ivan Leo Puoti + * Copyright 2010 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 "d3drm_private.h" + +/*********************************************************************** + * DllMain (D3DRM.@) + */ +BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved) +{ + switch(reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls( inst ); + break; + } + return TRUE; +} diff --git a/dll/directx/wine/d3drm/d3drm_private.h b/dll/directx/wine/d3drm/d3drm_private.h new file mode 100644 index 00000000000..777fe6869aa --- /dev/null +++ b/dll/directx/wine/d3drm/d3drm_private.h @@ -0,0 +1,63 @@ +/* + * Direct3DRM private interfaces (D3DRM.DLL) + * + * Copyright 2010 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 + */ + +#ifndef __D3DRM_PRIVATE_INCLUDED__ +#define __D3DRM_PRIVATE_INCLUDED__ + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#define COBJMACROS +#define NONAMELESSUNION + +#include +#include +#include +#include +#include +#include + +#include +WINE_DEFAULT_DEBUG_CHANNEL(d3drm); + +HRESULT Direct3DRMDevice_create(REFIID riid, IUnknown** ppObj) DECLSPEC_HIDDEN; +HRESULT Direct3DRMFace_create(REFIID riid, IUnknown** ret_iface) DECLSPEC_HIDDEN; +HRESULT Direct3DRMFrame_create(REFIID riid, IUnknown* parent_frame, IUnknown** ret_iface) DECLSPEC_HIDDEN; +HRESULT Direct3DRMLight_create(IUnknown** ppObj) DECLSPEC_HIDDEN; +HRESULT Direct3DRMMesh_create(IDirect3DRMMesh** obj) DECLSPEC_HIDDEN; +HRESULT Direct3DRMMeshBuilder_create(REFIID riid, IUnknown** ppObj) DECLSPEC_HIDDEN; +HRESULT Direct3DRMViewport_create(REFIID riid, IUnknown** ppObj) DECLSPEC_HIDDEN; +HRESULT Direct3DRMMaterial_create(IDirect3DRMMaterial2** ret_iface) DECLSPEC_HIDDEN; +HRESULT Direct3DRMTexture_create(REFIID riid, IUnknown** ret_iface) DECLSPEC_HIDDEN; + +HRESULT load_mesh_data(IDirect3DRMMeshBuilder3 *iface, IDirectXFileData *data, + D3DRMLOADTEXTURECALLBACK load_texture_proc, void *arg) DECLSPEC_HIDDEN; + +struct d3drm_file_header +{ + WORD major; + WORD minor; + DWORD flags; +}; + +extern char templates[]; + +#endif /* __D3DRM_PRIVATE_INCLUDED__ */ diff --git a/dll/directx/wine/d3drm/device.c b/dll/directx/wine/d3drm/device.c new file mode 100644 index 00000000000..9b0157563ec --- /dev/null +++ b/dll/directx/wine/d3drm/device.c @@ -0,0 +1,984 @@ +/* + * Implementation of IDirect3DRMDevice Interface + * + * Copyright 2011, 2012 AndrĂ© Hentschel + * + * This file contains the (internal) driver registration functions, + * driver enumeration APIs and DirectDraw creation functions. + * + * 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 "d3drm_private.h" + +#include + +struct d3drm_device +{ + IDirect3DRMDevice2 IDirect3DRMDevice2_iface; + IDirect3DRMDevice3 IDirect3DRMDevice3_iface; + IDirect3DRMWinDevice IDirect3DRMWinDevice_iface; + LONG ref; + BOOL dither; + D3DRMRENDERQUALITY quality; + DWORD rendermode; + DWORD height; + DWORD width; +}; + +static inline struct d3drm_device *impl_from_IDirect3DRMDevice2(IDirect3DRMDevice2 *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMDevice2_iface); +} + +static inline struct d3drm_device *impl_from_IDirect3DRMDevice3(IDirect3DRMDevice3 *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMDevice3_iface); +} + +static inline struct d3drm_device *impl_from_IDirect3DRMWinDevice(IDirect3DRMWinDevice *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMWinDevice_iface); +} + +static HRESULT WINAPI d3drm_device2_QueryInterface(IDirect3DRMDevice2 *iface, REFIID riid, void **out) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); + + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualGUID(riid, &IID_IDirect3DRMDevice2) + || IsEqualGUID(riid, &IID_IDirect3DRMDevice) + || IsEqualGUID(riid, &IID_IUnknown)) + { + *out = &device->IDirect3DRMDevice2_iface; + } + else if (IsEqualGUID(riid, &IID_IDirect3DRMDevice3)) + { + *out = &device->IDirect3DRMDevice3_iface; + } + else if (IsEqualGUID(riid, &IID_IDirect3DRMWinDevice)) + { + *out = &device->IDirect3DRMWinDevice_iface; + } + else + { + *out = NULL; + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static ULONG WINAPI d3drm_device2_AddRef(IDirect3DRMDevice2 *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); + ULONG refcount = InterlockedIncrement(&device->ref); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI d3drm_device2_Release(IDirect3DRMDevice2 *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); + ULONG refcount = InterlockedDecrement(&device->ref); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + HeapFree(GetProcessHeap(), 0, device); + + return refcount; +} + +static HRESULT WINAPI d3drm_device2_Clone(IDirect3DRMDevice2 *iface, + IUnknown *outer, REFIID iid, void **out) +{ + FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device2_AddDestroyCallback(IDirect3DRMDevice2 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device2_DeleteDestroyCallback(IDirect3DRMDevice2 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device2_SetAppData(IDirect3DRMDevice2 *iface, DWORD data) +{ + FIXME("iface %p, data %#x stub!\n", iface, data); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_device2_GetAppData(IDirect3DRMDevice2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static HRESULT WINAPI d3drm_device2_SetName(IDirect3DRMDevice2 *iface, const char *name) +{ + FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device2_GetName(IDirect3DRMDevice2 *iface, DWORD *size, char *name) +{ + FIXME("iface %p, size %p, name %p stub!\n", iface, size, name); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device2_GetClassName(IDirect3DRMDevice2 *iface, DWORD *size, char *name) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); + + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + return IDirect3DRMDevice3_GetClassName(&device->IDirect3DRMDevice3_iface, size, name); +} + +static HRESULT WINAPI d3drm_device2_Init(IDirect3DRMDevice2 *iface, ULONG width, ULONG height) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); + + TRACE("iface %p, width %u, height %u.\n", iface, width, height); + + return IDirect3DRMDevice3_Init(&device->IDirect3DRMDevice3_iface, width, height); +} + +static HRESULT WINAPI d3drm_device2_InitFromD3D(IDirect3DRMDevice2 *iface, + IDirect3D *d3d, IDirect3DDevice *d3d_device) +{ + FIXME("iface %p, d3d %p, d3d_device %p stub!\n", iface, d3d, d3d_device); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device2_InitFromClipper(IDirect3DRMDevice2 *iface, + IDirectDrawClipper *clipper, GUID *guid, int width, int height) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); + + TRACE("iface %p, clipper %p, guid %s, width %d, height %d.\n", + iface, clipper, debugstr_guid(guid), width, height); + + return IDirect3DRMDevice3_InitFromClipper(&device->IDirect3DRMDevice3_iface, + clipper, guid, width, height); +} + +static HRESULT WINAPI d3drm_device2_Update(IDirect3DRMDevice2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_device2_AddUpdateCallback(IDirect3DRMDevice2 *iface, + D3DRMUPDATECALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device2_DeleteUpdateCallback(IDirect3DRMDevice2 *iface, + D3DRMUPDATECALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device2_SetBufferCount(IDirect3DRMDevice2 *iface, DWORD count) +{ + FIXME("iface %p, count %u.\n", iface, count); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_device2_GetBufferCount(IDirect3DRMDevice2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device2_SetDither(IDirect3DRMDevice2 *iface, BOOL enable) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); + + TRACE("iface %p, enabled %#x.\n", iface, enable); + + return IDirect3DRMDevice3_SetDither(&device->IDirect3DRMDevice3_iface, enable); +} + +static HRESULT WINAPI d3drm_device2_SetShades(IDirect3DRMDevice2 *iface, DWORD count) +{ + FIXME("iface %p, count %u stub!\n", iface, count); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device2_SetQuality(IDirect3DRMDevice2 *iface, D3DRMRENDERQUALITY quality) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); + + TRACE("iface %p, quality %u.\n", iface, quality); + + return IDirect3DRMDevice3_SetQuality(&device->IDirect3DRMDevice3_iface, quality); +} + +static HRESULT WINAPI d3drm_device2_SetTextureQuality(IDirect3DRMDevice2 *iface, D3DRMTEXTUREQUALITY quality) +{ + FIXME("iface %p, quality %u stub!\n", iface, quality); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device2_GetViewports(IDirect3DRMDevice2 *iface, IDirect3DRMViewportArray **array) +{ + FIXME("iface %p, array %p stub!\n", iface, array); + + return E_NOTIMPL; +} + +static BOOL WINAPI d3drm_device2_GetDither(IDirect3DRMDevice2 *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetDither(&device->IDirect3DRMDevice3_iface); +} + +static DWORD WINAPI d3drm_device2_GetShades(IDirect3DRMDevice2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_device2_GetHeight(IDirect3DRMDevice2 *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetHeight(&device->IDirect3DRMDevice3_iface); +} + +static DWORD WINAPI d3drm_device2_GetWidth(IDirect3DRMDevice2 *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetWidth(&device->IDirect3DRMDevice3_iface); +} + +static DWORD WINAPI d3drm_device2_GetTrianglesDrawn(IDirect3DRMDevice2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_device2_GetWireframeOptions(IDirect3DRMDevice2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static D3DRMRENDERQUALITY WINAPI d3drm_device2_GetQuality(IDirect3DRMDevice2 *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetQuality(&device->IDirect3DRMDevice3_iface); +} + +static D3DCOLORMODEL WINAPI d3drm_device2_GetColorModel(IDirect3DRMDevice2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static D3DRMTEXTUREQUALITY WINAPI d3drm_device2_GetTextureQuality(IDirect3DRMDevice2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device2_GetDirect3DDevice(IDirect3DRMDevice2 *iface, IDirect3DDevice **d3d_device) +{ + FIXME("iface %p, d3d_device %p stub!\n", iface, d3d_device); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device2_InitFromD3D2(IDirect3DRMDevice2 *iface, + IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device) +{ + FIXME("iface %p, d3d %p, d3d_device %p stub!\n", iface, d3d, d3d_device); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device2_InitFromSurface(IDirect3DRMDevice2 *iface, + GUID *guid, IDirectDraw *ddraw, IDirectDrawSurface *backbuffer) +{ + FIXME("iface %p, guid %s, ddraw %p, backbuffer %p stub!\n", + iface, debugstr_guid(guid), ddraw, backbuffer); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device2_SetRenderMode(IDirect3DRMDevice2 *iface, DWORD flags) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); + + TRACE("iface %p, flags %#x.\n", iface, flags); + + return IDirect3DRMDevice3_SetRenderMode(&device->IDirect3DRMDevice3_iface, flags); +} + +static DWORD WINAPI d3drm_device2_GetRenderMode(IDirect3DRMDevice2 *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMDevice3_GetRenderMode(&device->IDirect3DRMDevice3_iface); +} + +static HRESULT WINAPI d3drm_device2_GetDirect3DDevice2(IDirect3DRMDevice2 *iface, IDirect3DDevice2 **d3d_device) +{ + FIXME("iface %p, d3d_device %p stub!\n", iface, d3d_device); + + return E_NOTIMPL; +} + +static const struct IDirect3DRMDevice2Vtbl d3drm_device2_vtbl = +{ + d3drm_device2_QueryInterface, + d3drm_device2_AddRef, + d3drm_device2_Release, + d3drm_device2_Clone, + d3drm_device2_AddDestroyCallback, + d3drm_device2_DeleteDestroyCallback, + d3drm_device2_SetAppData, + d3drm_device2_GetAppData, + d3drm_device2_SetName, + d3drm_device2_GetName, + d3drm_device2_GetClassName, + d3drm_device2_Init, + d3drm_device2_InitFromD3D, + d3drm_device2_InitFromClipper, + d3drm_device2_Update, + d3drm_device2_AddUpdateCallback, + d3drm_device2_DeleteUpdateCallback, + d3drm_device2_SetBufferCount, + d3drm_device2_GetBufferCount, + d3drm_device2_SetDither, + d3drm_device2_SetShades, + d3drm_device2_SetQuality, + d3drm_device2_SetTextureQuality, + d3drm_device2_GetViewports, + d3drm_device2_GetDither, + d3drm_device2_GetShades, + d3drm_device2_GetHeight, + d3drm_device2_GetWidth, + d3drm_device2_GetTrianglesDrawn, + d3drm_device2_GetWireframeOptions, + d3drm_device2_GetQuality, + d3drm_device2_GetColorModel, + d3drm_device2_GetTextureQuality, + d3drm_device2_GetDirect3DDevice, + d3drm_device2_InitFromD3D2, + d3drm_device2_InitFromSurface, + d3drm_device2_SetRenderMode, + d3drm_device2_GetRenderMode, + d3drm_device2_GetDirect3DDevice2, +}; + +static HRESULT WINAPI d3drm_device3_QueryInterface(IDirect3DRMDevice3 *iface, REFIID riid, void **out) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface); + + return d3drm_device2_QueryInterface(&device->IDirect3DRMDevice2_iface, riid, out); +} + +static ULONG WINAPI d3drm_device3_AddRef(IDirect3DRMDevice3 *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface); + + return d3drm_device2_AddRef(&device->IDirect3DRMDevice2_iface); +} + +static ULONG WINAPI d3drm_device3_Release(IDirect3DRMDevice3 *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface); + + return d3drm_device2_Release(&device->IDirect3DRMDevice2_iface); +} + +static HRESULT WINAPI d3drm_device3_Clone(IDirect3DRMDevice3 *iface, + IUnknown *outer, REFIID iid, void **out) +{ + FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_AddDestroyCallback(IDirect3DRMDevice3 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_DeleteDestroyCallback(IDirect3DRMDevice3 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_SetAppData(IDirect3DRMDevice3 *iface, DWORD data) +{ + FIXME("iface %p, data %#x stub!\n", iface, data); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_device3_GetAppData(IDirect3DRMDevice3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static HRESULT WINAPI d3drm_device3_SetName(IDirect3DRMDevice3 *iface, const char *name) +{ + FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_GetName(IDirect3DRMDevice3 *iface, DWORD *size, char *name) +{ + FIXME("iface %p, size %p, name %p stub!\n", iface, size, name); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_GetClassName(IDirect3DRMDevice3 *iface, DWORD *size, char *name) +{ + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + if (!size || *size < strlen("Device") || !name) + return E_INVALIDARG; + + strcpy(name, "Device"); + *size = sizeof("Device"); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_device3_Init(IDirect3DRMDevice3 *iface, ULONG width, ULONG height) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface); + + FIXME("iface %p, width %u, height %u stub!\n", iface, width, height); + + device->height = height; + device->width = width; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_device3_InitFromD3D(IDirect3DRMDevice3 *iface, + IDirect3D *d3d, IDirect3DDevice *d3d_device) +{ + FIXME("iface %p, d3d %p, d3d_device %p stub!\n", iface, d3d, d3d_device); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_InitFromClipper(IDirect3DRMDevice3 *iface, + IDirectDrawClipper *clipper, GUID *guid, int width, int height) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface); + + FIXME("iface %p, clipper %p, guid %s, width %d, height %d stub!\n", + iface, clipper, debugstr_guid(guid), width, height); + + device->height = height; + device->width = width; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_device3_Update(IDirect3DRMDevice3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_device3_AddUpdateCallback(IDirect3DRMDevice3 *iface, + D3DRMUPDATECALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_DeleteUpdateCallback(IDirect3DRMDevice3 *iface, + D3DRMUPDATECALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_SetBufferCount(IDirect3DRMDevice3 *iface, DWORD count) +{ + FIXME("iface %p, count %u stub!\n", iface, count); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_device3_GetBufferCount(IDirect3DRMDevice3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_SetDither(IDirect3DRMDevice3 *iface, BOOL enable) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface); + + TRACE("iface %p, enable %#x.\n", iface, enable); + + device->dither = enable; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_device3_SetShades(IDirect3DRMDevice3 *iface, DWORD count) +{ + FIXME("iface %p, count %u stub!\n", iface, count); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_SetQuality(IDirect3DRMDevice3 *iface, D3DRMRENDERQUALITY quality) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface); + + TRACE("iface %p, quality %u.\n", iface, quality); + + device->quality = quality; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_device3_SetTextureQuality(IDirect3DRMDevice3 *iface, D3DRMTEXTUREQUALITY quality) +{ + FIXME("iface %p, quality %u stub!\n", iface, quality); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_GetViewports(IDirect3DRMDevice3 *iface, IDirect3DRMViewportArray **array) +{ + FIXME("iface %p, array %p stub!\n", iface, array); + + return E_NOTIMPL; +} + +static BOOL WINAPI d3drm_device3_GetDither(IDirect3DRMDevice3 *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface); + + TRACE("iface %p.\n", iface); + + return device->dither; +} + +static DWORD WINAPI d3drm_device3_GetShades(IDirect3DRMDevice3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_device3_GetHeight(IDirect3DRMDevice3 *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface); + + TRACE("iface %p.\n", iface); + + return device->height; +} + +static DWORD WINAPI d3drm_device3_GetWidth(IDirect3DRMDevice3 *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface); + + TRACE("iface %p.\n", iface); + + return device->width; +} + +static DWORD WINAPI d3drm_device3_GetTrianglesDrawn(IDirect3DRMDevice3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_device3_GetWireframeOptions(IDirect3DRMDevice3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static D3DRMRENDERQUALITY WINAPI d3drm_device3_GetQuality(IDirect3DRMDevice3 *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface); + + TRACE("iface %p.\n", iface); + + return device->quality; +} + +static D3DCOLORMODEL WINAPI d3drm_device3_GetColorModel(IDirect3DRMDevice3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static D3DRMTEXTUREQUALITY WINAPI d3drm_device3_GetTextureQuality(IDirect3DRMDevice3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_GetDirect3DDevice(IDirect3DRMDevice3 *iface, IDirect3DDevice **d3d_device) +{ + FIXME("iface %p, d3d_device %p stub!\n", iface, d3d_device); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_InitFromD3D2(IDirect3DRMDevice3 *iface, + IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device) +{ + FIXME("iface %p, d3d %p, d3d_device %p stub!\n", iface, d3d, d3d_device); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_InitFromSurface(IDirect3DRMDevice3 *iface, + GUID *guid, IDirectDraw *ddraw, IDirectDrawSurface *backbuffer) +{ + FIXME("iface %p, guid %s, ddraw %p, backbuffer %p stub!\n", + iface, debugstr_guid(guid), ddraw, backbuffer); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_SetRenderMode(IDirect3DRMDevice3 *iface, DWORD flags) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface); + + TRACE("iface %p, flags %#x.\n", iface, flags); + + device->rendermode = flags; + + return D3DRM_OK; +} + +static DWORD WINAPI d3drm_device3_GetRenderMode(IDirect3DRMDevice3 *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface); + + TRACE("iface %p.\n", iface); + + return device->rendermode; +} + +static HRESULT WINAPI d3drm_device3_GetDirect3DDevice2(IDirect3DRMDevice3 *iface, IDirect3DDevice2 **d3d_device) +{ + FIXME("iface %p, d3d_device %p stub!\n", iface, d3d_device); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_FindPreferredTextureFormat(IDirect3DRMDevice3 *iface, + DWORD bitdepths, DWORD flags, DDPIXELFORMAT *pf) +{ + FIXME("iface %p, bitdepths %u, flags %#x, pf %p stub!\n", iface, bitdepths, flags, pf); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_RenderStateChange(IDirect3DRMDevice3 *iface, + D3DRENDERSTATETYPE state, DWORD value, DWORD flags) +{ + FIXME("iface %p, state %#x, value %#x, flags %#x stub!\n", iface, state, value, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_LightStateChange(IDirect3DRMDevice3 *iface, + D3DLIGHTSTATETYPE state, DWORD value, DWORD flags) +{ + FIXME("iface %p, state %#x, value %#x, flags %#x stub!\n", iface, state, value, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_GetStateChangeOptions(IDirect3DRMDevice3 *iface, + DWORD state_class, DWORD state_idx, DWORD *flags) +{ + FIXME("iface %p, state_class %#x, state_idx %#x, flags %p stub!\n", + iface, state_class, state_idx, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device3_SetStateChangeOptions(IDirect3DRMDevice3 *iface, + DWORD state_class, DWORD state_idx, DWORD flags) +{ + FIXME("iface %p, state_class %#x, state_idx %#x, flags %#x stub!\n", + iface, state_class, state_idx, flags); + + return E_NOTIMPL; +} + +static const struct IDirect3DRMDevice3Vtbl d3drm_device3_vtbl = +{ + d3drm_device3_QueryInterface, + d3drm_device3_AddRef, + d3drm_device3_Release, + d3drm_device3_Clone, + d3drm_device3_AddDestroyCallback, + d3drm_device3_DeleteDestroyCallback, + d3drm_device3_SetAppData, + d3drm_device3_GetAppData, + d3drm_device3_SetName, + d3drm_device3_GetName, + d3drm_device3_GetClassName, + d3drm_device3_Init, + d3drm_device3_InitFromD3D, + d3drm_device3_InitFromClipper, + d3drm_device3_Update, + d3drm_device3_AddUpdateCallback, + d3drm_device3_DeleteUpdateCallback, + d3drm_device3_SetBufferCount, + d3drm_device3_GetBufferCount, + d3drm_device3_SetDither, + d3drm_device3_SetShades, + d3drm_device3_SetQuality, + d3drm_device3_SetTextureQuality, + d3drm_device3_GetViewports, + d3drm_device3_GetDither, + d3drm_device3_GetShades, + d3drm_device3_GetHeight, + d3drm_device3_GetWidth, + d3drm_device3_GetTrianglesDrawn, + d3drm_device3_GetWireframeOptions, + d3drm_device3_GetQuality, + d3drm_device3_GetColorModel, + d3drm_device3_GetTextureQuality, + d3drm_device3_GetDirect3DDevice, + d3drm_device3_InitFromD3D2, + d3drm_device3_InitFromSurface, + d3drm_device3_SetRenderMode, + d3drm_device3_GetRenderMode, + d3drm_device3_GetDirect3DDevice2, + d3drm_device3_FindPreferredTextureFormat, + d3drm_device3_RenderStateChange, + d3drm_device3_LightStateChange, + d3drm_device3_GetStateChangeOptions, + d3drm_device3_SetStateChangeOptions, +}; + +static HRESULT WINAPI d3drm_device_win_QueryInterface(IDirect3DRMWinDevice *iface, REFIID riid, void **out) +{ + struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface); + + return d3drm_device2_QueryInterface(&device->IDirect3DRMDevice2_iface, riid, out); +} + +static ULONG WINAPI d3drm_device_win_AddRef(IDirect3DRMWinDevice *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface); + + return d3drm_device2_AddRef(&device->IDirect3DRMDevice2_iface); +} + +static ULONG WINAPI d3drm_device_win_Release(IDirect3DRMWinDevice *iface) +{ + struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface); + + return d3drm_device2_Release(&device->IDirect3DRMDevice2_iface); +} + +static HRESULT WINAPI d3drm_device_win_Clone(IDirect3DRMWinDevice *iface, + IUnknown *outer, REFIID iid, void **out) +{ + FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device_win_AddDestroyCallback(IDirect3DRMWinDevice *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device_win_DeleteDestroyCallback(IDirect3DRMWinDevice *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device_win_SetAppData(IDirect3DRMWinDevice *iface, DWORD data) +{ + FIXME("iface %p, data %#x stub!\n", iface, data); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_device_win_GetAppData(IDirect3DRMWinDevice *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static HRESULT WINAPI d3drm_device_win_SetName(IDirect3DRMWinDevice *iface, const char *name) +{ + FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device_win_GetName(IDirect3DRMWinDevice *iface, DWORD *size, char *name) +{ + FIXME("iface %p, size %p, name %p stub!\n", iface, size, name); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_device_win_GetClassName(IDirect3DRMWinDevice *iface, DWORD *size, char *name) +{ + struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface); + + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + return IDirect3DRMDevice3_GetClassName(&device->IDirect3DRMDevice3_iface, size, name); +} + +static HRESULT WINAPI d3drm_device_win_HandlePaint(IDirect3DRMWinDevice *iface, HDC dc) +{ + FIXME("iface %p, dc %p stub!\n", iface, dc); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_device_win_HandleActivate(IDirect3DRMWinDevice *iface, WORD wparam) +{ + FIXME("iface %p, wparam %#x stub!\n", iface, wparam); + + return D3DRM_OK; +} + +static const struct IDirect3DRMWinDeviceVtbl d3drm_device_win_vtbl = +{ + d3drm_device_win_QueryInterface, + d3drm_device_win_AddRef, + d3drm_device_win_Release, + d3drm_device_win_Clone, + d3drm_device_win_AddDestroyCallback, + d3drm_device_win_DeleteDestroyCallback, + d3drm_device_win_SetAppData, + d3drm_device_win_GetAppData, + d3drm_device_win_SetName, + d3drm_device_win_GetName, + d3drm_device_win_GetClassName, + d3drm_device_win_HandlePaint, + d3drm_device_win_HandleActivate, +}; + +HRESULT Direct3DRMDevice_create(REFIID riid, IUnknown **out) +{ + struct d3drm_device *object; + + TRACE("riid %s, out %p.\n", debugstr_guid(riid), out); + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + object->IDirect3DRMDevice2_iface.lpVtbl = &d3drm_device2_vtbl; + object->IDirect3DRMDevice3_iface.lpVtbl = &d3drm_device3_vtbl; + object->IDirect3DRMWinDevice_iface.lpVtbl = &d3drm_device_win_vtbl; + object->ref = 1; + + if (IsEqualGUID(riid, &IID_IDirect3DRMDevice3)) + *out = (IUnknown*)&object->IDirect3DRMDevice3_iface; + else + *out = (IUnknown*)&object->IDirect3DRMDevice2_iface; + + return S_OK; +} diff --git a/dll/directx/wine/d3drm/face.c b/dll/directx/wine/d3drm/face.c new file mode 100644 index 00000000000..5cb37348a14 --- /dev/null +++ b/dll/directx/wine/d3drm/face.c @@ -0,0 +1,606 @@ +/* + * Implementation of IDirect3DRMFace Interface + * + * Copyright 2013 AndrĂ© Hentschel + * + * This file contains the (internal) driver registration functions, + * driver enumeration APIs and DirectDraw creation functions. + * + * 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 "d3drm_private.h" + +struct d3drm_face +{ + IDirect3DRMFace IDirect3DRMFace_iface; + IDirect3DRMFace2 IDirect3DRMFace2_iface; + LONG ref; +}; + +static inline struct d3drm_face *impl_from_IDirect3DRMFace(IDirect3DRMFace *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_face, IDirect3DRMFace_iface); +} + +static inline struct d3drm_face *impl_from_IDirect3DRMFace2(IDirect3DRMFace2 *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_face, IDirect3DRMFace2_iface); +} + +static HRESULT WINAPI d3drm_face1_QueryInterface(IDirect3DRMFace *iface, REFIID riid, void **out) +{ + struct d3drm_face *face = impl_from_IDirect3DRMFace(iface); + + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + + if (IsEqualGUID(riid, &IID_IDirect3DRMFace) + || IsEqualGUID(riid, &IID_IUnknown)) + { + *out = &face->IDirect3DRMFace_iface; + } + else if(IsEqualGUID(riid, &IID_IDirect3DRMFace2)) + { + *out = &face->IDirect3DRMFace2_iface; + } + else + { + *out = NULL; + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static ULONG WINAPI d3drm_face1_AddRef(IDirect3DRMFace *iface) +{ + struct d3drm_face *face = impl_from_IDirect3DRMFace(iface); + ULONG refcount = InterlockedIncrement(&face->ref); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI d3drm_face1_Release(IDirect3DRMFace *iface) +{ + struct d3drm_face *face = impl_from_IDirect3DRMFace(iface); + ULONG refcount = InterlockedDecrement(&face->ref); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + HeapFree(GetProcessHeap(), 0, face); + + return refcount; +} + +static HRESULT WINAPI d3drm_face1_Clone(IDirect3DRMFace *iface, + IUnknown *outer, REFIID iid, void **out) +{ + FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face1_AddDestroyCallback(IDirect3DRMFace *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face1_DeleteDestroyCallback(IDirect3DRMFace *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face1_SetAppData(IDirect3DRMFace *iface, DWORD data) +{ + FIXME("iface %p, data %#x stub!\n", iface, data); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_face1_GetAppData(IDirect3DRMFace *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static HRESULT WINAPI d3drm_face1_SetName(IDirect3DRMFace *iface, const char *name) +{ + FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face1_GetName(IDirect3DRMFace *iface, DWORD *size, char *name) +{ + FIXME("iface %p, size %p, name %p stub!\n", iface, size, name); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face1_GetClassName(IDirect3DRMFace *iface, DWORD *size, char *name) +{ + struct d3drm_face *face = impl_from_IDirect3DRMFace(iface); + + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + return IDirect3DRMFace2_GetClassName(&face->IDirect3DRMFace2_iface, size, name); +} + +static HRESULT WINAPI d3drm_face1_AddVertex(IDirect3DRMFace *iface, D3DVALUE x, D3DVALUE y, D3DVALUE z) +{ + FIXME("iface %p, x %.8e, y %.8e, z %.8e stub!\n", iface, x, y, z); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face1_AddVertexAndNormalIndexed(IDirect3DRMFace *iface, + DWORD vertex, DWORD normal) +{ + FIXME("iface %p, vertex %u, normal %u stub!\n", iface, vertex, normal); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face1_SetColorRGB(IDirect3DRMFace *iface, + D3DVALUE r, D3DVALUE g, D3DVALUE b) +{ + FIXME("iface %p, r %.8e, g %.8e, b %.8e stub!\n", iface, r, g, b); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face1_SetColor(IDirect3DRMFace *iface, D3DCOLOR color) +{ + FIXME("iface %p, color 0x%08x stub!\n", iface, color); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face1_SetTexture(IDirect3DRMFace *iface, IDirect3DRMTexture *texture) +{ + FIXME("iface %p, texture %p stub!\n", iface, texture); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face1_SetTextureCoordinates(IDirect3DRMFace *iface, + DWORD vertex, D3DVALUE u, D3DVALUE v) +{ + FIXME("iface %p, vertex %u, u %.8e, v %.8e stub!\n", iface, vertex, u, v); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face1_SetMaterial(IDirect3DRMFace *iface, IDirect3DRMMaterial *material) +{ + FIXME("iface %p, material %p stub!\n", iface, material); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face1_SetTextureTopology(IDirect3DRMFace *iface, BOOL wrap_u, BOOL wrap_v) +{ + FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face1_GetVertex(IDirect3DRMFace *iface, + DWORD index, D3DVECTOR *vertex, D3DVECTOR *normal) +{ + FIXME("iface %p, index %u, vertex %p, normal %p stub!\n", iface, index, vertex, normal); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face1_GetVertices(IDirect3DRMFace *iface, + DWORD *vertex_count, D3DVECTOR *coords, D3DVECTOR *normals) +{ + FIXME("iface %p, vertex_count %p, coords %p, normals %p stub!\n", + iface, vertex_count, coords, normals); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face1_GetTextureCoordinates(IDirect3DRMFace *iface, + DWORD vertex, D3DVALUE *u, D3DVALUE *v) +{ + FIXME("iface %p, vertex %u, u %p, v %p stub!\n", iface, vertex, u, v); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face1_GetTextureTopology(IDirect3DRMFace *iface, BOOL *wrap_u, BOOL *wrap_v) +{ + FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face1_GetNormal(IDirect3DRMFace *iface, D3DVECTOR *normal) +{ + FIXME("iface %p, normal %p stub!\n", iface, normal); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face1_GetTexture(IDirect3DRMFace *iface, IDirect3DRMTexture **texture) +{ + FIXME("iface %p, texture %p stub!\n", iface, texture); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face1_GetMaterial(IDirect3DRMFace *iface, IDirect3DRMMaterial **material) +{ + FIXME("iface %p, material %p stub!\n", iface, material); + + return E_NOTIMPL; +} + +static int WINAPI d3drm_face1_GetVertexCount(IDirect3DRMFace *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static int WINAPI d3drm_face1_GetVertexIndex(IDirect3DRMFace *iface, DWORD which) +{ + FIXME("iface %p, which %u stub!\n", iface, which); + + return 0; +} + +static int WINAPI d3drm_face1_GetTextureCoordinateIndex(IDirect3DRMFace *iface, DWORD which) +{ + FIXME("iface %p, which %u stub!\n", iface, which); + + return 0; +} + +static D3DCOLOR WINAPI d3drm_face1_GetColor(IDirect3DRMFace *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static const struct IDirect3DRMFaceVtbl d3drm_face1_vtbl = +{ + d3drm_face1_QueryInterface, + d3drm_face1_AddRef, + d3drm_face1_Release, + d3drm_face1_Clone, + d3drm_face1_AddDestroyCallback, + d3drm_face1_DeleteDestroyCallback, + d3drm_face1_SetAppData, + d3drm_face1_GetAppData, + d3drm_face1_SetName, + d3drm_face1_GetName, + d3drm_face1_GetClassName, + d3drm_face1_AddVertex, + d3drm_face1_AddVertexAndNormalIndexed, + d3drm_face1_SetColorRGB, + d3drm_face1_SetColor, + d3drm_face1_SetTexture, + d3drm_face1_SetTextureCoordinates, + d3drm_face1_SetMaterial, + d3drm_face1_SetTextureTopology, + d3drm_face1_GetVertex, + d3drm_face1_GetVertices, + d3drm_face1_GetTextureCoordinates, + d3drm_face1_GetTextureTopology, + d3drm_face1_GetNormal, + d3drm_face1_GetTexture, + d3drm_face1_GetMaterial, + d3drm_face1_GetVertexCount, + d3drm_face1_GetVertexIndex, + d3drm_face1_GetTextureCoordinateIndex, + d3drm_face1_GetColor, +}; + +static HRESULT WINAPI d3drm_face2_QueryInterface(IDirect3DRMFace2 *iface, REFIID riid, void **out) +{ + struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface); + + return d3drm_face1_QueryInterface(&face->IDirect3DRMFace_iface, riid, out); +} + +static ULONG WINAPI d3drm_face2_AddRef(IDirect3DRMFace2 *iface) +{ + struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface); + + return d3drm_face1_AddRef(&face->IDirect3DRMFace_iface); +} + +static ULONG WINAPI d3drm_face2_Release(IDirect3DRMFace2 *iface) +{ + struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface); + + return d3drm_face1_Release(&face->IDirect3DRMFace_iface); +} + +static HRESULT WINAPI d3drm_face2_Clone(IDirect3DRMFace2 *iface, + IUnknown *outer, REFIID iid, void **out) +{ + FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face2_AddDestroyCallback(IDirect3DRMFace2 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face2_DeleteDestroyCallback(IDirect3DRMFace2 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face2_SetAppData(IDirect3DRMFace2 *iface, DWORD data) +{ + FIXME("iface %p, data %#x stub!\n", iface, data); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_face2_GetAppData(IDirect3DRMFace2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static HRESULT WINAPI d3drm_face2_SetName(IDirect3DRMFace2 *iface, const char *name) +{ + FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face2_GetName(IDirect3DRMFace2 *iface, DWORD *size, char *name) +{ + FIXME("iface %p, size %p, name %p stub!\n", iface, size, name); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face2_GetClassName(IDirect3DRMFace2 *iface, DWORD *size, char *name) +{ + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + if (!size || *size < strlen("Face") || !name) + return E_INVALIDARG; + + strcpy(name, "Face"); + *size = sizeof("Face"); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_face2_AddVertex(IDirect3DRMFace2 *iface, D3DVALUE x, D3DVALUE y, D3DVALUE z) +{ + FIXME("iface %p, x %.8e, y %.8e, z %.8e stub!\n", iface, x, y, z); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face2_AddVertexAndNormalIndexed(IDirect3DRMFace2 *iface, + DWORD vertex, DWORD normal) +{ + FIXME("iface %p, vertex %u, normal %u stub!\n", iface, vertex, normal); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face2_SetColorRGB(IDirect3DRMFace2 *iface, D3DVALUE r, D3DVALUE g, D3DVALUE b) +{ + FIXME("iface %p, r %.8e, g %.8e, b %.8e stub!\n", iface, r, g, b); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face2_SetColor(IDirect3DRMFace2 *iface, D3DCOLOR color) +{ + FIXME("iface %p, color 0x%08x stub!\n", iface, color); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face2_SetTexture(IDirect3DRMFace2 *iface, IDirect3DRMTexture3 *texture) +{ + FIXME("iface %p, texture %p stub!\n", iface, texture); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face2_SetTextureCoordinates(IDirect3DRMFace2 *iface, + DWORD vertex, D3DVALUE u, D3DVALUE v) +{ + FIXME("iface %p, vertex %u, u %.8e, v %.8e stub!\n", iface, vertex, u, v); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face2_SetMaterial(IDirect3DRMFace2 *iface, IDirect3DRMMaterial2 *material) +{ + FIXME("iface %p, material %p stub!\n", iface, material); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face2_SetTextureTopology(IDirect3DRMFace2 *iface, BOOL wrap_u, BOOL wrap_v) +{ + FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face2_GetVertex(IDirect3DRMFace2 *iface, + DWORD index, D3DVECTOR *vertex, D3DVECTOR *normal) +{ + FIXME("iface %p, index %u, vertex %p, normal %p stub!\n", iface, index, vertex, normal); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face2_GetVertices(IDirect3DRMFace2 *iface, + DWORD *vertex_count, D3DVECTOR *coords, D3DVECTOR *normals) +{ + FIXME("iface %p, vertex_count %p, coords %p, normals %p stub!\n", + iface, vertex_count, coords, normals); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face2_GetTextureCoordinates(IDirect3DRMFace2 *iface, + DWORD vertex, D3DVALUE *u, D3DVALUE *v) +{ + FIXME("iface %p, vertex %u, u %p, v %p stub!\n", iface, vertex, u, v); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face2_GetTextureTopology(IDirect3DRMFace2 *iface, BOOL *wrap_u, BOOL *wrap_v) +{ + FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face2_GetNormal(IDirect3DRMFace2 *iface, D3DVECTOR *normal) +{ + FIXME("iface %p, normal %p stub!\n", iface, normal); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face2_GetTexture(IDirect3DRMFace2 *iface, IDirect3DRMTexture3 **texture) +{ + FIXME("iface %p, texture %p stub!\n", iface, texture); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_face2_GetMaterial(IDirect3DRMFace2 *iface, IDirect3DRMMaterial2 **material) +{ + FIXME("iface %p, material %p stub!\n", iface, material); + + return E_NOTIMPL; +} + +static int WINAPI d3drm_face2_GetVertexCount(IDirect3DRMFace2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static int WINAPI d3drm_face2_GetVertexIndex(IDirect3DRMFace2 *iface, DWORD which) +{ + FIXME("iface %p, which %u stub!\n", iface, which); + + return 0; +} + +static int WINAPI d3drm_face2_GetTextureCoordinateIndex(IDirect3DRMFace2 *iface, DWORD which) +{ + FIXME("iface %p, which %u stub!\n", iface, which); + + return 0; +} + +static D3DCOLOR WINAPI d3drm_face2_GetColor(IDirect3DRMFace2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static const struct IDirect3DRMFace2Vtbl d3drm_face2_vtbl = +{ + d3drm_face2_QueryInterface, + d3drm_face2_AddRef, + d3drm_face2_Release, + d3drm_face2_Clone, + d3drm_face2_AddDestroyCallback, + d3drm_face2_DeleteDestroyCallback, + d3drm_face2_SetAppData, + d3drm_face2_GetAppData, + d3drm_face2_SetName, + d3drm_face2_GetName, + d3drm_face2_GetClassName, + d3drm_face2_AddVertex, + d3drm_face2_AddVertexAndNormalIndexed, + d3drm_face2_SetColorRGB, + d3drm_face2_SetColor, + d3drm_face2_SetTexture, + d3drm_face2_SetTextureCoordinates, + d3drm_face2_SetMaterial, + d3drm_face2_SetTextureTopology, + d3drm_face2_GetVertex, + d3drm_face2_GetVertices, + d3drm_face2_GetTextureCoordinates, + d3drm_face2_GetTextureTopology, + d3drm_face2_GetNormal, + d3drm_face2_GetTexture, + d3drm_face2_GetMaterial, + d3drm_face2_GetVertexCount, + d3drm_face2_GetVertexIndex, + d3drm_face2_GetTextureCoordinateIndex, + d3drm_face2_GetColor, +}; + +HRESULT Direct3DRMFace_create(REFIID riid, IUnknown **out) +{ + struct d3drm_face *object; + + TRACE("riid %s, out %p.\n", debugstr_guid(riid), out); + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + object->IDirect3DRMFace_iface.lpVtbl = &d3drm_face1_vtbl; + object->IDirect3DRMFace2_iface.lpVtbl = &d3drm_face2_vtbl; + object->ref = 1; + + if (IsEqualGUID(riid, &IID_IDirect3DRMFace2)) + *out = (IUnknown*)&object->IDirect3DRMFace2_iface; + else + *out = (IUnknown*)&object->IDirect3DRMFace_iface; + + return S_OK; +} diff --git a/dll/directx/wine/d3drm/frame.c b/dll/directx/wine/d3drm/frame.c new file mode 100644 index 00000000000..1e0f0566724 --- /dev/null +++ b/dll/directx/wine/d3drm/frame.c @@ -0,0 +1,2297 @@ +/* + * Implementation of IDirect3DRMFrame Interface + * + * Copyright 2011, 2012 AndrĂ© Hentschel + * Copyright 2012 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 "d3drm_private.h" + +#include + +static D3DRMMATRIX4D identity = { + { 1.0f, 0.0f, 0.0f, 0.0f }, + { 0.0f, 1.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 1.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f, 1.0f } +}; + +struct d3drm_frame +{ + IDirect3DRMFrame2 IDirect3DRMFrame2_iface; + IDirect3DRMFrame3 IDirect3DRMFrame3_iface; + LONG ref; + struct d3drm_frame *parent; + ULONG nb_children; + ULONG children_capacity; + IDirect3DRMFrame3** children; + ULONG nb_visuals; + ULONG visuals_capacity; + IDirect3DRMVisual** visuals; + ULONG nb_lights; + ULONG lights_capacity; + IDirect3DRMLight** lights; + D3DRMMATRIX4D transform; + D3DCOLOR scenebackground; +}; + +struct d3drm_frame_array +{ + IDirect3DRMFrameArray IDirect3DRMFrameArray_iface; + LONG ref; + ULONG size; + IDirect3DRMFrame **frames; +}; + +struct d3drm_visual_array +{ + IDirect3DRMVisualArray IDirect3DRMVisualArray_iface; + LONG ref; + ULONG size; + IDirect3DRMVisual **visuals; +}; + +struct d3drm_light_array +{ + IDirect3DRMLightArray IDirect3DRMLightArray_iface; + LONG ref; + ULONG size; + IDirect3DRMLight **lights; +}; + +static inline struct d3drm_frame *impl_from_IDirect3DRMFrame2(IDirect3DRMFrame2 *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_frame, IDirect3DRMFrame2_iface); +} + +static inline struct d3drm_frame *impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_frame, IDirect3DRMFrame3_iface); +} + +static inline struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface); + +static inline struct d3drm_frame_array *impl_from_IDirect3DRMFrameArray(IDirect3DRMFrameArray *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_frame_array, IDirect3DRMFrameArray_iface); +} + +static inline struct d3drm_visual_array *impl_from_IDirect3DRMVisualArray(IDirect3DRMVisualArray *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_visual_array, IDirect3DRMVisualArray_iface); +} + +static inline struct d3drm_light_array *impl_from_IDirect3DRMLightArray(IDirect3DRMLightArray *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_light_array, IDirect3DRMLightArray_iface); +} + +static HRESULT WINAPI d3drm_frame_array_QueryInterface(IDirect3DRMFrameArray *iface, REFIID riid, void **out) +{ + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualGUID(riid, &IID_IDirect3DRMFrameArray) + || IsEqualGUID(riid, &IID_IUnknown)) + { + IDirect3DRMFrameArray_AddRef(iface); + *out = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI d3drm_frame_array_AddRef(IDirect3DRMFrameArray *iface) +{ + struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface); + ULONG refcount = InterlockedIncrement(&array->ref); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI d3drm_frame_array_Release(IDirect3DRMFrameArray *iface) +{ + struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface); + ULONG refcount = InterlockedDecrement(&array->ref); + ULONG i; + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + { + for (i = 0; i < array->size; ++i) + { + IDirect3DRMFrame_Release(array->frames[i]); + } + HeapFree(GetProcessHeap(), 0, array->frames); + HeapFree(GetProcessHeap(), 0, array); + } + + return refcount; +} + +static DWORD WINAPI d3drm_frame_array_GetSize(IDirect3DRMFrameArray *iface) +{ + struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface); + + TRACE("iface %p.\n", iface); + + return array->size; +} + +static HRESULT WINAPI d3drm_frame_array_GetElement(IDirect3DRMFrameArray *iface, + DWORD index, IDirect3DRMFrame **frame) +{ + struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface); + + TRACE("iface %p, index %u, frame %p.\n", iface, index, frame); + + if (!frame) + return D3DRMERR_BADVALUE; + + if (index >= array->size) + { + *frame = NULL; + return D3DRMERR_BADVALUE; + } + + IDirect3DRMFrame_AddRef(array->frames[index]); + *frame = array->frames[index]; + + return D3DRM_OK; +} + +static const struct IDirect3DRMFrameArrayVtbl d3drm_frame_array_vtbl = +{ + d3drm_frame_array_QueryInterface, + d3drm_frame_array_AddRef, + d3drm_frame_array_Release, + d3drm_frame_array_GetSize, + d3drm_frame_array_GetElement, +}; + +static struct d3drm_frame_array *d3drm_frame_array_create(unsigned int frame_count, IDirect3DRMFrame3 **frames) +{ + struct d3drm_frame_array *array; + unsigned int i; + + if (!(array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*array)))) + return NULL; + + array->IDirect3DRMFrameArray_iface.lpVtbl = &d3drm_frame_array_vtbl; + array->ref = 1; + array->size = frame_count; + + if (frame_count) + { + if (!(array->frames = HeapAlloc(GetProcessHeap(), 0, frame_count * sizeof(*array->frames)))) + { + HeapFree(GetProcessHeap(), 0, array); + return NULL; + } + + for (i = 0; i < frame_count; ++i) + { + IDirect3DRMFrame3_QueryInterface(frames[i], &IID_IDirect3DRMFrame, (void **)&array->frames[i]); + } + } + + return array; +} + +static HRESULT WINAPI d3drm_visual_array_QueryInterface(IDirect3DRMVisualArray *iface, REFIID riid, void **out) +{ + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualGUID(riid, &IID_IDirect3DRMVisualArray) + || IsEqualGUID(riid, &IID_IUnknown)) + { + IDirect3DRMVisualArray_AddRef(iface); + *out = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI d3drm_visual_array_AddRef(IDirect3DRMVisualArray *iface) +{ + struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface); + ULONG refcount = InterlockedIncrement(&array->ref); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI d3drm_visual_array_Release(IDirect3DRMVisualArray *iface) +{ + struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface); + ULONG refcount = InterlockedDecrement(&array->ref); + ULONG i; + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + { + for (i = 0; i < array->size; ++i) + { + IDirect3DRMVisual_Release(array->visuals[i]); + } + HeapFree(GetProcessHeap(), 0, array->visuals); + HeapFree(GetProcessHeap(), 0, array); + } + + return refcount; +} + +static DWORD WINAPI d3drm_visual_array_GetSize(IDirect3DRMVisualArray *iface) +{ + struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface); + + TRACE("iface %p.\n", iface); + + return array->size; +} + +static HRESULT WINAPI d3drm_visual_array_GetElement(IDirect3DRMVisualArray *iface, + DWORD index, IDirect3DRMVisual **visual) +{ + struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface); + + TRACE("iface %p, index %u, visual %p.\n", iface, index, visual); + + if (!visual) + return D3DRMERR_BADVALUE; + + if (index >= array->size) + { + *visual = NULL; + return D3DRMERR_BADVALUE; + } + + IDirect3DRMVisual_AddRef(array->visuals[index]); + *visual = array->visuals[index]; + + return D3DRM_OK; +} + +static const struct IDirect3DRMVisualArrayVtbl d3drm_visual_array_vtbl = +{ + d3drm_visual_array_QueryInterface, + d3drm_visual_array_AddRef, + d3drm_visual_array_Release, + d3drm_visual_array_GetSize, + d3drm_visual_array_GetElement, +}; + +static struct d3drm_visual_array *d3drm_visual_array_create(unsigned int visual_count, IDirect3DRMVisual **visuals) +{ + struct d3drm_visual_array *array; + unsigned int i; + + if (!(array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*array)))) + return NULL; + + array->IDirect3DRMVisualArray_iface.lpVtbl = &d3drm_visual_array_vtbl; + array->ref = 1; + array->size = visual_count; + + if (visual_count) + { + if (!(array->visuals = HeapAlloc(GetProcessHeap(), 0, visual_count * sizeof(*array->visuals)))) + { + HeapFree(GetProcessHeap(), 0, array); + return NULL; + } + + for (i = 0; i < visual_count; ++i) + { + array->visuals[i] = visuals[i]; + IDirect3DRMVisual_AddRef(array->visuals[i]); + } + } + + return array; +} + +static HRESULT WINAPI d3drm_light_array_QueryInterface(IDirect3DRMLightArray *iface, REFIID riid, void **out) +{ + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualGUID(riid, &IID_IDirect3DRMLightArray) + || IsEqualGUID(riid, &IID_IUnknown)) + { + IDirect3DRMLightArray_AddRef(iface); + *out = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI d3drm_light_array_AddRef(IDirect3DRMLightArray *iface) +{ + struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface); + ULONG refcount = InterlockedIncrement(&array->ref); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI d3drm_light_array_Release(IDirect3DRMLightArray *iface) +{ + struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface); + ULONG refcount = InterlockedDecrement(&array->ref); + ULONG i; + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + { + for (i = 0; i < array->size; ++i) + { + IDirect3DRMLight_Release(array->lights[i]); + } + HeapFree(GetProcessHeap(), 0, array->lights); + HeapFree(GetProcessHeap(), 0, array); + } + + return refcount; +} + +static DWORD WINAPI d3drm_light_array_GetSize(IDirect3DRMLightArray *iface) +{ + struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface); + + TRACE("iface %p.\n", iface); + + return array->size; +} + +static HRESULT WINAPI d3drm_light_array_GetElement(IDirect3DRMLightArray *iface, + DWORD index, IDirect3DRMLight **light) +{ + struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface); + + TRACE("iface %p, index %u, light %p.\n", iface, index, light); + + if (!light) + return D3DRMERR_BADVALUE; + + if (index >= array->size) + { + *light = NULL; + return D3DRMERR_BADVALUE; + } + + IDirect3DRMLight_AddRef(array->lights[index]); + *light = array->lights[index]; + + return D3DRM_OK; +} + +static const struct IDirect3DRMLightArrayVtbl d3drm_light_array_vtbl = +{ + d3drm_light_array_QueryInterface, + d3drm_light_array_AddRef, + d3drm_light_array_Release, + d3drm_light_array_GetSize, + d3drm_light_array_GetElement, +}; + +static struct d3drm_light_array *d3drm_light_array_create(unsigned int light_count, IDirect3DRMLight **lights) +{ + struct d3drm_light_array *array; + unsigned int i; + + if (!(array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*array)))) + return NULL; + + array->IDirect3DRMLightArray_iface.lpVtbl = &d3drm_light_array_vtbl; + array->ref = 1; + array->size = light_count; + + if (light_count) + { + if (!(array->lights = HeapAlloc(GetProcessHeap(), 0, light_count * sizeof(*array->lights)))) + { + HeapFree(GetProcessHeap(), 0, array); + return NULL; + } + + for (i = 0; i < light_count; ++i) + { + array->lights[i] = lights[i]; + IDirect3DRMLight_AddRef(array->lights[i]); + } + } + + return array; +} + +static HRESULT WINAPI d3drm_frame2_QueryInterface(IDirect3DRMFrame2 *iface, REFIID riid, void **out) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualGUID(riid, &IID_IDirect3DRMFrame2) + || IsEqualGUID(riid, &IID_IDirect3DRMFrame) + || IsEqualGUID(riid, &IID_IUnknown)) + { + *out = &frame->IDirect3DRMFrame2_iface; + } + else if (IsEqualGUID(riid, &IID_IDirect3DRMFrame3)) + { + *out = &frame->IDirect3DRMFrame3_iface; + } + else + { + *out = NULL; + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static ULONG WINAPI d3drm_frame2_AddRef(IDirect3DRMFrame2 *iface) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + ULONG refcount = InterlockedIncrement(&frame->ref); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI d3drm_frame2_Release(IDirect3DRMFrame2 *iface) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + ULONG refcount = InterlockedDecrement(&frame->ref); + ULONG i; + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + { + for (i = 0; i < frame->nb_children; ++i) + { + IDirect3DRMFrame3_Release(frame->children[i]); + } + HeapFree(GetProcessHeap(), 0, frame->children); + for (i = 0; i < frame->nb_visuals; ++i) + { + IDirect3DRMVisual_Release(frame->visuals[i]); + } + HeapFree(GetProcessHeap(), 0, frame->visuals); + for (i = 0; i < frame->nb_lights; ++i) + { + IDirect3DRMLight_Release(frame->lights[i]); + } + HeapFree(GetProcessHeap(), 0, frame->lights); + HeapFree(GetProcessHeap(), 0, frame); + } + + return refcount; +} + +static HRESULT WINAPI d3drm_frame2_Clone(IDirect3DRMFrame2 *iface, + IUnknown *outer, REFIID iid, void **out) +{ + FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_AddDestroyCallback(IDirect3DRMFrame2 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_DeleteDestroyCallback(IDirect3DRMFrame2 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_SetAppData(IDirect3DRMFrame2 *iface, DWORD data) +{ + FIXME("iface %p, data %#x stub!\n", iface, data); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_frame2_GetAppData(IDirect3DRMFrame2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static HRESULT WINAPI d3drm_frame2_SetName(IDirect3DRMFrame2 *iface, const char *name) +{ + FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_GetName(IDirect3DRMFrame2 *iface, DWORD *size, char *name) +{ + FIXME("iface %p, size %p, name %p stub!\n", iface, size, name); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_GetClassName(IDirect3DRMFrame2 *iface, DWORD *size, char *name) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + return IDirect3DRMFrame3_GetClassName(&frame->IDirect3DRMFrame3_iface, size, name); +} + +static HRESULT WINAPI d3drm_frame2_AddChild(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *child) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + IDirect3DRMFrame3 *child3; + HRESULT hr; + + TRACE("iface %p, child %p.\n", iface, child); + + if (!child) + return D3DRMERR_BADOBJECT; + hr = IDirect3DRMFrame_QueryInterface(child, &IID_IDirect3DRMFrame3, (void **)&child3); + if (hr != S_OK) + return D3DRMERR_BADOBJECT; + IDirect3DRMFrame_Release(child); + + return IDirect3DRMFrame3_AddChild(&frame->IDirect3DRMFrame3_iface, child3); +} + +static HRESULT WINAPI d3drm_frame2_AddLight(IDirect3DRMFrame2 *iface, IDirect3DRMLight *light) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + + TRACE("iface %p, light %p.\n", iface, light); + + return IDirect3DRMFrame3_AddLight(&frame->IDirect3DRMFrame3_iface, light); +} + +static HRESULT WINAPI d3drm_frame2_AddMoveCallback(IDirect3DRMFrame2 *iface, + D3DRMFRAMEMOVECALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_AddTransform(IDirect3DRMFrame2 *iface, D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + + TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix); + + return IDirect3DRMFrame3_AddTransform(&frame->IDirect3DRMFrame3_iface, type, matrix); +} + +static HRESULT WINAPI d3drm_frame2_AddTranslation(IDirect3DRMFrame2 *iface, + D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z) +{ + FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_AddScale(IDirect3DRMFrame2 *iface, + D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) +{ + FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_AddRotation(IDirect3DRMFrame2 *iface, + D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) +{ + FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n", iface, type, x, y, z, theta); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_AddVisual(IDirect3DRMFrame2 *iface, IDirect3DRMVisual *visual) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + + TRACE("iface %p, visual %p.\n", iface, visual); + + return IDirect3DRMFrame3_AddVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual); +} + +static HRESULT WINAPI d3drm_frame2_GetChildren(IDirect3DRMFrame2 *iface, IDirect3DRMFrameArray **children) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + + TRACE("iface %p, children %p.\n", iface, children); + + return IDirect3DRMFrame3_GetChildren(&frame->IDirect3DRMFrame3_iface, children); +} + +static D3DCOLOR WINAPI d3drm_frame2_GetColor(IDirect3DRMFrame2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static HRESULT WINAPI d3drm_frame2_GetLights(IDirect3DRMFrame2 *iface, IDirect3DRMLightArray **lights) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + + TRACE("iface %p, lights %p.\n", iface, lights); + + return IDirect3DRMFrame3_GetLights(&frame->IDirect3DRMFrame3_iface, lights); +} + +static D3DRMMATERIALMODE WINAPI d3drm_frame2_GetMaterialMode(IDirect3DRMFrame2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return D3DRMMATERIAL_FROMPARENT; +} + +static HRESULT WINAPI d3drm_frame2_GetParent(IDirect3DRMFrame2 *iface, IDirect3DRMFrame **parent) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + + TRACE("iface %p, parent %p.\n", iface, parent); + + if (!parent) + return D3DRMERR_BADVALUE; + + if (frame->parent) + { + *parent = (IDirect3DRMFrame *)&frame->parent->IDirect3DRMFrame2_iface; + IDirect3DRMFrame_AddRef(*parent); + } + else + { + *parent = NULL; + } + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_frame2_GetPosition(IDirect3DRMFrame2 *iface, + IDirect3DRMFrame *reference, D3DVECTOR *position) +{ + FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_GetRotation(IDirect3DRMFrame2 *iface, + IDirect3DRMFrame *reference, D3DVECTOR *axis, D3DVALUE *theta) +{ + FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_GetScene(IDirect3DRMFrame2 *iface, IDirect3DRMFrame **scene) +{ + FIXME("iface %p, scene %p stub!\n", iface, scene); + + return E_NOTIMPL; +} + +static D3DRMSORTMODE WINAPI d3drm_frame2_GetSortMode(IDirect3DRMFrame2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return D3DRMSORT_FROMPARENT; +} + +static HRESULT WINAPI d3drm_frame2_GetTexture(IDirect3DRMFrame2 *iface, IDirect3DRMTexture **texture) +{ + FIXME("iface %p, texture %p stub!\n", iface, texture); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_GetTransform(IDirect3DRMFrame2 *iface, D3DRMMATRIX4D matrix) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + + TRACE("iface %p, matrix %p.\n", iface, matrix); + + memcpy(matrix, frame->transform, sizeof(D3DRMMATRIX4D)); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_frame2_GetVelocity(IDirect3DRMFrame2 *iface, + IDirect3DRMFrame *reference, D3DVECTOR *velocity, BOOL with_rotation) +{ + FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n", + iface, reference, velocity, with_rotation); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_GetOrientation(IDirect3DRMFrame2 *iface, + IDirect3DRMFrame *reference, D3DVECTOR *dir, D3DVECTOR *up) +{ + FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_GetVisuals(IDirect3DRMFrame2 *iface, IDirect3DRMVisualArray **visuals) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + struct d3drm_visual_array *array; + + TRACE("iface %p, visuals %p.\n", iface, visuals); + + if (!visuals) + return D3DRMERR_BADVALUE; + + if (!(array = d3drm_visual_array_create(frame->nb_visuals, frame->visuals))) + return E_OUTOFMEMORY; + + *visuals = &array->IDirect3DRMVisualArray_iface; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_frame2_GetTextureTopology(IDirect3DRMFrame2 *iface, BOOL *wrap_u, BOOL *wrap_v) +{ + FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_InverseTransform(IDirect3DRMFrame2 *iface, D3DVECTOR *d, D3DVECTOR *s) +{ + FIXME("iface %p, d %p, s %p stub!\n", iface, d, s); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_Load(IDirect3DRMFrame2 *iface, void *filename, + void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURECALLBACK cb, void *ctx) +{ + FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n", + iface, filename, name, flags, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_LookAt(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *target, + IDirect3DRMFrame *reference, D3DRMFRAMECONSTRAINT constraint) +{ + FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_Move(IDirect3DRMFrame2 *iface, D3DVALUE delta) +{ + FIXME("iface %p, delta %.8e stub!\n", iface, delta); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_DeleteChild(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *child) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + IDirect3DRMFrame3 *child3; + HRESULT hr; + + TRACE("iface %p, child %p.\n", iface, child); + + if (!child) + return D3DRMERR_BADOBJECT; + if (FAILED(hr = IDirect3DRMFrame_QueryInterface(child, &IID_IDirect3DRMFrame3, (void **)&child3))) + return D3DRMERR_BADOBJECT; + IDirect3DRMFrame_Release(child); + + return IDirect3DRMFrame3_DeleteChild(&frame->IDirect3DRMFrame3_iface, child3); +} + +static HRESULT WINAPI d3drm_frame2_DeleteLight(IDirect3DRMFrame2 *iface, IDirect3DRMLight *light) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + + TRACE("iface %p, light %p.\n", iface, light); + + return IDirect3DRMFrame3_DeleteLight(&frame->IDirect3DRMFrame3_iface, light); +} + +static HRESULT WINAPI d3drm_frame2_DeleteMoveCallback(IDirect3DRMFrame2 *iface, + D3DRMFRAMEMOVECALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_DeleteVisual(IDirect3DRMFrame2 *iface, IDirect3DRMVisual *visual) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + + TRACE("iface %p, visual %p.\n", iface, visual); + + return IDirect3DRMFrame3_DeleteVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual); +} + +static D3DCOLOR WINAPI d3drm_frame2_GetSceneBackground(IDirect3DRMFrame2 *iface) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMFrame3_GetSceneBackground(&frame->IDirect3DRMFrame3_iface); +} + +static HRESULT WINAPI d3drm_frame2_GetSceneBackgroundDepth(IDirect3DRMFrame2 *iface, + IDirectDrawSurface **surface) +{ + FIXME("iface %p, surface %p stub!\n", iface, surface); + + return E_NOTIMPL; +} + +static D3DCOLOR WINAPI d3drm_frame2_GetSceneFogColor(IDirect3DRMFrame2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static BOOL WINAPI d3drm_frame2_GetSceneFogEnable(IDirect3DRMFrame2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return FALSE; +} + +static D3DRMFOGMODE WINAPI d3drm_frame2_GetSceneFogMode(IDirect3DRMFrame2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return D3DRMFOG_LINEAR; +} + +static HRESULT WINAPI d3drm_frame2_GetSceneFogParams(IDirect3DRMFrame2 *iface, + D3DVALUE *start, D3DVALUE *end, D3DVALUE *density) +{ + FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_SetSceneBackground(IDirect3DRMFrame2 *iface, D3DCOLOR color) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + + TRACE("iface %p, color 0x%08x.\n", iface, color); + + return IDirect3DRMFrame3_SetSceneBackground(&frame->IDirect3DRMFrame3_iface, color); +} + +static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundRGB(IDirect3DRMFrame2 *iface, + D3DVALUE red, D3DVALUE green, D3DVALUE blue) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + + TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue); + + return IDirect3DRMFrame3_SetSceneBackgroundRGB(&frame->IDirect3DRMFrame3_iface, red, green, blue); +} + +static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundDepth(IDirect3DRMFrame2 *iface, IDirectDrawSurface *surface) +{ + FIXME("iface %p, surface %p stub!\n", iface, surface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundImage(IDirect3DRMFrame2 *iface, IDirect3DRMTexture *texture) +{ + FIXME("iface %p, texture %p stub!\n", iface, texture); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_SetSceneFogEnable(IDirect3DRMFrame2 *iface, BOOL enable) +{ + FIXME("iface %p, enable %#x stub!\n", iface, enable); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_SetSceneFogColor(IDirect3DRMFrame2 *iface, D3DCOLOR color) +{ + FIXME("iface %p, color 0x%08x stub!\n", iface, color); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_SetSceneFogMode(IDirect3DRMFrame2 *iface, D3DRMFOGMODE mode) +{ + FIXME("iface %p, mode %#x stub!\n", iface, mode); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_SetSceneFogParams(IDirect3DRMFrame2 *iface, + D3DVALUE start, D3DVALUE end, D3DVALUE density) +{ + FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_SetColor(IDirect3DRMFrame2 *iface, D3DCOLOR color) +{ + FIXME("iface %p, color 0x%08x stub!\n", iface, color); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_SetColorRGB(IDirect3DRMFrame2 *iface, + D3DVALUE red, D3DVALUE green, D3DVALUE blue) +{ + FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue); + + return E_NOTIMPL; +} + +static D3DRMZBUFFERMODE WINAPI d3drm_frame2_GetZbufferMode(IDirect3DRMFrame2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return D3DRMZBUFFER_FROMPARENT; +} + +static HRESULT WINAPI d3drm_frame2_SetMaterialMode(IDirect3DRMFrame2 *iface, D3DRMMATERIALMODE mode) +{ + FIXME("iface %p, mode %#x stub!\n", iface, mode); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_SetOrientation(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *reference, + D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz) +{ + FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n", + iface, reference, dx, dy, dz, ux, uy, uz); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_SetPosition(IDirect3DRMFrame2 *iface, + IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z) +{ + FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_SetRotation(IDirect3DRMFrame2 *iface, + IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) +{ + FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n", + iface, reference, x, y, z, theta); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_SetSortMode(IDirect3DRMFrame2 *iface, D3DRMSORTMODE mode) +{ + FIXME("iface %p, mode %#x stub!\n", iface, mode); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_SetTexture(IDirect3DRMFrame2 *iface, IDirect3DRMTexture *texture) +{ + FIXME("iface %p, texture %p stub!\n", iface, texture); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_SetTextureTopology(IDirect3DRMFrame2 *iface, BOOL wrap_u, BOOL wrap_v) +{ + FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_SetVelocity(IDirect3DRMFrame2 *iface, + IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation) +{ + FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x stub!\n", + iface, reference, x, y, z, with_rotation); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_SetZbufferMode(IDirect3DRMFrame2 *iface, D3DRMZBUFFERMODE mode) +{ + FIXME("iface %p, mode %#x stub!\n", iface, mode); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_Transform(IDirect3DRMFrame2 *iface, D3DVECTOR *d, D3DVECTOR *s) +{ + FIXME("iface %p, d %p, s %p stub!\n", iface, d, s); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_AddMoveCallback2(IDirect3DRMFrame2 *iface, + D3DRMFRAMEMOVECALLBACK cb, void *ctx, DWORD flags) +{ + FIXME("iface %p, cb %p, ctx %p, flags %#x stub!\n", iface, cb, ctx, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_GetBox(IDirect3DRMFrame2 *iface, D3DRMBOX *box) +{ + FIXME("iface %p, box %p stub!\n", iface, box); + + return E_NOTIMPL; +} + +static BOOL WINAPI d3drm_frame2_GetBoxEnable(IDirect3DRMFrame2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_GetAxes(IDirect3DRMFrame2 *iface, D3DVECTOR *dir, D3DVECTOR *up) +{ + FIXME("iface %p, dir %p, up %p stub!\n", iface, dir, up); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_GetMaterial(IDirect3DRMFrame2 *iface, IDirect3DRMMaterial **material) +{ + FIXME("iface %p, material %p stub!\n", iface, material); + + return E_NOTIMPL; +} + +static BOOL WINAPI d3drm_frame2_GetInheritAxes(IDirect3DRMFrame2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame2_GetHierarchyBox(IDirect3DRMFrame2 *iface, D3DRMBOX *box) +{ + FIXME("iface %p, box %p stub!\n", iface, box); + + return E_NOTIMPL; +} + +static const struct IDirect3DRMFrame2Vtbl d3drm_frame2_vtbl = +{ + d3drm_frame2_QueryInterface, + d3drm_frame2_AddRef, + d3drm_frame2_Release, + d3drm_frame2_Clone, + d3drm_frame2_AddDestroyCallback, + d3drm_frame2_DeleteDestroyCallback, + d3drm_frame2_SetAppData, + d3drm_frame2_GetAppData, + d3drm_frame2_SetName, + d3drm_frame2_GetName, + d3drm_frame2_GetClassName, + d3drm_frame2_AddChild, + d3drm_frame2_AddLight, + d3drm_frame2_AddMoveCallback, + d3drm_frame2_AddTransform, + d3drm_frame2_AddTranslation, + d3drm_frame2_AddScale, + d3drm_frame2_AddRotation, + d3drm_frame2_AddVisual, + d3drm_frame2_GetChildren, + d3drm_frame2_GetColor, + d3drm_frame2_GetLights, + d3drm_frame2_GetMaterialMode, + d3drm_frame2_GetParent, + d3drm_frame2_GetPosition, + d3drm_frame2_GetRotation, + d3drm_frame2_GetScene, + d3drm_frame2_GetSortMode, + d3drm_frame2_GetTexture, + d3drm_frame2_GetTransform, + d3drm_frame2_GetVelocity, + d3drm_frame2_GetOrientation, + d3drm_frame2_GetVisuals, + d3drm_frame2_GetTextureTopology, + d3drm_frame2_InverseTransform, + d3drm_frame2_Load, + d3drm_frame2_LookAt, + d3drm_frame2_Move, + d3drm_frame2_DeleteChild, + d3drm_frame2_DeleteLight, + d3drm_frame2_DeleteMoveCallback, + d3drm_frame2_DeleteVisual, + d3drm_frame2_GetSceneBackground, + d3drm_frame2_GetSceneBackgroundDepth, + d3drm_frame2_GetSceneFogColor, + d3drm_frame2_GetSceneFogEnable, + d3drm_frame2_GetSceneFogMode, + d3drm_frame2_GetSceneFogParams, + d3drm_frame2_SetSceneBackground, + d3drm_frame2_SetSceneBackgroundRGB, + d3drm_frame2_SetSceneBackgroundDepth, + d3drm_frame2_SetSceneBackgroundImage, + d3drm_frame2_SetSceneFogEnable, + d3drm_frame2_SetSceneFogColor, + d3drm_frame2_SetSceneFogMode, + d3drm_frame2_SetSceneFogParams, + d3drm_frame2_SetColor, + d3drm_frame2_SetColorRGB, + d3drm_frame2_GetZbufferMode, + d3drm_frame2_SetMaterialMode, + d3drm_frame2_SetOrientation, + d3drm_frame2_SetPosition, + d3drm_frame2_SetRotation, + d3drm_frame2_SetSortMode, + d3drm_frame2_SetTexture, + d3drm_frame2_SetTextureTopology, + d3drm_frame2_SetVelocity, + d3drm_frame2_SetZbufferMode, + d3drm_frame2_Transform, + d3drm_frame2_AddMoveCallback2, + d3drm_frame2_GetBox, + d3drm_frame2_GetBoxEnable, + d3drm_frame2_GetAxes, + d3drm_frame2_GetMaterial, + d3drm_frame2_GetInheritAxes, + d3drm_frame2_GetHierarchyBox, +}; + +static HRESULT WINAPI d3drm_frame3_QueryInterface(IDirect3DRMFrame3 *iface, REFIID riid, void **out) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface); + + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + return d3drm_frame2_QueryInterface(&frame->IDirect3DRMFrame2_iface, riid, out); +} + +static ULONG WINAPI d3drm_frame3_AddRef(IDirect3DRMFrame3 *iface) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface); + + TRACE("iface %p.\n", iface); + + return d3drm_frame2_AddRef(&frame->IDirect3DRMFrame2_iface); +} + +static ULONG WINAPI d3drm_frame3_Release(IDirect3DRMFrame3 *iface) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface); + + TRACE("iface %p.\n", iface); + + return d3drm_frame2_Release(&frame->IDirect3DRMFrame2_iface); +} + +static HRESULT WINAPI d3drm_frame3_Clone(IDirect3DRMFrame3 *iface, + IUnknown *outer, REFIID iid, void **out) +{ + FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_AddDestroyCallback(IDirect3DRMFrame3 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_DeleteDestroyCallback(IDirect3DRMFrame3 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetAppData(IDirect3DRMFrame3 *iface, DWORD data) +{ + FIXME("iface %p, data %#x stub!\n", iface, data); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_frame3_GetAppData(IDirect3DRMFrame3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static HRESULT WINAPI d3drm_frame3_SetName(IDirect3DRMFrame3 *iface, const char *name) +{ + FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_GetName(IDirect3DRMFrame3 *iface, DWORD *size, char *name) +{ + FIXME("iface %p, size %p, name %p stub!\n", iface, size, name); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_GetClassName(IDirect3DRMFrame3 *iface, DWORD *size, char *name) +{ + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + if (!size || *size < strlen("Frame") || !name) + return E_INVALIDARG; + + strcpy(name, "Frame"); + *size = sizeof("Frame"); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_frame3_AddChild(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *child) +{ + struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface); + struct d3drm_frame *child_obj = unsafe_impl_from_IDirect3DRMFrame3(child); + + TRACE("iface %p, child %p.\n", iface, child); + + if (!child_obj) + return D3DRMERR_BADOBJECT; + + if (child_obj->parent) + { + IDirect3DRMFrame3* parent = &child_obj->parent->IDirect3DRMFrame3_iface; + + if (parent == iface) + { + /* Passed frame is already a child so return success */ + return D3DRM_OK; + } + else + { + /* Remove parent and continue */ + IDirect3DRMFrame3_DeleteChild(parent, child); + } + } + + if ((This->nb_children + 1) > This->children_capacity) + { + ULONG new_capacity; + IDirect3DRMFrame3** children; + + if (!This->children_capacity) + { + new_capacity = 16; + children = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMFrame3*)); + } + else + { + new_capacity = This->children_capacity * 2; + children = HeapReAlloc(GetProcessHeap(), 0, This->children, new_capacity * sizeof(IDirect3DRMFrame3*)); + } + + if (!children) + return E_OUTOFMEMORY; + + This->children_capacity = new_capacity; + This->children = children; + } + + This->children[This->nb_children++] = child; + IDirect3DRMFrame3_AddRef(child); + child_obj->parent = This; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_frame3_AddLight(IDirect3DRMFrame3 *iface, IDirect3DRMLight *light) +{ + struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface); + ULONG i; + IDirect3DRMLight** lights; + + TRACE("iface %p, light %p.\n", iface, light); + + if (!light) + return D3DRMERR_BADOBJECT; + + /* Check if already existing and return gracefully without increasing ref count */ + for (i = 0; i < This->nb_lights; i++) + if (This->lights[i] == light) + return D3DRM_OK; + + if ((This->nb_lights + 1) > This->lights_capacity) + { + ULONG new_capacity; + + if (!This->lights_capacity) + { + new_capacity = 16; + lights = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMLight*)); + } + else + { + new_capacity = This->lights_capacity * 2; + lights = HeapReAlloc(GetProcessHeap(), 0, This->lights, new_capacity * sizeof(IDirect3DRMLight*)); + } + + if (!lights) + return E_OUTOFMEMORY; + + This->lights_capacity = new_capacity; + This->lights = lights; + } + + This->lights[This->nb_lights++] = light; + IDirect3DRMLight_AddRef(light); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_frame3_AddMoveCallback(IDirect3DRMFrame3 *iface, + D3DRMFRAME3MOVECALLBACK cb, void *ctx, DWORD flags) +{ + FIXME("iface %p, cb %p, ctx %p flags %#x stub!\n", iface, cb, ctx, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_AddTransform(IDirect3DRMFrame3 *iface, + D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface); + + TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix); + + switch (type) + { + case D3DRMCOMBINE_REPLACE: + memcpy(frame->transform, matrix, sizeof(D3DRMMATRIX4D)); + break; + + case D3DRMCOMBINE_BEFORE: + FIXME("D3DRMCOMBINE_BEFORE not supported yet\n"); + break; + + case D3DRMCOMBINE_AFTER: + FIXME("D3DRMCOMBINE_AFTER not supported yet\n"); + break; + + default: + WARN("Unknown Combine Type %u\n", type); + return D3DRMERR_BADVALUE; + } + + return S_OK; +} + +static HRESULT WINAPI d3drm_frame3_AddTranslation(IDirect3DRMFrame3 *iface, + D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z) +{ + FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_AddScale(IDirect3DRMFrame3 *iface, + D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) +{ + FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_AddRotation(IDirect3DRMFrame3 *iface, + D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) +{ + FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n", + iface, type, x, y, z, theta); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_AddVisual(IDirect3DRMFrame3 *iface, IUnknown *visual) +{ + struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface); + ULONG i; + IDirect3DRMVisual** visuals; + + TRACE("iface %p, visual %p.\n", iface, visual); + + if (!visual) + return D3DRMERR_BADOBJECT; + + /* Check if already existing and return gracefully without increasing ref count */ + for (i = 0; i < This->nb_visuals; i++) + if (This->visuals[i] == (IDirect3DRMVisual *)visual) + return D3DRM_OK; + + if ((This->nb_visuals + 1) > This->visuals_capacity) + { + ULONG new_capacity; + + if (!This->visuals_capacity) + { + new_capacity = 16; + visuals = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMVisual*)); + } + else + { + new_capacity = This->visuals_capacity * 2; + visuals = HeapReAlloc(GetProcessHeap(), 0, This->visuals, new_capacity * sizeof(IDirect3DRMVisual*)); + } + + if (!visuals) + return E_OUTOFMEMORY; + + This->visuals_capacity = new_capacity; + This->visuals = visuals; + } + + This->visuals[This->nb_visuals++] = (IDirect3DRMVisual *)visual; + IDirect3DRMVisual_AddRef(visual); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_frame3_GetChildren(IDirect3DRMFrame3 *iface, IDirect3DRMFrameArray **children) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface); + struct d3drm_frame_array *array; + + TRACE("iface %p, children %p.\n", iface, children); + + if (!children) + return D3DRMERR_BADVALUE; + + if (!(array = d3drm_frame_array_create(frame->nb_children, frame->children))) + return E_OUTOFMEMORY; + + *children = &array->IDirect3DRMFrameArray_iface; + + return D3DRM_OK; +} + +static D3DCOLOR WINAPI d3drm_frame3_GetColor(IDirect3DRMFrame3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static HRESULT WINAPI d3drm_frame3_GetLights(IDirect3DRMFrame3 *iface, IDirect3DRMLightArray **lights) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface); + struct d3drm_light_array *array; + + TRACE("iface %p, lights %p.\n", iface, lights); + + if (!lights) + return D3DRMERR_BADVALUE; + + if (!(array = d3drm_light_array_create(frame->nb_lights, frame->lights))) + return E_OUTOFMEMORY; + + *lights = &array->IDirect3DRMLightArray_iface; + + return D3DRM_OK; +} + +static D3DRMMATERIALMODE WINAPI d3drm_frame3_GetMaterialMode(IDirect3DRMFrame3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return D3DRMMATERIAL_FROMPARENT; +} + +static HRESULT WINAPI d3drm_frame3_GetParent(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 **parent) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface); + + TRACE("iface %p, parent %p.\n", iface, parent); + + if (!parent) + return D3DRMERR_BADVALUE; + + if (frame->parent) + { + *parent = &frame->parent->IDirect3DRMFrame3_iface; + IDirect3DRMFrame_AddRef(*parent); + } + else + { + *parent = NULL; + } + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_frame3_GetPosition(IDirect3DRMFrame3 *iface, + IDirect3DRMFrame3 *reference, D3DVECTOR *position) +{ + FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_GetRotation(IDirect3DRMFrame3 *iface, + IDirect3DRMFrame3 *reference, D3DVECTOR *axis, D3DVALUE *theta) +{ + FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_GetScene(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 **scene) +{ + FIXME("iface %p, scene %p stub!\n", iface, scene); + + return E_NOTIMPL; +} + +static D3DRMSORTMODE WINAPI d3drm_frame3_GetSortMode(IDirect3DRMFrame3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return D3DRMSORT_FROMPARENT; +} + +static HRESULT WINAPI d3drm_frame3_GetTexture(IDirect3DRMFrame3 *iface, IDirect3DRMTexture3 **texture) +{ + FIXME("iface %p, texture %p stub!\n", iface, texture); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_GetTransform(IDirect3DRMFrame3 *iface, + IDirect3DRMFrame3 *reference, D3DRMMATRIX4D matrix) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface); + + TRACE("iface %p, reference %p, matrix %p.\n", iface, reference, matrix); + + if (reference) + FIXME("Specifying a frame as the root of the scene different from the current root frame is not supported yet\n"); + + memcpy(matrix, frame->transform, sizeof(D3DRMMATRIX4D)); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_frame3_GetVelocity(IDirect3DRMFrame3 *iface, + IDirect3DRMFrame3 *reference, D3DVECTOR *velocity, BOOL with_rotation) +{ + FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n", + iface, reference, velocity, with_rotation); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_GetOrientation(IDirect3DRMFrame3 *iface, + IDirect3DRMFrame3 *reference, D3DVECTOR *dir, D3DVECTOR *up) +{ + FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_GetVisuals(IDirect3DRMFrame3 *iface, + DWORD *count, IUnknown **visuals) +{ + FIXME("iface %p, count %p, visuals %p stub!\n", iface, count, visuals); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_InverseTransform(IDirect3DRMFrame3 *iface, D3DVECTOR *d, D3DVECTOR *s) +{ + FIXME("iface %p, d %p, s %p stub!\n", iface, d, s); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_Load(IDirect3DRMFrame3 *iface, void *filename, + void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURE3CALLBACK cb, void *ctx) +{ + FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n", + iface, filename, name, flags, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_LookAt(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *target, + IDirect3DRMFrame3 *reference, D3DRMFRAMECONSTRAINT constraint) +{ + FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_Move(IDirect3DRMFrame3 *iface, D3DVALUE delta) +{ + FIXME("iface %p, delta %.8e stub!\n", iface, delta); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_DeleteChild(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *child) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface); + struct d3drm_frame *child_impl = unsafe_impl_from_IDirect3DRMFrame3(child); + ULONG i; + + TRACE("iface %p, child %p.\n", iface, child); + + if (!child_impl) + return D3DRMERR_BADOBJECT; + + /* Check if child exists */ + for (i = 0; i < frame->nb_children; ++i) + { + if (frame->children[i] == child) + break; + } + + if (i == frame->nb_children) + return D3DRMERR_BADVALUE; + + memmove(frame->children + i, frame->children + i + 1, sizeof(*frame->children) * (frame->nb_children - 1 - i)); + IDirect3DRMFrame3_Release(child); + child_impl->parent = NULL; + --frame->nb_children; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_frame3_DeleteLight(IDirect3DRMFrame3 *iface, IDirect3DRMLight *light) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface); + ULONG i; + + TRACE("iface %p, light %p.\n", iface, light); + + if (!light) + return D3DRMERR_BADOBJECT; + + /* Check if visual exists */ + for (i = 0; i < frame->nb_lights; ++i) + { + if (frame->lights[i] == light) + break; + } + + if (i == frame->nb_lights) + return D3DRMERR_BADVALUE; + + memmove(frame->lights + i, frame->lights + i + 1, sizeof(*frame->lights) * (frame->nb_lights - 1 - i)); + IDirect3DRMLight_Release(light); + --frame->nb_lights; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_frame3_DeleteMoveCallback(IDirect3DRMFrame3 *iface, + D3DRMFRAME3MOVECALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_DeleteVisual(IDirect3DRMFrame3 *iface, IUnknown *visual) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface); + ULONG i; + + TRACE("iface %p, visual %p.\n", iface, visual); + + if (!visual) + return D3DRMERR_BADOBJECT; + + /* Check if visual exists */ + for (i = 0; i < frame->nb_visuals; ++i) + { + if (frame->visuals[i] == (IDirect3DRMVisual *)visual) + break; + } + + if (i == frame->nb_visuals) + return D3DRMERR_BADVALUE; + + memmove(frame->visuals + i, frame->visuals + i + 1, sizeof(*frame->visuals) * (frame->nb_visuals - 1 - i)); + IDirect3DRMVisual_Release(visual); + --frame->nb_visuals; + + return D3DRM_OK; +} + +static D3DCOLOR WINAPI d3drm_frame3_GetSceneBackground(IDirect3DRMFrame3 *iface) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface); + + TRACE("iface %p.\n", iface); + + return frame->scenebackground; +} + +static HRESULT WINAPI d3drm_frame3_GetSceneBackgroundDepth(IDirect3DRMFrame3 *iface, + IDirectDrawSurface **surface) +{ + FIXME("iface %p, surface %p stub!\n", iface, surface); + + return E_NOTIMPL; +} + +static D3DCOLOR WINAPI d3drm_frame3_GetSceneFogColor(IDirect3DRMFrame3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static BOOL WINAPI d3drm_frame3_GetSceneFogEnable(IDirect3DRMFrame3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return FALSE; +} + +static D3DRMFOGMODE WINAPI d3drm_frame3_GetSceneFogMode(IDirect3DRMFrame3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return D3DRMFOG_LINEAR; +} + +static HRESULT WINAPI d3drm_frame3_GetSceneFogParams(IDirect3DRMFrame3 *iface, + D3DVALUE *start, D3DVALUE *end, D3DVALUE *density) +{ + FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetSceneBackground(IDirect3DRMFrame3 *iface, D3DCOLOR color) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface); + + TRACE("iface %p, color 0x%08x.\n", iface, color); + + frame->scenebackground = color; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundRGB(IDirect3DRMFrame3 *iface, + D3DVALUE red, D3DVALUE green, D3DVALUE blue) +{ + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface); + + TRACE("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue); + + frame->scenebackground = RGBA_MAKE((BYTE)(red * 255.0f), + (BYTE)(green * 255.0f), (BYTE)(blue * 255.0f), 0xff); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundDepth(IDirect3DRMFrame3 *iface, + IDirectDrawSurface *surface) +{ + FIXME("iface %p, surface %p stub!\n", iface, surface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundImage(IDirect3DRMFrame3 *iface, + IDirect3DRMTexture3 *texture) +{ + FIXME("iface %p, texture %p stub!\n", iface, texture); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetSceneFogEnable(IDirect3DRMFrame3 *iface, BOOL enable) +{ + FIXME("iface %p, enable %#x stub!\n", iface, enable); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetSceneFogColor(IDirect3DRMFrame3 *iface, D3DCOLOR color) +{ + FIXME("iface %p, color 0x%08x stub!\n", iface, color); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetSceneFogMode(IDirect3DRMFrame3 *iface, D3DRMFOGMODE mode) +{ + FIXME("iface %p, mode %#x stub!\n", iface, mode); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetSceneFogParams(IDirect3DRMFrame3 *iface, + D3DVALUE start, D3DVALUE end, D3DVALUE density) +{ + FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetColor(IDirect3DRMFrame3 *iface, D3DCOLOR color) +{ + FIXME("iface %p, color 0x%08x stub!\n", iface, color); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetColorRGB(IDirect3DRMFrame3 *iface, + D3DVALUE red, D3DVALUE green, D3DVALUE blue) +{ + FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue); + + return E_NOTIMPL; +} + +static D3DRMZBUFFERMODE WINAPI d3drm_frame3_GetZbufferMode(IDirect3DRMFrame3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return D3DRMZBUFFER_FROMPARENT; +} + +static HRESULT WINAPI d3drm_frame3_SetMaterialMode(IDirect3DRMFrame3 *iface, D3DRMMATERIALMODE mode) +{ + FIXME("iface %p, mode %#x stub!\n", iface, mode); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetOrientation(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *reference, + D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz) +{ + FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n", + iface, reference, dx, dy, dz, ux, uy, uz); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetPosition(IDirect3DRMFrame3 *iface, + IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z) +{ + FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetRotation(IDirect3DRMFrame3 *iface, + IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) +{ + FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n", + iface, reference, x, y, z, theta); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetSortMode(IDirect3DRMFrame3 *iface, D3DRMSORTMODE mode) +{ + FIXME("iface %p, mode %#x stub!\n", iface, mode); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetTexture(IDirect3DRMFrame3 *iface, IDirect3DRMTexture3 *texture) +{ + FIXME("iface %p, texture %p stub!\n", iface, texture); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetVelocity(IDirect3DRMFrame3 *iface, + IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation) +{ + FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x.\n", + iface, reference, x, y, z, with_rotation); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetZbufferMode(IDirect3DRMFrame3 *iface, D3DRMZBUFFERMODE mode) +{ + FIXME("iface %p, mode %#x stub!\n", iface, mode); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_Transform(IDirect3DRMFrame3 *iface, D3DVECTOR *d, D3DVECTOR *s) +{ + FIXME("iface %p, d %p, s %p stub!\n", iface, d, s); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_GetBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box) +{ + FIXME("iface %p, box %p stub!\n", iface, box); + + return E_NOTIMPL; +} + +static BOOL WINAPI d3drm_frame3_GetBoxEnable(IDirect3DRMFrame3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_GetAxes(IDirect3DRMFrame3 *iface, D3DVECTOR *dir, D3DVECTOR *up) +{ + FIXME("iface %p, dir %p, up %p stub!\n", iface, dir, up); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_GetMaterial(IDirect3DRMFrame3 *iface, IDirect3DRMMaterial2 **material) +{ + FIXME("iface %p, material %p stub!\n", iface, material); + + return E_NOTIMPL; +} + +static BOOL WINAPI d3drm_frame3_GetInheritAxes(IDirect3DRMFrame3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_GetHierarchyBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box) +{ + FIXME("iface %p, box %p stub!\n", iface, box); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box) +{ + FIXME("iface %p, box %p stub!\n", iface, box); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetBoxEnable(IDirect3DRMFrame3 *iface, BOOL enable) +{ + FIXME("iface %p, enable %#x stub!\n", iface, enable); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetAxes(IDirect3DRMFrame3 *iface, + D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz) +{ + FIXME("iface %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n", + iface, dx, dy, dz, ux, uy, uz); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetInheritAxes(IDirect3DRMFrame3 *iface, BOOL inherit) +{ + FIXME("iface %p, inherit %#x stub!\n", iface, inherit); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetMaterial(IDirect3DRMFrame3 *iface, IDirect3DRMMaterial2 *material) +{ + FIXME("iface %p, material %p stub!\n", iface, material); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetQuaternion(IDirect3DRMFrame3 *iface, + IDirect3DRMFrame3 *reference, D3DRMQUATERNION *q) +{ + FIXME("iface %p, reference %p, q %p stub!\n", iface, reference, q); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_RayPick(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *reference, + D3DRMRAY *ray, DWORD flags, IDirect3DRMPicked2Array **visuals) +{ + FIXME("iface %p, reference %p, ray %p, flags %#x, visuals %p stub!\n", + iface, reference, ray, flags, visuals); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_Save(IDirect3DRMFrame3 *iface, + const char *filename, D3DRMXOFFORMAT format, D3DRMSAVEOPTIONS flags) +{ + FIXME("iface %p, filename %s, format %#x, flags %#x stub!\n", + iface, debugstr_a(filename), format, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_TransformVectors(IDirect3DRMFrame3 *iface, + IDirect3DRMFrame3 *reference, DWORD num, D3DVECTOR *dst, D3DVECTOR *src) +{ + FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface, reference, num, dst, src); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_InverseTransformVectors(IDirect3DRMFrame3 *iface, + IDirect3DRMFrame3 *reference, DWORD num, D3DVECTOR *dst, D3DVECTOR *src) +{ + FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface, reference, num, dst, src); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetTraversalOptions(IDirect3DRMFrame3 *iface, DWORD flags) +{ + FIXME("iface %p, flags %#x stub!\n", iface, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_GetTraversalOptions(IDirect3DRMFrame3 *iface, DWORD *flags) +{ + FIXME("iface %p, flags %p stub!\n", iface, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetSceneFogMethod(IDirect3DRMFrame3 *iface, DWORD flags) +{ + FIXME("iface %p, flags %#x stub!\n", iface, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_GetSceneFogMethod(IDirect3DRMFrame3 *iface, DWORD *fog_mode) +{ + FIXME("iface %p, fog_mode %p stub!\n", iface, fog_mode); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_SetMaterialOverride(IDirect3DRMFrame3 *iface, + D3DRMMATERIALOVERRIDE *override) +{ + FIXME("iface %p, override %p stub!\n", iface, override); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_frame3_GetMaterialOverride(IDirect3DRMFrame3 *iface, + D3DRMMATERIALOVERRIDE *override) +{ + FIXME("iface %p, override %p stub!\n", iface, override); + + return E_NOTIMPL; +} + +static const struct IDirect3DRMFrame3Vtbl d3drm_frame3_vtbl = +{ + d3drm_frame3_QueryInterface, + d3drm_frame3_AddRef, + d3drm_frame3_Release, + d3drm_frame3_Clone, + d3drm_frame3_AddDestroyCallback, + d3drm_frame3_DeleteDestroyCallback, + d3drm_frame3_SetAppData, + d3drm_frame3_GetAppData, + d3drm_frame3_SetName, + d3drm_frame3_GetName, + d3drm_frame3_GetClassName, + d3drm_frame3_AddChild, + d3drm_frame3_AddLight, + d3drm_frame3_AddMoveCallback, + d3drm_frame3_AddTransform, + d3drm_frame3_AddTranslation, + d3drm_frame3_AddScale, + d3drm_frame3_AddRotation, + d3drm_frame3_AddVisual, + d3drm_frame3_GetChildren, + d3drm_frame3_GetColor, + d3drm_frame3_GetLights, + d3drm_frame3_GetMaterialMode, + d3drm_frame3_GetParent, + d3drm_frame3_GetPosition, + d3drm_frame3_GetRotation, + d3drm_frame3_GetScene, + d3drm_frame3_GetSortMode, + d3drm_frame3_GetTexture, + d3drm_frame3_GetTransform, + d3drm_frame3_GetVelocity, + d3drm_frame3_GetOrientation, + d3drm_frame3_GetVisuals, + d3drm_frame3_InverseTransform, + d3drm_frame3_Load, + d3drm_frame3_LookAt, + d3drm_frame3_Move, + d3drm_frame3_DeleteChild, + d3drm_frame3_DeleteLight, + d3drm_frame3_DeleteMoveCallback, + d3drm_frame3_DeleteVisual, + d3drm_frame3_GetSceneBackground, + d3drm_frame3_GetSceneBackgroundDepth, + d3drm_frame3_GetSceneFogColor, + d3drm_frame3_GetSceneFogEnable, + d3drm_frame3_GetSceneFogMode, + d3drm_frame3_GetSceneFogParams, + d3drm_frame3_SetSceneBackground, + d3drm_frame3_SetSceneBackgroundRGB, + d3drm_frame3_SetSceneBackgroundDepth, + d3drm_frame3_SetSceneBackgroundImage, + d3drm_frame3_SetSceneFogEnable, + d3drm_frame3_SetSceneFogColor, + d3drm_frame3_SetSceneFogMode, + d3drm_frame3_SetSceneFogParams, + d3drm_frame3_SetColor, + d3drm_frame3_SetColorRGB, + d3drm_frame3_GetZbufferMode, + d3drm_frame3_SetMaterialMode, + d3drm_frame3_SetOrientation, + d3drm_frame3_SetPosition, + d3drm_frame3_SetRotation, + d3drm_frame3_SetSortMode, + d3drm_frame3_SetTexture, + d3drm_frame3_SetVelocity, + d3drm_frame3_SetZbufferMode, + d3drm_frame3_Transform, + d3drm_frame3_GetBox, + d3drm_frame3_GetBoxEnable, + d3drm_frame3_GetAxes, + d3drm_frame3_GetMaterial, + d3drm_frame3_GetInheritAxes, + d3drm_frame3_GetHierarchyBox, + d3drm_frame3_SetBox, + d3drm_frame3_SetBoxEnable, + d3drm_frame3_SetAxes, + d3drm_frame3_SetInheritAxes, + d3drm_frame3_SetMaterial, + d3drm_frame3_SetQuaternion, + d3drm_frame3_RayPick, + d3drm_frame3_Save, + d3drm_frame3_TransformVectors, + d3drm_frame3_InverseTransformVectors, + d3drm_frame3_SetTraversalOptions, + d3drm_frame3_GetTraversalOptions, + d3drm_frame3_SetSceneFogMethod, + d3drm_frame3_GetSceneFogMethod, + d3drm_frame3_SetMaterialOverride, + d3drm_frame3_GetMaterialOverride, +}; + +static inline struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3drm_frame3_vtbl); + + return impl_from_IDirect3DRMFrame3(iface); +} + +HRESULT Direct3DRMFrame_create(REFIID riid, IUnknown *parent, IUnknown **out) +{ + struct d3drm_frame *object; + HRESULT hr; + + TRACE("riid %s, parent %p, out %p.\n", debugstr_guid(riid), parent, out); + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + object->IDirect3DRMFrame2_iface.lpVtbl = &d3drm_frame2_vtbl; + object->IDirect3DRMFrame3_iface.lpVtbl = &d3drm_frame3_vtbl; + object->ref = 1; + object->scenebackground = RGBA_MAKE(0, 0, 0, 0xff); + + memcpy(object->transform, identity, sizeof(D3DRMMATRIX4D)); + + if (parent) + { + IDirect3DRMFrame3 *p; + + hr = IDirect3DRMFrame_QueryInterface(parent, &IID_IDirect3DRMFrame3, (void**)&p); + if (hr != S_OK) + { + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + IDirect3DRMFrame_Release(parent); + IDirect3DRMFrame3_AddChild(p, &object->IDirect3DRMFrame3_iface); + } + + hr = IDirect3DRMFrame3_QueryInterface(&object->IDirect3DRMFrame3_iface, riid, (void **)out); + IDirect3DRMFrame3_Release(&object->IDirect3DRMFrame3_iface); + return S_OK; +} diff --git a/dll/directx/wine/d3drm/light.c b/dll/directx/wine/d3drm/light.c new file mode 100644 index 00000000000..4145ee1ba4b --- /dev/null +++ b/dll/directx/wine/d3drm/light.c @@ -0,0 +1,383 @@ +/* + * Implementation of IDirect3DRMLight Interface + * + * Copyright 2012 AndrĂ© Hentschel + * + * 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 "d3drm_private.h" + +struct d3drm_light +{ + IDirect3DRMLight IDirect3DRMLight_iface; + LONG ref; + D3DRMLIGHTTYPE type; + D3DCOLOR color; + D3DVALUE range; + D3DVALUE cattenuation; + D3DVALUE lattenuation; + D3DVALUE qattenuation; + D3DVALUE umbra; + D3DVALUE penumbra; +}; + +static inline struct d3drm_light *impl_from_IDirect3DRMLight(IDirect3DRMLight *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_light, IDirect3DRMLight_iface); +} + +static HRESULT WINAPI d3drm_light_QueryInterface(IDirect3DRMLight *iface, REFIID riid, void **out) +{ + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualGUID(riid, &IID_IDirect3DRMLight) + || IsEqualGUID(riid, &IID_IUnknown)) + { + IDirect3DRMLight_AddRef(iface); + *out = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI d3drm_light_AddRef(IDirect3DRMLight *iface) +{ + struct d3drm_light *light = impl_from_IDirect3DRMLight(iface); + ULONG refcount = InterlockedIncrement(&light->ref); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI d3drm_light_Release(IDirect3DRMLight *iface) +{ + struct d3drm_light *light = impl_from_IDirect3DRMLight(iface); + ULONG refcount = InterlockedDecrement(&light->ref); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + HeapFree(GetProcessHeap(), 0, light); + + return refcount; +} + +static HRESULT WINAPI d3drm_light_Clone(IDirect3DRMLight *iface, + IUnknown *outer, REFIID iid, void **out) +{ + FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_light_AddDestroyCallback(IDirect3DRMLight *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_light_DeleteDestroyCallback(IDirect3DRMLight *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_light_SetAppData(IDirect3DRMLight *iface, DWORD data) +{ + FIXME("iface %p, data %#x stub!\n", iface, data); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_light_GetAppData(IDirect3DRMLight *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static HRESULT WINAPI d3drm_light_SetName(IDirect3DRMLight *iface, const char *name) +{ + FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_light_GetName(IDirect3DRMLight *iface, DWORD *size, char *name) +{ + FIXME("iface %p, size %p, name %p stub!\n", iface, size, name); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_light_GetClassName(IDirect3DRMLight *iface, DWORD *size, char *name) +{ + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + if (!size || *size < strlen("Light") || !name) + return E_INVALIDARG; + + strcpy(name, "Light"); + *size = sizeof("Light"); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_light_SetType(IDirect3DRMLight *iface, D3DRMLIGHTTYPE type) +{ + struct d3drm_light *light = impl_from_IDirect3DRMLight(iface); + + TRACE("iface %p, type %#x.\n", iface, type); + + light->type = type; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_light_SetColor(IDirect3DRMLight *iface, D3DCOLOR color) +{ + struct d3drm_light *light = impl_from_IDirect3DRMLight(iface); + + TRACE("iface %p, color 0x%08x.\n", iface, color); + + light->color = color; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_light_SetColorRGB(IDirect3DRMLight *iface, + D3DVALUE red, D3DVALUE green, D3DVALUE blue) +{ + struct d3drm_light *light = impl_from_IDirect3DRMLight(iface); + + TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue); + + light->color = RGBA_MAKE((BYTE)(red * 255.0f), (BYTE)(green * 255.0f), (BYTE)(blue * 255.0f), 0xff); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_light_SetRange(IDirect3DRMLight *iface, D3DVALUE range) +{ + struct d3drm_light *light = impl_from_IDirect3DRMLight(iface); + + TRACE("iface %p, range %.8e.\n", iface, range); + + light->range = range; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_light_SetUmbra(IDirect3DRMLight *iface, D3DVALUE umbra) +{ + struct d3drm_light *light = impl_from_IDirect3DRMLight(iface); + + TRACE("iface %p, umbra %.8e.\n", iface, umbra); + + light->umbra = umbra; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_light_SetPenumbra(IDirect3DRMLight *iface, D3DVALUE penumbra) +{ + struct d3drm_light *light = impl_from_IDirect3DRMLight(iface); + + TRACE("iface %p, penumbra %.8e.\n", iface, penumbra); + + light->penumbra = penumbra; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_light_SetConstantAttenuation(IDirect3DRMLight *iface, D3DVALUE attenuation) +{ + struct d3drm_light *light = impl_from_IDirect3DRMLight(iface); + + TRACE("iface %p, attenuation %.8e.\n", iface, attenuation); + + light->cattenuation = attenuation; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_light_SetLinearAttenuation(IDirect3DRMLight *iface, D3DVALUE attenuation) +{ + struct d3drm_light *light = impl_from_IDirect3DRMLight(iface); + + TRACE("iface %p, attenuation %.8e.\n", iface, attenuation); + + light->lattenuation = attenuation; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_light_SetQuadraticAttenuation(IDirect3DRMLight *iface, D3DVALUE attenuation) +{ + struct d3drm_light *light = impl_from_IDirect3DRMLight(iface); + + TRACE("iface %p, attenuation %.8e.\n", iface, attenuation); + + light->qattenuation = attenuation; + + return D3DRM_OK; +} + +static D3DVALUE WINAPI d3drm_light_GetRange(IDirect3DRMLight *iface) +{ + struct d3drm_light *light = impl_from_IDirect3DRMLight(iface); + + TRACE("iface %p.\n", iface); + + return light->range; +} + +static D3DVALUE WINAPI d3drm_light_GetUmbra(IDirect3DRMLight *iface) +{ + struct d3drm_light *light = impl_from_IDirect3DRMLight(iface); + + TRACE("iface %p.\n", light); + + return light->umbra; +} + +static D3DVALUE WINAPI d3drm_light_GetPenumbra(IDirect3DRMLight *iface) +{ + struct d3drm_light *light = impl_from_IDirect3DRMLight(iface); + + TRACE("iface %p.\n", iface); + + return light->penumbra; +} + +static D3DVALUE WINAPI d3drm_light_GetConstantAttenuation(IDirect3DRMLight *iface) +{ + struct d3drm_light *light = impl_from_IDirect3DRMLight(iface); + + TRACE("iface %p.\n", iface); + + return light->cattenuation; +} + +static D3DVALUE WINAPI d3drm_light_GetLinearAttenuation(IDirect3DRMLight *iface) +{ + struct d3drm_light *light = impl_from_IDirect3DRMLight(iface); + + TRACE("iface %p.\n", iface); + + return light->lattenuation; +} + +static D3DVALUE WINAPI d3drm_light_GetQuadraticAttenuation(IDirect3DRMLight *iface) +{ + struct d3drm_light *light = impl_from_IDirect3DRMLight(iface); + + TRACE("iface %p.\n", iface); + + return light->qattenuation; +} + +static D3DCOLOR WINAPI d3drm_light_GetColor(IDirect3DRMLight *iface) +{ + struct d3drm_light *light = impl_from_IDirect3DRMLight(iface); + + TRACE("iface %p.\n", iface); + + return light->color; +} + +static D3DRMLIGHTTYPE WINAPI d3drm_light_GetType(IDirect3DRMLight *iface) +{ + struct d3drm_light *light = impl_from_IDirect3DRMLight(iface); + + TRACE("iface %p.\n", iface); + + return light->type; +} + +static HRESULT WINAPI d3drm_light_SetEnableFrame(IDirect3DRMLight *iface, IDirect3DRMFrame *frame) +{ + FIXME("iface %p, frame %p stub!\n", iface, frame); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_light_GetEnableFrame(IDirect3DRMLight *iface, IDirect3DRMFrame **frame) +{ + FIXME("iface %p, frame %p stub!\n", iface, frame); + + return E_NOTIMPL; +} + +static const struct IDirect3DRMLightVtbl d3drm_light_vtbl = +{ + d3drm_light_QueryInterface, + d3drm_light_AddRef, + d3drm_light_Release, + d3drm_light_Clone, + d3drm_light_AddDestroyCallback, + d3drm_light_DeleteDestroyCallback, + d3drm_light_SetAppData, + d3drm_light_GetAppData, + d3drm_light_SetName, + d3drm_light_GetName, + d3drm_light_GetClassName, + d3drm_light_SetType, + d3drm_light_SetColor, + d3drm_light_SetColorRGB, + d3drm_light_SetRange, + d3drm_light_SetUmbra, + d3drm_light_SetPenumbra, + d3drm_light_SetConstantAttenuation, + d3drm_light_SetLinearAttenuation, + d3drm_light_SetQuadraticAttenuation, + d3drm_light_GetRange, + d3drm_light_GetUmbra, + d3drm_light_GetPenumbra, + d3drm_light_GetConstantAttenuation, + d3drm_light_GetLinearAttenuation, + d3drm_light_GetQuadraticAttenuation, + d3drm_light_GetColor, + d3drm_light_GetType, + d3drm_light_SetEnableFrame, + d3drm_light_GetEnableFrame, +}; + +HRESULT Direct3DRMLight_create(IUnknown **out) +{ + struct d3drm_light *object; + + TRACE("out %p.\n", out); + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + object->IDirect3DRMLight_iface.lpVtbl = &d3drm_light_vtbl; + object->ref = 1; + + *out = (IUnknown *)&object->IDirect3DRMLight_iface; + + return S_OK; +} diff --git a/dll/directx/wine/d3drm/material.c b/dll/directx/wine/d3drm/material.c new file mode 100644 index 00000000000..4e6fa279274 --- /dev/null +++ b/dll/directx/wine/d3drm/material.c @@ -0,0 +1,298 @@ +/* + * Implementation of IDirect3DRMMaterial2 interface + * + * Copyright 2012 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 "d3drm_private.h" + +struct color_rgb +{ + D3DVALUE r; + D3DVALUE g; + D3DVALUE b; +}; + +struct d3drm_material +{ + IDirect3DRMMaterial2 IDirect3DRMMaterial2_iface; + LONG ref; + struct color_rgb emissive; + struct color_rgb specular; + D3DVALUE power; + struct color_rgb ambient; +}; + +static inline struct d3drm_material *impl_from_IDirect3DRMMaterial2(IDirect3DRMMaterial2 *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_material, IDirect3DRMMaterial2_iface); +} + +static HRESULT WINAPI d3drm_material_QueryInterface(IDirect3DRMMaterial2 *iface, REFIID riid, void **out) +{ + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualGUID(riid, &IID_IDirect3DRMMaterial2) + || IsEqualGUID(riid, &IID_IDirect3DRMMaterial) + || IsEqualGUID(riid, &IID_IUnknown)) + { + IDirect3DRMMaterial2_AddRef(iface); + *out = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI d3drm_material_AddRef(IDirect3DRMMaterial2 *iface) +{ + struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface); + ULONG refcount = InterlockedIncrement(&material->ref); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI d3drm_material_Release(IDirect3DRMMaterial2 *iface) +{ + struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface); + ULONG refcount = InterlockedDecrement(&material->ref); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + HeapFree(GetProcessHeap(), 0, material); + + return refcount; +} + +static HRESULT WINAPI d3drm_material_Clone(IDirect3DRMMaterial2 *iface, + IUnknown *outer, REFIID iid, void **out) +{ + FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_material_AddDestroyCallback(IDirect3DRMMaterial2 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_material_DeleteDestroyCallback(IDirect3DRMMaterial2 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_material_SetAppData(IDirect3DRMMaterial2 *iface, DWORD data) +{ + FIXME("iface %p, data %#x stub!\n", iface, data); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_material_GetAppData(IDirect3DRMMaterial2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static HRESULT WINAPI d3drm_material_SetName(IDirect3DRMMaterial2 *iface, const char *name) +{ + FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_material_GetName(IDirect3DRMMaterial2 *iface, DWORD *size, char *name) +{ + FIXME("iface %p, size %p, name %p stub!\n", iface, size, name); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_material_GetClassName(IDirect3DRMMaterial2 *iface, DWORD *size, char *name) +{ + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + if (!size || *size < strlen("Material") || !name) + return E_INVALIDARG; + + strcpy(name, "Material"); + *size = sizeof("Material"); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_material_SetPower(IDirect3DRMMaterial2 *iface, D3DVALUE power) +{ + struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface); + + TRACE("iface %p, power %.8e.\n", iface, power); + + material->power = power; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_material_SetSpecular(IDirect3DRMMaterial2 *iface, + D3DVALUE r, D3DVALUE g, D3DVALUE b) +{ + struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface); + + TRACE("iface %p, r %.8e, g %.8e, b %.8e.\n", iface, r, g, b); + + material->specular.r = r; + material->specular.g = g; + material->specular.b = b; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_material_SetEmissive(IDirect3DRMMaterial2 *iface, + D3DVALUE r, D3DVALUE g, D3DVALUE b) +{ + struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface); + + TRACE("iface %p, r %.8e, g %.8e, b %.8e.\n", iface, r, g, b); + + material->emissive.r = r; + material->emissive.g = g; + material->emissive.b = b; + + return D3DRM_OK; +} + +static D3DVALUE WINAPI d3drm_material_GetPower(IDirect3DRMMaterial2 *iface) +{ + struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface); + + TRACE("iface %p.\n", iface); + + return material->power; +} + +static HRESULT WINAPI d3drm_material_GetSpecular(IDirect3DRMMaterial2 *iface, + D3DVALUE *r, D3DVALUE *g, D3DVALUE *b) +{ + struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface); + + TRACE("iface %p, r %p, g %p, b %p.\n", iface, r, g, b); + + *r = material->specular.r; + *g = material->specular.g; + *b = material->specular.b; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_material_GetEmissive(IDirect3DRMMaterial2 *iface, + D3DVALUE *r, D3DVALUE *g, D3DVALUE *b) +{ + struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface); + + TRACE("iface %p, r %p, g %p, b %p.\n", iface, r, g, b); + + *r = material->emissive.r; + *g = material->emissive.g; + *b = material->emissive.b; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_material_GetAmbient(IDirect3DRMMaterial2 *iface, + D3DVALUE *r, D3DVALUE *g, D3DVALUE *b) +{ + struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface); + + TRACE("iface %p, r %p, g %p, b %p.\n", iface, r, g, b); + + *r = material->ambient.r; + *g = material->ambient.g; + *b = material->ambient.b; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_material_SetAmbient(IDirect3DRMMaterial2 *iface, + D3DVALUE r, D3DVALUE g, D3DVALUE b) +{ + struct d3drm_material *material = impl_from_IDirect3DRMMaterial2(iface); + + TRACE("iface %p, r %.8e, g %.8e, b %.8e.\n", iface, r, g, b); + + material->ambient.r = r; + material->ambient.g = g; + material->ambient.b = b; + + return D3DRM_OK; +} + +static const struct IDirect3DRMMaterial2Vtbl d3drm_material_vtbl = +{ + d3drm_material_QueryInterface, + d3drm_material_AddRef, + d3drm_material_Release, + d3drm_material_Clone, + d3drm_material_AddDestroyCallback, + d3drm_material_DeleteDestroyCallback, + d3drm_material_SetAppData, + d3drm_material_GetAppData, + d3drm_material_SetName, + d3drm_material_GetName, + d3drm_material_GetClassName, + d3drm_material_SetPower, + d3drm_material_SetSpecular, + d3drm_material_SetEmissive, + d3drm_material_GetPower, + d3drm_material_GetSpecular, + d3drm_material_GetEmissive, + d3drm_material_GetAmbient, + d3drm_material_SetAmbient, +}; + +HRESULT Direct3DRMMaterial_create(IDirect3DRMMaterial2 **out) +{ + struct d3drm_material *object; + + TRACE("out %p.\n", out); + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + object->IDirect3DRMMaterial2_iface.lpVtbl = &d3drm_material_vtbl; + object->ref = 1; + + object->specular.r = 1.0f; + object->specular.g = 1.0f; + object->specular.b = 1.0f; + + *out = &object->IDirect3DRMMaterial2_iface; + + return S_OK; +} diff --git a/dll/directx/wine/d3drm/math.c b/dll/directx/wine/d3drm/math.c new file mode 100644 index 00000000000..698e222db8a --- /dev/null +++ b/dll/directx/wine/d3drm/math.c @@ -0,0 +1,274 @@ +/* + * Copyright 2007 David Adam + * Copyright 2007 Vijay Kiran Kamuju + * + * 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 "d3drm_private.h" + +#include + +/* Create a RGB color from its components */ +D3DCOLOR WINAPI D3DRMCreateColorRGB(D3DVALUE red, D3DVALUE green, D3DVALUE blue) +{ + return (D3DRMCreateColorRGBA(red, green, blue, 255.0)); +} +/* Create a RGBA color from its components */ +D3DCOLOR WINAPI D3DRMCreateColorRGBA(D3DVALUE red, D3DVALUE green, D3DVALUE blue, D3DVALUE alpha) +{ + int Red, Green, Blue, Alpha; + Red=floor(red*255); + Green=floor(green*255); + Blue=floor(blue*255); + Alpha=floor(alpha*255); + if (red < 0) Red=0; + if (red > 1) Red=255; + if (green < 0) Green=0; + if (green > 1) Green=255; + if (blue < 0) Blue=0; + if (blue > 1) Blue=255; + if (alpha < 0) Alpha=0; + if (alpha > 1) Alpha=255; + return (RGBA_MAKE(Red, Green, Blue, Alpha)); +} + +/* Determine the alpha part of a color */ +D3DVALUE WINAPI D3DRMColorGetAlpha(D3DCOLOR color) +{ + return (RGBA_GETALPHA(color)/255.0); +} + +/* Determine the blue part of a color */ +D3DVALUE WINAPI D3DRMColorGetBlue(D3DCOLOR color) +{ + return (RGBA_GETBLUE(color)/255.0); +} + +/* Determine the green part of a color */ +D3DVALUE WINAPI D3DRMColorGetGreen(D3DCOLOR color) +{ + return (RGBA_GETGREEN(color)/255.0); +} + +/* Determine the red part of a color */ +D3DVALUE WINAPI D3DRMColorGetRed(D3DCOLOR color) +{ + return (RGBA_GETRED(color)/255.0); +} + +/* Product of 2 quaternions */ +D3DRMQUATERNION * WINAPI D3DRMQuaternionMultiply(D3DRMQUATERNION *q, D3DRMQUATERNION *a, D3DRMQUATERNION *b) +{ + D3DRMQUATERNION temp; + D3DVECTOR cross_product; + + D3DRMVectorCrossProduct(&cross_product, &a->v, &b->v); + temp.s = a->s * b->s - D3DRMVectorDotProduct(&a->v, &b->v); + temp.v.u1.x = a->s * b->v.u1.x + b->s * a->v.u1.x + cross_product.u1.x; + temp.v.u2.y = a->s * b->v.u2.y + b->s * a->v.u2.y + cross_product.u2.y; + temp.v.u3.z = a->s * b->v.u3.z + b->s * a->v.u3.z + cross_product.u3.z; + + *q = temp; + return q; +} + +/* Matrix for the Rotation that a unit quaternion represents */ +void WINAPI D3DRMMatrixFromQuaternion(D3DRMMATRIX4D m, D3DRMQUATERNION *q) +{ + D3DVALUE w,x,y,z; + w = q->s; + x = q->v.u1.x; + y = q->v.u2.y; + z = q->v.u3.z; + m[0][0] = 1.0-2.0*(y*y+z*z); + m[1][1] = 1.0-2.0*(x*x+z*z); + m[2][2] = 1.0-2.0*(x*x+y*y); + m[1][0] = 2.0*(x*y+z*w); + m[0][1] = 2.0*(x*y-z*w); + m[2][0] = 2.0*(x*z-y*w); + m[0][2] = 2.0*(x*z+y*w); + m[2][1] = 2.0*(y*z+x*w); + m[1][2] = 2.0*(y*z-x*w); + m[3][0] = 0.0; + m[3][1] = 0.0; + m[3][2] = 0.0; + m[0][3] = 0.0; + m[1][3] = 0.0; + m[2][3] = 0.0; + m[3][3] = 1.0; +} + +/* Return a unit quaternion that represents a rotation of an angle around an axis */ +D3DRMQUATERNION * WINAPI D3DRMQuaternionFromRotation(D3DRMQUATERNION *q, D3DVECTOR *v, D3DVALUE theta) +{ + q->s = cos(theta/2.0); + D3DRMVectorScale(&q->v, D3DRMVectorNormalize(v), sin(theta/2.0)); + return q; +} + +/* Interpolation between two quaternions */ +D3DRMQUATERNION * WINAPI D3DRMQuaternionSlerp(D3DRMQUATERNION *q, + D3DRMQUATERNION *a, D3DRMQUATERNION *b, D3DVALUE alpha) +{ + D3DVALUE dot, epsilon, temp, theta, u; + D3DVECTOR v1, v2; + + dot = a->s * b->s + D3DRMVectorDotProduct(&a->v, &b->v); + epsilon = 1.0f; + temp = 1.0f - alpha; + u = alpha; + if (dot < 0.0) + { + epsilon = -1.0; + dot = -dot; + } + if( 1.0f - dot > 0.001f ) + { + theta = acos(dot); + temp = sin(theta * temp) / sin(theta); + u = sin(theta * alpha) / sin(theta); + } + q->s = temp * a->s + epsilon * u * b->s; + D3DRMVectorScale(&v1, &a->v, temp); + D3DRMVectorScale(&v2, &b->v, epsilon * u); + D3DRMVectorAdd(&q->v, &v1, &v2); + return q; +} + +/* Add Two Vectors */ +D3DVECTOR * WINAPI D3DRMVectorAdd(D3DVECTOR *d, D3DVECTOR *s1, D3DVECTOR *s2) +{ + D3DVECTOR temp; + + temp.u1.x=s1->u1.x + s2->u1.x; + temp.u2.y=s1->u2.y + s2->u2.y; + temp.u3.z=s1->u3.z + s2->u3.z; + + *d = temp; + return d; +} + +/* Subtract Two Vectors */ +D3DVECTOR * WINAPI D3DRMVectorSubtract(D3DVECTOR *d, D3DVECTOR *s1, D3DVECTOR *s2) +{ + D3DVECTOR temp; + + temp.u1.x=s1->u1.x - s2->u1.x; + temp.u2.y=s1->u2.y - s2->u2.y; + temp.u3.z=s1->u3.z - s2->u3.z; + + *d = temp; + return d; +} + +/* Cross Product of Two Vectors */ +D3DVECTOR * WINAPI D3DRMVectorCrossProduct(D3DVECTOR *d, D3DVECTOR *s1, D3DVECTOR *s2) +{ + D3DVECTOR temp; + + temp.u1.x=s1->u2.y * s2->u3.z - s1->u3.z * s2->u2.y; + temp.u2.y=s1->u3.z * s2->u1.x - s1->u1.x * s2->u3.z; + temp.u3.z=s1->u1.x * s2->u2.y - s1->u2.y * s2->u1.x; + + *d = temp; + return d; +} + +/* Dot Product of Two vectors */ +D3DVALUE WINAPI D3DRMVectorDotProduct(D3DVECTOR *s1, D3DVECTOR *s2) +{ + D3DVALUE dot_product; + dot_product=s1->u1.x * s2->u1.x + s1->u2.y * s2->u2.y + s1->u3.z * s2->u3.z; + return dot_product; +} + +/* Norm of a vector */ +D3DVALUE WINAPI D3DRMVectorModulus(D3DVECTOR *v) +{ + D3DVALUE result; + result=sqrt(v->u1.x * v->u1.x + v->u2.y * v->u2.y + v->u3.z * v->u3.z); + return result; +} + +/* Normalize a vector. Returns (1,0,0) if INPUT is the NULL vector. */ +D3DVECTOR * WINAPI D3DRMVectorNormalize(D3DVECTOR *u) +{ + D3DVALUE modulus = D3DRMVectorModulus(u); + if(modulus) + { + D3DRMVectorScale(u,u,1.0/modulus); + } + else + { + u->u1.x=1.0; + u->u2.y=0.0; + u->u3.z=0.0; + } + return u; +} + +/* Returns a random unit vector */ +D3DVECTOR * WINAPI D3DRMVectorRandom(D3DVECTOR *d) +{ + d->u1.x = rand(); + d->u2.y = rand(); + d->u3.z = rand(); + D3DRMVectorNormalize(d); + return d; +} + +/* Reflection of a vector on a surface */ +D3DVECTOR * WINAPI D3DRMVectorReflect(D3DVECTOR *r, D3DVECTOR *ray, D3DVECTOR *norm) +{ + D3DVECTOR sca, temp; + D3DRMVectorSubtract(&temp, D3DRMVectorScale(&sca, norm, 2.0*D3DRMVectorDotProduct(ray,norm)), ray); + + *r = temp; + return r; +} + +/* Rotation of a vector */ +D3DVECTOR * WINAPI D3DRMVectorRotate(D3DVECTOR *r, D3DVECTOR *v, D3DVECTOR *axis, D3DVALUE theta) +{ + D3DRMQUATERNION quaternion1, quaternion2, quaternion3; + D3DVECTOR norm; + + quaternion1.s = cos(theta * 0.5f); + quaternion2.s = cos(theta * 0.5f); + norm = *D3DRMVectorNormalize(axis); + D3DRMVectorScale(&quaternion1.v, &norm, sin(theta * 0.5f)); + D3DRMVectorScale(&quaternion2.v, &norm, -sin(theta * 0.5f)); + quaternion3.s = 0.0; + quaternion3.v = *v; + D3DRMQuaternionMultiply(&quaternion1, &quaternion1, &quaternion3); + D3DRMQuaternionMultiply(&quaternion1, &quaternion1, &quaternion2); + + *r = *D3DRMVectorNormalize(&quaternion1.v); + return r; +} + +/* Scale a vector */ +D3DVECTOR * WINAPI D3DRMVectorScale(D3DVECTOR *d, D3DVECTOR *s, D3DVALUE factor) +{ + D3DVECTOR temp; + + temp.u1.x=factor * s->u1.x; + temp.u2.y=factor * s->u2.y; + temp.u3.z=factor * s->u3.z; + + *d = temp; + return d; +} diff --git a/dll/directx/wine/d3drm/meshbuilder.c b/dll/directx/wine/d3drm/meshbuilder.c new file mode 100644 index 00000000000..7f5ae7f94c7 --- /dev/null +++ b/dll/directx/wine/d3drm/meshbuilder.c @@ -0,0 +1,2810 @@ +/* + * Implementation of IDirect3DRMMeshBuilderX and IDirect3DRMMesh interfaces + * + * Copyright 2010, 2012 Christian Costa + * Copyright 2011 AndrĂ© Hentschel + * + * 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 "d3drm_private.h" + +struct mesh_group +{ + unsigned nb_vertices; + D3DRMVERTEX* vertices; + unsigned nb_faces; + unsigned vertex_per_face; + DWORD face_data_size; + unsigned* face_data; + D3DCOLOR color; + IDirect3DRMMaterial2* material; + IDirect3DRMTexture3* texture; +}; + +struct d3drm_mesh +{ + IDirect3DRMMesh IDirect3DRMMesh_iface; + LONG ref; + DWORD groups_capacity; + DWORD nb_groups; + struct mesh_group *groups; +}; + +struct coords_2d +{ + D3DVALUE u; + D3DVALUE v; +}; + +struct mesh_material +{ + D3DCOLOR color; + IDirect3DRMMaterial2 *material; + IDirect3DRMTexture3 *texture; +}; + +struct d3drm_mesh_builder +{ + IDirect3DRMMeshBuilder2 IDirect3DRMMeshBuilder2_iface; + IDirect3DRMMeshBuilder3 IDirect3DRMMeshBuilder3_iface; + LONG ref; + char* name; + DWORD nb_vertices; + D3DVECTOR* pVertices; + DWORD nb_normals; + D3DVECTOR* pNormals; + DWORD nb_faces; + DWORD face_data_size; + void *pFaceData; + DWORD nb_coords2d; + struct coords_2d *pCoords2d; + D3DCOLOR color; + IDirect3DRMMaterial2 *material; + IDirect3DRMTexture3 *texture; + DWORD nb_materials; + struct mesh_material *materials; + DWORD *material_indices; +}; + +char templates[] = { +"xof 0302txt 0064" +"template Header" +"{" +"<3D82AB43-62DA-11CF-AB39-0020AF71E433>" +"WORD major;" +"WORD minor;" +"DWORD flags;" +"}" +"template Vector" +"{" +"<3D82AB5E-62DA-11CF-AB39-0020AF71E433>" +"FLOAT x;" +"FLOAT y;" +"FLOAT z;" +"}" +"template Coords2d" +"{" +"" +"FLOAT u;" +"FLOAT v;" +"}" +"template Matrix4x4" +"{" +"" +"array FLOAT matrix[16];" +"}" +"template ColorRGBA" +"{" +"<35FF44E0-6C7C-11CF-8F52-0040333594A3>" +"FLOAT red;" +"FLOAT green;" +"FLOAT blue;" +"FLOAT alpha;" +"}" +"template ColorRGB" +"{" +"" +"FLOAT red;" +"FLOAT green;" +"FLOAT blue;" +"}" +"template IndexedColor" +"{" +"<1630B820-7842-11CF-8F52-0040333594A3>" +"DWORD index;" +"ColorRGBA indexColor;" +"}" +"template Boolean" +"{" +"<537DA6A0-CA37-11D0-941C-0080C80CFA7B>" +"DWORD truefalse;" +"}" +"template Boolean2d" +"{" +"<4885AE63-78E8-11CF-8F52-0040333594A3>" +"Boolean u;" +"Boolean v;" +"}" +"template MaterialWrap" +"{" +"<4885AE60-78E8-11CF-8F52-0040333594A3>" +"Boolean u;" +"Boolean v;" +"}" +"template TextureFilename" +"{" +"" +"STRING filename;" +"}" +"template Material" +"{" +"<3D82AB4D-62DA-11CF-AB39-0020AF71E433>" +"ColorRGBA faceColor;" +"FLOAT power;" +"ColorRGB specularColor;" +"ColorRGB emissiveColor;" +"[...]" +"}" +"template MeshFace" +"{" +"<3D82AB5F-62DA-11CF-AB39-0020AF71E433>" +"DWORD nFaceVertexIndices;" +"array DWORD faceVertexIndices[nFaceVertexIndices];" +"}" +"template MeshFaceWraps" +"{" +"" +"DWORD nFaceWrapValues;" +"array Boolean2d faceWrapValues[nFaceWrapValues];" +"}" +"template MeshTextureCoords" +"{" +"" +"DWORD nTextureCoords;" +"array Coords2d textureCoords[nTextureCoords];" +"}" +"template MeshMaterialList" +"{" +"" +"DWORD nMaterials;" +"DWORD nFaceIndexes;" +"array DWORD faceIndexes[nFaceIndexes];" +"[Material]" +"}" +"template MeshNormals" +"{" +"" +"DWORD nNormals;" +"array Vector normals[nNormals];" +"DWORD nFaceNormals;" +"array MeshFace faceNormals[nFaceNormals];" +"}" +"template MeshVertexColors" +"{" +"<1630B821-7842-11CF-8F52-0040333594A3>" +"DWORD nVertexColors;" +"array IndexedColor vertexColors[nVertexColors];" +"}" +"template Mesh" +"{" +"<3D82AB44-62DA-11CF-AB39-0020AF71E433>" +"DWORD nVertices;" +"array Vector vertices[nVertices];" +"DWORD nFaces;" +"array MeshFace faces[nFaces];" +"[...]" +"}" +"template FrameTransformMatrix" +"{" +"" +"Matrix4x4 frameMatrix;" +"}" +"template Frame" +"{" +"<3D82AB46-62DA-11CF-AB39-0020AF71E433>" +"[...]" +"}" +"template FloatKeys" +"{" +"<10DD46A9-775B-11CF-8F52-0040333594A3>" +"DWORD nValues;" +"array FLOAT values[nValues];" +"}" +"template TimedFloatKeys" +"{" +"" +"DWORD time;" +"FloatKeys tfkeys;" +"}" +"template AnimationKey" +"{" +"<10DD46A8-775B-11CF-8F52-0040333594A3>" +"DWORD keyType;" +"DWORD nKeys;" +"array TimedFloatKeys keys[nKeys];" +"}" +"template AnimationOptions" +"{" +"" +"DWORD openclosed;" +"DWORD positionquality;" +"}" +"template Animation" +"{" +"<3D82AB4F-62DA-11CF-AB39-0020AF71E433>" +"[...]" +"}" +"template AnimationSet" +"{" +"<3D82AB50-62DA-11CF-AB39-0020AF71E433>" +"[Animation]" +"}" +"template InlineData" +"{" +"<3A23EEA0-94B1-11D0-AB39-0020AF71E433>" +"[BINARY]" +"}" +"template Url" +"{" +"<3A23EEA1-94B1-11D0-AB39-0020AF71E433>" +"DWORD nUrls;" +"array STRING urls[nUrls];" +"}" +"template ProgressiveMesh" +"{" +"<8A63C360-997D-11D0-941C-0080C80CFA7B>" +"[Url,InlineData]" +"}" +"template Guid" +"{" +"" +"DWORD data1;" +"WORD data2;" +"WORD data3;" +"array UCHAR data4[8];" +"}" +"template StringProperty" +"{" +"<7F0F21E0-BFE1-11D1-82C0-00A0C9697271>" +"STRING key;" +"STRING value;" +"}" +"template PropertyBag" +"{" +"<7F0F21E1-BFE1-11D1-82C0-00A0C9697271>" +"[StringProperty]" +"}" +"template ExternalVisual" +"{" +"<98116AA0-BDBA-11D1-82C0-00A0C9697271>" +"Guid guidExternalVisual;" +"[...]" +"}" +"template RightHanded" +"{" +"<7F5D5EA0-D53A-11D1-82C0-00A0C9697271>" +"DWORD bRightHanded;" +"}" +}; + +static inline struct d3drm_mesh *impl_from_IDirect3DRMMesh(IDirect3DRMMesh *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_mesh, IDirect3DRMMesh_iface); +} + +static inline struct d3drm_mesh_builder *impl_from_IDirect3DRMMeshBuilder2(IDirect3DRMMeshBuilder2 *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_mesh_builder, IDirect3DRMMeshBuilder2_iface); +} + +static inline struct d3drm_mesh_builder *impl_from_IDirect3DRMMeshBuilder3(IDirect3DRMMeshBuilder3 *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_mesh_builder, IDirect3DRMMeshBuilder3_iface); +} + +static void clean_mesh_builder_data(struct d3drm_mesh_builder *mesh_builder) +{ + DWORD i; + + HeapFree(GetProcessHeap(), 0, mesh_builder->name); + mesh_builder->name = NULL; + HeapFree(GetProcessHeap(), 0, mesh_builder->pVertices); + mesh_builder->pVertices = NULL; + mesh_builder->nb_vertices = 0; + HeapFree(GetProcessHeap(), 0, mesh_builder->pNormals); + mesh_builder->pNormals = NULL; + mesh_builder->nb_normals = 0; + HeapFree(GetProcessHeap(), 0, mesh_builder->pFaceData); + mesh_builder->pFaceData = NULL; + mesh_builder->face_data_size = 0; + mesh_builder->nb_faces = 0; + HeapFree(GetProcessHeap(), 0, mesh_builder->pCoords2d); + mesh_builder->pCoords2d = NULL; + mesh_builder->nb_coords2d = 0; + for (i = 0; i < mesh_builder->nb_materials; i++) + { + if (mesh_builder->materials[i].material) + IDirect3DRMMaterial2_Release(mesh_builder->materials[i].material); + if (mesh_builder->materials[i].texture) + IDirect3DRMTexture3_Release(mesh_builder->materials[i].texture); + } + mesh_builder->nb_materials = 0; + HeapFree(GetProcessHeap(), 0, mesh_builder->materials); + HeapFree(GetProcessHeap(), 0, mesh_builder->material_indices); +} + +static HRESULT WINAPI d3drm_mesh_builder2_QueryInterface(IDirect3DRMMeshBuilder2 *iface, REFIID riid, void **out) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface); + + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualGUID(riid, &IID_IDirect3DRMMeshBuilder2) + || IsEqualGUID(riid, &IID_IDirect3DRMMeshBuilder) + || IsEqualGUID(riid, &IID_IUnknown)) + { + *out = &mesh_builder->IDirect3DRMMeshBuilder2_iface; + } + else if (IsEqualGUID(riid, &IID_IDirect3DRMMeshBuilder3)) + { + *out = &mesh_builder->IDirect3DRMMeshBuilder3_iface; + } + else + { + *out = NULL; + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static ULONG WINAPI d3drm_mesh_builder2_AddRef(IDirect3DRMMeshBuilder2 *iface) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface); + ULONG refcount = InterlockedIncrement(&mesh_builder->ref); + + TRACE("%p increasing refcount to %u.\n", mesh_builder, refcount); + + return refcount; +} + +static ULONG WINAPI d3drm_mesh_builder2_Release(IDirect3DRMMeshBuilder2 *iface) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface); + ULONG refcount = InterlockedDecrement(&mesh_builder->ref); + + TRACE("%p decreasing refcount to %u.\n", mesh_builder, refcount); + + if (!refcount) + { + clean_mesh_builder_data(mesh_builder); + if (mesh_builder->material) + IDirect3DRMMaterial2_Release(mesh_builder->material); + if (mesh_builder->texture) + IDirect3DRMTexture3_Release(mesh_builder->texture); + HeapFree(GetProcessHeap(), 0, mesh_builder); + } + + return refcount; +} + +static HRESULT WINAPI d3drm_mesh_builder2_Clone(IDirect3DRMMeshBuilder2 *iface, + IUnknown *outer, REFIID iid, void **out) +{ + FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_AddDestroyCallback(IDirect3DRMMeshBuilder2 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_DeleteDestroyCallback(IDirect3DRMMeshBuilder2 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_SetAppData(IDirect3DRMMeshBuilder2 *iface, DWORD data) +{ + FIXME("iface %p, data %#x stub!\n", iface, data); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_mesh_builder2_GetAppData(IDirect3DRMMeshBuilder2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static HRESULT WINAPI d3drm_mesh_builder2_SetName(IDirect3DRMMeshBuilder2 *iface, const char *name) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface); + + TRACE("iface %p, name %s.\n", iface, debugstr_a(name)); + + return IDirect3DRMMeshBuilder3_SetName(&mesh_builder->IDirect3DRMMeshBuilder3_iface, name); +} + +static HRESULT WINAPI d3drm_mesh_builder2_GetName(IDirect3DRMMeshBuilder2 *iface, DWORD *size, char *name) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface); + + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + return IDirect3DRMMeshBuilder3_GetName(&mesh_builder->IDirect3DRMMeshBuilder3_iface, size, name); +} + +static HRESULT WINAPI d3drm_mesh_builder2_GetClassName(IDirect3DRMMeshBuilder2 *iface, DWORD *size, char *name) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface); + + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + return IDirect3DRMMeshBuilder3_GetClassName(&mesh_builder->IDirect3DRMMeshBuilder3_iface, size, name); +} + +static HRESULT WINAPI d3drm_mesh_builder2_Load(IDirect3DRMMeshBuilder2 *iface, void *filename, + void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURECALLBACK cb, void *ctx) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface); + + TRACE("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p.\n", + iface, filename, name, flags, cb, ctx); + + if (cb) + FIXME("Texture callback is not yet supported\n"); + + return IDirect3DRMMeshBuilder3_Load(&mesh_builder->IDirect3DRMMeshBuilder3_iface, + filename, name, flags, NULL, ctx); +} + +static HRESULT WINAPI d3drm_mesh_builder2_Save(IDirect3DRMMeshBuilder2 *iface, + const char *filename, D3DRMXOFFORMAT format, D3DRMSAVEOPTIONS flags) +{ + FIXME("iface %p, filename %s, format %#x, flags %#x stub!\n", + iface, debugstr_a(filename), format, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_Scale(IDirect3DRMMeshBuilder2 *iface, + D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface); + + TRACE("iface %p, sx %.8e, sy %.8e, sz %.8e.\n", iface, sx, sy, sz); + + return IDirect3DRMMeshBuilder3_Scale(&mesh_builder->IDirect3DRMMeshBuilder3_iface, sx, sy, sz); +} + +static HRESULT WINAPI d3drm_mesh_builder2_Translate(IDirect3DRMMeshBuilder2 *iface, + D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) +{ + FIXME("iface %p, tx %.8e, ty %.8e, tz %.8e stub!\n", iface, tx, ty, tz); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_SetColorSource(IDirect3DRMMeshBuilder2 *iface, D3DRMCOLORSOURCE source) +{ + FIXME("iface %p, source %#x stub!\n", iface, source); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_GetBox(IDirect3DRMMeshBuilder2 *iface, D3DRMBOX *box) +{ + FIXME("iface %p, box %p stub!\n", iface, box); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_GenerateNormals(IDirect3DRMMeshBuilder2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static D3DRMCOLORSOURCE WINAPI d3drm_mesh_builder2_GetColorSource(IDirect3DRMMeshBuilder2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_AddMesh(IDirect3DRMMeshBuilder2 *iface, IDirect3DRMMesh *mesh) +{ + FIXME("iface %p, mesh %p stub!\n", iface, mesh); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_AddMeshBuilder(IDirect3DRMMeshBuilder2 *iface, + IDirect3DRMMeshBuilder *mesh_builder) +{ + FIXME("iface %p, mesh_builder %p stub!\n", iface, mesh_builder); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_AddFrame(IDirect3DRMMeshBuilder2 *iface, IDirect3DRMFrame *frame) +{ + FIXME("iface %p, frame %p stub!\n", iface, frame); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_AddFace(IDirect3DRMMeshBuilder2 *iface, IDirect3DRMFace *face) +{ + FIXME("iface %p, face %p stub!\n", iface, face); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_AddFaces(IDirect3DRMMeshBuilder2 *iface, + DWORD vertex_count, D3DVECTOR *vertices, DWORD normal_count, D3DVECTOR *normals, + DWORD *face_data, IDirect3DRMFaceArray **array) +{ + FIXME("iface %p, vertex_count %u, vertices %p, normal_count %u, normals %p, face_data %p, array %p stub!\n", + iface, vertex_count, vertices, normal_count, normals, face_data, array); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_ReserveSpace(IDirect3DRMMeshBuilder2 *iface, + DWORD vertex_count, DWORD normal_count, DWORD face_count) +{ + FIXME("iface %p, vertex_count %u, normal_count %u, face_count %u stub!\n", + iface, vertex_count, normal_count, face_count); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_SetColorRGB(IDirect3DRMMeshBuilder2 *iface, + D3DVALUE red, D3DVALUE green, D3DVALUE blue) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface); + + TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue); + + return IDirect3DRMMeshBuilder3_SetColorRGB(&mesh_builder->IDirect3DRMMeshBuilder3_iface, red, green, blue); +} + +static HRESULT WINAPI d3drm_mesh_builder2_SetColor(IDirect3DRMMeshBuilder2 *iface, D3DCOLOR color) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface); + + TRACE("iface %p, color 0x%08x.\n", iface, color); + + return IDirect3DRMMeshBuilder3_SetColor(&mesh_builder->IDirect3DRMMeshBuilder3_iface, color); +} + +static HRESULT WINAPI d3drm_mesh_builder2_SetTexture(IDirect3DRMMeshBuilder2 *iface, + IDirect3DRMTexture *texture) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface); + IDirect3DRMTexture3 *texture3 = NULL; + HRESULT hr = D3DRM_OK; + + TRACE("iface %p, texture %p.\n", iface, texture); + + if (texture) + hr = IDirect3DRMTexture_QueryInterface(texture, &IID_IDirect3DRMTexture3, (void **)&texture3); + if (SUCCEEDED(hr)) + hr = IDirect3DRMMeshBuilder3_SetTexture(&mesh_builder->IDirect3DRMMeshBuilder3_iface, texture3); + if (texture3) + IDirect3DRMTexture3_Release(texture3); + + return hr; +} + +static HRESULT WINAPI d3drm_mesh_builder2_SetMaterial(IDirect3DRMMeshBuilder2 *iface, + IDirect3DRMMaterial *material) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface); + + TRACE("iface %p, material %p.\n", iface, material); + + return IDirect3DRMMeshBuilder3_SetMaterial(&mesh_builder->IDirect3DRMMeshBuilder3_iface, + (IDirect3DRMMaterial2 *)material); +} + +static HRESULT WINAPI d3drm_mesh_builder2_SetTextureTopology(IDirect3DRMMeshBuilder2 *iface, + BOOL wrap_u, BOOL wrap_v) +{ + FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_SetQuality(IDirect3DRMMeshBuilder2 *iface, + D3DRMRENDERQUALITY quality) +{ + FIXME("iface %p, quality %#x stub!\n", iface, quality); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_SetPerspective(IDirect3DRMMeshBuilder2 *iface, BOOL enable) +{ + FIXME("iface %p, enable %#x stub!\n", iface, enable); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_SetVertex(IDirect3DRMMeshBuilder2 *iface, + DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) +{ + FIXME("iface %p, index %u, x %.8e, y %.8e, z %.8e stub!\n", iface, index, x, y, z); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_SetNormal(IDirect3DRMMeshBuilder2 *iface, + DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) +{ + FIXME("iface %p, index %u, x %.8e, y %.8e, z %.8e stub!\n", iface, index, x, y, z); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_SetTextureCoordinates(IDirect3DRMMeshBuilder2 *iface, + DWORD index, D3DVALUE u, D3DVALUE v) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface); + + TRACE("iface %p, index %u, u %.8e, v %.8e.\n", iface, index, u, v); + + return IDirect3DRMMeshBuilder3_SetTextureCoordinates(&mesh_builder->IDirect3DRMMeshBuilder3_iface, + index, u, v); +} + +static HRESULT WINAPI d3drm_mesh_builder2_SetVertexColor(IDirect3DRMMeshBuilder2 *iface, + DWORD index, D3DCOLOR color) +{ + FIXME("iface %p, index %u, color 0x%08x stub!\n", iface, index, color); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_SetVertexColorRGB(IDirect3DRMMeshBuilder2 *iface, + DWORD index, D3DVALUE red, D3DVALUE green, D3DVALUE blue) +{ + FIXME("iface %p, index %u, red %.8e, green %.8e, blue %.8e stub!\n", + iface, index, red, green, blue); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_GetFaces(IDirect3DRMMeshBuilder2 *iface, + IDirect3DRMFaceArray **array) +{ + FIXME("iface %p, array %p stub!\n", iface, array); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_GetVertices(IDirect3DRMMeshBuilder2 *iface, + DWORD *vertex_count, D3DVECTOR *vertices, DWORD *normal_count, D3DVECTOR *normals, + DWORD *face_data_size, DWORD *face_data) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface); + + TRACE("iface %p, vertex_count %p, vertices %p, normal_count %p, normals %p, face_data_size %p, face_data %p.\n", + iface, vertex_count, vertices, normal_count, normals, face_data_size, face_data); + + if (vertices && (!vertex_count || (*vertex_count < mesh_builder->nb_vertices))) + return D3DRMERR_BADVALUE; + if (vertex_count) + *vertex_count = mesh_builder->nb_vertices; + if (vertices && mesh_builder->nb_vertices) + memcpy(vertices, mesh_builder->pVertices, mesh_builder->nb_vertices * sizeof(*vertices)); + + if (normals && (!normal_count || (*normal_count < mesh_builder->nb_normals))) + return D3DRMERR_BADVALUE; + if (normal_count) + *normal_count = mesh_builder->nb_normals; + if (normals && mesh_builder->nb_normals) + memcpy(normals, mesh_builder->pNormals, mesh_builder->nb_normals * sizeof(*normals)); + + if (face_data && (!face_data_size || (*face_data_size < mesh_builder->face_data_size))) + return D3DRMERR_BADVALUE; + if (face_data_size) + *face_data_size = mesh_builder->face_data_size; + if (face_data && mesh_builder->face_data_size) + memcpy(face_data, mesh_builder->pFaceData, mesh_builder->face_data_size * sizeof(*face_data)); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_mesh_builder2_GetTextureCoordinates(IDirect3DRMMeshBuilder2 *iface, + DWORD index, D3DVALUE *u, D3DVALUE *v) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface); + + TRACE("iface %p, index %u, u %p, v %p.\n", iface, index, u, v); + + return IDirect3DRMMeshBuilder3_GetTextureCoordinates(&mesh_builder->IDirect3DRMMeshBuilder3_iface, + index, u, v); +} + +static int WINAPI d3drm_mesh_builder2_AddVertex(IDirect3DRMMeshBuilder2 *iface, + D3DVALUE x, D3DVALUE y, D3DVALUE z) +{ + FIXME("iface %p, x %.8e, y %.8e, z %.8e stub!\n", iface, x, y, z); + + return 0; +} + +static int WINAPI d3drm_mesh_builder2_AddNormal(IDirect3DRMMeshBuilder2 *iface, + D3DVALUE x, D3DVALUE y, D3DVALUE z) +{ + FIXME("iface %p, x %.8e, y %.8e, z %.8e stub!\n", iface, x, y, z); + + return 0; +} + +static HRESULT WINAPI d3drm_mesh_builder2_CreateFace(IDirect3DRMMeshBuilder2 *iface, IDirect3DRMFace **face) +{ + TRACE("iface %p, face %p.\n", iface, face); + + return Direct3DRMFace_create(&IID_IDirect3DRMFace, (IUnknown **)face); +} + +static D3DRMRENDERQUALITY WINAPI d3drm_mesh_builder2_GetQuality(IDirect3DRMMeshBuilder2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static BOOL WINAPI d3drm_mesh_builder2_GetPerspective(IDirect3DRMMeshBuilder2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return FALSE; +} + +static int WINAPI d3drm_mesh_builder2_GetFaceCount(IDirect3DRMMeshBuilder2 *iface) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface); + + TRACE("iface %p.\n", iface); + + return mesh_builder->nb_faces; +} + +static int WINAPI d3drm_mesh_builder2_GetVertexCount(IDirect3DRMMeshBuilder2 *iface) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface); + + TRACE("iface %p.\n", iface); + + return mesh_builder->nb_vertices; +} + +static D3DCOLOR WINAPI d3drm_mesh_builder2_GetVertexColor(IDirect3DRMMeshBuilder2 *iface, DWORD index) +{ + FIXME("iface %p, index %u stub!\n", iface, index); + + return 0; +} + +static HRESULT WINAPI d3drm_mesh_builder2_CreateMesh(IDirect3DRMMeshBuilder2 *iface, IDirect3DRMMesh **mesh) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface); + + TRACE("iface %p, mesh %p.\n", iface, mesh); + + return IDirect3DRMMeshBuilder3_CreateMesh(&mesh_builder->IDirect3DRMMeshBuilder3_iface, mesh); +} + +static HRESULT WINAPI d3drm_mesh_builder2_GenerateNormals2(IDirect3DRMMeshBuilder2 *iface, + D3DVALUE crease, DWORD flags) +{ + FIXME("iface %p, crease %.8e, flags %#x stub!\n", iface, crease, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder2_GetFace(IDirect3DRMMeshBuilder2 *iface, + DWORD index, IDirect3DRMFace **face) +{ + FIXME("iface %p, index %u, face %p stub!\n", iface, index, face); + + return E_NOTIMPL; +} + +static const struct IDirect3DRMMeshBuilder2Vtbl d3drm_mesh_builder2_vtbl = +{ + d3drm_mesh_builder2_QueryInterface, + d3drm_mesh_builder2_AddRef, + d3drm_mesh_builder2_Release, + d3drm_mesh_builder2_Clone, + d3drm_mesh_builder2_AddDestroyCallback, + d3drm_mesh_builder2_DeleteDestroyCallback, + d3drm_mesh_builder2_SetAppData, + d3drm_mesh_builder2_GetAppData, + d3drm_mesh_builder2_SetName, + d3drm_mesh_builder2_GetName, + d3drm_mesh_builder2_GetClassName, + d3drm_mesh_builder2_Load, + d3drm_mesh_builder2_Save, + d3drm_mesh_builder2_Scale, + d3drm_mesh_builder2_Translate, + d3drm_mesh_builder2_SetColorSource, + d3drm_mesh_builder2_GetBox, + d3drm_mesh_builder2_GenerateNormals, + d3drm_mesh_builder2_GetColorSource, + d3drm_mesh_builder2_AddMesh, + d3drm_mesh_builder2_AddMeshBuilder, + d3drm_mesh_builder2_AddFrame, + d3drm_mesh_builder2_AddFace, + d3drm_mesh_builder2_AddFaces, + d3drm_mesh_builder2_ReserveSpace, + d3drm_mesh_builder2_SetColorRGB, + d3drm_mesh_builder2_SetColor, + d3drm_mesh_builder2_SetTexture, + d3drm_mesh_builder2_SetMaterial, + d3drm_mesh_builder2_SetTextureTopology, + d3drm_mesh_builder2_SetQuality, + d3drm_mesh_builder2_SetPerspective, + d3drm_mesh_builder2_SetVertex, + d3drm_mesh_builder2_SetNormal, + d3drm_mesh_builder2_SetTextureCoordinates, + d3drm_mesh_builder2_SetVertexColor, + d3drm_mesh_builder2_SetVertexColorRGB, + d3drm_mesh_builder2_GetFaces, + d3drm_mesh_builder2_GetVertices, + d3drm_mesh_builder2_GetTextureCoordinates, + d3drm_mesh_builder2_AddVertex, + d3drm_mesh_builder2_AddNormal, + d3drm_mesh_builder2_CreateFace, + d3drm_mesh_builder2_GetQuality, + d3drm_mesh_builder2_GetPerspective, + d3drm_mesh_builder2_GetFaceCount, + d3drm_mesh_builder2_GetVertexCount, + d3drm_mesh_builder2_GetVertexColor, + d3drm_mesh_builder2_CreateMesh, + d3drm_mesh_builder2_GenerateNormals2, + d3drm_mesh_builder2_GetFace, +}; + +static HRESULT WINAPI d3drm_mesh_builder3_QueryInterface(IDirect3DRMMeshBuilder3 *iface, REFIID riid, void **out) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface); + + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + return d3drm_mesh_builder2_QueryInterface(&mesh_builder->IDirect3DRMMeshBuilder2_iface, riid, out); +} + +static ULONG WINAPI d3drm_mesh_builder3_AddRef(IDirect3DRMMeshBuilder3 *iface) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface); + + TRACE("iface %p.\n", iface); + + return d3drm_mesh_builder2_AddRef(&mesh_builder->IDirect3DRMMeshBuilder2_iface); +} + +static ULONG WINAPI d3drm_mesh_builder3_Release(IDirect3DRMMeshBuilder3 *iface) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface); + + TRACE("iface %p.\n", iface); + + return d3drm_mesh_builder2_Release(&mesh_builder->IDirect3DRMMeshBuilder2_iface); +} + +static HRESULT WINAPI d3drm_mesh_builder3_Clone(IDirect3DRMMeshBuilder3 *iface, + IUnknown *outer, REFIID iid, void **out) +{ + FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_AddDestroyCallback(IDirect3DRMMeshBuilder3 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_DeleteDestroyCallback(IDirect3DRMMeshBuilder3 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_SetAppData(IDirect3DRMMeshBuilder3 *iface, DWORD data) +{ + FIXME("iface %p, data %#x stub!\n", iface, data); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_mesh_builder3_GetAppData(IDirect3DRMMeshBuilder3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static HRESULT WINAPI d3drm_mesh_builder3_SetName(IDirect3DRMMeshBuilder3 *iface, const char *name) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface); + char *string = NULL; + + TRACE("iface %p, name %s.\n", iface, debugstr_a(name)); + + if (name) + { + string = HeapAlloc(GetProcessHeap(), 0, strlen(name) + 1); + if (!string) return E_OUTOFMEMORY; + strcpy(string, name); + } + HeapFree(GetProcessHeap(), 0, mesh_builder->name); + mesh_builder->name = string; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_mesh_builder3_GetName(IDirect3DRMMeshBuilder3 *iface, + DWORD *size, char *name) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface); + + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + if (!size) + return E_POINTER; + + if (!mesh_builder->name) + { + *size = 0; + return D3DRM_OK; + } + + if (*size < (strlen(mesh_builder->name) + 1)) + return E_INVALIDARG; + + strcpy(name, mesh_builder->name); + *size = strlen(mesh_builder->name) + 1; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_mesh_builder3_GetClassName(IDirect3DRMMeshBuilder3 *iface, + DWORD *size, char *name) +{ + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + if (!size || *size < strlen("Builder") || !name) + return E_INVALIDARG; + + strcpy(name, "Builder"); + *size = sizeof("Builder"); + + return D3DRM_OK; +} + +HRESULT load_mesh_data(IDirect3DRMMeshBuilder3 *iface, IDirectXFileData *pData, + D3DRMLOADTEXTURECALLBACK load_texture_proc, void *arg) +{ + struct d3drm_mesh_builder *This = impl_from_IDirect3DRMMeshBuilder3(iface); + IDirectXFileData *pData2 = NULL; + const GUID* guid; + DWORD size; + BYTE *ptr; + HRESULT hr; + HRESULT ret = D3DRMERR_BADOBJECT; + DWORD* faces_vertex_idx_data = NULL; + DWORD* faces_vertex_idx_ptr; + DWORD faces_vertex_idx_size; + DWORD* faces_normal_idx_data = NULL; + DWORD* faces_normal_idx_ptr = NULL; + DWORD* faces_data_ptr; + DWORD faces_data_size = 0; + DWORD i; + + TRACE("(%p)->(%p)\n", This, pData); + + hr = IDirectXFileData_GetName(pData, NULL, &size); + if (hr != DXFILE_OK) + return hr; + if (size) + { + This->name = HeapAlloc(GetProcessHeap(), 0, size); + if (!This->name) + return E_OUTOFMEMORY; + + hr = IDirectXFileData_GetName(pData, This->name, &size); + if (hr != DXFILE_OK) + return hr; + } + + TRACE("Mesh name is '%s'\n", This->name ? This->name : ""); + + This->nb_normals = 0; + + hr = IDirectXFileData_GetData(pData, NULL, &size, (void**)&ptr); + if (hr != DXFILE_OK) + goto end; + + This->nb_vertices = *(DWORD*)ptr; + This->nb_faces = *(DWORD*)(ptr + sizeof(DWORD) + This->nb_vertices * sizeof(D3DVECTOR)); + faces_vertex_idx_size = size - sizeof(DWORD) - This->nb_vertices * sizeof(D3DVECTOR) - sizeof(DWORD); + faces_vertex_idx_ptr = (DWORD*)(ptr + sizeof(DWORD) + This->nb_vertices * sizeof(D3DVECTOR) + sizeof(DWORD)); + + TRACE("Mesh: nb_vertices = %d, nb_faces = %d, faces_vertex_idx_size = %d\n", This->nb_vertices, This->nb_faces, faces_vertex_idx_size); + + This->pVertices = HeapAlloc(GetProcessHeap(), 0, This->nb_vertices * sizeof(D3DVECTOR)); + memcpy(This->pVertices, ptr + sizeof(DWORD), This->nb_vertices * sizeof(D3DVECTOR)); + + faces_vertex_idx_ptr = faces_vertex_idx_data = HeapAlloc(GetProcessHeap(), 0, faces_vertex_idx_size); + memcpy(faces_vertex_idx_data, ptr + sizeof(DWORD) + This->nb_vertices * sizeof(D3DVECTOR) + sizeof(DWORD), faces_vertex_idx_size); + + /* Each vertex index will have its normal index counterpart so just allocate twice the size */ + This->pFaceData = HeapAlloc(GetProcessHeap(), 0, faces_vertex_idx_size * 2); + faces_data_ptr = (DWORD*)This->pFaceData; + + while (1) + { + IDirectXFileObject *object; + + hr = IDirectXFileData_GetNextObject(pData, &object); + if (hr == DXFILEERR_NOMOREOBJECTS) + { + TRACE("No more object\n"); + break; + } + if (hr != DXFILE_OK) + goto end; + + hr = IDirectXFileObject_QueryInterface(object, &IID_IDirectXFileData, (void**)&pData2); + IDirectXFileObject_Release(object); + if (hr != DXFILE_OK) + goto end; + + hr = IDirectXFileData_GetType(pData2, &guid); + if (hr != DXFILE_OK) + goto end; + + TRACE("Found object type whose GUID = %s\n", debugstr_guid(guid)); + + if (IsEqualGUID(guid, &TID_D3DRMMeshNormals)) + { + DWORD nb_faces_normals; + DWORD faces_normal_idx_size; + + hr = IDirectXFileData_GetData(pData2, NULL, &size, (void**)&ptr); + if (hr != DXFILE_OK) + goto end; + + This->nb_normals = *(DWORD*)ptr; + nb_faces_normals = *(DWORD*)(ptr + sizeof(DWORD) + This->nb_normals * sizeof(D3DVECTOR)); + + TRACE("MeshNormals: nb_normals = %d, nb_faces_normals = %d\n", This->nb_normals, nb_faces_normals); + if (nb_faces_normals != This->nb_faces) + WARN("nb_face_normals (%d) != nb_faces (%d)\n", nb_faces_normals, This->nb_normals); + + This->pNormals = HeapAlloc(GetProcessHeap(), 0, This->nb_normals * sizeof(D3DVECTOR)); + memcpy(This->pNormals, ptr + sizeof(DWORD), This->nb_normals * sizeof(D3DVECTOR)); + + faces_normal_idx_size = size - (2 * sizeof(DWORD) + This->nb_normals * sizeof(D3DVECTOR)); + faces_normal_idx_ptr = faces_normal_idx_data = HeapAlloc(GetProcessHeap(), 0, faces_normal_idx_size); + memcpy(faces_normal_idx_data, ptr + sizeof(DWORD) + This->nb_normals * sizeof(D3DVECTOR) + sizeof(DWORD), faces_normal_idx_size); + } + else if (IsEqualGUID(guid, &TID_D3DRMMeshTextureCoords)) + { + hr = IDirectXFileData_GetData(pData2, NULL, &size, (void**)&ptr); + if (hr != DXFILE_OK) + goto end; + + This->nb_coords2d = *(DWORD*)ptr; + + TRACE("MeshTextureCoords: nb_coords2d = %d\n", This->nb_coords2d); + + This->pCoords2d = HeapAlloc(GetProcessHeap(), 0, This->nb_coords2d * sizeof(*This->pCoords2d)); + memcpy(This->pCoords2d, ptr + sizeof(DWORD), This->nb_coords2d * sizeof(*This->pCoords2d)); + + } + else if (IsEqualGUID(guid, &TID_D3DRMMeshMaterialList)) + { + DWORD nb_materials; + DWORD nb_face_indices; + DWORD data_size; + IDirectXFileObject *child; + DWORD i = 0; + float* values; + + TRACE("Process MeshMaterialList\n"); + + hr = IDirectXFileData_GetData(pData2, NULL, &size, (void**)&ptr); + if (hr != DXFILE_OK) + goto end; + + nb_materials = *(DWORD*)ptr; + nb_face_indices = *(DWORD*)(ptr + sizeof(DWORD)); + data_size = 2 * sizeof(DWORD) + nb_face_indices * sizeof(DWORD); + + TRACE("nMaterials = %u, nFaceIndexes = %u\n", nb_materials, nb_face_indices); + + if (size != data_size) + WARN("Returned size %u does not match expected one %u\n", size, data_size); + + This->material_indices = HeapAlloc(GetProcessHeap(), 0, sizeof(*This->material_indices) * nb_face_indices); + if (!This->material_indices) + goto end; + memcpy(This->material_indices, ptr + 2 * sizeof(DWORD), sizeof(*This->material_indices) * nb_face_indices), + + This->materials = HeapAlloc(GetProcessHeap(), 0, sizeof(*This->materials) * nb_materials); + if (!This->materials) + { + HeapFree(GetProcessHeap(), 0, This->material_indices); + goto end; + } + This->nb_materials = nb_materials; + + while (SUCCEEDED(hr = IDirectXFileData_GetNextObject(pData2, &child)) && (i < nb_materials)) + { + IDirectXFileData *data; + IDirectXFileDataReference *reference; + IDirectXFileObject *material_child; + + hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileData, (void **)&data); + if (FAILED(hr)) + { + hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileDataReference, (void **)&reference); + IDirectXFileObject_Release(child); + if (FAILED(hr)) + goto end; + + hr = IDirectXFileDataReference_Resolve(reference, &data); + IDirectXFileDataReference_Release(reference); + if (FAILED(hr)) + goto end; + } + else + { + IDirectXFileObject_Release(child); + } + + hr = Direct3DRMMaterial_create(&This->materials[i].material); + if (FAILED(hr)) + { + IDirectXFileData_Release(data); + goto end; + } + + hr = IDirectXFileData_GetData(data, NULL, &size, (void**)&ptr); + if (hr != DXFILE_OK) + { + IDirectXFileData_Release(data); + goto end; + } + + if (size != 44) + WARN("Material size %u does not match expected one %u\n", size, 44); + + values = (float*)ptr; + + This->materials[i].color = RGBA_MAKE((BYTE)(values[0] * 255.0f), (BYTE)(values[1] * 255.0f), + (BYTE)(values[2] * 255.0f), (BYTE)(values[3] * 255.0f)); + + IDirect3DRMMaterial2_SetAmbient(This->materials[i].material, values[0], values [1], values[2]); /* Alpha ignored */ + IDirect3DRMMaterial2_SetPower(This->materials[i].material, values[4]); + IDirect3DRMMaterial2_SetSpecular(This->materials[i].material, values[5], values[6], values[7]); + IDirect3DRMMaterial2_SetEmissive(This->materials[i].material, values[8], values[9], values[10]); + + This->materials[i].texture = NULL; + + hr = IDirectXFileData_GetNextObject(data, &material_child); + if (hr == S_OK) + { + IDirectXFileData *data; + char **filename; + + hr = IDirectXFileObject_QueryInterface(material_child, &IID_IDirectXFileData, (void **)&data); + if (FAILED(hr)) + { + IDirectXFileDataReference *reference; + + hr = IDirectXFileObject_QueryInterface(material_child, &IID_IDirectXFileDataReference, (void **)&reference); + if (FAILED(hr)) + goto end; + + hr = IDirectXFileDataReference_Resolve(reference, &data); + IDirectXFileDataReference_Release(reference); + if (FAILED(hr)) + goto end; + } + + hr = IDirectXFileData_GetType(data, &guid); + if (hr != DXFILE_OK) + goto end; + if (!IsEqualGUID(guid, &TID_D3DRMTextureFilename)) + { + WARN("Not a texture filename\n"); + goto end; + } + + size = 4; + hr = IDirectXFileData_GetData(data, NULL, &size, (void**)&filename); + if (SUCCEEDED(hr)) + { + if (load_texture_proc) + { + IDirect3DRMTexture *texture; + + hr = load_texture_proc(*filename, arg, &texture); + if (SUCCEEDED(hr)) + { + hr = IDirect3DTexture_QueryInterface(texture, &IID_IDirect3DRMTexture3, (void**)&This->materials[i].texture); + IDirect3DTexture_Release(texture); + } + } + else + { + HANDLE file; + + /* If the texture file is not found, no texture is associated with the material */ + file = CreateFileA(*filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); + if (file != INVALID_HANDLE_VALUE) + { + CloseHandle(file); + + hr = Direct3DRMTexture_create(&IID_IDirect3DRMTexture3, (IUnknown**)&This->materials[i].texture); + if (FAILED(hr)) + { + IDirectXFileData_Release(data); + goto end; + } + } + } + } + } + else if (hr != DXFILEERR_NOMOREOBJECTS) + { + goto end; + } + hr = S_OK; + + IDirectXFileData_Release(data); + i++; + } + if (hr == S_OK) + { + IDirectXFileObject_Release(child); + WARN("Found more sub-objects than expected\n"); + } + else if (hr != DXFILEERR_NOMOREOBJECTS) + { + goto end; + } + hr = S_OK; + } + else + { + FIXME("Unknown GUID %s, ignoring...\n", debugstr_guid(guid)); + } + + IDirectXFileData_Release(pData2); + pData2 = NULL; + } + + if (!This->nb_normals) + { + /* Allocate normals, one per vertex */ + This->pNormals = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->nb_vertices * sizeof(D3DVECTOR)); + if (!This->pNormals) + goto end; + } + + for (i = 0; i < This->nb_faces; i++) + { + DWORD j; + DWORD nb_face_indexes; + D3DVECTOR face_normal; + + if (faces_vertex_idx_size < sizeof(DWORD)) + WARN("Not enough data to read number of indices of face %d\n", i); + + nb_face_indexes = *(faces_data_ptr + faces_data_size++) = *(faces_vertex_idx_ptr++); + faces_vertex_idx_size--; + if (faces_normal_idx_data && (*(faces_normal_idx_ptr++) != nb_face_indexes)) + WARN("Faces indices number mismatch\n"); + + if (faces_vertex_idx_size < (nb_face_indexes * sizeof(DWORD))) + WARN("Not enough data to read all indices of face %d\n", i); + + if (!This->nb_normals) + { + /* Compute face normal */ + if (nb_face_indexes > 2) + { + D3DVECTOR a, b; + + D3DRMVectorSubtract(&a, &This->pVertices[faces_vertex_idx_ptr[2]], &This->pVertices[faces_vertex_idx_ptr[1]]); + D3DRMVectorSubtract(&b, &This->pVertices[faces_vertex_idx_ptr[0]], &This->pVertices[faces_vertex_idx_ptr[1]]); + D3DRMVectorCrossProduct(&face_normal, &a, &b); + D3DRMVectorNormalize(&face_normal); + } + else + { + face_normal.u1.x = 0.0f; + face_normal.u2.y = 0.0f; + face_normal.u3.z = 0.0f; + } + } + + for (j = 0; j < nb_face_indexes; j++) + { + /* Copy vertex index */ + *(faces_data_ptr + faces_data_size++) = *faces_vertex_idx_ptr; + /* Copy normal index */ + if (This->nb_normals) + { + /* Read from x file */ + *(faces_data_ptr + faces_data_size++) = *(faces_normal_idx_ptr++); + } + else + { + DWORD vertex_idx = *faces_vertex_idx_ptr; + if (vertex_idx >= This->nb_vertices) + { + WARN("Found vertex index %u but only %u vertices available => use index 0\n", vertex_idx, This->nb_vertices); + vertex_idx = 0; + } + *(faces_data_ptr + faces_data_size++) = vertex_idx; + /* Add face normal to vertex normal */ + D3DRMVectorAdd(&This->pNormals[vertex_idx], &This->pNormals[vertex_idx], &face_normal); + } + faces_vertex_idx_ptr++; + } + faces_vertex_idx_size -= nb_face_indexes; + } + + /* Last DWORD must be 0 */ + *(faces_data_ptr + faces_data_size++) = 0; + + /* Set size (in number of DWORD) of all faces data */ + This->face_data_size = faces_data_size; + + if (!This->nb_normals) + { + /* Normalize all normals */ + for (i = 0; i < This->nb_vertices; i++) + { + D3DRMVectorNormalize(&This->pNormals[i]); + } + This->nb_normals = This->nb_vertices; + } + + /* If there is no texture coordinates, generate default texture coordinates (0.0f, 0.0f) for each vertex */ + if (!This->pCoords2d) + { + This->nb_coords2d = This->nb_vertices; + This->pCoords2d = HeapAlloc(GetProcessHeap(), 0, This->nb_coords2d * sizeof(*This->pCoords2d)); + for (i = 0; i < This->nb_coords2d; i++) + { + This->pCoords2d[i].u = 0.0f; + This->pCoords2d[i].v = 0.0f; + } + } + + TRACE("Mesh data loaded successfully\n"); + + ret = D3DRM_OK; + +end: + + HeapFree(GetProcessHeap(), 0, faces_normal_idx_data); + HeapFree(GetProcessHeap(), 0, faces_vertex_idx_data); + + return ret; +} + +static HRESULT WINAPI d3drm_mesh_builder3_Load(IDirect3DRMMeshBuilder3 *iface, void *filename, + void *name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURE3CALLBACK cb, void *arg) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface); + DXFILELOADOPTIONS load_options; + IDirectXFile *dxfile = NULL; + IDirectXFileEnumObject *enum_object = NULL; + IDirectXFileData *data = NULL; + const GUID* guid; + DWORD size; + struct d3drm_file_header *header; + HRESULT hr; + HRESULT ret = D3DRMERR_BADOBJECT; + + TRACE("iface %p, filename %p, name %p, loadflags %#x, cb %p, arg %p.\n", + iface, filename, name, loadflags, cb, arg); + + clean_mesh_builder_data(mesh_builder); + + if (loadflags == D3DRMLOAD_FROMMEMORY) + { + load_options = DXFILELOAD_FROMMEMORY; + } + else if (loadflags == D3DRMLOAD_FROMFILE) + { + load_options = DXFILELOAD_FROMFILE; + TRACE("Loading from file %s\n", debugstr_a(filename)); + } + else + { + FIXME("Load options %d not supported yet\n", loadflags); + return E_NOTIMPL; + } + + hr = DirectXFileCreate(&dxfile); + if (hr != DXFILE_OK) + goto end; + + hr = IDirectXFile_RegisterTemplates(dxfile, templates, strlen(templates)); + if (hr != DXFILE_OK) + goto end; + + hr = IDirectXFile_CreateEnumObject(dxfile, filename, load_options, &enum_object); + if (hr != DXFILE_OK) + goto end; + + hr = IDirectXFileEnumObject_GetNextDataObject(enum_object, &data); + if (hr != DXFILE_OK) + goto end; + + hr = IDirectXFileData_GetType(data, &guid); + if (hr != DXFILE_OK) + goto end; + + TRACE("Found object type whose GUID = %s\n", debugstr_guid(guid)); + + if (!IsEqualGUID(guid, &TID_DXFILEHeader)) + { + ret = D3DRMERR_BADFILE; + goto end; + } + + hr = IDirectXFileData_GetData(data, NULL, &size, (void**)&header); + if ((hr != DXFILE_OK) || (size != sizeof(*header))) + goto end; + + TRACE("Version is %u.%u, flags %#x.\n", header->major, header->minor, header->flags); + + /* Version must be 1.0.x */ + if ((header->major != 1) || (header->minor != 0)) + { + ret = D3DRMERR_BADFILE; + goto end; + } + + IDirectXFileData_Release(data); + data = NULL; + + hr = IDirectXFileEnumObject_GetNextDataObject(enum_object, &data); + if (hr != DXFILE_OK) + { + ret = D3DRMERR_NOTFOUND; + goto end; + } + + hr = IDirectXFileData_GetType(data, &guid); + if (hr != DXFILE_OK) + goto end; + + TRACE("Found object type whose GUID = %s\n", debugstr_guid(guid)); + + if (!IsEqualGUID(guid, &TID_D3DRMMesh)) + { + ret = D3DRMERR_NOTFOUND; + goto end; + } + + /* We don't care about the texture interface version since we rely on QueryInterface */ + hr = load_mesh_data(iface, data, (D3DRMLOADTEXTURECALLBACK)cb, arg); + if (hr == S_OK) + ret = D3DRM_OK; + +end: + + if (data) + IDirectXFileData_Release(data); + if (enum_object) + IDirectXFileEnumObject_Release(enum_object); + if (dxfile) + IDirectXFile_Release(dxfile); + + if (ret != D3DRM_OK) + clean_mesh_builder_data(mesh_builder); + + return ret; +} + +static HRESULT WINAPI d3drm_mesh_builder3_Save(IDirect3DRMMeshBuilder3 *iface, + const char *filename, D3DRMXOFFORMAT format, D3DRMSAVEOPTIONS flags) +{ + FIXME("iface %p, filename %s, format %#x, flags %#x stub!\n", + iface, debugstr_a(filename), format, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_Scale(IDirect3DRMMeshBuilder3 *iface, + D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface); + DWORD i; + + TRACE("iface %p, sx %.8e, sy %.8e, sz %.8e.\n", iface, sx, sy, sz); + + for (i = 0; i < mesh_builder->nb_vertices; ++i) + { + mesh_builder->pVertices[i].u1.x *= sx; + mesh_builder->pVertices[i].u2.y *= sy; + mesh_builder->pVertices[i].u3.z *= sz; + } + + /* Normals are not affected by Scale */ + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_mesh_builder3_Translate(IDirect3DRMMeshBuilder3 *iface, + D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) +{ + FIXME("iface %p, tx %.8e, ty %.8e, tz %.8e stub!\n", iface, tx, ty, tz); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_SetColorSource(IDirect3DRMMeshBuilder3 *iface, + D3DRMCOLORSOURCE source) +{ + FIXME("iface %p, source %#x stub!\n", iface, source); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_GetBox(IDirect3DRMMeshBuilder3 *iface, D3DRMBOX *box) +{ + FIXME("iface %p, box %p stub!\n", iface, box); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_GenerateNormals(IDirect3DRMMeshBuilder3 *iface, + D3DVALUE crease, DWORD flags) +{ + FIXME("iface %p, crease %.8e, flags %#x stub!\n", iface, crease, flags); + + return E_NOTIMPL; +} + +static D3DRMCOLORSOURCE WINAPI d3drm_mesh_builder3_GetColorSource(IDirect3DRMMeshBuilder3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_AddMesh(IDirect3DRMMeshBuilder3 *iface, IDirect3DRMMesh *mesh) +{ + FIXME("iface %p, mesh %p stub!\n", iface, mesh); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_AddMeshBuilder(IDirect3DRMMeshBuilder3 *iface, + IDirect3DRMMeshBuilder3 *mesh_builder, DWORD flags) +{ + FIXME("iface %p, mesh_builder %p, flags %#x stub!\n", iface, mesh_builder, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_AddFrame(IDirect3DRMMeshBuilder3 *iface, IDirect3DRMFrame3 *frame) +{ + FIXME("iface %p, frame %p stub!\n", iface, frame); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_AddFace(IDirect3DRMMeshBuilder3 *iface, IDirect3DRMFace2 *face) +{ + FIXME("iface %p, face %p stub!\n", iface, face); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_AddFaces(IDirect3DRMMeshBuilder3 *iface, + DWORD vertex_count, D3DVECTOR *vertices, DWORD normal_count, D3DVECTOR *normals, + DWORD *face_data, IDirect3DRMFaceArray **array) +{ + FIXME("iface %p, vertex_count %u, vertices %p, normal_count %u, normals %p, face_data %p array %p stub!\n", + iface, vertex_count, vertices, normal_count, normals, face_data, array); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_ReserveSpace(IDirect3DRMMeshBuilder3 *iface, + DWORD vertex_count, DWORD normal_count, DWORD face_count) +{ + FIXME("iface %p, vertex_count %u, normal_count %u, face_count %u stub!\n", + iface, vertex_count, normal_count, face_count); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_SetColorRGB(IDirect3DRMMeshBuilder3 *iface, + D3DVALUE red, D3DVALUE green, D3DVALUE blue) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface); + + TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue); + + mesh_builder->color = RGBA_MAKE((BYTE)(red * 255.0f), (BYTE)(green * 255.0f), (BYTE)(blue * 255.0f), 0xff); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_mesh_builder3_SetColor(IDirect3DRMMeshBuilder3 *iface, D3DCOLOR color) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface); + + TRACE("iface %p, color 0x%08x.\n", iface, color); + + mesh_builder->color = color; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_mesh_builder3_SetTexture(IDirect3DRMMeshBuilder3 *iface, + IDirect3DRMTexture3 *texture) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface); + + TRACE("iface %p, texture %p.\n", iface, texture); + + if (texture) + IDirect3DRMTexture3_AddRef(texture); + if (mesh_builder->texture) + IDirect3DRMTexture3_Release(mesh_builder->texture); + mesh_builder->texture = texture; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_mesh_builder3_SetMaterial(IDirect3DRMMeshBuilder3 *iface, + IDirect3DRMMaterial2 *material) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface); + + TRACE("iface %p, material %p.\n", iface, material); + + if (material) + IDirect3DRMTexture2_AddRef(material); + if (mesh_builder->material) + IDirect3DRMTexture2_Release(mesh_builder->material); + mesh_builder->material = material; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_mesh_builder3_SetTextureTopology(IDirect3DRMMeshBuilder3 *iface, + BOOL wrap_u, BOOL wrap_v) +{ + FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_SetQuality(IDirect3DRMMeshBuilder3 *iface, + D3DRMRENDERQUALITY quality) +{ + FIXME("iface %p, quality %#x stub!\n", iface, quality); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_SetPerspective(IDirect3DRMMeshBuilder3 *iface, + BOOL enable) +{ + FIXME("iface %p, enable %#x stub!\n", iface, enable); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_SetVertex(IDirect3DRMMeshBuilder3 *iface, + DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) +{ + FIXME("iface %p, index %u, x %.8e, y %.8e, z %.8e stub!\n", iface, index, x, y, z); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_SetNormal(IDirect3DRMMeshBuilder3 *iface, + DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) +{ + FIXME("iface %p, index %u, x %.8e, y %.8e, z %.8e stub!\n", iface, index, x, y, z); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_SetTextureCoordinates(IDirect3DRMMeshBuilder3 *iface, + DWORD index, D3DVALUE u, D3DVALUE v) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface); + + TRACE("iface %p, index %u, u %.8e, v %.8e.\n", iface, index, u, v); + + if (index >= mesh_builder->nb_coords2d) + return D3DRMERR_BADVALUE; + + mesh_builder->pCoords2d[index].u = u; + mesh_builder->pCoords2d[index].v = v; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_mesh_builder3_SetVertexColor(IDirect3DRMMeshBuilder3 *iface, + DWORD index, D3DCOLOR color) +{ + FIXME("iface %p, index %u, color 0x%08x stub!\n", iface, index, color); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_SetVertexColorRGB(IDirect3DRMMeshBuilder3 *iface, + DWORD index, D3DVALUE red, D3DVALUE green, D3DVALUE blue) +{ + FIXME("iface %p, index %u, red %.8e, green %.8e, blue %.8e stub!\n", + iface, index, red, green, blue); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_GetFaces(IDirect3DRMMeshBuilder3 *iface, + IDirect3DRMFaceArray **array) +{ + FIXME("iface %p, array %p stub!\n", iface, array); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_GetGeometry(IDirect3DRMMeshBuilder3 *iface, + DWORD *vertex_count, D3DVECTOR *vertices, DWORD *normal_count, D3DVECTOR *normals, + DWORD *face_data_size, DWORD *face_data) +{ + FIXME("iface %p, vertex_count %p, vertices %p, normal_count %p, normals %p, " + "face_data_size %p, face_data %p stub!\n", + iface, vertex_count, vertices, normal_count, normals, face_data_size, face_data); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_GetTextureCoordinates(IDirect3DRMMeshBuilder3 *iface, + DWORD index, D3DVALUE *u, D3DVALUE *v) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface); + + TRACE("iface %p, index %u, u %p, v %p.\n", iface, index, u, v); + + if (index >= mesh_builder->nb_coords2d) + return D3DRMERR_BADVALUE; + + *u = mesh_builder->pCoords2d[index].u; + *v = mesh_builder->pCoords2d[index].v; + + return D3DRM_OK; +} + +static int WINAPI d3drm_mesh_builder3_AddVertex(IDirect3DRMMeshBuilder3 *iface, + D3DVALUE x, D3DVALUE y, D3DVALUE z) +{ + FIXME("iface %p, x %.8e, y %.8e, z %.8e stub!\n", iface, x, y, z); + + return 0; +} + +static int WINAPI d3drm_mesh_builder3_AddNormal(IDirect3DRMMeshBuilder3 *iface, + D3DVALUE x, D3DVALUE y, D3DVALUE z) +{ + FIXME("iface %p, x %.8e, y %.8e, z %.8e stub!\n", iface, x, y, z); + + return 0; +} + +static HRESULT WINAPI d3drm_mesh_builder3_CreateFace(IDirect3DRMMeshBuilder3 *iface, IDirect3DRMFace2 **face) +{ + TRACE("iface %p, face %p.\n", iface, face); + + return Direct3DRMFace_create(&IID_IDirect3DRMFace2, (IUnknown **)face); +} + +static D3DRMRENDERQUALITY WINAPI d3drm_mesh_builder3_GetQuality(IDirect3DRMMeshBuilder3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static BOOL WINAPI d3drm_mesh_builder3_GetPerspective(IDirect3DRMMeshBuilder3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return FALSE; +} + +static int WINAPI d3drm_mesh_builder3_GetFaceCount(IDirect3DRMMeshBuilder3 *iface) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface); + + TRACE("iface %p.\n", iface); + + return mesh_builder->nb_faces; +} + +static int WINAPI d3drm_mesh_builder3_GetVertexCount(IDirect3DRMMeshBuilder3 *iface) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface); + + TRACE("iface %p.\n", iface); + + return mesh_builder->nb_vertices; +} + +static D3DCOLOR WINAPI d3drm_mesh_builder3_GetVertexColor(IDirect3DRMMeshBuilder3 *iface, + DWORD index) +{ + FIXME("iface %p, index %u stub!\n", iface, index); + + return 0; +} + +static HRESULT WINAPI d3drm_mesh_builder3_CreateMesh(IDirect3DRMMeshBuilder3 *iface, IDirect3DRMMesh **mesh) +{ + struct d3drm_mesh_builder *This = impl_from_IDirect3DRMMeshBuilder3(iface); + HRESULT hr; + D3DRMGROUPINDEX group; + + TRACE("iface %p, mesh %p.\n", iface, mesh); + + if (!mesh) + return E_POINTER; + + hr = Direct3DRMMesh_create(mesh); + if (FAILED(hr)) + return hr; + + /* If there is mesh data, create a group and put data inside */ + if (This->nb_vertices) + { + DWORD i, j; + int k; + D3DRMVERTEX* vertices; + + vertices = HeapAlloc(GetProcessHeap(), 0, This->nb_vertices * sizeof(D3DRMVERTEX)); + if (!vertices) + { + IDirect3DRMMesh_Release(*mesh); + return E_OUTOFMEMORY; + } + for (i = 0; i < This->nb_vertices; i++) + vertices[i].position = This->pVertices[i]; + hr = IDirect3DRMMesh_SetVertices(*mesh, 0, 0, This->nb_vertices, vertices); + HeapFree(GetProcessHeap(), 0, vertices); + + /* Groups are in reverse order compared to materials list in X file */ + for (k = This->nb_materials - 1; k >= 0; k--) + { + unsigned* face_data; + unsigned* out_ptr; + DWORD* in_ptr = This->pFaceData; + ULONG vertex_per_face = 0; + BOOL* used_vertices; + unsigned nb_vertices = 0; + unsigned nb_faces = 0; + + used_vertices = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->face_data_size * sizeof(*used_vertices)); + if (!used_vertices) + { + IDirect3DRMMesh_Release(*mesh); + return E_OUTOFMEMORY; + } + + face_data = HeapAlloc(GetProcessHeap(), 0, This->face_data_size * sizeof(*face_data)); + if (!face_data) + { + HeapFree(GetProcessHeap(), 0, used_vertices); + IDirect3DRMMesh_Release(*mesh); + return E_OUTOFMEMORY; + } + out_ptr = face_data; + + /* If all faces have the same number of vertex, set vertex_per_face */ + for (i = 0; i < This->nb_faces; i++) + { + /* Process only faces belonging to the group */ + if (This->material_indices[i] == k) + { + if (vertex_per_face && (vertex_per_face != *in_ptr)) + break; + vertex_per_face = *in_ptr; + } + in_ptr += 1 + *in_ptr * 2; + } + if (i != This->nb_faces) + vertex_per_face = 0; + + /* Put only vertex indices */ + in_ptr = This->pFaceData; + for (i = 0; i < This->nb_faces; i++) + { + DWORD nb_indices = *in_ptr++; + + /* Skip faces not belonging to the group */ + if (This->material_indices[i] != k) + { + in_ptr += 2 * nb_indices; + continue; + } + + /* Don't put nb indices when vertex_per_face is set */ + if (vertex_per_face) + *out_ptr++ = nb_indices; + + for (j = 0; j < nb_indices; j++) + { + *out_ptr = *in_ptr++; + used_vertices[*out_ptr++] = TRUE; + /* Skip normal index */ + in_ptr++; + } + + nb_faces++; + } + + for (i = 0; i < This->nb_vertices; i++) + if (used_vertices[i]) + nb_vertices++; + + hr = IDirect3DRMMesh_AddGroup(*mesh, nb_vertices, nb_faces, vertex_per_face, face_data, &group); + HeapFree(GetProcessHeap(), 0, used_vertices); + HeapFree(GetProcessHeap(), 0, face_data); + if (SUCCEEDED(hr)) + hr = IDirect3DRMMesh_SetGroupColor(*mesh, group, This->materials[k].color); + if (SUCCEEDED(hr)) + hr = IDirect3DRMMesh_SetGroupMaterial(*mesh, group, + (IDirect3DRMMaterial *)This->materials[k].material); + if (SUCCEEDED(hr) && This->materials[k].texture) + { + IDirect3DRMTexture *texture; + + IDirect3DRMTexture3_QueryInterface(This->materials[k].texture, + &IID_IDirect3DRMTexture, (void **)&texture); + hr = IDirect3DRMMesh_SetGroupTexture(*mesh, group, texture); + IDirect3DRMTexture_Release(texture); + } + if (FAILED(hr)) + { + IDirect3DRMMesh_Release(*mesh); + return hr; + } + } + } + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_mesh_builder3_GetFace(IDirect3DRMMeshBuilder3 *iface, + DWORD index, IDirect3DRMFace2 **face) +{ + FIXME("iface %p, index %u, face %p stub!\n", iface, index, face); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_GetVertex(IDirect3DRMMeshBuilder3 *iface, + DWORD index, D3DVECTOR *vector) +{ + FIXME("iface %p, index %u, vector %p stub!\n", iface, index, vector); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_GetNormal(IDirect3DRMMeshBuilder3 *iface, + DWORD index, D3DVECTOR *vector) +{ + FIXME("iface %p, index %u, vector %p stub!\n", iface, index, vector); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_DeleteVertices(IDirect3DRMMeshBuilder3 *iface, + DWORD start_idx, DWORD count) +{ + FIXME("iface %p, start_idx %u, count %u stub!\n", iface, start_idx, count); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_DeleteNormals(IDirect3DRMMeshBuilder3 *iface, + DWORD start_idx, DWORD count) +{ + FIXME("iface %p, start_idx %u, count %u stub!\n", iface, start_idx, count); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_DeleteFace(IDirect3DRMMeshBuilder3 *iface, IDirect3DRMFace2 *face) +{ + FIXME("iface %p, face %p stub!\n", iface, face); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_Empty(IDirect3DRMMeshBuilder3 *iface, DWORD flags) +{ + FIXME("iface %p, flags %#x stub!\n", iface, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_Optimize(IDirect3DRMMeshBuilder3 *iface, DWORD flags) +{ + FIXME("iface %p, flags %#x stub!\n", iface, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_AddFacesIndexed(IDirect3DRMMeshBuilder3 *iface, + DWORD flags, DWORD *indices, DWORD *start_idx, DWORD *count) +{ + FIXME("iface %p, flags %#x, indices %p, start_idx %p, count %p stub!\n", + iface, flags, indices, start_idx, count); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_CreateSubMesh(IDirect3DRMMeshBuilder3 *iface, IUnknown **mesh) +{ + FIXME("iface %p, mesh %p stub!\n", iface, mesh); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_GetParentMesh(IDirect3DRMMeshBuilder3 *iface, + DWORD flags, IUnknown **parent) +{ + FIXME("iface %p, flags %#x, parent %p stub!\n", iface, flags, parent); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_GetSubMeshes(IDirect3DRMMeshBuilder3 *iface, + DWORD *count, IUnknown **meshes) +{ + FIXME("iface %p, count %p, meshes %p stub!\n", iface, count, meshes); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_DeleteSubMesh(IDirect3DRMMeshBuilder3 *iface, IUnknown *mesh) +{ + FIXME("iface %p, mesh %p stub!\n", iface, mesh); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_Enable(IDirect3DRMMeshBuilder3 *iface, DWORD index) +{ + FIXME("iface %p, index %u stub!\n", iface, index); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_GetEnable(IDirect3DRMMeshBuilder3 *iface, DWORD *indices) +{ + FIXME("iface %p, indices %p stub!\n", iface, indices); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_AddTriangles(IDirect3DRMMeshBuilder3 *iface, + DWORD flags, DWORD format, DWORD vertex_count, void *data) +{ + FIXME("iface %p, flags %#x, format %#x, vertex_count %u, data %p stub!\n", + iface, flags, format, vertex_count, data); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_SetVertices(IDirect3DRMMeshBuilder3 *iface, + DWORD start_idx, DWORD count, D3DVECTOR *vector) +{ + FIXME("iface %p, start_idx %u, count %u, vector %p stub!\n", iface, start_idx, count, vector); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_GetVertices(IDirect3DRMMeshBuilder3 *iface, + DWORD start_idx, DWORD *vertex_count, D3DVECTOR *vertices) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface); + DWORD count = mesh_builder->nb_vertices - start_idx; + + TRACE("iface %p, start_idx %u, vertex_count %p, vertices %p.\n", + iface, start_idx, vertex_count, vertices); + + if (vertex_count) + *vertex_count = count; + if (vertices && mesh_builder->nb_vertices) + memcpy(vertices, mesh_builder->pVertices + start_idx, count * sizeof(*vertices)); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_mesh_builder3_SetNormals(IDirect3DRMMeshBuilder3 *iface, + DWORD start_idx, DWORD count, D3DVECTOR *vector) +{ + FIXME("iface %p, start_idx %u, count %u, vector %p stub!\n", + iface, start_idx, count, vector); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_builder3_GetNormals(IDirect3DRMMeshBuilder3 *iface, + DWORD start_idx, DWORD *normal_count, D3DVECTOR *normals) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface); + DWORD count = mesh_builder->nb_normals - start_idx; + + TRACE("iface %p, start_idx %u, normal_count %p, normals %p stub!\n", + iface, start_idx, normal_count, normals); + + if (normal_count) + *normal_count = count; + if (normals && mesh_builder->nb_normals) + memcpy(normals, mesh_builder->pNormals + start_idx, count * sizeof(*normals)); + + return D3DRM_OK; +} + +static int WINAPI d3drm_mesh_builder3_GetNormalCount(IDirect3DRMMeshBuilder3 *iface) +{ + struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface); + + TRACE("iface %p.\n", iface); + + return mesh_builder->nb_normals; +} + +static const struct IDirect3DRMMeshBuilder3Vtbl d3drm_mesh_builder3_vtbl = +{ + d3drm_mesh_builder3_QueryInterface, + d3drm_mesh_builder3_AddRef, + d3drm_mesh_builder3_Release, + d3drm_mesh_builder3_Clone, + d3drm_mesh_builder3_AddDestroyCallback, + d3drm_mesh_builder3_DeleteDestroyCallback, + d3drm_mesh_builder3_SetAppData, + d3drm_mesh_builder3_GetAppData, + d3drm_mesh_builder3_SetName, + d3drm_mesh_builder3_GetName, + d3drm_mesh_builder3_GetClassName, + d3drm_mesh_builder3_Load, + d3drm_mesh_builder3_Save, + d3drm_mesh_builder3_Scale, + d3drm_mesh_builder3_Translate, + d3drm_mesh_builder3_SetColorSource, + d3drm_mesh_builder3_GetBox, + d3drm_mesh_builder3_GenerateNormals, + d3drm_mesh_builder3_GetColorSource, + d3drm_mesh_builder3_AddMesh, + d3drm_mesh_builder3_AddMeshBuilder, + d3drm_mesh_builder3_AddFrame, + d3drm_mesh_builder3_AddFace, + d3drm_mesh_builder3_AddFaces, + d3drm_mesh_builder3_ReserveSpace, + d3drm_mesh_builder3_SetColorRGB, + d3drm_mesh_builder3_SetColor, + d3drm_mesh_builder3_SetTexture, + d3drm_mesh_builder3_SetMaterial, + d3drm_mesh_builder3_SetTextureTopology, + d3drm_mesh_builder3_SetQuality, + d3drm_mesh_builder3_SetPerspective, + d3drm_mesh_builder3_SetVertex, + d3drm_mesh_builder3_SetNormal, + d3drm_mesh_builder3_SetTextureCoordinates, + d3drm_mesh_builder3_SetVertexColor, + d3drm_mesh_builder3_SetVertexColorRGB, + d3drm_mesh_builder3_GetFaces, + d3drm_mesh_builder3_GetGeometry, + d3drm_mesh_builder3_GetTextureCoordinates, + d3drm_mesh_builder3_AddVertex, + d3drm_mesh_builder3_AddNormal, + d3drm_mesh_builder3_CreateFace, + d3drm_mesh_builder3_GetQuality, + d3drm_mesh_builder3_GetPerspective, + d3drm_mesh_builder3_GetFaceCount, + d3drm_mesh_builder3_GetVertexCount, + d3drm_mesh_builder3_GetVertexColor, + d3drm_mesh_builder3_CreateMesh, + d3drm_mesh_builder3_GetFace, + d3drm_mesh_builder3_GetVertex, + d3drm_mesh_builder3_GetNormal, + d3drm_mesh_builder3_DeleteVertices, + d3drm_mesh_builder3_DeleteNormals, + d3drm_mesh_builder3_DeleteFace, + d3drm_mesh_builder3_Empty, + d3drm_mesh_builder3_Optimize, + d3drm_mesh_builder3_AddFacesIndexed, + d3drm_mesh_builder3_CreateSubMesh, + d3drm_mesh_builder3_GetParentMesh, + d3drm_mesh_builder3_GetSubMeshes, + d3drm_mesh_builder3_DeleteSubMesh, + d3drm_mesh_builder3_Enable, + d3drm_mesh_builder3_GetEnable, + d3drm_mesh_builder3_AddTriangles, + d3drm_mesh_builder3_SetVertices, + d3drm_mesh_builder3_GetVertices, + d3drm_mesh_builder3_SetNormals, + d3drm_mesh_builder3_GetNormals, + d3drm_mesh_builder3_GetNormalCount, +}; + +HRESULT Direct3DRMMeshBuilder_create(REFIID riid, IUnknown **out) +{ + struct d3drm_mesh_builder *object; + + TRACE("riid %s, out %p.\n", debugstr_guid(riid), out); + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + object->IDirect3DRMMeshBuilder2_iface.lpVtbl = &d3drm_mesh_builder2_vtbl; + object->IDirect3DRMMeshBuilder3_iface.lpVtbl = &d3drm_mesh_builder3_vtbl; + object->ref = 1; + + if (IsEqualGUID(riid, &IID_IDirect3DRMMeshBuilder3)) + *out = (IUnknown *)&object->IDirect3DRMMeshBuilder3_iface; + else + *out = (IUnknown *)&object->IDirect3DRMMeshBuilder2_iface; + + return S_OK; +} + +static HRESULT WINAPI d3drm_mesh_QueryInterface(IDirect3DRMMesh *iface, REFIID riid, void **out) +{ + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualGUID(riid, &IID_IDirect3DRMMesh) + || IsEqualGUID(riid, &IID_IUnknown)) + { + IDirect3DRMMesh_AddRef(iface); + *out = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI d3drm_mesh_AddRef(IDirect3DRMMesh *iface) +{ + struct d3drm_mesh *mesh = impl_from_IDirect3DRMMesh(iface); + ULONG refcount = InterlockedIncrement(&mesh->ref); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI d3drm_mesh_Release(IDirect3DRMMesh *iface) +{ + struct d3drm_mesh *mesh = impl_from_IDirect3DRMMesh(iface); + ULONG refcount = InterlockedDecrement(&mesh->ref); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + { + DWORD i; + + for (i = 0; i < mesh->nb_groups; ++i) + { + HeapFree(GetProcessHeap(), 0, mesh->groups[i].vertices); + HeapFree(GetProcessHeap(), 0, mesh->groups[i].face_data); + if (mesh->groups[i].material) + IDirect3DRMMaterial2_Release(mesh->groups[i].material); + if (mesh->groups[i].texture) + IDirect3DRMTexture3_Release(mesh->groups[i].texture); + } + HeapFree(GetProcessHeap(), 0, mesh->groups); + HeapFree(GetProcessHeap(), 0, mesh); + } + + return refcount; +} + +static HRESULT WINAPI d3drm_mesh_Clone(IDirect3DRMMesh *iface, + IUnknown *outer, REFIID iid, void **out) +{ + FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_AddDestroyCallback(IDirect3DRMMesh *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_DeleteDestroyCallback(IDirect3DRMMesh *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_SetAppData(IDirect3DRMMesh *iface, DWORD data) +{ + FIXME("iface %p, data %#x stub!\n", iface, data); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_mesh_GetAppData(IDirect3DRMMesh *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static HRESULT WINAPI d3drm_mesh_SetName(IDirect3DRMMesh *iface, const char *name) +{ + FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_GetName(IDirect3DRMMesh *iface, DWORD *size, char *name) +{ + FIXME("iface %p, size %p, name %p stub!\n", iface, size, name); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_GetClassName(IDirect3DRMMesh *iface, DWORD *size, char *name) +{ + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + if (!size || *size < strlen("Mesh") || !name) + return E_INVALIDARG; + + strcpy(name, "Mesh"); + *size = sizeof("Mesh"); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_mesh_Scale(IDirect3DRMMesh *iface, + D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) +{ + FIXME("iface %p, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, sx, sy, sz); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_Translate(IDirect3DRMMesh *iface, + D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) +{ + FIXME("iface %p, tx %.8e, ty %.8e, tz %.8e stub!\n", iface, tx, ty, tz); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_GetBox(IDirect3DRMMesh *iface, D3DRMBOX *box) +{ + FIXME("iface %p, box %p stub!\n", iface, box); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_AddGroup(IDirect3DRMMesh *iface, unsigned vertex_count, + unsigned face_count, unsigned vertex_per_face, unsigned *face_data, D3DRMGROUPINDEX *id) +{ + struct d3drm_mesh *mesh = impl_from_IDirect3DRMMesh(iface); + struct mesh_group *group; + + TRACE("iface %p, vertex_count %u, face_count %u, vertex_per_face %u, face_data %p, id %p.\n", + iface, vertex_count, face_count, vertex_per_face, face_data, id); + + if (!face_data || !id) + return E_POINTER; + + if ((mesh->nb_groups + 1) > mesh->groups_capacity) + { + struct mesh_group *groups; + ULONG new_capacity; + + if (!mesh->groups_capacity) + { + new_capacity = 16; + groups = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(*groups)); + } + else + { + new_capacity = mesh->groups_capacity * 2; + groups = HeapReAlloc(GetProcessHeap(), 0, mesh->groups, new_capacity * sizeof(*groups)); + } + + if (!groups) + return E_OUTOFMEMORY; + + mesh->groups_capacity = new_capacity; + mesh->groups = groups; + } + + group = mesh->groups + mesh->nb_groups; + + group->vertices = HeapAlloc(GetProcessHeap(), 0, vertex_count * sizeof(D3DRMVERTEX)); + if (!group->vertices) + return E_OUTOFMEMORY; + group->nb_vertices = vertex_count; + group->nb_faces = face_count; + group->vertex_per_face = vertex_per_face; + + if (vertex_per_face) + { + group->face_data_size = face_count * vertex_per_face; + } + else + { + unsigned i; + unsigned nb_indices; + unsigned* face_data_ptr = face_data; + group->face_data_size = 0; + + for (i = 0; i < face_count; i++) + { + nb_indices = *face_data_ptr; + group->face_data_size += nb_indices + 1; + face_data_ptr += nb_indices; + } + } + + group->face_data = HeapAlloc(GetProcessHeap(), 0, group->face_data_size * sizeof(unsigned)); + if (!group->face_data) + { + HeapFree(GetProcessHeap(), 0 , group->vertices); + return E_OUTOFMEMORY; + } + + memcpy(group->face_data, face_data, group->face_data_size * sizeof(unsigned)); + + group->material = NULL; + group->texture = NULL; + + *id = mesh->nb_groups++; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_mesh_SetVertices(IDirect3DRMMesh *iface, D3DRMGROUPINDEX group_id, + unsigned int start_idx, unsigned int count, D3DRMVERTEX *values) +{ + struct d3drm_mesh *mesh = impl_from_IDirect3DRMMesh(iface); + + TRACE("iface %p, group_id %#x, start_idx %u, count %u, values %p.\n", + iface, group_id, start_idx, count, values); + + if (group_id >= mesh->nb_groups) + return D3DRMERR_BADVALUE; + + if ((start_idx + count - 1) >= mesh->groups[group_id].nb_vertices) + return D3DRMERR_BADVALUE; + + if (!values) + return E_POINTER; + + memcpy(mesh->groups[group_id].vertices + start_idx, values, count * sizeof(*values)); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_mesh_SetGroupColor(IDirect3DRMMesh *iface, D3DRMGROUPINDEX id, D3DCOLOR color) +{ + struct d3drm_mesh *mesh = impl_from_IDirect3DRMMesh(iface); + + TRACE("iface %p, id %#x, color 0x%08x.\n", iface, id, color); + + if (id >= mesh->nb_groups) + return D3DRMERR_BADVALUE; + + mesh->groups[id].color = color; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_mesh_SetGroupColorRGB(IDirect3DRMMesh *iface, + D3DRMGROUPINDEX id, D3DVALUE red, D3DVALUE green, D3DVALUE blue) +{ + struct d3drm_mesh *mesh = impl_from_IDirect3DRMMesh(iface); + + TRACE("iface %p, id %#x, red %.8e, green %.8e, blue %.8e.\n", iface, id, red, green, blue); + + if (id >= mesh->nb_groups) + return D3DRMERR_BADVALUE; + + mesh->groups[id].color = RGBA_MAKE((BYTE)(red * 255.0f), (BYTE)(green * 255.0f), (BYTE)(blue * 255.0f), 0xff); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_mesh_SetGroupMapping(IDirect3DRMMesh *iface, D3DRMGROUPINDEX id, D3DRMMAPPING value) +{ + FIXME("iface %p, id %#x, value %#x stub!\n", iface, id, value); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_SetGroupQuality(IDirect3DRMMesh *iface, D3DRMGROUPINDEX id, D3DRMRENDERQUALITY value) +{ + FIXME("iface %p, id %#x, value %#x stub!\n", iface, id, value); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_mesh_SetGroupMaterial(IDirect3DRMMesh *iface, + D3DRMGROUPINDEX id, IDirect3DRMMaterial *material) +{ + struct d3drm_mesh *mesh = impl_from_IDirect3DRMMesh(iface); + + TRACE("iface %p, id %#x, material %p.\n", iface, id, material); + + if (id >= mesh->nb_groups) + return D3DRMERR_BADVALUE; + + if (mesh->groups[id].material) + IDirect3DRMMaterial2_Release(mesh->groups[id].material); + + mesh->groups[id].material = (IDirect3DRMMaterial2 *)material; + + if (material) + IDirect3DRMMaterial2_AddRef(mesh->groups[id].material); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_mesh_SetGroupTexture(IDirect3DRMMesh *iface, + D3DRMGROUPINDEX id, IDirect3DRMTexture *texture) +{ + struct d3drm_mesh *mesh = impl_from_IDirect3DRMMesh(iface); + + TRACE("iface %p, id %#x, texture %p.\n", iface, id, texture); + + if (id >= mesh->nb_groups) + return D3DRMERR_BADVALUE; + + if (mesh->groups[id].texture) + IDirect3DRMTexture3_Release(mesh->groups[id].texture); + + if (!texture) + { + mesh->groups[id].texture = NULL; + return D3DRM_OK; + } + + return IDirect3DRMTexture3_QueryInterface(texture, &IID_IDirect3DRMTexture, (void **)&mesh->groups[id].texture); +} + +static DWORD WINAPI d3drm_mesh_GetGroupCount(IDirect3DRMMesh *iface) +{ + struct d3drm_mesh *mesh = impl_from_IDirect3DRMMesh(iface); + + TRACE("iface %p.\n", iface); + + return mesh->nb_groups; +} + +static HRESULT WINAPI d3drm_mesh_GetGroup(IDirect3DRMMesh *iface, D3DRMGROUPINDEX id, unsigned *vertex_count, + unsigned *face_count, unsigned *vertex_per_face, DWORD *face_data_size, unsigned *face_data) +{ + struct d3drm_mesh *mesh = impl_from_IDirect3DRMMesh(iface); + + TRACE("iface %p, id %#x, vertex_count %p, face_count %p, vertex_per_face %p, face_data_size %p, face_data %p.\n", + iface, id, vertex_count, face_count, vertex_per_face, face_data_size,face_data); + + if (id >= mesh->nb_groups) + return D3DRMERR_BADVALUE; + + if (vertex_count) + *vertex_count = mesh->groups[id].nb_vertices; + if (face_count) + *face_count = mesh->groups[id].nb_faces; + if (vertex_per_face) + *vertex_per_face = mesh->groups[id].vertex_per_face; + if (face_data_size) + *face_data_size = mesh->groups[id].face_data_size; + if (face_data) + memcpy(face_data, mesh->groups[id].face_data, mesh->groups[id].face_data_size * sizeof(*face_data)); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_mesh_GetVertices(IDirect3DRMMesh *iface, + D3DRMGROUPINDEX group_id, DWORD start_idx, DWORD count, D3DRMVERTEX *vertices) +{ + struct d3drm_mesh *mesh = impl_from_IDirect3DRMMesh(iface); + + TRACE("iface %p, group_id %#x, start_idx %u, count %u, vertices %p.\n", + iface, group_id, start_idx, count, vertices); + + if (group_id >= mesh->nb_groups) + return D3DRMERR_BADVALUE; + + if ((start_idx + count - 1) >= mesh->groups[group_id].nb_vertices) + return D3DRMERR_BADVALUE; + + if (!vertices) + return E_POINTER; + + memcpy(vertices, mesh->groups[group_id].vertices + start_idx, count * sizeof(*vertices)); + + return D3DRM_OK; +} + +static D3DCOLOR WINAPI d3drm_mesh_GetGroupColor(IDirect3DRMMesh *iface, D3DRMGROUPINDEX id) +{ + struct d3drm_mesh *mesh = impl_from_IDirect3DRMMesh(iface); + + TRACE("iface %p, id %#x.\n", iface, id); + + return mesh->groups[id].color; +} + +static D3DRMMAPPING WINAPI d3drm_mesh_GetGroupMapping(IDirect3DRMMesh *iface, D3DRMGROUPINDEX id) +{ + FIXME("iface %p, id %#x stub!\n", iface, id); + + return 0; +} +static D3DRMRENDERQUALITY WINAPI d3drm_mesh_GetGroupQuality(IDirect3DRMMesh *iface, D3DRMGROUPINDEX id) +{ + FIXME("iface %p, id %#x stub!\n", iface, id); + + return 0; +} + +static HRESULT WINAPI d3drm_mesh_GetGroupMaterial(IDirect3DRMMesh *iface, + D3DRMGROUPINDEX id, IDirect3DRMMaterial **material) +{ + struct d3drm_mesh *mesh = impl_from_IDirect3DRMMesh(iface); + + TRACE("iface %p, id %#x, material %p.\n", iface, id, material); + + if (id >= mesh->nb_groups) + return D3DRMERR_BADVALUE; + + if (!material) + return E_POINTER; + + if (mesh->groups[id].material) + IDirect3DRMTexture_QueryInterface(mesh->groups[id].material, &IID_IDirect3DRMMaterial, (void **)material); + else + *material = NULL; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_mesh_GetGroupTexture(IDirect3DRMMesh *iface, + D3DRMGROUPINDEX id, IDirect3DRMTexture **texture) +{ + struct d3drm_mesh *mesh = impl_from_IDirect3DRMMesh(iface); + + TRACE("iface %p, id %#x, texture %p.\n", iface, id, texture); + + if (id >= mesh->nb_groups) + return D3DRMERR_BADVALUE; + + if (!texture) + return E_POINTER; + + if (mesh->groups[id].texture) + IDirect3DRMTexture_QueryInterface(mesh->groups[id].texture, &IID_IDirect3DRMTexture, (void **)texture); + else + *texture = NULL; + + return D3DRM_OK; +} + +static const struct IDirect3DRMMeshVtbl d3drm_mesh_vtbl = +{ + d3drm_mesh_QueryInterface, + d3drm_mesh_AddRef, + d3drm_mesh_Release, + d3drm_mesh_Clone, + d3drm_mesh_AddDestroyCallback, + d3drm_mesh_DeleteDestroyCallback, + d3drm_mesh_SetAppData, + d3drm_mesh_GetAppData, + d3drm_mesh_SetName, + d3drm_mesh_GetName, + d3drm_mesh_GetClassName, + d3drm_mesh_Scale, + d3drm_mesh_Translate, + d3drm_mesh_GetBox, + d3drm_mesh_AddGroup, + d3drm_mesh_SetVertices, + d3drm_mesh_SetGroupColor, + d3drm_mesh_SetGroupColorRGB, + d3drm_mesh_SetGroupMapping, + d3drm_mesh_SetGroupQuality, + d3drm_mesh_SetGroupMaterial, + d3drm_mesh_SetGroupTexture, + d3drm_mesh_GetGroupCount, + d3drm_mesh_GetGroup, + d3drm_mesh_GetVertices, + d3drm_mesh_GetGroupColor, + d3drm_mesh_GetGroupMapping, + d3drm_mesh_GetGroupQuality, + d3drm_mesh_GetGroupMaterial, + d3drm_mesh_GetGroupTexture, +}; + +HRESULT Direct3DRMMesh_create(IDirect3DRMMesh **mesh) +{ + struct d3drm_mesh *object; + + TRACE("mesh %p.\n", mesh); + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + object->IDirect3DRMMesh_iface.lpVtbl = &d3drm_mesh_vtbl; + object->ref = 1; + + *mesh = &object->IDirect3DRMMesh_iface; + + return S_OK; +} diff --git a/dll/directx/wine/d3drm/texture.c b/dll/directx/wine/d3drm/texture.c new file mode 100644 index 00000000000..fb580a1fcf9 --- /dev/null +++ b/dll/directx/wine/d3drm/texture.c @@ -0,0 +1,729 @@ +/* + * Implementation of IDirect3DRMTextureX interfaces + * + * Copyright 2012 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 "d3drm_private.h" + +struct d3drm_texture +{ + IDirect3DRMTexture2 IDirect3DRMTexture2_iface; + IDirect3DRMTexture3 IDirect3DRMTexture3_iface; + LONG ref; + DWORD app_data; +}; + +static inline struct d3drm_texture *impl_from_IDirect3DRMTexture2(IDirect3DRMTexture2 *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_texture, IDirect3DRMTexture2_iface); +} + +static inline struct d3drm_texture *impl_from_IDirect3DRMTexture3(IDirect3DRMTexture3 *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_texture, IDirect3DRMTexture3_iface); +} + +static HRESULT WINAPI d3drm_texture2_QueryInterface(IDirect3DRMTexture2 *iface, REFIID riid, void **out) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); + + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualGUID(riid, &IID_IDirect3DRMTexture2) + || IsEqualGUID(riid, &IID_IDirect3DRMTexture) + || IsEqualGUID(riid, &IID_IUnknown)) + { + *out = &texture->IDirect3DRMTexture2_iface; + } + else if (IsEqualGUID(riid, &IID_IDirect3DRMTexture3)) + { + *out = &texture->IDirect3DRMTexture3_iface; + } + else + { + *out = NULL; + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static ULONG WINAPI d3drm_texture2_AddRef(IDirect3DRMTexture2 *iface) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); + ULONG refcount = InterlockedIncrement(&texture->ref); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI d3drm_texture2_Release(IDirect3DRMTexture2 *iface) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); + ULONG refcount = InterlockedDecrement(&texture->ref); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + HeapFree(GetProcessHeap(), 0, texture); + + return refcount; +} + +static HRESULT WINAPI d3drm_texture2_Clone(IDirect3DRMTexture2 *iface, + IUnknown *outer, REFIID iid, void **out) +{ + FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture2_AddDestroyCallback(IDirect3DRMTexture2 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture2_DeleteDestroyCallback(IDirect3DRMTexture2 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture2_SetAppData(IDirect3DRMTexture2 *iface, DWORD data) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); + + TRACE("iface %p, data %#x.\n", iface, data); + + return IDirect3DRMTexture3_SetAppData(&texture->IDirect3DRMTexture3_iface, data); +} + +static DWORD WINAPI d3drm_texture2_GetAppData(IDirect3DRMTexture2 *iface) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMTexture3_GetAppData(&texture->IDirect3DRMTexture3_iface); +} + +static HRESULT WINAPI d3drm_texture2_SetName(IDirect3DRMTexture2 *iface, const char *name) +{ + FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture2_GetName(IDirect3DRMTexture2 *iface, DWORD *size, char *name) +{ + FIXME("iface %p, size %p, name %p stub!\n", iface, size, name); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture2_GetClassName(IDirect3DRMTexture2 *iface, DWORD *size, char *name) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); + + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + return IDirect3DRMTexture3_GetClassName(&texture->IDirect3DRMTexture3_iface, size, name); +} + +static HRESULT WINAPI d3drm_texture2_InitFromFile(IDirect3DRMTexture2 *iface, const char *filename) +{ + FIXME("iface %p, filename %s stub!\n", iface, debugstr_a(filename)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture2_InitFromSurface(IDirect3DRMTexture2 *iface, + IDirectDrawSurface *surface) +{ + FIXME("iface %p, surface %p stub!\n", iface, surface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture2_InitFromResource(IDirect3DRMTexture2 *iface, HRSRC resource) +{ + FIXME("iface %p, resource %p stub!\n", iface, resource); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture2_Changed(IDirect3DRMTexture2 *iface, BOOL pixels, BOOL palette) +{ + FIXME("iface %p, pixels %#x, palette %#x stub!\n", iface, pixels, palette); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture2_SetColors(IDirect3DRMTexture2 *iface, DWORD max_colors) +{ + FIXME("iface %p, max_colors %u stub!\n", iface, max_colors); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture2_SetShades(IDirect3DRMTexture2 *iface, DWORD max_shades) +{ + FIXME("iface %p, max_shades %u stub!\n", iface, max_shades); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture2_SetDecalSize(IDirect3DRMTexture2 *iface, D3DVALUE width, D3DVALUE height) +{ + FIXME("iface %p, width %.8e, height %.8e stub!\n", iface, width, height); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture2_SetDecalOrigin(IDirect3DRMTexture2 *iface, LONG x, LONG y) +{ + FIXME("iface %p, x %d, y %d stub!\n", iface, x, y); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture2_SetDecalScale(IDirect3DRMTexture2 *iface, DWORD scale) +{ + FIXME("iface %p, scale %u stub!\n", iface, scale); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture2_SetDecalTransparency(IDirect3DRMTexture2 *iface, BOOL transparency) +{ + FIXME("iface %p, transparency %#x stub!\n", iface, transparency); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture2_SetDecalTransparentColor(IDirect3DRMTexture2 *iface, D3DCOLOR color) +{ + FIXME("iface %p, color 0x%08x stub!\n", iface, color); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture2_GetDecalSize(IDirect3DRMTexture2 *iface, D3DVALUE *width, D3DVALUE *height) +{ + FIXME("iface %p, width %p, height %p stub!\n", iface, width, height); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture2_GetDecalOrigin(IDirect3DRMTexture2 *iface, LONG *x, LONG *y) +{ + FIXME("iface %p, x %p, y %p stub!\n", iface, x, y); + + return E_NOTIMPL; +} + +static D3DRMIMAGE * WINAPI d3drm_texture2_GetImage(IDirect3DRMTexture2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return NULL; +} + +static DWORD WINAPI d3drm_texture2_GetShades(IDirect3DRMTexture2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static DWORD WINAPI d3drm_texture2_GetColors(IDirect3DRMTexture2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static DWORD WINAPI d3drm_texture2_GetDecalScale(IDirect3DRMTexture2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static BOOL WINAPI d3drm_texture2_GetDecalTransparency(IDirect3DRMTexture2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return FALSE; +} + +static D3DCOLOR WINAPI d3drm_texture2_GetDecalTransparentColor(IDirect3DRMTexture2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static HRESULT WINAPI d3drm_texture2_InitFromImage(IDirect3DRMTexture2 *iface, D3DRMIMAGE *image) +{ + FIXME("iface %p, image %p stub!\n", iface, image); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture2_InitFromResource2(IDirect3DRMTexture2 *iface, + HMODULE module, const char *name, const char *type) +{ + FIXME("iface %p, module %p, name %s, type %s stub!\n", + iface, module, debugstr_a(name), debugstr_a(type)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture2_GenerateMIPMap(IDirect3DRMTexture2 *iface, DWORD flags) +{ + FIXME("iface %p, flags %#x stub!\n", iface, flags); + + return E_NOTIMPL; +} + +static const struct IDirect3DRMTexture2Vtbl d3drm_texture2_vtbl = +{ + d3drm_texture2_QueryInterface, + d3drm_texture2_AddRef, + d3drm_texture2_Release, + d3drm_texture2_Clone, + d3drm_texture2_AddDestroyCallback, + d3drm_texture2_DeleteDestroyCallback, + d3drm_texture2_SetAppData, + d3drm_texture2_GetAppData, + d3drm_texture2_SetName, + d3drm_texture2_GetName, + d3drm_texture2_GetClassName, + d3drm_texture2_InitFromFile, + d3drm_texture2_InitFromSurface, + d3drm_texture2_InitFromResource, + d3drm_texture2_Changed, + d3drm_texture2_SetColors, + d3drm_texture2_SetShades, + d3drm_texture2_SetDecalSize, + d3drm_texture2_SetDecalOrigin, + d3drm_texture2_SetDecalScale, + d3drm_texture2_SetDecalTransparency, + d3drm_texture2_SetDecalTransparentColor, + d3drm_texture2_GetDecalSize, + d3drm_texture2_GetDecalOrigin, + d3drm_texture2_GetImage, + d3drm_texture2_GetShades, + d3drm_texture2_GetColors, + d3drm_texture2_GetDecalScale, + d3drm_texture2_GetDecalTransparency, + d3drm_texture2_GetDecalTransparentColor, + d3drm_texture2_InitFromImage, + d3drm_texture2_InitFromResource2, + d3drm_texture2_GenerateMIPMap, +}; + +static HRESULT WINAPI d3drm_texture3_QueryInterface(IDirect3DRMTexture3 *iface, REFIID riid, void **out) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface); + + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualGUID(riid, &IID_IDirect3DRMTexture2) + || IsEqualGUID(riid, &IID_IDirect3DRMTexture) + || IsEqualGUID(riid, &IID_IUnknown)) + { + *out = &texture->IDirect3DRMTexture2_iface; + } + else if (IsEqualGUID(riid, &IID_IDirect3DRMTexture3)) + { + *out = &texture->IDirect3DRMTexture3_iface; + } + else + { + *out = NULL; + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static ULONG WINAPI d3drm_texture3_AddRef(IDirect3DRMTexture3 *iface) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface); + ULONG refcount = InterlockedIncrement(&texture->ref); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI d3drm_texture3_Release(IDirect3DRMTexture3 *iface) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface); + ULONG refcount = InterlockedDecrement(&texture->ref); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + HeapFree(GetProcessHeap(), 0, texture); + + return refcount; +} + +static HRESULT WINAPI d3drm_texture3_Clone(IDirect3DRMTexture3 *iface, + IUnknown *outer, REFIID iid, void **out) +{ + FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_AddDestroyCallback(IDirect3DRMTexture3 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_DeleteDestroyCallback(IDirect3DRMTexture3 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_SetAppData(IDirect3DRMTexture3 *iface, DWORD data) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface); + + TRACE("iface %p, data %#x.\n", iface, data); + + texture->app_data = data; + + return D3DRM_OK; +} + +static DWORD WINAPI d3drm_texture3_GetAppData(IDirect3DRMTexture3 *iface) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface); + + TRACE("iface %p.\n", iface); + + return texture->app_data; +} + +static HRESULT WINAPI d3drm_texture3_SetName(IDirect3DRMTexture3 *iface, const char *name) +{ + FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_GetName(IDirect3DRMTexture3 *iface, DWORD *size, char *name) +{ + FIXME("iface %p, size %p, name %p stub!\n", iface, size, name); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_GetClassName(IDirect3DRMTexture3 *iface, DWORD *size, char *name) +{ + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + if (!size || *size < strlen("Texture") || !name) + return E_INVALIDARG; + + strcpy(name, "Texture"); + *size = sizeof("Texture"); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_texture3_InitFromFile(IDirect3DRMTexture3 *iface, const char *filename) +{ + FIXME("iface %p, filename %s stub!\n", iface, debugstr_a(filename)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_InitFromSurface(IDirect3DRMTexture3 *iface, + IDirectDrawSurface *surface) +{ + FIXME("iface %p, surface %p stub!\n", iface, surface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_InitFromResource(IDirect3DRMTexture3 *iface, HRSRC resource) +{ + FIXME("iface %p, resource %p stub!\n", iface, resource); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_Changed(IDirect3DRMTexture3 *iface, + DWORD flags, DWORD rect_count, RECT *rects) +{ + FIXME("iface %p, flags %#x, rect_count %u, rects %p stub!\n", iface, flags, rect_count, rects); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_SetColors(IDirect3DRMTexture3 *iface, DWORD max_colors) +{ + FIXME("iface %p, max_colors %u stub!\n", iface, max_colors); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_SetShades(IDirect3DRMTexture3 *iface, DWORD max_shades) +{ + FIXME("iface %p, max_shades %u stub!\n", iface, max_shades); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_SetDecalSize(IDirect3DRMTexture3 *iface, D3DVALUE width, D3DVALUE height) +{ + FIXME("iface %p, width %.8e, height %.8e stub!\n", iface, width, height); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_SetDecalOrigin(IDirect3DRMTexture3 *iface, LONG x, LONG y) +{ + FIXME("iface %p, x %d, y %d stub!\n", iface, x, y); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_SetDecalScale(IDirect3DRMTexture3 *iface, DWORD scale) +{ + FIXME("iface %p, scale %u stub!\n", iface, scale); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_SetDecalTransparency(IDirect3DRMTexture3 *iface, BOOL transparency) +{ + FIXME("iface %p, transparency %#x stub!\n", iface, transparency); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_SetDecalTransparentColor(IDirect3DRMTexture3 *iface, D3DCOLOR color) +{ + FIXME("iface %p, color 0x%08x stub!\n", iface, color); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_GetDecalSize(IDirect3DRMTexture3 *iface, D3DVALUE *width, D3DVALUE *height) +{ + FIXME("iface %p, width %p, height %p stub!\n", iface, width, height); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_GetDecalOrigin(IDirect3DRMTexture3 *iface, LONG *x, LONG *y) +{ + FIXME("iface %p, x %p, y %p stub!\n", iface, x, y); + + return E_NOTIMPL; +} + +static D3DRMIMAGE * WINAPI d3drm_texture3_GetImage(IDirect3DRMTexture3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return NULL; +} + +static DWORD WINAPI d3drm_texture3_GetShades(IDirect3DRMTexture3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static DWORD WINAPI d3drm_texture3_GetColors(IDirect3DRMTexture3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static DWORD WINAPI d3drm_texture3_GetDecalScale(IDirect3DRMTexture3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static BOOL WINAPI d3drm_texture3_GetDecalTransparency(IDirect3DRMTexture3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return FALSE; +} + +static D3DCOLOR WINAPI d3drm_texture3_GetDecalTransparentColor(IDirect3DRMTexture3 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static HRESULT WINAPI d3drm_texture3_InitFromImage(IDirect3DRMTexture3 *iface, D3DRMIMAGE *image) +{ + FIXME("iface %p, image %p stub!\n", iface, image); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_InitFromResource2(IDirect3DRMTexture3 *iface, + HMODULE module, const char *name, const char *type) +{ + FIXME("iface %p, module %p, name %s, type %s stub!\n", + iface, module, debugstr_a(name), debugstr_a(type)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_GenerateMIPMap(IDirect3DRMTexture3 *iface, DWORD flags) +{ + FIXME("iface %p, flags %#x stub!\n", iface, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_GetSurface(IDirect3DRMTexture3 *iface, + DWORD flags, IDirectDrawSurface **surface) +{ + FIXME("iface %p, flags %#x, surface %p stub!\n", iface, flags, surface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_SetCacheOptions(IDirect3DRMTexture3 *iface, LONG importance, DWORD flags) +{ + FIXME("iface %p, importance %d, flags %#x stub!\n", iface, importance, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_GetCacheOptions(IDirect3DRMTexture3 *iface, + LONG *importance, DWORD *flags) +{ + FIXME("iface %p, importance %p, flags %p stub!\n", iface, importance, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_SetDownsampleCallback(IDirect3DRMTexture3 *iface, + D3DRMDOWNSAMPLECALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture3_SetValidationCallback(IDirect3DRMTexture3 *iface, + D3DRMVALIDATIONCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static const struct IDirect3DRMTexture3Vtbl d3drm_texture3_vtbl = +{ + d3drm_texture3_QueryInterface, + d3drm_texture3_AddRef, + d3drm_texture3_Release, + d3drm_texture3_Clone, + d3drm_texture3_AddDestroyCallback, + d3drm_texture3_DeleteDestroyCallback, + d3drm_texture3_SetAppData, + d3drm_texture3_GetAppData, + d3drm_texture3_SetName, + d3drm_texture3_GetName, + d3drm_texture3_GetClassName, + d3drm_texture3_InitFromFile, + d3drm_texture3_InitFromSurface, + d3drm_texture3_InitFromResource, + d3drm_texture3_Changed, + d3drm_texture3_SetColors, + d3drm_texture3_SetShades, + d3drm_texture3_SetDecalSize, + d3drm_texture3_SetDecalOrigin, + d3drm_texture3_SetDecalScale, + d3drm_texture3_SetDecalTransparency, + d3drm_texture3_SetDecalTransparentColor, + d3drm_texture3_GetDecalSize, + d3drm_texture3_GetDecalOrigin, + d3drm_texture3_GetImage, + d3drm_texture3_GetShades, + d3drm_texture3_GetColors, + d3drm_texture3_GetDecalScale, + d3drm_texture3_GetDecalTransparency, + d3drm_texture3_GetDecalTransparentColor, + d3drm_texture3_InitFromImage, + d3drm_texture3_InitFromResource2, + d3drm_texture3_GenerateMIPMap, + d3drm_texture3_GetSurface, + d3drm_texture3_SetCacheOptions, + d3drm_texture3_GetCacheOptions, + d3drm_texture3_SetDownsampleCallback, + d3drm_texture3_SetValidationCallback, +}; + +HRESULT Direct3DRMTexture_create(REFIID riid, IUnknown **out) +{ + struct d3drm_texture *object; + + TRACE("riid %s, out %p.\n", debugstr_guid(riid), out); + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + object->IDirect3DRMTexture2_iface.lpVtbl = &d3drm_texture2_vtbl; + object->IDirect3DRMTexture3_iface.lpVtbl = &d3drm_texture3_vtbl; + object->ref = 1; + + if (IsEqualGUID(riid, &IID_IDirect3DRMTexture3)) + *out = (IUnknown *)&object->IDirect3DRMTexture3_iface; + else + *out = (IUnknown *)&object->IDirect3DRMTexture2_iface; + + return S_OK; +} diff --git a/dll/directx/wine/d3drm/version.rc b/dll/directx/wine/d3drm/version.rc new file mode 100644 index 00000000000..a9ce437be72 --- /dev/null +++ b/dll/directx/wine/d3drm/version.rc @@ -0,0 +1,26 @@ +/* + * Copyright 2004 Ivan Leo Puoti + * + * 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 + */ + +#define WINE_FILEDESCRIPTION_STR "Wine Direct3D Retained Mode Utility Functions" +#define WINE_FILENAME_STR "d3drm.dll" +#define WINE_FILEVERSION 5,0,2134,14 +#define WINE_FILEVERSION_STR "5.0.2134.14" +#define WINE_PRODUCTVERSION 5,0,2134,14 +#define WINE_PRODUCTVERSION_STR "5.0" + +#include "wine/wine_common_ver.rc" diff --git a/dll/directx/wine/d3drm/viewport.c b/dll/directx/wine/d3drm/viewport.c new file mode 100644 index 00000000000..d8bfaa706fd --- /dev/null +++ b/dll/directx/wine/d3drm/viewport.c @@ -0,0 +1,824 @@ +/* + * Implementation of IDirect3DRMViewport Interface + * + * Copyright 2012 AndrĂ© Hentschel + * + * This file contains the (internal) driver registration functions, + * driver enumeration APIs and DirectDraw creation functions. + * + * 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 "d3drm_private.h" + +struct d3drm_viewport +{ + IDirect3DRMViewport IDirect3DRMViewport_iface; + IDirect3DRMViewport2 IDirect3DRMViewport2_iface; + LONG ref; + D3DVALUE back; + D3DVALUE front; + D3DVALUE field; + D3DRMPROJECTIONTYPE projection; +}; + +static inline struct d3drm_viewport *impl_from_IDirect3DRMViewport(IDirect3DRMViewport *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_viewport, IDirect3DRMViewport_iface); +} + +static inline struct d3drm_viewport *impl_from_IDirect3DRMViewport2(IDirect3DRMViewport2 *iface) +{ + return CONTAINING_RECORD(iface, struct d3drm_viewport, IDirect3DRMViewport2_iface); +} + +static HRESULT WINAPI d3drm_viewport1_QueryInterface(IDirect3DRMViewport *iface, REFIID riid, void **out) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface); + + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualGUID(riid, &IID_IDirect3DRMViewport) + || IsEqualGUID(riid, &IID_IUnknown)) + { + *out = &viewport->IDirect3DRMViewport_iface; + } + else if (IsEqualGUID(riid, &IID_IDirect3DRMViewport2)) + { + *out = &viewport->IDirect3DRMViewport2_iface; + } + else + { + *out = NULL; + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static ULONG WINAPI d3drm_viewport1_AddRef(IDirect3DRMViewport *iface) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface); + ULONG refcount = InterlockedIncrement(&viewport->ref); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI d3drm_viewport1_Release(IDirect3DRMViewport *iface) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface); + ULONG refcount = InterlockedDecrement(&viewport->ref); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + HeapFree(GetProcessHeap(), 0, viewport); + + return refcount; +} + +static HRESULT WINAPI d3drm_viewport1_Clone(IDirect3DRMViewport *iface, + IUnknown *outer, REFIID iid, void **out) +{ + FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport1_AddDestroyCallback(IDirect3DRMViewport *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport1_DeleteDestroyCallback(IDirect3DRMViewport *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport1_SetAppData(IDirect3DRMViewport *iface, DWORD data) +{ + FIXME("iface %p, data %#x stub!\n", iface, data); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_viewport1_GetAppData(IDirect3DRMViewport *iface) +{ + FIXME("iface %p.\n", iface); + + return 0; +} + +static HRESULT WINAPI d3drm_viewport1_SetName(IDirect3DRMViewport *iface, const char *name) +{ + FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport1_GetName(IDirect3DRMViewport *iface, DWORD *size, char *name) +{ + FIXME("iface %p, size %p, name %p stub!\n", iface, size, name); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport1_GetClassName(IDirect3DRMViewport *iface, DWORD *size, char *name) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface); + + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + return IDirect3DRMViewport2_GetClassName(&viewport->IDirect3DRMViewport2_iface, size, name); +} + +static HRESULT WINAPI d3drm_viewport1_Init(IDirect3DRMViewport *iface, IDirect3DRMDevice *device, + IDirect3DRMFrame *camera, DWORD x, DWORD y, DWORD width, DWORD height) +{ + FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u stub!\n", + iface, device, camera, x, y, width, height); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport1_Clear(IDirect3DRMViewport *iface) +{ + FIXME("iface %p.\n", iface); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_viewport1_Render(IDirect3DRMViewport *iface, IDirect3DRMFrame *frame) +{ + FIXME("iface %p, frame %p stub!\n", iface, frame); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_viewport1_SetFront(IDirect3DRMViewport *iface, D3DVALUE front) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface); + + TRACE("iface %p, front %.8e.\n", iface, front); + + return IDirect3DRMViewport2_SetFront(&viewport->IDirect3DRMViewport2_iface, front); +} + +static HRESULT WINAPI d3drm_viewport1_SetBack(IDirect3DRMViewport *iface, D3DVALUE back) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface); + + TRACE("iface %p, back %.8e.\n", iface, back); + + return IDirect3DRMViewport2_SetBack(&viewport->IDirect3DRMViewport2_iface, back); +} + +static HRESULT WINAPI d3drm_viewport1_SetField(IDirect3DRMViewport *iface, D3DVALUE field) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface); + + TRACE("iface %p, field %.8e.\n", iface, field); + + return IDirect3DRMViewport2_SetField(&viewport->IDirect3DRMViewport2_iface, field); +} + +static HRESULT WINAPI d3drm_viewport1_SetUniformScaling(IDirect3DRMViewport *iface, BOOL b) +{ + FIXME("iface %p, b %#x stub!\n", iface, b); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport1_SetCamera(IDirect3DRMViewport *iface, IDirect3DRMFrame *camera) +{ + FIXME("iface %p, camera %p stub!\n", iface, camera); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport1_SetProjection(IDirect3DRMViewport *iface, D3DRMPROJECTIONTYPE type) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface); + + TRACE("iface %p, type %#x.\n", iface, type); + + return IDirect3DRMViewport2_SetProjection(&viewport->IDirect3DRMViewport2_iface, type); +} + +static HRESULT WINAPI d3drm_viewport1_Transform(IDirect3DRMViewport *iface, D3DRMVECTOR4D *d, D3DVECTOR *s) +{ + FIXME("iface %p, d %p, s %p stub!\n", iface, d, s); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport1_InverseTransform(IDirect3DRMViewport *iface, D3DVECTOR *d, D3DRMVECTOR4D *s) +{ + FIXME("iface %p, d %p, s %p stub!\n", iface, d, s); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport1_Configure(IDirect3DRMViewport *iface, + LONG x, LONG y, DWORD width, DWORD height) +{ + FIXME("iface %p, x %d, y %d, width %u, height %u stub!\n", iface, x, y, width, height); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport1_ForceUpdate(IDirect3DRMViewport *iface, + DWORD x1, DWORD y1, DWORD x2, DWORD y2) +{ + FIXME("iface %p, x1 %u, y1 %u, x2 %u, y2 %u stub!\n", iface, x1, y1, x2, y2); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport1_SetPlane(IDirect3DRMViewport *iface, + D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top) +{ + FIXME("iface %p, left %.8e, right %.8e, bottom %.8e, top %.8e stub!\n", + iface, left, right, bottom, top); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport1_GetCamera(IDirect3DRMViewport *iface, IDirect3DRMFrame **camera) +{ + FIXME("iface %p, camera %p stub!\n", iface, camera); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport1_GetDevice(IDirect3DRMViewport *iface, IDirect3DRMDevice **device) +{ + FIXME("iface %p, device %p stub!\n", iface, device); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport1_GetPlane(IDirect3DRMViewport *iface, + D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top) +{ + FIXME("iface %p, left %p, right %p, bottom %p, top %p stub!\n", + iface, left, right, bottom, top); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport1_Pick(IDirect3DRMViewport *iface, + LONG x, LONG y, IDirect3DRMPickedArray **visuals) +{ + FIXME("iface %p, x %d, y %d, visuals %p stub!\n", iface, x, y, visuals); + + return E_NOTIMPL; +} + +static BOOL WINAPI d3drm_viewport1_GetUniformScaling(IDirect3DRMViewport *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static LONG WINAPI d3drm_viewport1_GetX(IDirect3DRMViewport *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static LONG WINAPI d3drm_viewport1_GetY(IDirect3DRMViewport *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_viewport1_GetWidth(IDirect3DRMViewport *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_viewport1_GetHeight(IDirect3DRMViewport *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static D3DVALUE WINAPI d3drm_viewport1_GetField(IDirect3DRMViewport *iface) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMViewport2_GetField(&viewport->IDirect3DRMViewport2_iface); +} + +static D3DVALUE WINAPI d3drm_viewport1_GetBack(IDirect3DRMViewport *iface) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMViewport2_GetBack(&viewport->IDirect3DRMViewport2_iface); +} + +static D3DVALUE WINAPI d3drm_viewport1_GetFront(IDirect3DRMViewport *iface) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMViewport2_GetFront(&viewport->IDirect3DRMViewport2_iface); +} + +static D3DRMPROJECTIONTYPE WINAPI d3drm_viewport1_GetProjection(IDirect3DRMViewport *iface) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMViewport2_GetProjection(&viewport->IDirect3DRMViewport2_iface); +} + +static HRESULT WINAPI d3drm_viewport1_GetDirect3DViewport(IDirect3DRMViewport *iface, + IDirect3DViewport **viewport) +{ + FIXME("iface %p, viewport %p stub!\n", iface, viewport); + + return E_NOTIMPL; +} + +static const struct IDirect3DRMViewportVtbl d3drm_viewport1_vtbl = +{ + d3drm_viewport1_QueryInterface, + d3drm_viewport1_AddRef, + d3drm_viewport1_Release, + d3drm_viewport1_Clone, + d3drm_viewport1_AddDestroyCallback, + d3drm_viewport1_DeleteDestroyCallback, + d3drm_viewport1_SetAppData, + d3drm_viewport1_GetAppData, + d3drm_viewport1_SetName, + d3drm_viewport1_GetName, + d3drm_viewport1_GetClassName, + d3drm_viewport1_Init, + d3drm_viewport1_Clear, + d3drm_viewport1_Render, + d3drm_viewport1_SetFront, + d3drm_viewport1_SetBack, + d3drm_viewport1_SetField, + d3drm_viewport1_SetUniformScaling, + d3drm_viewport1_SetCamera, + d3drm_viewport1_SetProjection, + d3drm_viewport1_Transform, + d3drm_viewport1_InverseTransform, + d3drm_viewport1_Configure, + d3drm_viewport1_ForceUpdate, + d3drm_viewport1_SetPlane, + d3drm_viewport1_GetCamera, + d3drm_viewport1_GetDevice, + d3drm_viewport1_GetPlane, + d3drm_viewport1_Pick, + d3drm_viewport1_GetUniformScaling, + d3drm_viewport1_GetX, + d3drm_viewport1_GetY, + d3drm_viewport1_GetWidth, + d3drm_viewport1_GetHeight, + d3drm_viewport1_GetField, + d3drm_viewport1_GetBack, + d3drm_viewport1_GetFront, + d3drm_viewport1_GetProjection, + d3drm_viewport1_GetDirect3DViewport, +}; + +static HRESULT WINAPI d3drm_viewport2_QueryInterface(IDirect3DRMViewport2 *iface, REFIID riid, void **out) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface); + + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + return d3drm_viewport1_QueryInterface(&viewport->IDirect3DRMViewport_iface, riid, out); +} + +static ULONG WINAPI d3drm_viewport2_AddRef(IDirect3DRMViewport2 *iface) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface); + + TRACE("iface %p.\n", iface); + + return d3drm_viewport1_AddRef(&viewport->IDirect3DRMViewport_iface); +} + +static ULONG WINAPI d3drm_viewport2_Release(IDirect3DRMViewport2 *iface) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface); + + TRACE("iface %p.\n", iface); + + return d3drm_viewport1_Release(&viewport->IDirect3DRMViewport_iface); +} + +static HRESULT WINAPI d3drm_viewport2_Clone(IDirect3DRMViewport2 *iface, + IUnknown *outer, REFIID iid, void **out) +{ + FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport2_AddDestroyCallback(IDirect3DRMViewport2 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport2_DeleteDestroyCallback(IDirect3DRMViewport2 *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport2_SetAppData(IDirect3DRMViewport2 *iface, DWORD data) +{ + FIXME("iface %p, data %#x stub!\n", iface, data); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_viewport2_GetAppData(IDirect3DRMViewport2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static HRESULT WINAPI d3drm_viewport2_SetName(IDirect3DRMViewport2 *iface, const char *name) +{ + FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport2_GetName(IDirect3DRMViewport2 *iface, DWORD *size, char *name) +{ + FIXME("iface %p, size %p, name %p stub!\n", iface, size, name); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport2_GetClassName(IDirect3DRMViewport2 *iface, DWORD *size, char *name) +{ + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + if (!size || *size < strlen("Viewport") || !name) + return E_INVALIDARG; + + strcpy(name, "Viewport"); + *size = sizeof("Viewport"); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_viewport2_Init(IDirect3DRMViewport2 *iface, IDirect3DRMDevice3 *device, + IDirect3DRMFrame3 *camera, DWORD x, DWORD y, DWORD width, DWORD height) +{ + FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u stub!\n", + iface, device, camera, x, y, width, height); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport2_Clear(IDirect3DRMViewport2 *iface, DWORD flags) +{ + FIXME("iface %p, flags %#x.\n", iface, flags); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_viewport2_Render(IDirect3DRMViewport2 *iface, IDirect3DRMFrame3 *frame) +{ + FIXME("iface %p, frame %p stub!\n", iface, frame); + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_viewport2_SetFront(IDirect3DRMViewport2 *iface, D3DVALUE front) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface); + + TRACE("iface %p, front %.8e.\n", iface, front); + + viewport->front = front; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_viewport2_SetBack(IDirect3DRMViewport2 *iface, D3DVALUE back) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface); + + TRACE("iface %p, back %.8e.\n", iface, back); + + viewport->back = back; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_viewport2_SetField(IDirect3DRMViewport2 *iface, D3DVALUE field) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface); + + TRACE("iface %p, field %.8e.\n", iface, field); + + viewport->field = field; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_viewport2_SetUniformScaling(IDirect3DRMViewport2 *iface, BOOL b) +{ + FIXME("iface %p, b %#x stub!\n", iface, b); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport2_SetCamera(IDirect3DRMViewport2 *iface, IDirect3DRMFrame3 *camera) +{ + FIXME("iface %p, camera %p stub!\n", iface, camera); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport2_SetProjection(IDirect3DRMViewport2 *iface, D3DRMPROJECTIONTYPE type) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface); + + TRACE("iface %p, type %#x.\n", iface, type); + + viewport->projection = type; + + return D3DRM_OK; +} + +static HRESULT WINAPI d3drm_viewport2_Transform(IDirect3DRMViewport2 *iface, D3DRMVECTOR4D *d, D3DVECTOR *s) +{ + FIXME("iface %p, d %p, s %p stub!\n", iface, d, s); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport2_InverseTransform(IDirect3DRMViewport2 *iface, D3DVECTOR *d, D3DRMVECTOR4D *s) +{ + FIXME("iface %p, d %p, s %p stub!\n", iface, d, s); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport2_Configure(IDirect3DRMViewport2 *iface, + LONG x, LONG y, DWORD width, DWORD height) +{ + FIXME("iface %p, x %d, y %d, width %u, height %u stub!\n", iface, x, y, width, height); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport2_ForceUpdate(IDirect3DRMViewport2* iface, + DWORD x1, DWORD y1, DWORD x2, DWORD y2) +{ + FIXME("iface %p, x1 %u, y1 %u, x2 %u, y2 %u stub!\n", iface, x1, y1, x2, y2); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport2_SetPlane(IDirect3DRMViewport2 *iface, + D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top) +{ + FIXME("iface %p, left %.8e, right %.8e, bottom %.8e, top %.8e stub!\n", + iface, left, right, bottom, top); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport2_GetCamera(IDirect3DRMViewport2 *iface, IDirect3DRMFrame3 **camera) +{ + FIXME("iface %p, camera %p stub!\n", iface, camera); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport2_GetDevice(IDirect3DRMViewport2 *iface, IDirect3DRMDevice3 **device) +{ + FIXME("iface %p, device %p stub!\n", iface, device); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport2_GetPlane(IDirect3DRMViewport2 *iface, + D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top) +{ + FIXME("iface %p, left %p, right %p, bottom %p, top %p stub!\n", + iface, left, right, bottom, top); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport2_Pick(IDirect3DRMViewport2 *iface, + LONG x, LONG y, IDirect3DRMPickedArray **visuals) +{ + FIXME("iface %p, x %d, y %d, visuals %p stub!\n", iface, x, y, visuals); + + return E_NOTIMPL; +} + +static BOOL WINAPI d3drm_viewport2_GetUniformScaling(IDirect3DRMViewport2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static LONG WINAPI d3drm_viewport2_GetX(IDirect3DRMViewport2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static LONG WINAPI d3drm_viewport2_GetY(IDirect3DRMViewport2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_viewport2_GetWidth(IDirect3DRMViewport2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static DWORD WINAPI d3drm_viewport2_GetHeight(IDirect3DRMViewport2 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static D3DVALUE WINAPI d3drm_viewport2_GetField(IDirect3DRMViewport2 *iface) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface); + + TRACE("iface %p.\n", iface); + + return viewport->field; +} + +static D3DVALUE WINAPI d3drm_viewport2_GetBack(IDirect3DRMViewport2 *iface) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface); + + TRACE("iface %p.\n", iface); + + return viewport->back; +} + +static D3DVALUE WINAPI d3drm_viewport2_GetFront(IDirect3DRMViewport2 *iface) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface); + + TRACE("iface %p.\n", iface); + + return viewport->front; +} + +static D3DRMPROJECTIONTYPE WINAPI d3drm_viewport2_GetProjection(IDirect3DRMViewport2 *iface) +{ + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface); + + TRACE("iface %p.\n", iface); + + return viewport->projection; +} + +static HRESULT WINAPI d3drm_viewport2_GetDirect3DViewport(IDirect3DRMViewport2 *iface, + IDirect3DViewport **viewport) +{ + FIXME("iface %p, viewport %p stub!\n", iface, viewport); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport2_TransformVectors(IDirect3DRMViewport2 *iface, + DWORD vector_count, D3DRMVECTOR4D *dst, D3DVECTOR *src) +{ + FIXME("iface %p, vector_count %u, dst %p, src %p stub!\n", iface, vector_count, dst, src); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_viewport2_InverseTransformVectors(IDirect3DRMViewport2 *iface, + DWORD vector_count, D3DVECTOR *dst, D3DRMVECTOR4D *src) +{ + FIXME("iface %p, vector_count %u, dst %p, src %p stub!\n", iface, vector_count, dst, src); + + return E_NOTIMPL; +} + +static const struct IDirect3DRMViewport2Vtbl d3drm_viewport2_vtbl = +{ + d3drm_viewport2_QueryInterface, + d3drm_viewport2_AddRef, + d3drm_viewport2_Release, + d3drm_viewport2_Clone, + d3drm_viewport2_AddDestroyCallback, + d3drm_viewport2_DeleteDestroyCallback, + d3drm_viewport2_SetAppData, + d3drm_viewport2_GetAppData, + d3drm_viewport2_SetName, + d3drm_viewport2_GetName, + d3drm_viewport2_GetClassName, + d3drm_viewport2_Init, + d3drm_viewport2_Clear, + d3drm_viewport2_Render, + d3drm_viewport2_SetFront, + d3drm_viewport2_SetBack, + d3drm_viewport2_SetField, + d3drm_viewport2_SetUniformScaling, + d3drm_viewport2_SetCamera, + d3drm_viewport2_SetProjection, + d3drm_viewport2_Transform, + d3drm_viewport2_InverseTransform, + d3drm_viewport2_Configure, + d3drm_viewport2_ForceUpdate, + d3drm_viewport2_SetPlane, + d3drm_viewport2_GetCamera, + d3drm_viewport2_GetDevice, + d3drm_viewport2_GetPlane, + d3drm_viewport2_Pick, + d3drm_viewport2_GetUniformScaling, + d3drm_viewport2_GetX, + d3drm_viewport2_GetY, + d3drm_viewport2_GetWidth, + d3drm_viewport2_GetHeight, + d3drm_viewport2_GetField, + d3drm_viewport2_GetBack, + d3drm_viewport2_GetFront, + d3drm_viewport2_GetProjection, + d3drm_viewport2_GetDirect3DViewport, + d3drm_viewport2_TransformVectors, + d3drm_viewport2_InverseTransformVectors, +}; + +HRESULT Direct3DRMViewport_create(REFIID riid, IUnknown **out) +{ + struct d3drm_viewport *object; + + TRACE("riid %s, out %p.\n", debugstr_guid(riid), out); + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + object->IDirect3DRMViewport_iface.lpVtbl = &d3drm_viewport1_vtbl; + object->IDirect3DRMViewport2_iface.lpVtbl = &d3drm_viewport2_vtbl; + object->ref = 1; + + if (IsEqualGUID(riid, &IID_IDirect3DRMViewport2)) + *out = (IUnknown *)&object->IDirect3DRMViewport2_iface; + else + *out = (IUnknown *)&object->IDirect3DRMViewport_iface; + + return S_OK; +} diff --git a/dll/directx/wine/dsound/CMakeLists.txt b/dll/directx/wine/dsound/CMakeLists.txt index f5363688bcb..e660e4e8725 100644 --- a/dll/directx/wine/dsound/CMakeLists.txt +++ b/dll/directx/wine/dsound/CMakeLists.txt @@ -30,5 +30,5 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang") target_link_libraries(dsound mingwex) endif() -add_importlibs(dsound winmm ole32 advapi32 user32 msvcrt kernel32 ntdll) +add_importlibs(dsound winmm advapi32 msvcrt kernel32 ntdll) add_cd_file(TARGET dsound DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/dsound/buffer.c b/dll/directx/wine/dsound/buffer.c index a574449859b..89b516cacce 100644 --- a/dll/directx/wine/dsound/buffer.c +++ b/dll/directx/wine/dsound/buffer.c @@ -25,52 +25,59 @@ * IDirectSoundNotify */ -static inline struct IDirectSoundBufferImpl *impl_from_IDirectSoundNotify(IDirectSoundNotify *iface) +struct IDirectSoundNotifyImpl { - return CONTAINING_RECORD(iface, struct IDirectSoundBufferImpl, IDirectSoundNotify_iface); + /* IUnknown fields */ + const IDirectSoundNotifyVtbl *lpVtbl; + LONG ref; + IDirectSoundBufferImpl* dsb; +}; + +static HRESULT IDirectSoundNotifyImpl_Create(IDirectSoundBufferImpl *dsb, + IDirectSoundNotifyImpl **pdsn); +static HRESULT IDirectSoundNotifyImpl_Destroy(IDirectSoundNotifyImpl *pdsn); + +static HRESULT WINAPI IDirectSoundNotifyImpl_QueryInterface( + LPDIRECTSOUNDNOTIFY iface,REFIID riid,LPVOID *ppobj +) { + IDirectSoundNotifyImpl *This = (IDirectSoundNotifyImpl *)iface; + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); + + if (This->dsb == NULL) { + WARN("invalid parameter\n"); + return E_INVALIDARG; + } + + return IDirectSoundBuffer_QueryInterface((LPDIRECTSOUNDBUFFER)This->dsb, riid, ppobj); } -static HRESULT WINAPI IDirectSoundNotifyImpl_QueryInterface(IDirectSoundNotify *iface, REFIID riid, - void **ppobj) +static ULONG WINAPI IDirectSoundNotifyImpl_AddRef(LPDIRECTSOUNDNOTIFY iface) { - IDirectSoundBufferImpl *This = impl_from_IDirectSoundNotify(iface); - - TRACE("(%p,%s,%p)\n", This, debugstr_guid(riid), ppobj); - - return IDirectSoundBuffer8_QueryInterface(&This->IDirectSoundBuffer8_iface, riid, ppobj); -} - -static ULONG WINAPI IDirectSoundNotifyImpl_AddRef(IDirectSoundNotify *iface) -{ - IDirectSoundBufferImpl *This = impl_from_IDirectSoundNotify(iface); - ULONG ref = InterlockedIncrement(&This->refn); - + IDirectSoundNotifyImpl *This = (IDirectSoundNotifyImpl *)iface; + ULONG ref = InterlockedIncrement(&(This->ref)); TRACE("(%p) ref was %d\n", This, ref - 1); - - if(ref == 1) - InterlockedIncrement(&This->numIfaces); - return ref; } -static ULONG WINAPI IDirectSoundNotifyImpl_Release(IDirectSoundNotify *iface) +static ULONG WINAPI IDirectSoundNotifyImpl_Release(LPDIRECTSOUNDNOTIFY iface) { - IDirectSoundBufferImpl *This = impl_from_IDirectSoundNotify(iface); - ULONG ref = InterlockedDecrement(&This->refn); - + IDirectSoundNotifyImpl *This = (IDirectSoundNotifyImpl *)iface; + ULONG ref = InterlockedDecrement(&(This->ref)); TRACE("(%p) ref was %d\n", This, ref + 1); - if (!ref && !InterlockedDecrement(&This->numIfaces)) - secondarybuffer_destroy(This); - + if (!ref) { + This->dsb->notify = NULL; + IDirectSoundBuffer_Release((LPDIRECTSOUNDBUFFER)This->dsb); + HeapFree(GetProcessHeap(), 0, This); + TRACE("(%p) released\n", This); + } return ref; } -static HRESULT WINAPI IDirectSoundNotifyImpl_SetNotificationPositions(IDirectSoundNotify *iface, - DWORD howmuch, const DSBPOSITIONNOTIFY *notify) -{ - IDirectSoundBufferImpl *This = impl_from_IDirectSoundNotify(iface); - +static HRESULT WINAPI IDirectSoundNotifyImpl_SetNotificationPositions( + LPDIRECTSOUNDNOTIFY iface,DWORD howmuch,LPCDSBPOSITIONNOTIFY notify +) { + IDirectSoundNotifyImpl *This = (IDirectSoundNotifyImpl *)iface; TRACE("(%p,0x%08x,%p)\n",This,howmuch,notify); if (howmuch > 0 && notify == NULL) { @@ -85,24 +92,30 @@ static HRESULT WINAPI IDirectSoundNotifyImpl_SetNotificationPositions(IDirectSou notify[i].dwOffset,notify[i].hEventNotify); } - if (howmuch > 0) { + if (This->dsb->hwnotify) { + HRESULT hres; + hres = IDsDriverNotify_SetNotificationPositions(This->dsb->hwnotify, howmuch, notify); + if (hres != DS_OK) + WARN("IDsDriverNotify_SetNotificationPositions failed\n"); + return hres; + } else if (howmuch > 0) { /* Make an internal copy of the caller-supplied array. * Replace the existing copy if one is already present. */ - HeapFree(GetProcessHeap(), 0, This->notifies); - This->notifies = HeapAlloc(GetProcessHeap(), 0, + HeapFree(GetProcessHeap(), 0, This->dsb->notifies); + This->dsb->notifies = HeapAlloc(GetProcessHeap(), 0, howmuch * sizeof(DSBPOSITIONNOTIFY)); - if (This->notifies == NULL) { + if (This->dsb->notifies == NULL) { WARN("out of memory\n"); return DSERR_OUTOFMEMORY; } - CopyMemory(This->notifies, notify, howmuch * sizeof(DSBPOSITIONNOTIFY)); - This->nrofnotifies = howmuch; - } else { - HeapFree(GetProcessHeap(), 0, This->notifies); - This->notifies = NULL; - This->nrofnotifies = 0; - } + CopyMemory(This->dsb->notifies, notify, howmuch * sizeof(DSBPOSITIONNOTIFY)); + This->dsb->nrofnotifies = howmuch; + } else { + HeapFree(GetProcessHeap(), 0, This->dsb->notifies); + This->dsb->notifies = NULL; + This->dsb->nrofnotifies = 0; + } return S_OK; } @@ -115,6 +128,40 @@ static const IDirectSoundNotifyVtbl dsnvt = IDirectSoundNotifyImpl_SetNotificationPositions, }; +static HRESULT IDirectSoundNotifyImpl_Create( + IDirectSoundBufferImpl * dsb, + IDirectSoundNotifyImpl **pdsn) +{ + IDirectSoundNotifyImpl * dsn; + TRACE("(%p,%p)\n",dsb,pdsn); + + dsn = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*dsn)); + + if (dsn == NULL) { + WARN("out of memory\n"); + return DSERR_OUTOFMEMORY; + } + + dsn->ref = 0; + dsn->lpVtbl = &dsnvt; + dsn->dsb = dsb; + dsb->notify = dsn; + IDirectSoundBuffer_AddRef((LPDIRECTSOUNDBUFFER)dsb); + + *pdsn = dsn; + return DS_OK; +} + +static HRESULT IDirectSoundNotifyImpl_Destroy( + IDirectSoundNotifyImpl *pdsn) +{ + TRACE("(%p)\n",pdsn); + + while (IDirectSoundNotifyImpl_Release((LPDIRECTSOUNDNOTIFY)pdsn) > 0); + + return DS_OK; +} + /******************************************************************************* * IDirectSoundBuffer */ @@ -126,7 +173,7 @@ static inline IDirectSoundBufferImpl *impl_from_IDirectSoundBuffer8(IDirectSound static inline BOOL is_primary_buffer(IDirectSoundBufferImpl *This) { - return (This->dsbd.dwFlags & DSBCAPS_PRIMARYBUFFER) != 0; + return This->dsbd.dwFlags & DSBCAPS_PRIMARYBUFFER ? TRUE : FALSE; } static HRESULT WINAPI IDirectSoundBufferImpl_SetFormat(IDirectSoundBuffer8 *iface, @@ -179,6 +226,14 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetVolume(IDirectSoundBuffer8 *ifac DSOUND_RecalcVolPan(&(This->volpan)); } + if (vol != oldVol) { + if (This->hwbuf) { + hres = IDsDriverBuffer_SetVolumePan(This->hwbuf, &(This->volpan)); + if (hres != DS_OK) + WARN("IDsDriverBuffer_SetVolumePan failed\n"); + } + } + RtlReleaseResource(&This->lock); /* **** */ @@ -237,9 +292,10 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetFrequency(IDirectSoundBuffer8 *i oldFreq = This->freq; This->freq = freq; if (freq != oldFreq) { - This->freqAdjust = This->freq / (float)This->device->pwfx->nSamplesPerSec; + This->freqAdjust = ((DWORD64)This->freq << DSOUND_FREQSHIFT) / This->device->pwfx->nSamplesPerSec; This->nAvgBytesPerSec = freq * This->pwfx->nBlockAlign; DSOUND_RecalcFormat(This); + DSOUND_MixToTemporary(This, 0, This->buflen, FALSE); } RtlReleaseResource(&This->lock); @@ -260,11 +316,18 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Play(IDirectSoundBuffer8 *iface, DW RtlAcquireResourceExclusive(&This->lock, TRUE); This->playflags = flags; - if (This->state == STATE_STOPPED) { + if (This->state == STATE_STOPPED && !This->hwbuf) { This->leadin = TRUE; This->state = STATE_STARTING; } else if (This->state == STATE_STOPPING) This->state = STATE_PLAYING; + if (This->hwbuf) { + hres = IDsDriverBuffer_Play(This->hwbuf, 0, 0, This->playflags); + if (hres != DS_OK) + WARN("IDsDriverBuffer_Play failed\n"); + else + This->state = STATE_PLAYING; + } RtlReleaseResource(&This->lock); /* **** */ @@ -289,6 +352,13 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Stop(IDirectSoundBuffer8 *iface) This->state = STATE_STOPPED; DSOUND_CheckEvent(This, 0, 0); } + if (This->hwbuf) { + hres = IDsDriverBuffer_Stop(This->hwbuf); + if (hres != DS_OK) + WARN("IDsDriverBuffer_Stop failed\n"); + else + This->state = STATE_STOPPED; + } RtlReleaseResource(&This->lock); /* **** */ @@ -312,22 +382,16 @@ static ULONG WINAPI IDirectSoundBufferImpl_AddRef(IDirectSoundBuffer8 *iface) static ULONG WINAPI IDirectSoundBufferImpl_Release(IDirectSoundBuffer8 *iface) { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer8(iface); - ULONG ref; + ULONG ref = InterlockedDecrement(&This->ref); - if (is_primary_buffer(This)){ - ref = capped_refcount_dec(&This->ref); - if(!ref) - capped_refcount_dec(&This->numIfaces); - TRACE("(%p) ref is now: %d\n", This, ref); - return ref; - } + TRACE("(%p) ref was %d\n", This, ref + 1); - ref = InterlockedDecrement(&This->ref); - if (!ref && !InterlockedDecrement(&This->numIfaces)) + if (!ref && !InterlockedDecrement(&This->numIfaces)) { + if (is_primary_buffer(This)) + primarybuffer_destroy(This); + else secondarybuffer_destroy(This); - - TRACE("(%p) ref is now %d\n", This, ref); - + } return ref; } @@ -335,31 +399,36 @@ static HRESULT WINAPI IDirectSoundBufferImpl_GetCurrentPosition(IDirectSoundBuff DWORD *playpos, DWORD *writepos) { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer8(iface); - DWORD pos; + HRESULT hres; TRACE("(%p,%p,%p)\n",This,playpos,writepos); RtlAcquireResourceShared(&This->lock, TRUE); + if (This->hwbuf) { + hres=IDsDriverBuffer_GetPosition(This->hwbuf,playpos,writepos); + if (hres != DS_OK) { + WARN("IDsDriverBuffer_GetPosition failed\n"); + return hres; + } + } else { + DWORD pos = This->sec_mixpos; - pos = This->sec_mixpos; + /* sanity */ + if (pos >= This->buflen){ + FIXME("Bad play position. playpos: %d, buflen: %d\n", pos, This->buflen); + pos %= This->buflen; + } - /* sanity */ - if (pos >= This->buflen){ - FIXME("Bad play position. playpos: %d, buflen: %d\n", pos, This->buflen); - pos %= This->buflen; + if (playpos) + *playpos = pos; + if (writepos) + *writepos = pos; } - - if (playpos) - *playpos = pos; - if (writepos) - *writepos = pos; - - if (writepos && This->state != STATE_STOPPED) { + if (writepos && This->state != STATE_STOPPED && (!This->hwbuf || !(This->device->drvdesc.dwFlags & DSDDESC_DONTNEEDWRITELEAD))) { /* apply the documented 10ms lead to writepos */ *writepos += This->writelead; *writepos %= This->buflen; } - RtlReleaseResource(&This->lock); TRACE("playpos = %d, writepos = %d, buflen=%d (%p, time=%d)\n", @@ -469,31 +538,44 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Lock(IDirectSoundBuffer8 *iface, DW /* **** */ RtlAcquireResourceShared(&This->lock, TRUE); - if (writecursor+writebytes <= This->buflen) { - *(LPBYTE*)lplpaudioptr1 = This->buffer->memory+writecursor; - if (This->sec_mixpos >= writecursor && This->sec_mixpos < writecursor + writebytes && This->state == STATE_PLAYING) - WARN("Overwriting mixing position, case 1\n"); - *audiobytes1 = writebytes; - if (lplpaudioptr2) - *(LPBYTE*)lplpaudioptr2 = NULL; - if (audiobytes2) - *audiobytes2 = 0; - TRACE("Locked %p(%i bytes) and %p(%i bytes) writecursor=%d\n", - *(LPBYTE*)lplpaudioptr1, *audiobytes1, lplpaudioptr2 ? *(LPBYTE*)lplpaudioptr2 : NULL, audiobytes2 ? *audiobytes2: 0, writecursor); - TRACE("->%d.0\n",writebytes); + if (!(This->device->drvdesc.dwFlags & DSDDESC_DONTNEEDSECONDARYLOCK) && This->hwbuf) { + hres = IDsDriverBuffer_Lock(This->hwbuf, + lplpaudioptr1, audiobytes1, + lplpaudioptr2, audiobytes2, + writecursor, writebytes, + 0); + if (hres != DS_OK) { + WARN("IDsDriverBuffer_Lock failed\n"); + RtlReleaseResource(&This->lock); + return hres; + } } else { - DWORD remainder = writebytes + writecursor - This->buflen; - *(LPBYTE*)lplpaudioptr1 = This->buffer->memory+writecursor; - *audiobytes1 = This->buflen-writecursor; - if (This->sec_mixpos >= writecursor && This->sec_mixpos < writecursor + writebytes && This->state == STATE_PLAYING) - WARN("Overwriting mixing position, case 2\n"); - if (lplpaudioptr2) - *(LPBYTE*)lplpaudioptr2 = This->buffer->memory; - if (audiobytes2) - *audiobytes2 = writebytes-(This->buflen-writecursor); - if (audiobytes2 && This->sec_mixpos < remainder && This->state == STATE_PLAYING) - WARN("Overwriting mixing position, case 3\n"); - TRACE("Locked %p(%i bytes) and %p(%i bytes) writecursor=%d\n", *(LPBYTE*)lplpaudioptr1, *audiobytes1, lplpaudioptr2 ? *(LPBYTE*)lplpaudioptr2 : NULL, audiobytes2 ? *audiobytes2: 0, writecursor); + if (writecursor+writebytes <= This->buflen) { + *(LPBYTE*)lplpaudioptr1 = This->buffer->memory+writecursor; + if (This->sec_mixpos >= writecursor && This->sec_mixpos < writecursor + writebytes && This->state == STATE_PLAYING) + WARN("Overwriting mixing position, case 1\n"); + *audiobytes1 = writebytes; + if (lplpaudioptr2) + *(LPBYTE*)lplpaudioptr2 = NULL; + if (audiobytes2) + *audiobytes2 = 0; + TRACE("Locked %p(%i bytes) and %p(%i bytes) writecursor=%d\n", + *(LPBYTE*)lplpaudioptr1, *audiobytes1, lplpaudioptr2 ? *(LPBYTE*)lplpaudioptr2 : NULL, audiobytes2 ? *audiobytes2: 0, writecursor); + TRACE("->%d.0\n",writebytes); + } else { + DWORD remainder = writebytes + writecursor - This->buflen; + *(LPBYTE*)lplpaudioptr1 = This->buffer->memory+writecursor; + *audiobytes1 = This->buflen-writecursor; + if (This->sec_mixpos >= writecursor && This->sec_mixpos < writecursor + writebytes && This->state == STATE_PLAYING) + WARN("Overwriting mixing position, case 2\n"); + if (lplpaudioptr2) + *(LPBYTE*)lplpaudioptr2 = This->buffer->memory; + if (audiobytes2) + *audiobytes2 = writebytes-(This->buflen-writecursor); + if (audiobytes2 && This->sec_mixpos < remainder && This->state == STATE_PLAYING) + WARN("Overwriting mixing position, case 3\n"); + TRACE("Locked %p(%i bytes) and %p(%i bytes) writecursor=%d\n", *(LPBYTE*)lplpaudioptr1, *audiobytes1, lplpaudioptr2 ? *(LPBYTE*)lplpaudioptr2 : NULL, audiobytes2 ? *audiobytes2: 0, writecursor); + } } RtlReleaseResource(&This->lock); @@ -507,12 +589,15 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetCurrentPosition(IDirectSoundBuff { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer8(iface); HRESULT hres = DS_OK; + DWORD oldpos; TRACE("(%p,%d)\n",This,newpos); /* **** */ RtlAcquireResourceExclusive(&This->lock, TRUE); + oldpos = This->sec_mixpos; + /* start mixing from this new location instead */ newpos %= This->buflen; newpos -= newpos%This->pwfx->nBlockAlign; @@ -521,6 +606,16 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetCurrentPosition(IDirectSoundBuff /* at this point, do not attempt to reset buffers, mess with primary mix position, or anything like that to reduce latency. The data already prebuffered cannot be changed */ + /* position HW buffer if applicable, else just start mixing from new location instead */ + if (This->hwbuf) { + hres = IDsDriverBuffer_SetPosition(This->hwbuf, This->buf_mixpos); + if (hres != DS_OK) + WARN("IDsDriverBuffer_SetPosition failed\n"); + } + else if (oldpos != newpos) + /* FIXME: Perhaps add a call to DSOUND_MixToTemporary here? Not sure it's needed */ + This->buf_mixpos = DSOUND_secpos_to_bufpos(This, newpos, 0, NULL); + RtlReleaseResource(&This->lock); /* **** */ @@ -552,6 +647,12 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetPan(IDirectSoundBuffer8 *iface, if (This->volpan.lPan != pan) { This->volpan.lPan = pan; DSOUND_RecalcVolPan(&(This->volpan)); + + if (This->hwbuf) { + hres = IDsDriverBuffer_SetVolumePan(This->hwbuf, &(This->volpan)); + if (hres != DS_OK) + WARN("IDsDriverBuffer_SetVolumePan failed\n"); + } } RtlReleaseResource(&This->lock); @@ -589,14 +690,22 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Unlock(IDirectSoundBuffer8 *iface, TRACE("(%p,%p,%d,%p,%d)\n", This,p1,x1,p2,x2); + /* **** */ + RtlAcquireResourceShared(&This->lock, TRUE); + + if (!(This->device->drvdesc.dwFlags & DSDDESC_DONTNEEDSECONDARYLOCK) && This->hwbuf) { + hres = IDsDriverBuffer_Unlock(This->hwbuf, p1, x1, p2, x2); + if (hres != DS_OK) + WARN("IDsDriverBuffer_Unlock failed\n"); + } + + RtlReleaseResource(&This->lock); + /* **** */ + if (!p2) x2 = 0; - if((p1 && ((BYTE*)p1 < This->buffer->memory || (BYTE*)p1 >= This->buffer->memory + This->buflen)) || - (p2 && ((BYTE*)p2 < This->buffer->memory || (BYTE*)p2 >= This->buffer->memory + This->buflen))) - return DSERR_INVALIDPARAM; - - if (x1 || x2) + if (!This->hwbuf && (x1 || x2)) { RtlAcquireResourceShared(&This->device->buffer_list_lock, TRUE); LIST_FOR_EACH_ENTRY(iter, &This->buffer->buffers, IDirectSoundBufferImpl, entry ) @@ -606,7 +715,11 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Unlock(IDirectSoundBuffer8 *iface, { if(x1 + (DWORD_PTR)p1 - (DWORD_PTR)iter->buffer->memory > iter->buflen) hres = DSERR_INVALIDPARAM; + else + DSOUND_MixToTemporary(iter, (DWORD_PTR)p1 - (DWORD_PTR)iter->buffer->memory, x1, FALSE); } + if (x2) + DSOUND_MixToTemporary(iter, 0, x2, FALSE); RtlReleaseResource(&iter->lock); } RtlReleaseResource(&This->device->buffer_list_lock); @@ -707,7 +820,8 @@ static HRESULT WINAPI IDirectSoundBufferImpl_GetCaps(IDirectSoundBuffer8 *iface, } caps->dwFlags = This->dsbd.dwFlags; - caps->dwFlags |= DSBCAPS_LOCSOFTWARE; + if (This->hwbuf) caps->dwFlags |= DSBCAPS_LOCHARDWARE; + else caps->dwFlags |= DSBCAPS_LOCSOFTWARE; caps->dwBufferBytes = This->buflen; @@ -741,19 +855,27 @@ static HRESULT WINAPI IDirectSoundBufferImpl_QueryInterface(IDirectSoundBuffer8 } if ( IsEqualGUID( &IID_IDirectSoundNotify, riid ) ) { - IDirectSoundNotify_AddRef(&This->IDirectSoundNotify_iface); - *ppobj = &This->IDirectSoundNotify_iface; - return S_OK; + if (!This->notify) + IDirectSoundNotifyImpl_Create(This, &(This->notify)); + if (This->notify) { + IDirectSoundNotify_AddRef((LPDIRECTSOUNDNOTIFY)This->notify); + *ppobj = This->notify; + return S_OK; + } + WARN("IID_IDirectSoundNotify\n"); + return E_NOINTERFACE; } if ( IsEqualGUID( &IID_IDirectSound3DBuffer, riid ) ) { - if(This->dsbd.dwFlags & DSBCAPS_CTRL3D){ - IDirectSound3DBuffer_AddRef(&This->IDirectSound3DBuffer_iface); - *ppobj = &This->IDirectSound3DBuffer_iface; - return S_OK; - } - TRACE("app requested IDirectSound3DBuffer on non-3D secondary buffer\n"); - return E_NOINTERFACE; + if (!This->ds3db) + IDirectSound3DBufferImpl_Create(This, &(This->ds3db)); + if (This->ds3db) { + IDirectSound3DBuffer_AddRef((LPDIRECTSOUND3DBUFFER)This->ds3db); + *ppobj = This->ds3db; + return S_OK; + } + WARN("IID_IDirectSound3DBuffer\n"); + return E_NOINTERFACE; } if ( IsEqualGUID( &IID_IDirectSound3DListener, riid ) ) { @@ -762,9 +884,15 @@ static HRESULT WINAPI IDirectSoundBufferImpl_QueryInterface(IDirectSoundBuffer8 } if ( IsEqualGUID( &IID_IKsPropertySet, riid ) ) { - IKsPropertySet_AddRef(&This->IKsPropertySet_iface); - *ppobj = &This->IKsPropertySet_iface; - return S_OK; + if (!This->iks) + IKsBufferPropertySetImpl_Create(This, &(This->iks)); + if (This->iks) { + IKsPropertySet_AddRef((LPKSPROPERTYSET)This->iks); + *ppobj = This->iks; + return S_OK; + } + WARN("IID_IKsPropertySet\n"); + return E_NOINTERFACE; } FIXME( "Unknown IID %s\n", debugstr_guid( riid ) ); @@ -809,6 +937,7 @@ HRESULT IDirectSoundBufferImpl_Create( LPWAVEFORMATEX wfex = dsbd->lpwfxFormat; HRESULT err = DS_OK; DWORD capf = 0; + int use_hw; TRACE("(%p,%p,%p)\n",device,pdsb,dsbd); if (dsbd->dwBufferBytes < DSBSIZE_MIN || dsbd->dwBufferBytes > DSBSIZE_MAX) { @@ -827,16 +956,11 @@ HRESULT IDirectSoundBufferImpl_Create( TRACE("Created buffer at %p\n", dsb); - dsb->ref = 0; - dsb->refn = 0; - dsb->ref3D = 0; - dsb->refiks = 0; - dsb->numIfaces = 0; + dsb->ref = 1; + dsb->numIfaces = 1; dsb->device = device; - dsb->IDirectSoundBuffer8_iface.lpVtbl = &dsbvt; - dsb->IDirectSoundNotify_iface.lpVtbl = &dsnvt; - dsb->IDirectSound3DBuffer_iface.lpVtbl = &ds3dbvt; - dsb->IKsPropertySet_iface.lpVtbl = &iksbvt; + dsb->IDirectSoundBuffer8_iface.lpVtbl = &dsbvt; + dsb->iks = NULL; /* size depends on version */ CopyMemory(&dsb->dsbd, dsbd, dsbd->dwSize); @@ -856,8 +980,10 @@ HRESULT IDirectSoundBufferImpl_Create( dsb->buflen = dsbd->dwBufferBytes; dsb->freq = dsbd->lpwfxFormat->nSamplesPerSec; + dsb->notify = NULL; dsb->notifies = NULL; dsb->nrofnotifies = 0; + dsb->hwnotify = 0; /* Check necessary hardware mixing capabilities */ if (wfex->nChannels==2) capf |= DSCAPS_SECONDARYSTEREO; @@ -865,7 +991,24 @@ HRESULT IDirectSoundBufferImpl_Create( if (wfex->wBitsPerSample==16) capf |= DSCAPS_SECONDARY16BIT; else capf |= DSCAPS_SECONDARY8BIT; - TRACE("capf = 0x%08x, device->drvcaps.dwFlags = 0x%08x\n", capf, device->drvcaps.dwFlags); + use_hw = !!(dsbd->dwFlags & DSBCAPS_LOCHARDWARE); + TRACE("use_hw = %d, capf = 0x%08x, device->drvcaps.dwFlags = 0x%08x\n", use_hw, capf, device->drvcaps.dwFlags); + if (use_hw && ((device->drvcaps.dwFlags & capf) != capf || !device->driver)) + { + if (device->driver) + WARN("Format not supported for hardware buffer\n"); + HeapFree(GetProcessHeap(),0,dsb->pwfx); + HeapFree(GetProcessHeap(),0,dsb); + *pdsb = NULL; + if ((device->drvcaps.dwFlags & capf) != capf) + return DSERR_BADFORMAT; + return DSERR_GENERIC; + } + + /* FIXME: check hardware sample rate mixing capabilities */ + /* FIXME: check app hints for software/hardware buffer (STATIC, LOCHARDWARE, etc) */ + /* FIXME: check whether any hardware buffers are left */ + /* FIXME: handle DSDHEAP_CREATEHEAP for hardware buffers */ /* Allocate an empty buffer */ dsb->buffer = HeapAlloc(GetProcessHeap(),0,sizeof(*(dsb->buffer))); @@ -877,15 +1020,35 @@ HRESULT IDirectSoundBufferImpl_Create( return DSERR_OUTOFMEMORY; } - /* Allocate system memory for buffer */ - dsb->buffer->memory = HeapAlloc(GetProcessHeap(),0,dsb->buflen); - if (dsb->buffer->memory == NULL) { - WARN("out of memory\n"); - HeapFree(GetProcessHeap(),0,dsb->pwfx); - HeapFree(GetProcessHeap(),0,dsb->buffer); - HeapFree(GetProcessHeap(),0,dsb); - *pdsb = NULL; - return DSERR_OUTOFMEMORY; + /* Allocate system memory for buffer if applicable */ + if ((device->drvdesc.dwFlags & DSDDESC_USESYSTEMMEMORY) || !use_hw) { + dsb->buffer->memory = HeapAlloc(GetProcessHeap(),0,dsb->buflen); + if (dsb->buffer->memory == NULL) { + WARN("out of memory\n"); + HeapFree(GetProcessHeap(),0,dsb->pwfx); + HeapFree(GetProcessHeap(),0,dsb->buffer); + HeapFree(GetProcessHeap(),0,dsb); + *pdsb = NULL; + return DSERR_OUTOFMEMORY; + } + } + + /* Allocate the hardware buffer */ + if (use_hw) { + err = IDsDriver_CreateSoundBuffer(device->driver,wfex,dsbd->dwFlags,0, + &(dsb->buflen),&(dsb->buffer->memory), + (LPVOID*)&(dsb->hwbuf)); + if (FAILED(err)) + { + WARN("Failed to create hardware secondary buffer: %08x\n", err); + if (device->drvdesc.dwFlags & DSDDESC_USESYSTEMMEMORY) + HeapFree(GetProcessHeap(),0,dsb->buffer->memory); + HeapFree(GetProcessHeap(),0,dsb->buffer); + HeapFree(GetProcessHeap(),0,dsb->pwfx); + HeapFree(GetProcessHeap(),0,dsb); + *pdsb = NULL; + return DSERR_GENERIC; + } } dsb->buffer->ref = 1; @@ -895,10 +1058,10 @@ HRESULT IDirectSoundBufferImpl_Create( /* It's not necessary to initialize values to zero since */ /* we allocated this structure with HEAP_ZERO_MEMORY... */ - dsb->sec_mixpos = 0; + dsb->buf_mixpos = dsb->sec_mixpos = 0; dsb->state = STATE_STOPPED; - dsb->freqAdjust = dsb->freq / (float)device->pwfx->nSamplesPerSec; + dsb->freqAdjust = ((DWORD64)dsb->freq << DSOUND_FREQSHIFT) / device->pwfx->nSamplesPerSec; dsb->nAvgBytesPerSec = dsb->freq * dsbd->lpwfxFormat->nBlockAlign; @@ -943,28 +1106,27 @@ HRESULT IDirectSoundBufferImpl_Create( } } - IDirectSoundBuffer8_AddRef(&dsb->IDirectSoundBuffer8_iface); *pdsb = dsb; return err; } void secondarybuffer_destroy(IDirectSoundBufferImpl *This) { - ULONG ref = InterlockedIncrement(&This->numIfaces); - - if (ref > 1) - WARN("Destroying buffer with %u in use interfaces\n", ref - 1); - DirectSoundDevice_RemoveBuffer(This->device, This); RtlDeleteResource(&This->lock); - This->buffer->ref--; - list_remove(&This->entry); - if (This->buffer->ref == 0) { - HeapFree(GetProcessHeap(), 0, This->buffer->memory); - HeapFree(GetProcessHeap(), 0, This->buffer); + if (This->hwbuf) + IDsDriverBuffer_Release(This->hwbuf); + if (!This->hwbuf || (This->device->drvdesc.dwFlags & DSDDESC_USESYSTEMMEMORY)) { + This->buffer->ref--; + list_remove(&This->entry); + if (This->buffer->ref == 0) { + HeapFree(GetProcessHeap(), 0, This->buffer->memory); + HeapFree(GetProcessHeap(), 0, This->buffer); + } } + HeapFree(GetProcessHeap(), 0, This->tmp_buffer); HeapFree(GetProcessHeap(), 0, This->notifies); HeapFree(GetProcessHeap(), 0, This->pwfx); HeapFree(GetProcessHeap(), 0, This); @@ -972,6 +1134,38 @@ void secondarybuffer_destroy(IDirectSoundBufferImpl *This) TRACE("(%p) released\n", This); } +HRESULT IDirectSoundBufferImpl_Destroy( + IDirectSoundBufferImpl *pdsb) +{ + TRACE("(%p)\n",pdsb); + + /* This keeps the *_Destroy functions from possibly deleting + * this object until it is ready to be deleted */ + InterlockedIncrement(&pdsb->numIfaces); + + if (pdsb->iks) { + WARN("iks not NULL\n"); + IKsBufferPropertySetImpl_Destroy(pdsb->iks); + pdsb->iks = NULL; + } + + if (pdsb->ds3db) { + WARN("ds3db not NULL\n"); + IDirectSound3DBufferImpl_Destroy(pdsb->ds3db); + pdsb->ds3db = NULL; + } + + if (pdsb->notify) { + WARN("notify not NULL\n"); + IDirectSoundNotifyImpl_Destroy(pdsb->notify); + pdsb->notify = NULL; + } + + secondarybuffer_destroy(pdsb); + + return S_OK; +} + HRESULT IDirectSoundBufferImpl_Duplicate( DirectSoundDevice *device, IDirectSoundBufferImpl **ppdsb, @@ -987,34 +1181,44 @@ HRESULT IDirectSoundBufferImpl_Duplicate( *ppdsb = NULL; return DSERR_OUTOFMEMORY; } - - RtlAcquireResourceShared(&pdsb->lock, TRUE); - CopyMemory(dsb, pdsb, sizeof(*dsb)); dsb->pwfx = DSOUND_CopyFormat(pdsb->pwfx); - - RtlReleaseResource(&pdsb->lock); - if (dsb->pwfx == NULL) { HeapFree(GetProcessHeap(),0,dsb); *ppdsb = NULL; return DSERR_OUTOFMEMORY; } + if (pdsb->hwbuf) { + TRACE("duplicating hardware buffer\n"); + + hres = IDsDriver_DuplicateSoundBuffer(device->driver, pdsb->hwbuf, + (LPVOID *)&dsb->hwbuf); + if (FAILED(hres)) { + WARN("IDsDriver_DuplicateSoundBuffer failed (%08x)\n", hres); + HeapFree(GetProcessHeap(),0,dsb->pwfx); + HeapFree(GetProcessHeap(),0,dsb); + *ppdsb = NULL; + return hres; + } + } + dsb->buffer->ref++; list_add_head(&dsb->buffer->buffers, &dsb->entry); - dsb->ref = 0; - dsb->refn = 0; - dsb->ref3D = 0; - dsb->refiks = 0; - dsb->numIfaces = 0; + dsb->ref = 1; + dsb->numIfaces = 1; dsb->state = STATE_STOPPED; - dsb->sec_mixpos = 0; + dsb->buf_mixpos = dsb->sec_mixpos = 0; + dsb->notify = NULL; dsb->notifies = NULL; dsb->nrofnotifies = 0; dsb->device = device; + dsb->ds3db = NULL; + dsb->iks = NULL; /* FIXME? */ + dsb->tmp_buffer = NULL; DSOUND_RecalcFormat(dsb); + DSOUND_MixToTemporary(dsb, 0, dsb->buflen, FALSE); RtlInitializeResource(&dsb->lock); @@ -1022,6 +1226,7 @@ HRESULT IDirectSoundBufferImpl_Duplicate( hres = DirectSoundDevice_AddBuffer(device, dsb); if (hres != DS_OK) { RtlDeleteResource(&dsb->lock); + HeapFree(GetProcessHeap(),0,dsb->tmp_buffer); list_remove(&dsb->entry); dsb->buffer->ref--; HeapFree(GetProcessHeap(),0,dsb->pwfx); @@ -1029,104 +1234,191 @@ HRESULT IDirectSoundBufferImpl_Duplicate( dsb = NULL; } - IDirectSoundBuffer8_AddRef(&dsb->IDirectSoundBuffer8_iface); *ppdsb = dsb; return hres; } /******************************************************************************* - * IKsPropertySet + * IKsBufferPropertySet */ -static inline IDirectSoundBufferImpl *impl_from_IKsPropertySet(IKsPropertySet *iface) -{ - return CONTAINING_RECORD(iface, IDirectSoundBufferImpl, IKsPropertySet_iface); -} - /* IUnknown methods */ -static HRESULT WINAPI IKsPropertySetImpl_QueryInterface(IKsPropertySet *iface, REFIID riid, - void **ppobj) +static HRESULT WINAPI IKsBufferPropertySetImpl_QueryInterface( + LPKSPROPERTYSET iface, + REFIID riid, + LPVOID *ppobj ) { - IDirectSoundBufferImpl *This = impl_from_IKsPropertySet(iface); - + IKsBufferPropertySetImpl *This = (IKsBufferPropertySetImpl *)iface; TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); - return IDirectSoundBuffer_QueryInterface(&This->IDirectSoundBuffer8_iface, riid, ppobj); + return IDirectSoundBuffer_QueryInterface((LPDIRECTSOUNDBUFFER8)This->dsb, riid, ppobj); } -static ULONG WINAPI IKsPropertySetImpl_AddRef(IKsPropertySet *iface) +static ULONG WINAPI IKsBufferPropertySetImpl_AddRef(LPKSPROPERTYSET iface) { - IDirectSoundBufferImpl *This = impl_from_IKsPropertySet(iface); - ULONG ref = InterlockedIncrement(&This->refiks); - + IKsBufferPropertySetImpl *This = (IKsBufferPropertySetImpl *)iface; + ULONG ref = InterlockedIncrement(&(This->ref)); TRACE("(%p) ref was %d\n", This, ref - 1); - - if(ref == 1) - InterlockedIncrement(&This->numIfaces); - return ref; } -static ULONG WINAPI IKsPropertySetImpl_Release(IKsPropertySet *iface) +static ULONG WINAPI IKsBufferPropertySetImpl_Release(LPKSPROPERTYSET iface) { - IDirectSoundBufferImpl *This = impl_from_IKsPropertySet(iface); - ULONG ref; + IKsBufferPropertySetImpl *This = (IKsBufferPropertySetImpl *)iface; + ULONG ref = InterlockedDecrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref + 1); - if (is_primary_buffer(This)){ - ref = capped_refcount_dec(&This->refiks); - if(!ref) - capped_refcount_dec(&This->numIfaces); - TRACE("(%p) ref is now: %d\n", This, ref); - return ref; + if (!ref) { + This->dsb->iks = 0; + IDirectSoundBuffer_Release((LPDIRECTSOUND3DBUFFER)This->dsb); + HeapFree(GetProcessHeap(), 0, This); + TRACE("(%p) released\n", This); } - - ref = InterlockedDecrement(&This->refiks); - if (!ref && !InterlockedDecrement(&This->numIfaces)) - secondarybuffer_destroy(This); - - TRACE("(%p) ref is now %d\n", This, ref); - return ref; } -static HRESULT WINAPI IKsPropertySetImpl_Get(IKsPropertySet *iface, REFGUID guidPropSet, - ULONG dwPropID, void *pInstanceData, ULONG cbInstanceData, void *pPropData, - ULONG cbPropData, ULONG *pcbReturned) +static HRESULT WINAPI IKsBufferPropertySetImpl_Get( + LPKSPROPERTYSET iface, + REFGUID guidPropSet, + ULONG dwPropID, + LPVOID pInstanceData, + ULONG cbInstanceData, + LPVOID pPropData, + ULONG cbPropData, + PULONG pcbReturned ) { - IDirectSoundBufferImpl *This = impl_from_IKsPropertySet(iface); - + IKsBufferPropertySetImpl *This = (IKsBufferPropertySetImpl *)iface; + PIDSDRIVERPROPERTYSET ps; TRACE("(iface=%p,guidPropSet=%s,dwPropID=%d,pInstanceData=%p,cbInstanceData=%d,pPropData=%p,cbPropData=%d,pcbReturned=%p)\n", This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData,pcbReturned); + if (This->dsb->hwbuf) { + IDsDriver_QueryInterface(This->dsb->hwbuf, &IID_IDsDriverPropertySet, (void **)&ps); + + if (ps) { + DSPROPERTY prop; + HRESULT hres; + + prop.s.Set = *guidPropSet; + prop.s.Id = dwPropID; + prop.s.Flags = 0; /* unused */ + prop.s.InstanceId = (ULONG)This->dsb->device; + + + hres = IDsDriverPropertySet_Get(ps, &prop, pInstanceData, cbInstanceData, pPropData, cbPropData, pcbReturned); + + IDsDriverPropertySet_Release(ps); + + return hres; + } + } + return E_PROP_ID_UNSUPPORTED; } -static HRESULT WINAPI IKsPropertySetImpl_Set(IKsPropertySet *iface, REFGUID guidPropSet, - ULONG dwPropID, void *pInstanceData, ULONG cbInstanceData, void *pPropData, - ULONG cbPropData) +static HRESULT WINAPI IKsBufferPropertySetImpl_Set( + LPKSPROPERTYSET iface, + REFGUID guidPropSet, + ULONG dwPropID, + LPVOID pInstanceData, + ULONG cbInstanceData, + LPVOID pPropData, + ULONG cbPropData ) { - IDirectSoundBufferImpl *This = impl_from_IKsPropertySet(iface); - + IKsBufferPropertySetImpl *This = (IKsBufferPropertySetImpl *)iface; + PIDSDRIVERPROPERTYSET ps; TRACE("(%p,%s,%d,%p,%d,%p,%d)\n",This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData); + if (This->dsb->hwbuf) { + IDsDriver_QueryInterface(This->dsb->hwbuf, &IID_IDsDriverPropertySet, (void **)&ps); + + if (ps) { + DSPROPERTY prop; + HRESULT hres; + + prop.s.Set = *guidPropSet; + prop.s.Id = dwPropID; + prop.s.Flags = 0; /* unused */ + prop.s.InstanceId = (ULONG)This->dsb->device; + hres = IDsDriverPropertySet_Set(ps,&prop,pInstanceData,cbInstanceData,pPropData,cbPropData); + + IDsDriverPropertySet_Release(ps); + + return hres; + } + } + return E_PROP_ID_UNSUPPORTED; } -static HRESULT WINAPI IKsPropertySetImpl_QuerySupport(IKsPropertySet *iface, REFGUID guidPropSet, - ULONG dwPropID, ULONG *pTypeSupport) +static HRESULT WINAPI IKsBufferPropertySetImpl_QuerySupport( + LPKSPROPERTYSET iface, + REFGUID guidPropSet, + ULONG dwPropID, + PULONG pTypeSupport ) { - IDirectSoundBufferImpl *This = impl_from_IKsPropertySet(iface); - + IKsBufferPropertySetImpl *This = (IKsBufferPropertySetImpl *)iface; + PIDSDRIVERPROPERTYSET ps; TRACE("(%p,%s,%d,%p)\n",This,debugstr_guid(guidPropSet),dwPropID,pTypeSupport); + if (This->dsb->hwbuf) { + IDsDriver_QueryInterface(This->dsb->hwbuf, &IID_IDsDriverPropertySet, (void **)&ps); + + if (ps) { + HRESULT hres; + + hres = IDsDriverPropertySet_QuerySupport(ps,guidPropSet, dwPropID,pTypeSupport); + + IDsDriverPropertySet_Release(ps); + + return hres; + } + } + return E_PROP_ID_UNSUPPORTED; } -const IKsPropertySetVtbl iksbvt = { - IKsPropertySetImpl_QueryInterface, - IKsPropertySetImpl_AddRef, - IKsPropertySetImpl_Release, - IKsPropertySetImpl_Get, - IKsPropertySetImpl_Set, - IKsPropertySetImpl_QuerySupport +static const IKsPropertySetVtbl iksbvt = { + IKsBufferPropertySetImpl_QueryInterface, + IKsBufferPropertySetImpl_AddRef, + IKsBufferPropertySetImpl_Release, + IKsBufferPropertySetImpl_Get, + IKsBufferPropertySetImpl_Set, + IKsBufferPropertySetImpl_QuerySupport }; + +HRESULT IKsBufferPropertySetImpl_Create( + IDirectSoundBufferImpl *dsb, + IKsBufferPropertySetImpl **piks) +{ + IKsBufferPropertySetImpl *iks; + TRACE("(%p,%p)\n",dsb,piks); + *piks = NULL; + + iks = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(*iks)); + if (iks == 0) { + WARN("out of memory\n"); + *piks = NULL; + return DSERR_OUTOFMEMORY; + } + + iks->ref = 0; + iks->dsb = dsb; + dsb->iks = iks; + iks->lpVtbl = &iksbvt; + + IDirectSoundBuffer_AddRef((LPDIRECTSOUNDBUFFER)dsb); + + *piks = iks; + return S_OK; +} + +HRESULT IKsBufferPropertySetImpl_Destroy( + IKsBufferPropertySetImpl *piks) +{ + TRACE("(%p)\n",piks); + + while (IKsBufferPropertySetImpl_Release((LPKSPROPERTYSET)piks) > 0); + + return S_OK; +} diff --git a/dll/directx/wine/dsound/capture.c b/dll/directx/wine/dsound/capture.c index 756bbc090f2..b8df4f52488 100644 --- a/dll/directx/wine/dsound/capture.c +++ b/dll/directx/wine/dsound/capture.c @@ -27,117 +27,67 @@ #include "dsound_private.h" -typedef struct DirectSoundCaptureDevice DirectSoundCaptureDevice; - -/* IDirectSoundCaptureBuffer implementation structure */ -typedef struct IDirectSoundCaptureBufferImpl +/***************************************************************************** + * IDirectSoundCaptureNotify implementation structure + */ +struct IDirectSoundCaptureNotifyImpl { - IDirectSoundCaptureBuffer8 IDirectSoundCaptureBuffer8_iface; - IDirectSoundNotify IDirectSoundNotify_iface; - LONG numIfaces; /* "in use interfaces" refcount */ - LONG ref, refn; - /* IDirectSoundCaptureBuffer fields */ - DirectSoundCaptureDevice *device; - DSCBUFFERDESC *pdscbd; - DWORD flags; - /* IDirectSoundNotify fields */ - DSBPOSITIONNOTIFY *notifies; - int nrofnotifies; -} IDirectSoundCaptureBufferImpl; - -/* DirectSoundCaptureDevice implementation structure */ -struct DirectSoundCaptureDevice -{ - GUID guid; - LONG ref; - DSCCAPS drvcaps; - BYTE *buffer; - DWORD buflen, write_pos_bytes; - WAVEFORMATEX *pwfx; - IDirectSoundCaptureBufferImpl *capture_buffer; - DWORD state; - UINT timerID; - CRITICAL_SECTION lock; - IMMDevice *mmdevice; - IAudioClient *client; - IAudioCaptureClient *capture; - struct list entry; + /* IUnknown fields */ + const IDirectSoundNotifyVtbl *lpVtbl; + LONG ref; + IDirectSoundCaptureBufferImpl* dscb; }; - -static void capturebuffer_destroy(IDirectSoundCaptureBufferImpl *This) -{ - if (This->device->state == STATE_CAPTURING) - This->device->state = STATE_STOPPING; - - HeapFree(GetProcessHeap(),0, This->pdscbd); - - if (This->device->client) { - IAudioClient_Release(This->device->client); - This->device->client = NULL; - } - - if (This->device->capture) { - IAudioCaptureClient_Release(This->device->capture); - This->device->capture = NULL; - } - - /* remove from DirectSoundCaptureDevice */ - This->device->capture_buffer = NULL; - - HeapFree(GetProcessHeap(), 0, This->notifies); - HeapFree(GetProcessHeap(), 0, This); - TRACE("(%p) released\n", This); -} - /******************************************************************************* - * IDirectSoundNotify + * IDirectSoundCaptureNotify */ -static inline struct IDirectSoundCaptureBufferImpl *impl_from_IDirectSoundNotify(IDirectSoundNotify *iface) +static HRESULT WINAPI IDirectSoundCaptureNotifyImpl_QueryInterface( + LPDIRECTSOUNDNOTIFY iface, + REFIID riid, + LPVOID *ppobj) { - return CONTAINING_RECORD(iface, IDirectSoundCaptureBufferImpl, IDirectSoundNotify_iface); + IDirectSoundCaptureNotifyImpl *This = (IDirectSoundCaptureNotifyImpl *)iface; + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); + + if (This->dscb == NULL) { + WARN("invalid parameter\n"); + return E_INVALIDARG; + } + + return IDirectSoundCaptureBuffer_QueryInterface((LPDIRECTSOUNDCAPTUREBUFFER)This->dscb, riid, ppobj); } -static HRESULT WINAPI IDirectSoundNotifyImpl_QueryInterface(IDirectSoundNotify *iface, REFIID riid, - void **ppobj) +static ULONG WINAPI IDirectSoundCaptureNotifyImpl_AddRef(LPDIRECTSOUNDNOTIFY iface) { - IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundNotify(iface); - - TRACE("(%p,%s,%p)\n", This, debugstr_guid(riid), ppobj); - - return IDirectSoundCaptureBuffer_QueryInterface(&This->IDirectSoundCaptureBuffer8_iface, riid, ppobj); -} - -static ULONG WINAPI IDirectSoundNotifyImpl_AddRef(IDirectSoundNotify *iface) -{ - IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundNotify(iface); - ULONG ref = InterlockedIncrement(&This->refn); - + IDirectSoundCaptureNotifyImpl *This = (IDirectSoundCaptureNotifyImpl *)iface; + ULONG ref = InterlockedIncrement(&(This->ref)); TRACE("(%p) ref was %d\n", This, ref - 1); - - if(ref == 1) - InterlockedIncrement(&This->numIfaces); - return ref; } -static ULONG WINAPI IDirectSoundNotifyImpl_Release(IDirectSoundNotify *iface) +static ULONG WINAPI IDirectSoundCaptureNotifyImpl_Release(LPDIRECTSOUNDNOTIFY iface) { - IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundNotify(iface); - ULONG ref = InterlockedDecrement(&This->refn); - + IDirectSoundCaptureNotifyImpl *This = (IDirectSoundCaptureNotifyImpl *)iface; + ULONG ref = InterlockedDecrement(&(This->ref)); TRACE("(%p) ref was %d\n", This, ref + 1); - if (!ref && !InterlockedDecrement(&This->numIfaces)) - capturebuffer_destroy(This); - + if (!ref) { + if (This->dscb->hwnotify) + IDsDriverNotify_Release(This->dscb->hwnotify); + This->dscb->notify=NULL; + IDirectSoundCaptureBuffer_Release((LPDIRECTSOUNDCAPTUREBUFFER)This->dscb); + HeapFree(GetProcessHeap(),0,This); + TRACE("(%p) released\n", This); + } return ref; } -static HRESULT WINAPI IDirectSoundNotifyImpl_SetNotificationPositions(IDirectSoundNotify *iface, - DWORD howmuch, const DSBPOSITIONNOTIFY *notify) +static HRESULT WINAPI IDirectSoundCaptureNotifyImpl_SetNotificationPositions( + LPDIRECTSOUNDNOTIFY iface, + DWORD howmuch, + LPCDSBPOSITIONNOTIFY notify) { - IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundNotify(iface); + IDirectSoundCaptureNotifyImpl *This = (IDirectSoundCaptureNotifyImpl *)iface; TRACE("(%p,0x%08x,%p)\n",This,howmuch,notify); if (howmuch > 0 && notify == NULL) { @@ -152,26 +102,32 @@ static HRESULT WINAPI IDirectSoundNotifyImpl_SetNotificationPositions(IDirectSou notify[i].dwOffset,notify[i].hEventNotify); } - if (howmuch > 0) { + if (This->dscb->hwnotify) { + HRESULT hres; + hres = IDsDriverNotify_SetNotificationPositions(This->dscb->hwnotify, howmuch, notify); + if (hres != DS_OK) + WARN("IDsDriverNotify_SetNotificationPositions failed\n"); + return hres; + } else if (howmuch > 0) { /* Make an internal copy of the caller-supplied array. * Replace the existing copy if one is already present. */ - if (This->notifies) - This->notifies = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->notifies, - howmuch * sizeof(DSBPOSITIONNOTIFY)); + if (This->dscb->notifies) + This->dscb->notifies = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + This->dscb->notifies, howmuch * sizeof(DSBPOSITIONNOTIFY)); else - This->notifies = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - howmuch * sizeof(DSBPOSITIONNOTIFY)); + This->dscb->notifies = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + howmuch * sizeof(DSBPOSITIONNOTIFY)); - if (!This->notifies) { + if (This->dscb->notifies == NULL) { WARN("out of memory\n"); return DSERR_OUTOFMEMORY; } - CopyMemory(This->notifies, notify, howmuch * sizeof(DSBPOSITIONNOTIFY)); - This->nrofnotifies = howmuch; + CopyMemory(This->dscb->notifies, notify, howmuch * sizeof(DSBPOSITIONNOTIFY)); + This->dscb->nrofnotifies = howmuch; } else { - HeapFree(GetProcessHeap(), 0, This->notifies); - This->notifies = NULL; - This->nrofnotifies = 0; + HeapFree(GetProcessHeap(), 0, This->dscb->notifies); + This->dscb->notifies = NULL; + This->dscb->nrofnotifies = 0; } return S_OK; @@ -179,12 +135,36 @@ static HRESULT WINAPI IDirectSoundNotifyImpl_SetNotificationPositions(IDirectSou static const IDirectSoundNotifyVtbl dscnvt = { - IDirectSoundNotifyImpl_QueryInterface, - IDirectSoundNotifyImpl_AddRef, - IDirectSoundNotifyImpl_Release, - IDirectSoundNotifyImpl_SetNotificationPositions + IDirectSoundCaptureNotifyImpl_QueryInterface, + IDirectSoundCaptureNotifyImpl_AddRef, + IDirectSoundCaptureNotifyImpl_Release, + IDirectSoundCaptureNotifyImpl_SetNotificationPositions, }; +static HRESULT IDirectSoundCaptureNotifyImpl_Create( + IDirectSoundCaptureBufferImpl *dscb, + IDirectSoundCaptureNotifyImpl **pdscn) +{ + IDirectSoundCaptureNotifyImpl * dscn; + TRACE("(%p,%p)\n",dscb,pdscn); + + dscn = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*dscn)); + + if (dscn == NULL) { + WARN("out of memory\n"); + return DSERR_OUTOFMEMORY; + } + + dscn->ref = 0; + dscn->lpVtbl = &dscnvt; + dscn->dscb = dscb; + dscb->notify = dscn; + IDirectSoundCaptureBuffer_AddRef((LPDIRECTSOUNDCAPTUREBUFFER)dscb); + + *pdscn = dscn; + return DS_OK; +} + static const char * const captureStateString[] = { "STATE_STOPPED", @@ -195,18 +175,16 @@ static const char * const captureStateString[] = { /******************************************************************************* - * IDirectSoundCaptureBuffer + * IDirectSoundCaptureBuffer */ -static inline IDirectSoundCaptureBufferImpl *impl_from_IDirectSoundCaptureBuffer8(IDirectSoundCaptureBuffer8 *iface) +static HRESULT WINAPI +IDirectSoundCaptureBufferImpl_QueryInterface( + LPDIRECTSOUNDCAPTUREBUFFER8 iface, + REFIID riid, + LPVOID* ppobj ) { - return CONTAINING_RECORD(iface, IDirectSoundCaptureBufferImpl, IDirectSoundCaptureBuffer8_iface); -} - -static HRESULT WINAPI IDirectSoundCaptureBufferImpl_QueryInterface(IDirectSoundCaptureBuffer8 *iface, - REFIID riid, void **ppobj) -{ - IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundCaptureBuffer8(iface); - + IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)iface; + HRESULT hres; TRACE( "(%p,%s,%p)\n", This, debugstr_guid(riid), ppobj ); if (ppobj == NULL) { @@ -216,53 +194,100 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_QueryInterface(IDirectSoundC *ppobj = NULL; + if ( IsEqualGUID( &IID_IDirectSoundNotify, riid ) ) { + if (!This->notify) + hres = IDirectSoundCaptureNotifyImpl_Create(This, &This->notify); + if (This->notify) { + IDirectSoundNotify_AddRef((LPDIRECTSOUNDNOTIFY)This->notify); + if (This->device->hwbuf && !This->hwnotify) { + hres = IDsCaptureDriverBuffer_QueryInterface(This->device->hwbuf, + &IID_IDsDriverNotify, (LPVOID*)&(This->hwnotify)); + if (hres != DS_OK) { + WARN("IDsCaptureDriverBuffer_QueryInterface failed\n"); + IDirectSoundNotify_Release((LPDIRECTSOUNDNOTIFY)This->notify); + *ppobj = 0; + return hres; + } + } + + *ppobj = This->notify; + return DS_OK; + } + + WARN("IID_IDirectSoundNotify\n"); + return E_FAIL; + } + if ( IsEqualGUID( &IID_IDirectSoundCaptureBuffer, riid ) || IsEqualGUID( &IID_IDirectSoundCaptureBuffer8, riid ) ) { IDirectSoundCaptureBuffer8_AddRef(iface); - *ppobj = iface; - return S_OK; - } - - if ( IsEqualGUID( &IID_IDirectSoundNotify, riid ) ) { - IDirectSoundNotify_AddRef(&This->IDirectSoundNotify_iface); - *ppobj = &This->IDirectSoundNotify_iface; - return S_OK; + *ppobj = This; + return NO_ERROR; } FIXME("(%p,%s,%p) unsupported GUID\n", This, debugstr_guid(riid), ppobj); return E_NOINTERFACE; } -static ULONG WINAPI IDirectSoundCaptureBufferImpl_AddRef(IDirectSoundCaptureBuffer8 *iface) +static ULONG WINAPI +IDirectSoundCaptureBufferImpl_AddRef( LPDIRECTSOUNDCAPTUREBUFFER8 iface ) { - IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundCaptureBuffer8(iface); - ULONG ref = InterlockedIncrement(&This->ref); - + IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)iface; + ULONG ref = InterlockedIncrement(&(This->ref)); TRACE("(%p) ref was %d\n", This, ref - 1); - - if(ref == 1) - InterlockedIncrement(&This->numIfaces); - return ref; } -static ULONG WINAPI IDirectSoundCaptureBufferImpl_Release(IDirectSoundCaptureBuffer8 *iface) +static ULONG WINAPI +IDirectSoundCaptureBufferImpl_Release( LPDIRECTSOUNDCAPTUREBUFFER8 iface ) { - IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundCaptureBuffer8(iface); - ULONG ref = InterlockedDecrement(&This->ref); - + IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)iface; + ULONG ref = InterlockedDecrement(&(This->ref)); TRACE("(%p) ref was %d\n", This, ref + 1); - if (!ref && !InterlockedDecrement(&This->numIfaces)) - capturebuffer_destroy(This); + if (!ref) { + TRACE("deleting object\n"); + if (This->device->state == STATE_CAPTURING) + This->device->state = STATE_STOPPING; + HeapFree(GetProcessHeap(),0, This->pdscbd); + + if (This->device->hwi) { + waveInReset(This->device->hwi); + waveInClose(This->device->hwi); + HeapFree(GetProcessHeap(),0, This->device->pwave); + This->device->pwave = 0; + This->device->hwi = 0; + } + + if (This->device->hwbuf) + IDsCaptureDriverBuffer_Release(This->device->hwbuf); + + /* remove from DirectSoundCaptureDevice */ + This->device->capture_buffer = NULL; + + if (This->notify) + IDirectSoundNotify_Release((LPDIRECTSOUNDNOTIFY)This->notify); + + /* If driver manages its own buffer, IDsCaptureDriverBuffer_Release + should have freed the buffer. Prevent freeing it again in + IDirectSoundCaptureBufferImpl_Create */ + if (!(This->device->drvdesc.dwFlags & DSDDESC_USESYSTEMMEMORY)) + This->device->buffer = NULL; + + HeapFree(GetProcessHeap(), 0, This->notifies); + HeapFree( GetProcessHeap(), 0, This ); + TRACE("(%p) released\n", This); + } return ref; } -static HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetCaps(IDirectSoundCaptureBuffer8 *iface, - DSCBCAPS *lpDSCBCaps) +static HRESULT WINAPI +IDirectSoundCaptureBufferImpl_GetCaps( + LPDIRECTSOUNDCAPTUREBUFFER8 iface, + LPDSCBCAPS lpDSCBCaps ) { - IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundCaptureBuffer8(iface); + IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)iface; TRACE( "(%p,%p)\n", This, lpDSCBCaps ); if (lpDSCBCaps == NULL) { @@ -289,11 +314,14 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetCaps(IDirectSoundCaptureB return DS_OK; } -static HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetCurrentPosition(IDirectSoundCaptureBuffer8 *iface, - DWORD *lpdwCapturePosition, DWORD *lpdwReadPosition) +static HRESULT WINAPI +IDirectSoundCaptureBufferImpl_GetCurrentPosition( + LPDIRECTSOUNDCAPTUREBUFFER8 iface, + LPDWORD lpdwCapturePosition, + LPDWORD lpdwReadPosition ) { - IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundCaptureBuffer8(iface); - + IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)iface; + HRESULT hres = DS_OK; TRACE( "(%p,%p,%p)\n", This, lpdwCapturePosition, lpdwReadPosition ); if (This->device == NULL) { @@ -301,35 +329,42 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetCurrentPosition(IDirectSo return DSERR_INVALIDPARAM; } - EnterCriticalSection(&This->device->lock); + if (This->device->driver) { + hres = IDsCaptureDriverBuffer_GetPosition(This->device->hwbuf, lpdwCapturePosition, lpdwReadPosition ); + if (hres != DS_OK) + WARN("IDsCaptureDriverBuffer_GetPosition failed\n"); + } else if (This->device->hwi) { + DWORD pos; - if (!This->device->client) { + EnterCriticalSection(&This->device->lock); + pos = (DWORD_PTR)This->device->pwave[This->device->index].lpData - (DWORD_PTR)This->device->buffer; + if (lpdwCapturePosition) + *lpdwCapturePosition = (This->device->pwave[This->device->index].dwBufferLength + pos) % This->device->buflen; + if (lpdwReadPosition) + *lpdwReadPosition = pos; LeaveCriticalSection(&This->device->lock); + + } else { WARN("no driver\n"); - return DSERR_NODRIVER; + hres = DSERR_NODRIVER; } - if(lpdwCapturePosition) - *lpdwCapturePosition = This->device->write_pos_bytes; - - if(lpdwReadPosition) - *lpdwReadPosition = This->device->write_pos_bytes; - - LeaveCriticalSection(&This->device->lock); - TRACE("cappos=%d readpos=%d\n", (lpdwCapturePosition?*lpdwCapturePosition:-1), (lpdwReadPosition?*lpdwReadPosition:-1)); - TRACE("returning DS_OK\n"); - - return DS_OK; + TRACE("returning %08x\n", hres); + return hres; } -static HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetFormat(IDirectSoundCaptureBuffer8 *iface, - WAVEFORMATEX *lpwfxFormat, DWORD dwSizeAllocated, DWORD *lpdwSizeWritten) +static HRESULT WINAPI +IDirectSoundCaptureBufferImpl_GetFormat( + LPDIRECTSOUNDCAPTUREBUFFER8 iface, + LPWAVEFORMATEX lpwfxFormat, + DWORD dwSizeAllocated, + LPDWORD lpdwSizeWritten ) { - IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundCaptureBuffer8(iface); + IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)iface; HRESULT hres = DS_OK; - - TRACE("(%p,%p,0x%08x,%p)\n", This, lpwfxFormat, dwSizeAllocated, lpdwSizeWritten); + TRACE( "(%p,%p,0x%08x,%p)\n", This, lpwfxFormat, dwSizeAllocated, + lpdwSizeWritten ); if (This->device == NULL) { WARN("invalid parameter: This->device == NULL\n"); @@ -356,11 +391,12 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetFormat(IDirectSoundCaptur return hres; } -static HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetStatus(IDirectSoundCaptureBuffer8 *iface, - DWORD *lpdwStatus) +static HRESULT WINAPI +IDirectSoundCaptureBufferImpl_GetStatus( + LPDIRECTSOUNDCAPTUREBUFFER8 iface, + LPDWORD lpdwStatus ) { - IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundCaptureBuffer8(iface); - + IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)iface; TRACE( "(%p, %p), thread is %04x\n", This, lpdwStatus, GetCurrentThreadId() ); if (This->device == NULL) { @@ -393,23 +429,32 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetStatus(IDirectSoundCaptur return DS_OK; } -static HRESULT WINAPI IDirectSoundCaptureBufferImpl_Initialize(IDirectSoundCaptureBuffer8 *iface, - IDirectSoundCapture *lpDSC, const DSCBUFFERDESC *lpcDSCBDesc) +static HRESULT WINAPI +IDirectSoundCaptureBufferImpl_Initialize( + LPDIRECTSOUNDCAPTUREBUFFER8 iface, + LPDIRECTSOUNDCAPTURE lpDSC, + LPCDSCBUFFERDESC lpcDSCBDesc ) { - IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundCaptureBuffer8(iface); + IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)iface; FIXME( "(%p,%p,%p): stub\n", This, lpDSC, lpcDSCBDesc ); return DS_OK; } -static HRESULT WINAPI IDirectSoundCaptureBufferImpl_Lock(IDirectSoundCaptureBuffer8 *iface, - DWORD dwReadCusor, DWORD dwReadBytes, void **lplpvAudioPtr1, DWORD *lpdwAudioBytes1, - void **lplpvAudioPtr2, DWORD *lpdwAudioBytes2, DWORD dwFlags) +static HRESULT WINAPI +IDirectSoundCaptureBufferImpl_Lock( + LPDIRECTSOUNDCAPTUREBUFFER8 iface, + DWORD dwReadCusor, + DWORD dwReadBytes, + LPVOID* lplpvAudioPtr1, + LPDWORD lpdwAudioBytes1, + LPVOID* lplpvAudioPtr2, + LPDWORD lpdwAudioBytes2, + DWORD dwFlags ) { - IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundCaptureBuffer8(iface); HRESULT hres = DS_OK; - + IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)iface; TRACE( "(%p,%08u,%08u,%p,%p,%p,%p,0x%08x) at %d\n", This, dwReadCusor, dwReadBytes, lplpvAudioPtr1, lpdwAudioBytes1, lplpvAudioPtr2, lpdwAudioBytes2, dwFlags, GetTickCount() ); @@ -431,7 +476,14 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_Lock(IDirectSoundCaptureBuff EnterCriticalSection(&(This->device->lock)); - if (This->device->client) { + if (This->device->driver) { + hres = IDsCaptureDriverBuffer_Lock(This->device->hwbuf, lplpvAudioPtr1, + lpdwAudioBytes1, lplpvAudioPtr2, + lpdwAudioBytes2, dwReadCusor, + dwReadBytes, dwFlags); + if (hres != DS_OK) + WARN("IDsCaptureDriverBuffer_Lock failed\n"); + } else if (This->device->hwi) { *lplpvAudioPtr1 = This->device->buffer + dwReadCusor; if ( (dwReadCusor + dwReadBytes) > This->device->buflen) { *lpdwAudioBytes1 = This->device->buflen - dwReadCusor; @@ -457,12 +509,13 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_Lock(IDirectSoundCaptureBuff return hres; } -static HRESULT WINAPI IDirectSoundCaptureBufferImpl_Start(IDirectSoundCaptureBuffer8 *iface, - DWORD dwFlags) +static HRESULT WINAPI +IDirectSoundCaptureBufferImpl_Start( + LPDIRECTSOUNDCAPTUREBUFFER8 iface, + DWORD dwFlags ) { - IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundCaptureBuffer8(iface); - HRESULT hres; - + HRESULT hres = DS_OK; + IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)iface; TRACE( "(%p,0x%08x)\n", This, dwFlags ); if (This->device == NULL) { @@ -470,45 +523,101 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_Start(IDirectSoundCaptureBuf return DSERR_INVALIDPARAM; } - if ( !This->device->client ) { + if ( (This->device->driver == 0) && (This->device->hwi == 0) ) { WARN("no driver\n"); return DSERR_NODRIVER; } EnterCriticalSection(&(This->device->lock)); + This->flags = dwFlags; + TRACE("old This->state=%s\n",captureStateString[This->device->state]); if (This->device->state == STATE_STOPPED) This->device->state = STATE_STARTING; else if (This->device->state == STATE_STOPPING) This->device->state = STATE_CAPTURING; - else - goto out; TRACE("new This->device->state=%s\n",captureStateString[This->device->state]); - This->flags = dwFlags; - if (This->device->buffer) - FillMemory(This->device->buffer, This->device->buflen, (This->device->pwfx->wBitsPerSample == 8) ? 128 : 0); + LeaveCriticalSection(&(This->device->lock)); - hres = IAudioClient_Start(This->device->client); - if(FAILED(hres)){ - WARN("Start failed: %08x\n", hres); - LeaveCriticalSection(&This->device->lock); - return hres; + if (This->device->driver) { + hres = IDsCaptureDriverBuffer_Start(This->device->hwbuf, dwFlags); + if (hres != DS_OK) + WARN("IDsCaptureDriverBuffer_Start failed\n"); + } else if (This->device->hwi) { + DirectSoundCaptureDevice *device = This->device; + + if (device->buffer) { + int c; + DWORD blocksize = DSOUND_fraglen(device->pwfx->nSamplesPerSec, device->pwfx->nBlockAlign); + device->nrofpwaves = device->buflen / blocksize + !!(device->buflen % blocksize); + TRACE("nrofpwaves=%d\n", device->nrofpwaves); + + /* prepare headers */ + if (device->pwave) + device->pwave = HeapReAlloc(GetProcessHeap(), 0,device->pwave, device->nrofpwaves*sizeof(WAVEHDR)); + else + device->pwave = HeapAlloc(GetProcessHeap(), 0, device->nrofpwaves*sizeof(WAVEHDR)); + + for (c = 0; c < device->nrofpwaves; ++c) { + device->pwave[c].lpData = (char *)device->buffer + c * blocksize; + if (c + 1 == device->nrofpwaves) + device->pwave[c].dwBufferLength = device->buflen - c * blocksize; + else + device->pwave[c].dwBufferLength = blocksize; + device->pwave[c].dwBytesRecorded = 0; + device->pwave[c].dwUser = (DWORD_PTR)device; + device->pwave[c].dwFlags = 0; + device->pwave[c].dwLoops = 0; + hres = mmErr(waveInPrepareHeader(device->hwi, &(device->pwave[c]),sizeof(WAVEHDR))); + if (hres != DS_OK) { + WARN("waveInPrepareHeader failed\n"); + while (c--) + waveInUnprepareHeader(device->hwi, &(device->pwave[c]),sizeof(WAVEHDR)); + break; + } + + hres = mmErr(waveInAddBuffer(device->hwi, &(device->pwave[c]), sizeof(WAVEHDR))); + if (hres != DS_OK) { + WARN("waveInAddBuffer failed\n"); + while (c--) + waveInUnprepareHeader(device->hwi, &(device->pwave[c]),sizeof(WAVEHDR)); + break; + } + } + + FillMemory(device->buffer, device->buflen, (device->pwfx->wBitsPerSample == 8) ? 128 : 0); + } + + device->index = 0; + + if (hres == DS_OK) { + /* start filling the first buffer */ + hres = mmErr(waveInStart(device->hwi)); + if (hres != DS_OK) + WARN("waveInStart failed\n"); + } + + if (hres != DS_OK) { + WARN("calling waveInClose because of error\n"); + waveInClose(device->hwi); + device->hwi = 0; + } + } else { + WARN("no driver\n"); + hres = DSERR_NODRIVER; } -out: - LeaveCriticalSection(&This->device->lock); - - TRACE("returning DS_OK\n"); - return DS_OK; + TRACE("returning %08x\n", hres); + return hres; } -static HRESULT WINAPI IDirectSoundCaptureBufferImpl_Stop(IDirectSoundCaptureBuffer8 *iface) +static HRESULT WINAPI +IDirectSoundCaptureBufferImpl_Stop( LPDIRECTSOUNDCAPTUREBUFFER8 iface ) { - IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundCaptureBuffer8(iface); - HRESULT hres; - - TRACE("(%p)\n", This); + HRESULT hres = DS_OK; + IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)iface; + TRACE( "(%p)\n", This ); if (This->device == NULL) { WARN("invalid parameter: This->device == NULL\n"); @@ -524,26 +633,35 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_Stop(IDirectSoundCaptureBuff This->device->state = STATE_STOPPED; TRACE("new This->device->state=%s\n",captureStateString[This->device->state]); - if(This->device->client){ - hres = IAudioClient_Stop(This->device->client); - if(FAILED(hres)){ - LeaveCriticalSection(&This->device->lock); - return hres; - } - } - LeaveCriticalSection(&(This->device->lock)); - TRACE("returning DS_OK\n"); - return DS_OK; + if (This->device->driver) { + hres = IDsCaptureDriverBuffer_Stop(This->device->hwbuf); + if (hres != DS_OK) + WARN("IDsCaptureDriverBuffer_Stop() failed\n"); + } else if (This->device->hwi) { + hres = mmErr(waveInReset(This->device->hwi)); + if (hres != DS_OK) + WARN("waveInReset() failed\n"); + } else { + WARN("no driver\n"); + hres = DSERR_NODRIVER; + } + + TRACE("returning %08x\n", hres); + return hres; } -static HRESULT WINAPI IDirectSoundCaptureBufferImpl_Unlock(IDirectSoundCaptureBuffer8 *iface, - void *lpvAudioPtr1, DWORD dwAudioBytes1, void *lpvAudioPtr2, DWORD dwAudioBytes2) +static HRESULT WINAPI +IDirectSoundCaptureBufferImpl_Unlock( + LPDIRECTSOUNDCAPTUREBUFFER8 iface, + LPVOID lpvAudioPtr1, + DWORD dwAudioBytes1, + LPVOID lpvAudioPtr2, + DWORD dwAudioBytes2 ) { - IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundCaptureBuffer8(iface); HRESULT hres = DS_OK; - + IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)iface; TRACE( "(%p,%p,%08u,%p,%08u)\n", This, lpvAudioPtr1, dwAudioBytes1, lpvAudioPtr2, dwAudioBytes2 ); @@ -552,7 +670,12 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_Unlock(IDirectSoundCaptureBu return DSERR_INVALIDPARAM; } - if (!This->device->client) { + if (This->device->driver) { + hres = IDsCaptureDriverBuffer_Unlock(This->device->hwbuf, lpvAudioPtr1, + dwAudioBytes1, lpvAudioPtr2, dwAudioBytes2); + if (hres != DS_OK) + WARN("IDsCaptureDriverBuffer_Unlock failed\n"); + } else if (!This->device->hwi) { WARN("invalid call\n"); hres = DSERR_INVALIDCALL; } @@ -561,25 +684,29 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_Unlock(IDirectSoundCaptureBu return hres; } -static HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetObjectInPath(IDirectSoundCaptureBuffer8 *iface, - REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, void **ppObject) +static HRESULT WINAPI +IDirectSoundCaptureBufferImpl_GetObjectInPath( + LPDIRECTSOUNDCAPTUREBUFFER8 iface, + REFGUID rguidObject, + DWORD dwIndex, + REFGUID rguidInterface, + LPVOID* ppObject ) { - IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundCaptureBuffer8(iface); + IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)iface; FIXME( "(%p,%s,%u,%s,%p): stub\n", This, debugstr_guid(rguidObject), dwIndex, debugstr_guid(rguidInterface), ppObject ); - if (!ppObject) - return DSERR_INVALIDPARAM; - - *ppObject = NULL; - return DSERR_CONTROLUNAVAIL; + return DS_OK; } -static HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetFXStatus(IDirectSoundCaptureBuffer8 *iface, - DWORD dwFXCount, DWORD *pdwFXStatus) +static HRESULT WINAPI +IDirectSoundCaptureBufferImpl_GetFXStatus( + LPDIRECTSOUNDCAPTUREBUFFER8 iface, + DWORD dwFXCount, + LPDWORD pdwFXStatus ) { - IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundCaptureBuffer8(iface); + IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)iface; FIXME( "(%p,%u,%p): stub\n", This, dwFXCount, pdwFXStatus ); @@ -634,13 +761,55 @@ static void capture_CheckNotify(IDirectSoundCaptureBufferImpl *This, DWORD from, } } +static void CALLBACK +DSOUND_capture_callback(HWAVEIN hwi, UINT msg, DWORD_PTR dwUser, DWORD_PTR dw1, + DWORD_PTR dw2) +{ + DirectSoundCaptureDevice * This = (DirectSoundCaptureDevice*)dwUser; + IDirectSoundCaptureBufferImpl * Moi = This->capture_buffer; + TRACE("(%p,%08x(%s),%08lx,%08lx,%08lx) entering at %d\n",hwi,msg, + msg == MM_WIM_OPEN ? "MM_WIM_OPEN" : msg == MM_WIM_CLOSE ? "MM_WIM_CLOSE" : + msg == MM_WIM_DATA ? "MM_WIM_DATA" : "UNKNOWN",dwUser,dw1,dw2,GetTickCount()); + + if (msg == MM_WIM_DATA) { + EnterCriticalSection( &(This->lock) ); + TRACE("DirectSoundCapture msg=MM_WIM_DATA, old This->state=%s, old This->index=%d\n", + captureStateString[This->state],This->index); + if (This->state != STATE_STOPPED) { + int index = This->index; + if (This->state == STATE_STARTING) + This->state = STATE_CAPTURING; + capture_CheckNotify(Moi, (DWORD_PTR)This->pwave[index].lpData - (DWORD_PTR)This->buffer, This->pwave[index].dwBufferLength); + This->index = (This->index + 1) % This->nrofpwaves; + if ( (This->index == 0) && !(This->capture_buffer->flags & DSCBSTART_LOOPING) ) { + TRACE("end of buffer\n"); + This->state = STATE_STOPPED; + capture_CheckNotify(Moi, 0, 0); + } else { + if (This->state == STATE_CAPTURING) { + waveInUnprepareHeader(hwi, &(This->pwave[index]), sizeof(WAVEHDR)); + waveInPrepareHeader(hwi, &(This->pwave[index]), sizeof(WAVEHDR)); + waveInAddBuffer(hwi, &(This->pwave[index]), sizeof(WAVEHDR)); + } else if (This->state == STATE_STOPPING) { + TRACE("stopping\n"); + This->state = STATE_STOPPED; + } + } + } + TRACE("DirectSoundCapture new This->state=%s, new This->index=%d\n", + captureStateString[This->state],This->index); + LeaveCriticalSection( &(This->lock) ); + } + + TRACE("completed\n"); +} + static HRESULT IDirectSoundCaptureBufferImpl_Create( DirectSoundCaptureDevice *device, IDirectSoundCaptureBufferImpl ** ppobj, LPCDSCBUFFERDESC lpcDSCBufferDesc) { LPWAVEFORMATEX wfex; - IDirectSoundCaptureBufferImpl *This; TRACE( "(%p,%p,%p)\n", device, ppobj, lpcDSCBufferDesc); if (ppobj == NULL) { @@ -648,15 +817,15 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create( return DSERR_INVALIDPARAM; } - *ppobj = NULL; - if (!device) { WARN("not initialized\n"); + *ppobj = NULL; return DSERR_UNINITIALIZED; } if (lpcDSCBufferDesc == NULL) { WARN("invalid parameter: lpcDSCBufferDesc == NULL\n"); + *ppobj = NULL; return DSERR_INVALIDPARAM; } @@ -665,6 +834,7 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create( (lpcDSCBufferDesc->dwBufferBytes == 0) || (lpcDSCBufferDesc->lpwfxFormat == NULL) ) { /* FIXME: DSERR_BADFORMAT ? */ WARN("invalid lpcDSCBufferDesc\n"); + *ppobj = NULL; return DSERR_INVALIDPARAM; } @@ -677,26 +847,30 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create( wfex->wBitsPerSample, wfex->cbSize); device->pwfx = DSOUND_CopyFormat(wfex); - if ( device->pwfx == NULL ) + if ( device->pwfx == NULL ) { + *ppobj = NULL; return DSERR_OUTOFMEMORY; + } - This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY, + *ppobj = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY, sizeof(IDirectSoundCaptureBufferImpl)); - if ( This == NULL ) { + if ( *ppobj == NULL ) { WARN("out of memory\n"); + *ppobj = NULL; return DSERR_OUTOFMEMORY; } else { - HRESULT err = DS_OK; + HRESULT err = DS_OK; LPBYTE newbuf; DWORD buflen; + IDirectSoundCaptureBufferImpl *This = *ppobj; - This->numIfaces = 0; - This->ref = 0; - This->refn = 0; + This->ref = 1; This->device = device; This->device->capture_buffer = This; - This->nrofnotifies = 0; + This->notify = NULL; + This->nrofnotifies = 0; + This->hwnotify = NULL; This->pdscbd = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY, lpcDSCBufferDesc->dwSize); @@ -706,72 +880,80 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create( WARN("no memory\n"); This->device->capture_buffer = 0; HeapFree( GetProcessHeap(), 0, This ); + *ppobj = NULL; return DSERR_OUTOFMEMORY; } - This->IDirectSoundCaptureBuffer8_iface.lpVtbl = &dscbvt; - This->IDirectSoundNotify_iface.lpVtbl = &dscnvt; + This->lpVtbl = &dscbvt; - err = IMMDevice_Activate(device->mmdevice, &IID_IAudioClient, - CLSCTX_INPROC_SERVER, NULL, (void**)&device->client); - if(FAILED(err)){ - WARN("Activate failed: %08x\n", err); - HeapFree(GetProcessHeap(), 0, This->pdscbd); - This->device->capture_buffer = 0; - HeapFree( GetProcessHeap(), 0, This ); - return err; - } + if (device->driver) { + if (This->device->drvdesc.dwFlags & DSDDESC_DOMMSYSTEMOPEN) + FIXME("DSDDESC_DOMMSYSTEMOPEN not supported\n"); - err = IAudioClient_Initialize(device->client, - AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST, - 200 * 100000, 50000, device->pwfx, NULL); - if(FAILED(err)){ - WARN("Initialize failed: %08x\n", err); - IAudioClient_Release(device->client); - device->client = NULL; - HeapFree(GetProcessHeap(), 0, This->pdscbd); - This->device->capture_buffer = 0; - HeapFree( GetProcessHeap(), 0, This ); - if(err == AUDCLNT_E_UNSUPPORTED_FORMAT) - return DSERR_BADFORMAT; - return err; - } + if (This->device->drvdesc.dwFlags & DSDDESC_USESYSTEMMEMORY) { + /* allocate buffer from system memory */ + buflen = lpcDSCBufferDesc->dwBufferBytes; + TRACE("desired buflen=%d, old buffer=%p\n", buflen, device->buffer); + if (device->buffer) + newbuf = HeapReAlloc(GetProcessHeap(),0,device->buffer,buflen); + else + newbuf = HeapAlloc(GetProcessHeap(),0,buflen); - err = IAudioClient_GetService(device->client, &IID_IAudioCaptureClient, - (void**)&device->capture); - if(FAILED(err)){ - WARN("GetService failed: %08x\n", err); - IAudioClient_Release(device->client); - device->client = NULL; - HeapFree(GetProcessHeap(), 0, This->pdscbd); - This->device->capture_buffer = 0; - HeapFree( GetProcessHeap(), 0, This ); - return err; - } + if (newbuf == NULL) { + WARN("failed to allocate capture buffer\n"); + err = DSERR_OUTOFMEMORY; + /* but the old buffer might still exist and must be re-prepared */ + } else { + device->buffer = newbuf; + device->buflen = buflen; + } + } else { + /* let driver allocate memory */ + device->buflen = lpcDSCBufferDesc->dwBufferBytes; + /* FIXME: */ + HeapFree( GetProcessHeap(), 0, device->buffer); + device->buffer = NULL; + } - buflen = lpcDSCBufferDesc->dwBufferBytes; - TRACE("desired buflen=%d, old buffer=%p\n", buflen, device->buffer); - if (device->buffer) - newbuf = HeapReAlloc(GetProcessHeap(),0,device->buffer,buflen); - else - newbuf = HeapAlloc(GetProcessHeap(),0,buflen); - if (newbuf == NULL) { - IAudioClient_Release(device->client); - device->client = NULL; - IAudioCaptureClient_Release(device->capture); - device->capture = NULL; - HeapFree(GetProcessHeap(), 0, This->pdscbd); - This->device->capture_buffer = 0; - HeapFree( GetProcessHeap(), 0, This ); - return DSERR_OUTOFMEMORY; - } - device->buffer = newbuf; - device->buflen = buflen; + err = IDsCaptureDriver_CreateCaptureBuffer(device->driver, + device->pwfx,0,0,&(device->buflen),&(device->buffer),(LPVOID*)&(device->hwbuf)); + if (err != DS_OK) { + WARN("IDsCaptureDriver_CreateCaptureBuffer failed\n"); + This->device->capture_buffer = 0; + HeapFree( GetProcessHeap(), 0, This ); + *ppobj = NULL; + return err; + } + } else { + DWORD flags = CALLBACK_FUNCTION | WAVE_MAPPED; + err = mmErr(waveInOpen(&(device->hwi), + device->drvdesc.dnDevNode, device->pwfx, + (DWORD_PTR)DSOUND_capture_callback, (DWORD_PTR)device, flags)); + if (err != DS_OK) { + WARN("waveInOpen failed\n"); + This->device->capture_buffer = 0; + HeapFree( GetProcessHeap(), 0, This ); + *ppobj = NULL; + return err; + } + + buflen = lpcDSCBufferDesc->dwBufferBytes; + TRACE("desired buflen=%d, old buffer=%p\n", buflen, device->buffer); + if (device->buffer) + newbuf = HeapReAlloc(GetProcessHeap(),0,device->buffer,buflen); + else + newbuf = HeapAlloc(GetProcessHeap(),0,buflen); + if (newbuf == NULL) { + WARN("failed to allocate capture buffer\n"); + err = DSERR_OUTOFMEMORY; + /* but the old buffer might still exist and must be re-prepared */ + } else { + device->buffer = newbuf; + device->buflen = buflen; + } + } } - IDirectSoundCaptureBuffer_AddRef(&This->IDirectSoundCaptureBuffer8_iface); - *ppobj = This; - TRACE("returning DS_OK\n"); return DS_OK; } @@ -780,6 +962,8 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create( /******************************************************************************* * DirectSoundCaptureDevice */ +DirectSoundCaptureDevice * DSOUND_capture[MAXWAVEDRIVERS]; + static HRESULT DirectSoundCaptureDevice_Create( DirectSoundCaptureDevice ** ppDevice) { @@ -813,351 +997,224 @@ static ULONG DirectSoundCaptureDevice_Release( if (!ref) { TRACE("deleting object\n"); - - timeKillEvent(device->timerID); - timeEndPeriod(DS_TIME_RES); - - EnterCriticalSection(&DSOUND_capturers_lock); - list_remove(&device->entry); - LeaveCriticalSection(&DSOUND_capturers_lock); - if (device->capture_buffer) - IDirectSoundCaptureBufferImpl_Release(&device->capture_buffer->IDirectSoundCaptureBuffer8_iface); + IDirectSoundCaptureBufferImpl_Release( + (LPDIRECTSOUNDCAPTUREBUFFER8) device->capture_buffer); + + if (device->driver) { + IDsCaptureDriver_Close(device->driver); + IDsCaptureDriver_Release(device->driver); + } - if(device->mmdevice) - IMMDevice_Release(device->mmdevice); HeapFree(GetProcessHeap(), 0, device->pwfx); device->lock.DebugInfo->Spare[0] = 0; DeleteCriticalSection( &(device->lock) ); + DSOUND_capture[device->drvdesc.dnDevNode] = NULL; HeapFree(GetProcessHeap(), 0, device); TRACE("(%p) released\n", device); } return ref; } -static void CALLBACK DSOUND_capture_timer(UINT timerID, UINT msg, DWORD_PTR user, - DWORD_PTR dw1, DWORD_PTR dw2) -{ - DirectSoundCaptureDevice *device = (DirectSoundCaptureDevice*)user; - UINT32 packet_frames, packet_bytes, avail_bytes; - DWORD flags; - BYTE *buf; - HRESULT hr; - - if(!device->ref) - return; - - EnterCriticalSection(&device->lock); - - if(!device->capture_buffer || device->state == STATE_STOPPED){ - LeaveCriticalSection(&device->lock); - return; - } - - if(device->state == STATE_STOPPING){ - device->state = STATE_STOPPED; - LeaveCriticalSection(&device->lock); - return; - } - - if(device->state == STATE_STARTING) - device->state = STATE_CAPTURING; - - hr = IAudioCaptureClient_GetBuffer(device->capture, &buf, &packet_frames, - &flags, NULL, NULL); - if(FAILED(hr)){ - LeaveCriticalSection(&device->lock); - WARN("GetBuffer failed: %08x\n", hr); - return; - } - - packet_bytes = packet_frames * device->pwfx->nBlockAlign; - - avail_bytes = device->buflen - device->write_pos_bytes; - if(avail_bytes > packet_bytes) - avail_bytes = packet_bytes; - - memcpy(device->buffer + device->write_pos_bytes, buf, avail_bytes); - capture_CheckNotify(device->capture_buffer, device->write_pos_bytes, avail_bytes); - - packet_bytes -= avail_bytes; - if(packet_bytes > 0){ - if(device->capture_buffer->flags & DSCBSTART_LOOPING){ - memcpy(device->buffer, buf + avail_bytes, packet_bytes); - capture_CheckNotify(device->capture_buffer, 0, packet_bytes); - }else{ - device->state = STATE_STOPPED; - capture_CheckNotify(device->capture_buffer, 0, 0); - } - } - - device->write_pos_bytes += avail_bytes + packet_bytes; - device->write_pos_bytes %= device->buflen; - - hr = IAudioCaptureClient_ReleaseBuffer(device->capture, packet_frames); - if(FAILED(hr)){ - LeaveCriticalSection(&device->lock); - WARN("ReleaseBuffer failed: %08x\n", hr); - return; - } - - LeaveCriticalSection(&device->lock); -} - -static struct _TestFormat { - DWORD flag; - DWORD rate; - DWORD depth; - WORD channels; -} formats_to_test[] = { - { WAVE_FORMAT_1M08, 11025, 8, 1 }, - { WAVE_FORMAT_1M16, 11025, 16, 1 }, - { WAVE_FORMAT_1S08, 11025, 8, 2 }, - { WAVE_FORMAT_1S16, 11025, 16, 2 }, - { WAVE_FORMAT_2M08, 22050, 8, 1 }, - { WAVE_FORMAT_2M16, 22050, 16, 1 }, - { WAVE_FORMAT_2S08, 22050, 8, 2 }, - { WAVE_FORMAT_2S16, 22050, 16, 2 }, - { WAVE_FORMAT_4M08, 44100, 8, 1 }, - { WAVE_FORMAT_4M16, 44100, 16, 1 }, - { WAVE_FORMAT_4S08, 44100, 8, 2 }, - { WAVE_FORMAT_4S16, 44100, 16, 2 }, - { WAVE_FORMAT_48M08, 48000, 8, 1 }, - { WAVE_FORMAT_48M16, 48000, 16, 1 }, - { WAVE_FORMAT_48S08, 48000, 8, 2 }, - { WAVE_FORMAT_48S16, 48000, 16, 2 }, - { WAVE_FORMAT_96M08, 96000, 8, 1 }, - { WAVE_FORMAT_96M16, 96000, 16, 1 }, - { WAVE_FORMAT_96S08, 96000, 8, 2 }, - { WAVE_FORMAT_96S16, 96000, 16, 2 }, - {0} -}; - static HRESULT DirectSoundCaptureDevice_Initialize( DirectSoundCaptureDevice ** ppDevice, LPCGUID lpcGUID) { - HRESULT hr; + HRESULT err = DSERR_INVALIDPARAM; + unsigned wid, widn; + BOOLEAN found = FALSE; GUID devGUID; - IMMDevice *mmdevice; - struct _TestFormat *fmt; - DirectSoundCaptureDevice *device; - IAudioClient *client; - + DirectSoundCaptureDevice *device = *ppDevice; TRACE("(%p, %s)\n", ppDevice, debugstr_guid(lpcGUID)); /* Default device? */ if ( !lpcGUID || IsEqualGUID(lpcGUID, &GUID_NULL) ) - lpcGUID = &DSDEVID_DefaultCapture; - - if(IsEqualGUID(lpcGUID, &DSDEVID_DefaultPlayback) || - IsEqualGUID(lpcGUID, &DSDEVID_DefaultVoicePlayback)) - return DSERR_NODRIVER; + lpcGUID = &DSDEVID_DefaultCapture; if (GetDeviceID(lpcGUID, &devGUID) != DS_OK) { WARN("invalid parameter: lpcGUID\n"); return DSERR_INVALIDPARAM; } - hr = get_mmdevice(eCapture, &devGUID, &mmdevice); - if(FAILED(hr)) - return hr; - - EnterCriticalSection(&DSOUND_capturers_lock); - - LIST_FOR_EACH_ENTRY(device, &DSOUND_capturers, DirectSoundCaptureDevice, entry){ - if(IsEqualGUID(&device->guid, &devGUID)){ - IMMDevice_Release(mmdevice); - LeaveCriticalSection(&DSOUND_capturers_lock); - return DSERR_ALLOCATED; - } + widn = waveInGetNumDevs(); + if (!widn) { + WARN("no audio devices found\n"); + return DSERR_NODRIVER; } - hr = DirectSoundCaptureDevice_Create(&device); - if (hr != DS_OK) { + /* enumerate WINMM audio devices and find the one we want */ + for (wid=0; widguid = devGUID; - - device->mmdevice = mmdevice; - - device->drvcaps.dwFlags = 0; - - device->drvcaps.dwFormats = 0; - device->drvcaps.dwChannels = 0; - hr = IMMDevice_Activate(mmdevice, &IID_IAudioClient, - CLSCTX_INPROC_SERVER, NULL, (void**)&client); - if(FAILED(hr)){ - device->lock.DebugInfo->Spare[0] = 0; - DeleteCriticalSection(&device->lock); - HeapFree(GetProcessHeap(), 0, device); - LeaveCriticalSection(&DSOUND_capturers_lock); - return DSERR_NODRIVER; - } - - for(fmt = formats_to_test; fmt->flag; ++fmt){ - if(DSOUND_check_supported(client, fmt->rate, fmt->depth, fmt->channels)){ - device->drvcaps.dwFormats |= fmt->flag; - if(fmt->channels > device->drvcaps.dwChannels) - device->drvcaps.dwChannels = fmt->channels; - } - } - IAudioClient_Release(client); - - device->timerID = DSOUND_create_timer(DSOUND_capture_timer, (DWORD_PTR)device); - - list_add_tail(&DSOUND_capturers, &device->entry); - *ppDevice = device; + device->guid = devGUID; - LeaveCriticalSection(&DSOUND_capturers_lock); + /* Disable the direct sound driver to force emulation if requested. */ + device->driver = NULL; + if (ds_hw_accel != DS_HW_ACCEL_EMULATION) + { + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&device->driver,0)); + if ( (err != DS_OK) && (err != DSERR_UNSUPPORTED) ) { + WARN("waveInMessage failed; err=%x\n",err); + return err; + } + } + err = DS_OK; - return S_OK; + /* Get driver description */ + if (device->driver) { + TRACE("using DirectSound driver\n"); + err = IDsCaptureDriver_GetDriverDesc(device->driver, &(device->drvdesc)); + if (err != DS_OK) { + WARN("IDsCaptureDriver_GetDriverDesc failed\n"); + return err; + } + } else { + TRACE("using WINMM\n"); + /* if no DirectSound interface available, use WINMM API instead */ + device->drvdesc.dwFlags = DSDDESC_DOMMSYSTEMOPEN | + DSDDESC_DOMMSYSTEMSETFORMAT; + } + + device->drvdesc.dnDevNode = wid; + + /* open the DirectSound driver if available */ + if (device->driver && (err == DS_OK)) + err = IDsCaptureDriver_Open(device->driver); + + if (err == DS_OK) { + *ppDevice = device; + + /* the driver is now open, so it's now allowed to call GetCaps */ + if (device->driver) { + device->drvcaps.dwSize = sizeof(device->drvcaps); + err = IDsCaptureDriver_GetCaps(device->driver,&(device->drvcaps)); + if (err != DS_OK) { + WARN("IDsCaptureDriver_GetCaps failed\n"); + return err; + } + } else /*if (device->hwi)*/ { + WAVEINCAPSA wic; + err = mmErr(waveInGetDevCapsA((UINT)device->drvdesc.dnDevNode, &wic, sizeof(wic))); + + if (err == DS_OK) { + device->drvcaps.dwFlags = 0; + lstrcpynA(device->drvdesc.szDrvname, wic.szPname, + sizeof(device->drvdesc.szDrvname)); + + device->drvcaps.dwFlags |= DSCCAPS_EMULDRIVER; + device->drvcaps.dwFormats = wic.dwFormats; + device->drvcaps.dwChannels = wic.wChannels; + } + } + } + + return err; } /***************************************************************************** * IDirectSoundCapture implementation structure */ -typedef struct IDirectSoundCaptureImpl +struct IDirectSoundCaptureImpl { - IUnknown IUnknown_inner; - IDirectSoundCapture IDirectSoundCapture_iface; - LONG ref, refdsc, numIfaces; - IUnknown *outer_unk; /* internal */ - DirectSoundCaptureDevice *device; - BOOL has_dsc8; -} IDirectSoundCaptureImpl; + /* IUnknown fields */ + const IDirectSoundCaptureVtbl *lpVtbl; + LONG ref; -static void capture_destroy(IDirectSoundCaptureImpl *This) -{ - if (This->device) - DirectSoundCaptureDevice_Release(This->device); - HeapFree(GetProcessHeap(),0,This); - TRACE("(%p) released\n", This); -} - -/******************************************************************************* - * IUnknown Implementation for DirectSoundCapture - */ -static inline IDirectSoundCaptureImpl *impl_from_IUnknown(IUnknown *iface) -{ - return CONTAINING_RECORD(iface, IDirectSoundCaptureImpl, IUnknown_inner); -} - -static HRESULT WINAPI IUnknownImpl_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) -{ - IDirectSoundCaptureImpl *This = impl_from_IUnknown(iface); - - TRACE("(%p,%s,%p)\n", This, debugstr_guid(riid), ppv); - - if (!ppv) { - WARN("invalid parameter\n"); - return E_INVALIDARG; - } - *ppv = NULL; - - if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = &This->IUnknown_inner; - else if (IsEqualIID(riid, &IID_IDirectSoundCapture)) - *ppv = &This->IDirectSoundCapture_iface; - else { - WARN("unknown IID %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; - } - - IUnknown_AddRef((IUnknown*)*ppv); - return S_OK; -} - -static ULONG WINAPI IUnknownImpl_AddRef(IUnknown *iface) -{ - IDirectSoundCaptureImpl *This = impl_from_IUnknown(iface); - ULONG ref = InterlockedIncrement(&This->ref); - - TRACE("(%p) ref=%d\n", This, ref); - - if(ref == 1) - InterlockedIncrement(&This->numIfaces); - return ref; -} - -static ULONG WINAPI IUnknownImpl_Release(IUnknown *iface) -{ - IDirectSoundCaptureImpl *This = impl_from_IUnknown(iface); - ULONG ref = InterlockedDecrement(&This->ref); - - TRACE("(%p) ref=%d\n", This, ref); - - if (!ref && !InterlockedDecrement(&This->numIfaces)) - capture_destroy(This); - return ref; -} - -static const IUnknownVtbl unk_vtbl = -{ - IUnknownImpl_QueryInterface, - IUnknownImpl_AddRef, - IUnknownImpl_Release + DirectSoundCaptureDevice *device; }; /*************************************************************************** * IDirectSoundCaptureImpl */ -static inline struct IDirectSoundCaptureImpl *impl_from_IDirectSoundCapture(IDirectSoundCapture *iface) +static HRESULT WINAPI +IDirectSoundCaptureImpl_QueryInterface( + LPDIRECTSOUNDCAPTURE iface, + REFIID riid, + LPVOID* ppobj ) { - return CONTAINING_RECORD(iface, struct IDirectSoundCaptureImpl, IDirectSoundCapture_iface); + IDirectSoundCaptureImpl *This = (IDirectSoundCaptureImpl *)iface; + TRACE( "(%p,%s,%p)\n", This, debugstr_guid(riid), ppobj ); + + if (ppobj == NULL) { + WARN("invalid parameter\n"); + return E_INVALIDARG; + } + + *ppobj = NULL; + + if (IsEqualIID(riid, &IID_IUnknown)) { + IDirectSoundCapture_AddRef((LPDIRECTSOUNDCAPTURE)This); + *ppobj = This; + return DS_OK; + } else if (IsEqualIID(riid, &IID_IDirectSoundCapture)) { + IDirectSoundCapture_AddRef((LPDIRECTSOUNDCAPTURE)This); + *ppobj = This; + return DS_OK; + } + + WARN("unsupported riid: %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; } -static HRESULT WINAPI IDirectSoundCaptureImpl_QueryInterface(IDirectSoundCapture *iface, - REFIID riid, void **ppv) +static ULONG WINAPI +IDirectSoundCaptureImpl_AddRef( LPDIRECTSOUNDCAPTURE iface ) { - IDirectSoundCaptureImpl *This = impl_from_IDirectSoundCapture(iface); - TRACE("(%p,%s,%p)\n", iface, debugstr_guid(riid), ppv); - return IUnknown_QueryInterface(This->outer_unk, riid, ppv); -} - -static ULONG WINAPI IDirectSoundCaptureImpl_AddRef(IDirectSoundCapture *iface) -{ - IDirectSoundCaptureImpl *This = impl_from_IDirectSoundCapture(iface); - ULONG ref = InterlockedIncrement(&This->refdsc); - - TRACE("(%p) ref=%d\n", This, ref); - - if(ref == 1) - InterlockedIncrement(&This->numIfaces); + IDirectSoundCaptureImpl *This = (IDirectSoundCaptureImpl *)iface; + ULONG ref = InterlockedIncrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref - 1); return ref; } -static ULONG WINAPI IDirectSoundCaptureImpl_Release(IDirectSoundCapture *iface) +static ULONG WINAPI +IDirectSoundCaptureImpl_Release( LPDIRECTSOUNDCAPTURE iface ) { - IDirectSoundCaptureImpl *This = impl_from_IDirectSoundCapture(iface); - ULONG ref = InterlockedDecrement(&This->refdsc); + IDirectSoundCaptureImpl *This = (IDirectSoundCaptureImpl *)iface; + ULONG ref = InterlockedDecrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref + 1); - TRACE("(%p) ref=%d\n", This, ref); + if (!ref) { + if (This->device) + DirectSoundCaptureDevice_Release(This->device); - if (!ref && !InterlockedDecrement(&This->numIfaces)) - capture_destroy(This); + HeapFree( GetProcessHeap(), 0, This ); + TRACE("(%p) released\n", This); + } return ref; } -static HRESULT WINAPI IDirectSoundCaptureImpl_CreateCaptureBuffer(IDirectSoundCapture *iface, - LPCDSCBUFFERDESC lpcDSCBufferDesc, IDirectSoundCaptureBuffer **lplpDSCaptureBuffer, - IUnknown *pUnk) +static HRESULT WINAPI IDirectSoundCaptureImpl_CreateCaptureBuffer( + LPDIRECTSOUNDCAPTURE iface, + LPCDSCBUFFERDESC lpcDSCBufferDesc, + LPDIRECTSOUNDCAPTUREBUFFER* lplpDSCaptureBuffer, + LPUNKNOWN pUnk ) { - IDirectSoundCaptureImpl *This = impl_from_IDirectSoundCapture(iface); HRESULT hr; + IDirectSoundCaptureImpl *This = (IDirectSoundCaptureImpl *)iface; TRACE( "(%p,%p,%p,%p)\n",iface,lpcDSCBufferDesc,lplpDSCaptureBuffer,pUnk); - if (pUnk) { - WARN("invalid parameter: pUnk != NULL\n"); - return DSERR_NOAGGREGATION; - } - if (lpcDSCBufferDesc == NULL) { WARN("invalid parameter: lpcDSCBufferDesc == NULL)\n"); return DSERR_INVALIDPARAM; @@ -1188,11 +1245,11 @@ static HRESULT WINAPI IDirectSoundCaptureImpl_CreateCaptureBuffer(IDirectSoundCa return hr; } -static HRESULT WINAPI IDirectSoundCaptureImpl_GetCaps(IDirectSoundCapture *iface, - LPDSCCAPS lpDSCCaps) +static HRESULT WINAPI IDirectSoundCaptureImpl_GetCaps( + LPDIRECTSOUNDCAPTURE iface, + LPDSCCAPS lpDSCCaps ) { - IDirectSoundCaptureImpl *This = impl_from_IDirectSoundCapture(iface); - + IDirectSoundCaptureImpl *This = (IDirectSoundCaptureImpl *)iface; TRACE("(%p,%p)\n",This,lpDSCCaps); if (This->device == NULL) { @@ -1220,11 +1277,11 @@ static HRESULT WINAPI IDirectSoundCaptureImpl_GetCaps(IDirectSoundCapture *iface return DS_OK; } -static HRESULT WINAPI IDirectSoundCaptureImpl_Initialize(IDirectSoundCapture *iface, - LPCGUID lpcGUID) +static HRESULT WINAPI IDirectSoundCaptureImpl_Initialize( + LPDIRECTSOUNDCAPTURE iface, + LPCGUID lpcGUID ) { - IDirectSoundCaptureImpl *This = impl_from_IDirectSoundCapture(iface); - + IDirectSoundCaptureImpl *This = (IDirectSoundCaptureImpl *)iface; TRACE("(%p,%s)\n", This, debugstr_guid(lpcGUID)); if (This->device != NULL) { @@ -1247,50 +1304,85 @@ static const IDirectSoundCaptureVtbl dscvt = IDirectSoundCaptureImpl_Initialize }; -HRESULT IDirectSoundCaptureImpl_Create(IUnknown *outer_unk, REFIID riid, void **ppv, BOOL has_dsc8) +static HRESULT IDirectSoundCaptureImpl_Create( + LPDIRECTSOUNDCAPTURE8 * ppDSC) { - IDirectSoundCaptureImpl *obj; - HRESULT hr; + IDirectSoundCaptureImpl *pDSC; + TRACE("(%p)\n", ppDSC); - TRACE("(%s, %p)\n", debugstr_guid(riid), ppv); - - *ppv = NULL; - obj = HeapAlloc(GetProcessHeap(), 0, sizeof(*obj)); - if (obj == NULL) { + /* Allocate memory */ + pDSC = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectSoundCaptureImpl)); + if (pDSC == NULL) { WARN("out of memory\n"); + *ppDSC = NULL; return DSERR_OUTOFMEMORY; } + pDSC->lpVtbl = &dscvt; + pDSC->ref = 0; + pDSC->device = NULL; + + *ppDSC = (LPDIRECTSOUNDCAPTURE8)pDSC; + + return DS_OK; +} + +HRESULT DSOUND_CaptureCreate( + REFIID riid, + LPDIRECTSOUNDCAPTURE *ppDSC) +{ + LPDIRECTSOUNDCAPTURE pDSC; + HRESULT hr; + TRACE("(%s, %p)\n", debugstr_guid(riid), ppDSC); + + if (!IsEqualIID(riid, &IID_IUnknown) && + !IsEqualIID(riid, &IID_IDirectSoundCapture)) { + *ppDSC = 0; + return E_NOINTERFACE; + } + + /* Get dsound configuration */ setup_dsound_options(); - obj->IUnknown_inner.lpVtbl = &unk_vtbl; - obj->IDirectSoundCapture_iface.lpVtbl = &dscvt; - obj->ref = 1; - obj->refdsc = 0; - obj->numIfaces = 1; - obj->device = NULL; - obj->has_dsc8 = has_dsc8; - - /* COM aggregation supported only internally */ - if (outer_unk) - obj->outer_unk = outer_unk; - else - obj->outer_unk = &obj->IUnknown_inner; - - hr = IUnknown_QueryInterface(&obj->IUnknown_inner, riid, ppv); - IUnknown_Release(&obj->IUnknown_inner); + hr = IDirectSoundCaptureImpl_Create(&pDSC); + if (hr == DS_OK) { + IDirectSoundCapture_AddRef(pDSC); + *ppDSC = pDSC; + } else { + WARN("IDirectSoundCaptureImpl_Create failed\n"); + *ppDSC = 0; + } return hr; } -HRESULT DSOUND_CaptureCreate(REFIID riid, void **ppv) +HRESULT DSOUND_CaptureCreate8( + REFIID riid, + LPDIRECTSOUNDCAPTURE8 *ppDSC8) { - return IDirectSoundCaptureImpl_Create(NULL, riid, ppv, FALSE); -} + LPDIRECTSOUNDCAPTURE8 pDSC8; + HRESULT hr; + TRACE("(%s, %p)\n", debugstr_guid(riid), ppDSC8); -HRESULT DSOUND_CaptureCreate8(REFIID riid, void **ppv) -{ - return IDirectSoundCaptureImpl_Create(NULL, riid, ppv, TRUE); + if (!IsEqualIID(riid, &IID_IUnknown) && + !IsEqualIID(riid, &IID_IDirectSoundCapture8)) { + *ppDSC8 = 0; + return E_NOINTERFACE; + } + + /* Get dsound configuration */ + setup_dsound_options(); + + hr = IDirectSoundCaptureImpl_Create(&pDSC8); + if (hr == DS_OK) { + IDirectSoundCapture_AddRef(pDSC8); + *ppDSC8 = pDSC8; + } else { + WARN("IDirectSoundCaptureImpl_Create failed\n"); + *ppDSC8 = 0; + } + + return hr; } /*************************************************************************** @@ -1315,12 +1407,13 @@ HRESULT DSOUND_CaptureCreate8(REFIID riid, void **ppv) * * DSERR_ALLOCATED is returned for sound devices that do not support full duplex. */ -HRESULT WINAPI DirectSoundCaptureCreate(LPCGUID lpcGUID, IDirectSoundCapture **ppDSC, - IUnknown *pUnkOuter) +HRESULT WINAPI DirectSoundCaptureCreate( + LPCGUID lpcGUID, + LPDIRECTSOUNDCAPTURE *ppDSC, + LPUNKNOWN pUnkOuter) { HRESULT hr; - IDirectSoundCapture *pDSC; - + LPDIRECTSOUNDCAPTURE pDSC; TRACE("(%s,%p,%p)\n", debugstr_guid(lpcGUID), ppDSC, pUnkOuter); if (ppDSC == NULL) { @@ -1330,10 +1423,11 @@ HRESULT WINAPI DirectSoundCaptureCreate(LPCGUID lpcGUID, IDirectSoundCapture **p if (pUnkOuter) { WARN("invalid parameter: pUnkOuter != NULL\n"); + *ppDSC = NULL; return DSERR_NOAGGREGATION; } - hr = DSOUND_CaptureCreate(&IID_IDirectSoundCapture, (void**)&pDSC); + hr = DSOUND_CaptureCreate(&IID_IDirectSoundCapture, &pDSC); if (hr == DS_OK) { hr = IDirectSoundCapture_Initialize(pDSC, lpcGUID); if (hr != DS_OK) { @@ -1389,7 +1483,7 @@ HRESULT WINAPI DirectSoundCaptureCreate8( return DSERR_NOAGGREGATION; } - hr = DSOUND_CaptureCreate8(&IID_IDirectSoundCapture8, (void**)&pDSC8); + hr = DSOUND_CaptureCreate8(&IID_IDirectSoundCapture8, &pDSC8); if (hr == DS_OK) { hr = IDirectSoundCapture_Initialize(pDSC8, lpcGUID); if (hr != DS_OK) { diff --git a/dll/directx/wine/dsound/dsound.c b/dll/directx/wine/dsound/dsound.c index 19577c914d7..9656b2ca160 100644 --- a/dll/directx/wine/dsound/dsound.c +++ b/dll/directx/wine/dsound/dsound.c @@ -22,16 +22,74 @@ #include "dsound_private.h" -typedef struct IDirectSoundImpl { - IUnknown IUnknown_inner; - IDirectSound8 IDirectSound8_iface; - IUnknown *outer_unk; /* internal */ - LONG ref, refds, numIfaces; - DirectSoundDevice *device; - BOOL has_ds8; -} IDirectSoundImpl; +/***************************************************************************** + * IDirectSound COM components + */ +struct IDirectSound_IUnknown { + const IUnknownVtbl *lpVtbl; + LONG ref; + LPDIRECTSOUND8 pds; +}; -static const char * dumpCooperativeLevel(DWORD level) +static HRESULT IDirectSound_IUnknown_Create(LPDIRECTSOUND8 pds, LPUNKNOWN * ppunk); + +struct IDirectSound_IDirectSound { + const IDirectSoundVtbl *lpVtbl; + LONG ref; + LPDIRECTSOUND8 pds; +}; + +static HRESULT IDirectSound_IDirectSound_Create(LPDIRECTSOUND8 pds, LPDIRECTSOUND * ppds); + +/***************************************************************************** + * IDirectSound8 COM components + */ +struct IDirectSound8_IUnknown { + const IUnknownVtbl *lpVtbl; + LONG ref; + LPDIRECTSOUND8 pds; +}; + +static HRESULT IDirectSound8_IUnknown_Create(LPDIRECTSOUND8 pds, LPUNKNOWN * ppunk); +static ULONG WINAPI IDirectSound8_IUnknown_AddRef(LPUNKNOWN iface); + +struct IDirectSound8_IDirectSound { + const IDirectSoundVtbl *lpVtbl; + LONG ref; + LPDIRECTSOUND8 pds; +}; + +static HRESULT IDirectSound8_IDirectSound_Create(LPDIRECTSOUND8 pds, LPDIRECTSOUND * ppds); +static ULONG WINAPI IDirectSound8_IDirectSound_AddRef(LPDIRECTSOUND iface); + +struct IDirectSound8_IDirectSound8 { + const IDirectSound8Vtbl *lpVtbl; + LONG ref; + LPDIRECTSOUND8 pds; +}; + +static HRESULT IDirectSound8_IDirectSound8_Create(LPDIRECTSOUND8 pds, LPDIRECTSOUND8 * ppds); +static ULONG WINAPI IDirectSound8_IDirectSound8_AddRef(LPDIRECTSOUND8 iface); + +/***************************************************************************** + * IDirectSound implementation structure + */ +struct IDirectSoundImpl +{ + LONG ref; + + DirectSoundDevice *device; + LPUNKNOWN pUnknown; + LPDIRECTSOUND pDS; + LPDIRECTSOUND8 pDS8; +}; + +static HRESULT IDirectSoundImpl_Create(LPDIRECTSOUND8 * ppds); + +static ULONG WINAPI IDirectSound_IUnknown_AddRef(LPUNKNOWN iface); +static ULONG WINAPI IDirectSound_IDirectSound_AddRef(LPDIRECTSOUND iface); + +const char * dumpCooperativeLevel(DWORD level) { #define LE(x) case x: return #x switch (level) { @@ -98,367 +156,844 @@ static void _dump_DSBCAPS(DWORD xmask) { TRACE("%s ",flags[i].name); } -static void directsound_destroy(IDirectSoundImpl *This) -{ - if (This->device) - DirectSoundDevice_Release(This->device); - HeapFree(GetProcessHeap(),0,This); - TRACE("(%p) released\n", This); -} - /******************************************************************************* - * IUnknown Implementation for DirectSound + * IDirectSoundImpl_DirectSound */ -static inline IDirectSoundImpl *impl_from_IUnknown(IUnknown *iface) +static HRESULT DSOUND_QueryInterface( + LPDIRECTSOUND8 iface, + REFIID riid, + LPVOID * ppobj) { - return CONTAINING_RECORD(iface, IDirectSoundImpl, IUnknown_inner); -} + IDirectSoundImpl *This = (IDirectSoundImpl *)iface; + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); -static HRESULT WINAPI IUnknownImpl_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) -{ - IDirectSoundImpl *This = impl_from_IUnknown(iface); - - TRACE("(%p,%s,%p)\n", This, debugstr_guid(riid), ppv); - - if (!ppv) { + if (ppobj == NULL) { WARN("invalid parameter\n"); return E_INVALIDARG; } - *ppv = NULL; - if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = &This->IUnknown_inner; - else if (IsEqualIID(riid, &IID_IDirectSound) || - (IsEqualIID(riid, &IID_IDirectSound8) && This->has_ds8)) - *ppv = &This->IDirectSound8_iface; - else { - WARN("unknown IID %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; + if (IsEqualIID(riid, &IID_IUnknown)) { + if (!This->pUnknown) { + IDirectSound_IUnknown_Create(iface, &This->pUnknown); + if (!This->pUnknown) { + WARN("IDirectSound_IUnknown_Create() failed\n"); + *ppobj = NULL; + return E_NOINTERFACE; + } + } + IDirectSound_IUnknown_AddRef(This->pUnknown); + *ppobj = This->pUnknown; + return S_OK; + } else if (IsEqualIID(riid, &IID_IDirectSound)) { + if (!This->pDS) { + IDirectSound_IDirectSound_Create(iface, &This->pDS); + if (!This->pDS) { + WARN("IDirectSound_IDirectSound_Create() failed\n"); + *ppobj = NULL; + return E_NOINTERFACE; + } + } + IDirectSound_IDirectSound_AddRef(This->pDS); + *ppobj = This->pDS; + return S_OK; } - IUnknown_AddRef((IUnknown*)*ppv); - return S_OK; + *ppobj = NULL; + WARN("Unknown IID %s\n",debugstr_guid(riid)); + return E_NOINTERFACE; } -static ULONG WINAPI IUnknownImpl_AddRef(IUnknown *iface) +static HRESULT DSOUND_QueryInterface8( + LPDIRECTSOUND8 iface, + REFIID riid, + LPVOID * ppobj) { - IDirectSoundImpl *This = impl_from_IUnknown(iface); - ULONG ref = InterlockedIncrement(&This->ref); + IDirectSoundImpl *This = (IDirectSoundImpl *)iface; + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); - TRACE("(%p) ref=%d\n", This, ref); + if (ppobj == NULL) { + WARN("invalid parameter\n"); + return E_INVALIDARG; + } - if(ref == 1) - InterlockedIncrement(&This->numIfaces); + if (IsEqualIID(riid, &IID_IUnknown)) { + if (!This->pUnknown) { + IDirectSound8_IUnknown_Create(iface, &This->pUnknown); + if (!This->pUnknown) { + WARN("IDirectSound8_IUnknown_Create() failed\n"); + *ppobj = NULL; + return E_NOINTERFACE; + } + } + IDirectSound8_IUnknown_AddRef(This->pUnknown); + *ppobj = This->pUnknown; + return S_OK; + } else if (IsEqualIID(riid, &IID_IDirectSound)) { + if (!This->pDS) { + IDirectSound8_IDirectSound_Create(iface, &This->pDS); + if (!This->pDS) { + WARN("IDirectSound8_IDirectSound_Create() failed\n"); + *ppobj = NULL; + return E_NOINTERFACE; + } + } + IDirectSound8_IDirectSound_AddRef(This->pDS); + *ppobj = This->pDS; + return S_OK; + } else if (IsEqualIID(riid, &IID_IDirectSound8)) { + if (!This->pDS8) { + IDirectSound8_IDirectSound8_Create(iface, &This->pDS8); + if (!This->pDS8) { + WARN("IDirectSound8_IDirectSound8_Create() failed\n"); + *ppobj = NULL; + return E_NOINTERFACE; + } + } + IDirectSound8_IDirectSound8_AddRef(This->pDS8); + *ppobj = This->pDS8; + return S_OK; + } + *ppobj = NULL; + WARN("Unknown IID %s\n",debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG IDirectSoundImpl_AddRef( + LPDIRECTSOUND8 iface) +{ + IDirectSoundImpl *This = (IDirectSoundImpl *)iface; + ULONG ref = InterlockedIncrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref - 1); return ref; } -static ULONG WINAPI IUnknownImpl_Release(IUnknown *iface) +static ULONG IDirectSoundImpl_Release( + LPDIRECTSOUND8 iface) { - IDirectSoundImpl *This = impl_from_IUnknown(iface); - ULONG ref = InterlockedDecrement(&This->ref); - - TRACE("(%p) ref=%d\n", This, ref); - - if (!ref && !InterlockedDecrement(&This->numIfaces)) - directsound_destroy(This); + IDirectSoundImpl *This = (IDirectSoundImpl *)iface; + ULONG ref = InterlockedDecrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref + 1); + if (!ref) { + if (This->device) + DirectSoundDevice_Release(This->device); + HeapFree(GetProcessHeap(),0,This); + TRACE("(%p) released\n", This); + } return ref; } -static const IUnknownVtbl unk_vtbl = +static HRESULT IDirectSoundImpl_Create( + LPDIRECTSOUND8 * ppDS) { - IUnknownImpl_QueryInterface, - IUnknownImpl_AddRef, - IUnknownImpl_Release -}; + IDirectSoundImpl* pDS; + TRACE("(%p)\n",ppDS); -/******************************************************************************* - * IDirectSound and IDirectSound8 Implementation - */ -static inline IDirectSoundImpl *impl_from_IDirectSound8(IDirectSound8 *iface) -{ - return CONTAINING_RECORD(iface, IDirectSoundImpl, IDirectSound8_iface); -} - -static HRESULT WINAPI IDirectSound8Impl_QueryInterface(IDirectSound8 *iface, REFIID riid, - void **ppv) -{ - IDirectSoundImpl *This = impl_from_IDirectSound8(iface); - TRACE("(%p,%s,%p)\n", This, debugstr_guid(riid), ppv); - return IUnknown_QueryInterface(This->outer_unk, riid, ppv); -} - -static ULONG WINAPI IDirectSound8Impl_AddRef(IDirectSound8 *iface) -{ - IDirectSoundImpl *This = impl_from_IDirectSound8(iface); - ULONG ref = InterlockedIncrement(&This->refds); - - TRACE("(%p) refds=%d\n", This, ref); - - if(ref == 1) - InterlockedIncrement(&This->numIfaces); - - return ref; -} - -static ULONG WINAPI IDirectSound8Impl_Release(IDirectSound8 *iface) -{ - IDirectSoundImpl *This = impl_from_IDirectSound8(iface); - ULONG ref = InterlockedDecrement(&(This->refds)); - - TRACE("(%p) refds=%d\n", This, ref); - - if (!ref && !InterlockedDecrement(&This->numIfaces)) - directsound_destroy(This); - - return ref; -} - -static HRESULT WINAPI IDirectSound8Impl_CreateSoundBuffer(IDirectSound8 *iface, - const DSBUFFERDESC *dsbd, IDirectSoundBuffer **ppdsb, IUnknown *lpunk) -{ - IDirectSoundImpl *This = impl_from_IDirectSound8(iface); - TRACE("(%p,%p,%p,%p)\n", This, dsbd, ppdsb, lpunk); - return DirectSoundDevice_CreateSoundBuffer(This->device, dsbd, ppdsb, lpunk, This->has_ds8); -} - -static HRESULT WINAPI IDirectSound8Impl_GetCaps(IDirectSound8 *iface, DSCAPS *dscaps) -{ - IDirectSoundImpl *This = impl_from_IDirectSound8(iface); - - TRACE("(%p, %p)\n", This, dscaps); - - if (!This->device) { - WARN("not initialized\n"); - return DSERR_UNINITIALIZED; - } - if (!dscaps) { - WARN("invalid parameter: dscaps = NULL\n"); - return DSERR_INVALIDPARAM; - } - if (dscaps->dwSize < sizeof(*dscaps)) { - WARN("invalid parameter: dscaps->dwSize = %d\n", dscaps->dwSize); - return DSERR_INVALIDPARAM; - } - - dscaps->dwFlags = This->device->drvcaps.dwFlags; - dscaps->dwMinSecondarySampleRate = This->device->drvcaps.dwMinSecondarySampleRate; - dscaps->dwMaxSecondarySampleRate = This->device->drvcaps.dwMaxSecondarySampleRate; - dscaps->dwPrimaryBuffers = This->device->drvcaps.dwPrimaryBuffers; - dscaps->dwMaxHwMixingAllBuffers = This->device->drvcaps.dwMaxHwMixingAllBuffers; - dscaps->dwMaxHwMixingStaticBuffers = This->device->drvcaps.dwMaxHwMixingStaticBuffers; - dscaps->dwMaxHwMixingStreamingBuffers = This->device->drvcaps.dwMaxHwMixingStreamingBuffers; - dscaps->dwFreeHwMixingAllBuffers = This->device->drvcaps.dwFreeHwMixingAllBuffers; - dscaps->dwFreeHwMixingStaticBuffers = This->device->drvcaps.dwFreeHwMixingStaticBuffers; - dscaps->dwFreeHwMixingStreamingBuffers = This->device->drvcaps.dwFreeHwMixingStreamingBuffers; - dscaps->dwMaxHw3DAllBuffers = This->device->drvcaps.dwMaxHw3DAllBuffers; - dscaps->dwMaxHw3DStaticBuffers = This->device->drvcaps.dwMaxHw3DStaticBuffers; - dscaps->dwMaxHw3DStreamingBuffers = This->device->drvcaps.dwMaxHw3DStreamingBuffers; - dscaps->dwFreeHw3DAllBuffers = This->device->drvcaps.dwFreeHw3DAllBuffers; - dscaps->dwFreeHw3DStaticBuffers = This->device->drvcaps.dwFreeHw3DStaticBuffers; - dscaps->dwFreeHw3DStreamingBuffers = This->device->drvcaps.dwFreeHw3DStreamingBuffers; - dscaps->dwTotalHwMemBytes = This->device->drvcaps.dwTotalHwMemBytes; - dscaps->dwFreeHwMemBytes = This->device->drvcaps.dwFreeHwMemBytes; - dscaps->dwMaxContigFreeHwMemBytes = This->device->drvcaps.dwMaxContigFreeHwMemBytes; - dscaps->dwUnlockTransferRateHwBuffers = This->device->drvcaps.dwUnlockTransferRateHwBuffers; - dscaps->dwPlayCpuOverheadSwBuffers = This->device->drvcaps.dwPlayCpuOverheadSwBuffers; - - if (TRACE_ON(dsound)) { - TRACE("(flags=0x%08x:\n", dscaps->dwFlags); - _dump_DSCAPS(dscaps->dwFlags); - TRACE(")\n"); - } - - return DS_OK; -} - -static HRESULT WINAPI IDirectSound8Impl_DuplicateSoundBuffer(IDirectSound8 *iface, - IDirectSoundBuffer *psb, IDirectSoundBuffer **ppdsb) -{ - IDirectSoundImpl *This = impl_from_IDirectSound8(iface); - TRACE("(%p,%p,%p)\n", This, psb, ppdsb); - return DirectSoundDevice_DuplicateSoundBuffer(This->device, psb, ppdsb); -} - -static HRESULT WINAPI IDirectSound8Impl_SetCooperativeLevel(IDirectSound8 *iface, HWND hwnd, - DWORD level) -{ - IDirectSoundImpl *This = impl_from_IDirectSound8(iface); - DirectSoundDevice *device = This->device; - DWORD oldlevel; - HRESULT hr = S_OK; - - TRACE("(%p,%p,%s)\n", This, hwnd, dumpCooperativeLevel(level)); - - if (!device) { - WARN("not initialized\n"); - return DSERR_UNINITIALIZED; - } - - if (level == DSSCL_PRIORITY || level == DSSCL_EXCLUSIVE) { - WARN("level=%s not fully supported\n", - level==DSSCL_PRIORITY ? "DSSCL_PRIORITY" : "DSSCL_EXCLUSIVE"); - } - - RtlAcquireResourceExclusive(&device->buffer_list_lock, TRUE); - EnterCriticalSection(&device->mixlock); - oldlevel = device->priolevel; - device->priolevel = level; - if ((level == DSSCL_WRITEPRIMARY) != (oldlevel == DSSCL_WRITEPRIMARY)) { - hr = DSOUND_ReopenDevice(device, level == DSSCL_WRITEPRIMARY); - if (FAILED(hr)) - device->priolevel = oldlevel; - else - DSOUND_PrimaryOpen(device); - } - LeaveCriticalSection(&device->mixlock); - RtlReleaseResource(&device->buffer_list_lock); - return hr; -} - -static HRESULT WINAPI IDirectSound8Impl_Compact(IDirectSound8 *iface) -{ - IDirectSoundImpl *This = impl_from_IDirectSound8(iface); - - TRACE("(%p)\n", This); - - if (!This->device) { - WARN("not initialized\n"); - return DSERR_UNINITIALIZED; - } - - if (This->device->priolevel < DSSCL_PRIORITY) { - WARN("incorrect priority level\n"); - return DSERR_PRIOLEVELNEEDED; - } - return DS_OK; -} - -static HRESULT WINAPI IDirectSound8Impl_GetSpeakerConfig(IDirectSound8 *iface, DWORD *config) -{ - IDirectSoundImpl *This = impl_from_IDirectSound8(iface); - - TRACE("(%p, %p)\n", This, config); - - if (!This->device) { - WARN("not initialized\n"); - return DSERR_UNINITIALIZED; - } - if (!config) { - WARN("invalid parameter: config == NULL\n"); - return DSERR_INVALIDPARAM; - } - - WARN("not fully functional\n"); - *config = This->device->speaker_config; - return DS_OK; -} - -static HRESULT WINAPI IDirectSound8Impl_SetSpeakerConfig(IDirectSound8 *iface, DWORD config) -{ - IDirectSoundImpl *This = impl_from_IDirectSound8(iface); - - TRACE("(%p,0x%08x)\n", This, config); - - if (!This->device) { - WARN("not initialized\n"); - return DSERR_UNINITIALIZED; - } - - This->device->speaker_config = config; - WARN("not fully functional\n"); - return DS_OK; -} - -static HRESULT WINAPI IDirectSound8Impl_Initialize(IDirectSound8 *iface, const GUID *lpcGuid) -{ - IDirectSoundImpl *This = impl_from_IDirectSound8(iface); - TRACE("(%p, %s)\n", This, debugstr_guid(lpcGuid)); - return DirectSoundDevice_Initialize(&This->device, lpcGuid); -} - -static HRESULT WINAPI IDirectSound8Impl_VerifyCertification(IDirectSound8 *iface, DWORD *certified) -{ - IDirectSoundImpl *This = impl_from_IDirectSound8(iface); - - TRACE("(%p, %p)\n", This, certified); - - if (!This->device) { - WARN("not initialized\n"); - return DSERR_UNINITIALIZED; - } - - if (This->device->drvcaps.dwFlags & DSCAPS_CERTIFIED) - *certified = DS_CERTIFIED; - else - *certified = DS_UNCERTIFIED; - - return DS_OK; -} - -static const IDirectSound8Vtbl ds8_vtbl = -{ - IDirectSound8Impl_QueryInterface, - IDirectSound8Impl_AddRef, - IDirectSound8Impl_Release, - IDirectSound8Impl_CreateSoundBuffer, - IDirectSound8Impl_GetCaps, - IDirectSound8Impl_DuplicateSoundBuffer, - IDirectSound8Impl_SetCooperativeLevel, - IDirectSound8Impl_Compact, - IDirectSound8Impl_GetSpeakerConfig, - IDirectSound8Impl_SetSpeakerConfig, - IDirectSound8Impl_Initialize, - IDirectSound8Impl_VerifyCertification -}; - -HRESULT IDirectSoundImpl_Create(IUnknown *outer_unk, REFIID riid, void **ppv, BOOL has_ds8) -{ - IDirectSoundImpl *obj; - HRESULT hr; - - TRACE("(%s, %p)\n", debugstr_guid(riid), ppv); - - *ppv = NULL; - obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*obj)); - if (!obj) { + /* Allocate memory */ + pDS = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectSoundImpl)); + if (pDS == NULL) { WARN("out of memory\n"); + *ppDS = NULL; return DSERR_OUTOFMEMORY; } + pDS->ref = 0; + pDS->device = NULL; + + *ppDS = (LPDIRECTSOUND8)pDS; + + return DS_OK; +} + +/******************************************************************************* + * IDirectSound_IUnknown + */ +static HRESULT WINAPI IDirectSound_IUnknown_QueryInterface( + LPUNKNOWN iface, + REFIID riid, + LPVOID * ppobj) +{ + IDirectSound_IUnknown *This = (IDirectSound_IUnknown *)iface; + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); + return DSOUND_QueryInterface(This->pds, riid, ppobj); +} + +static ULONG WINAPI IDirectSound_IUnknown_AddRef( + LPUNKNOWN iface) +{ + IDirectSound_IUnknown *This = (IDirectSound_IUnknown *)iface; + ULONG ref = InterlockedIncrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref - 1); + return ref; +} + +static ULONG WINAPI IDirectSound_IUnknown_Release( + LPUNKNOWN iface) +{ + IDirectSound_IUnknown *This = (IDirectSound_IUnknown *)iface; + ULONG ref = InterlockedDecrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref + 1); + if (!ref) { + ((IDirectSoundImpl*)This->pds)->pUnknown = NULL; + IDirectSoundImpl_Release(This->pds); + HeapFree(GetProcessHeap(), 0, This); + TRACE("(%p) released\n", This); + } + return ref; +} + +static const IUnknownVtbl DirectSound_Unknown_Vtbl = +{ + IDirectSound_IUnknown_QueryInterface, + IDirectSound_IUnknown_AddRef, + IDirectSound_IUnknown_Release +}; + +static HRESULT IDirectSound_IUnknown_Create( + LPDIRECTSOUND8 pds, + LPUNKNOWN * ppunk) +{ + IDirectSound_IUnknown * pdsunk; + TRACE("(%p,%p)\n",pds,ppunk); + + if (ppunk == NULL) { + ERR("invalid parameter: ppunk == NULL\n"); + return DSERR_INVALIDPARAM; + } + + if (pds == NULL) { + ERR("invalid parameter: pds == NULL\n"); + *ppunk = NULL; + return DSERR_INVALIDPARAM; + } + + pdsunk = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsunk)); + if (pdsunk == NULL) { + WARN("out of memory\n"); + *ppunk = NULL; + return DSERR_OUTOFMEMORY; + } + + pdsunk->lpVtbl = &DirectSound_Unknown_Vtbl; + pdsunk->ref = 0; + pdsunk->pds = pds; + + IDirectSoundImpl_AddRef(pds); + *ppunk = (LPUNKNOWN)pdsunk; + + return DS_OK; +} + +/******************************************************************************* + * IDirectSound_IDirectSound + */ +static HRESULT WINAPI IDirectSound_IDirectSound_QueryInterface( + LPDIRECTSOUND iface, + REFIID riid, + LPVOID * ppobj) +{ + IDirectSound_IDirectSound *This = (IDirectSound_IDirectSound *)iface; + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); + return DSOUND_QueryInterface(This->pds, riid, ppobj); +} + +static ULONG WINAPI IDirectSound_IDirectSound_AddRef( + LPDIRECTSOUND iface) +{ + IDirectSound_IDirectSound *This = (IDirectSound_IDirectSound *)iface; + ULONG ref = InterlockedIncrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref - 1); + return ref; +} + +static ULONG WINAPI IDirectSound_IDirectSound_Release( + LPDIRECTSOUND iface) +{ + IDirectSound_IDirectSound *This = (IDirectSound_IDirectSound *)iface; + ULONG ref = InterlockedDecrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref + 1); + if (!ref) { + ((IDirectSoundImpl*)This->pds)->pDS = NULL; + IDirectSoundImpl_Release(This->pds); + HeapFree(GetProcessHeap(), 0, This); + TRACE("(%p) released\n", This); + } + return ref; +} + +static HRESULT WINAPI IDirectSound_IDirectSound_CreateSoundBuffer( + LPDIRECTSOUND iface, + LPCDSBUFFERDESC dsbd, + LPLPDIRECTSOUNDBUFFER ppdsb, + LPUNKNOWN lpunk) +{ + IDirectSound_IDirectSound *This = (IDirectSound_IDirectSound *)iface; + TRACE("(%p,%p,%p,%p)\n",This,dsbd,ppdsb,lpunk); + return DirectSoundDevice_CreateSoundBuffer(((IDirectSoundImpl *)This->pds)->device,dsbd,ppdsb,lpunk,FALSE); +} + +static HRESULT WINAPI IDirectSound_IDirectSound_GetCaps( + LPDIRECTSOUND iface, + LPDSCAPS lpDSCaps) +{ + IDirectSound_IDirectSound *This = (IDirectSound_IDirectSound *)iface; + TRACE("(%p,%p)\n",This,lpDSCaps); + return DirectSoundDevice_GetCaps(((IDirectSoundImpl *)This->pds)->device, lpDSCaps); +} + +static HRESULT WINAPI IDirectSound_IDirectSound_DuplicateSoundBuffer( + LPDIRECTSOUND iface, + LPDIRECTSOUNDBUFFER psb, + LPLPDIRECTSOUNDBUFFER ppdsb) +{ + IDirectSound_IDirectSound *This = (IDirectSound_IDirectSound *)iface; + TRACE("(%p,%p,%p)\n",This,psb,ppdsb); + return DirectSoundDevice_DuplicateSoundBuffer(((IDirectSoundImpl *)This->pds)->device,psb,ppdsb); +} + +static HRESULT WINAPI IDirectSound_IDirectSound_SetCooperativeLevel( + LPDIRECTSOUND iface, + HWND hwnd, + DWORD level) +{ + IDirectSound_IDirectSound *This = (IDirectSound_IDirectSound *)iface; + TRACE("(%p,%p,%s)\n",This,hwnd,dumpCooperativeLevel(level)); + return DirectSoundDevice_SetCooperativeLevel(((IDirectSoundImpl *)This->pds)->device, hwnd, level); +} + +static HRESULT WINAPI IDirectSound_IDirectSound_Compact( + LPDIRECTSOUND iface) +{ + IDirectSound_IDirectSound *This = (IDirectSound_IDirectSound *)iface; + TRACE("(%p)\n", This); + return DirectSoundDevice_Compact(((IDirectSoundImpl *)This->pds)->device); +} + +static HRESULT WINAPI IDirectSound_IDirectSound_GetSpeakerConfig( + LPDIRECTSOUND iface, + LPDWORD lpdwSpeakerConfig) +{ + IDirectSound_IDirectSound *This = (IDirectSound_IDirectSound *)iface; + TRACE("(%p, %p)\n", This, lpdwSpeakerConfig); + return DirectSoundDevice_GetSpeakerConfig(((IDirectSoundImpl *)This->pds)->device,lpdwSpeakerConfig); +} + +static HRESULT WINAPI IDirectSound_IDirectSound_SetSpeakerConfig( + LPDIRECTSOUND iface, + DWORD config) +{ + IDirectSound_IDirectSound *This = (IDirectSound_IDirectSound *)iface; + TRACE("(%p,0x%08x)\n",This,config); + return DirectSoundDevice_SetSpeakerConfig(((IDirectSoundImpl *)This->pds)->device,config); +} + +static HRESULT WINAPI IDirectSound_IDirectSound_Initialize( + LPDIRECTSOUND iface, + LPCGUID lpcGuid) +{ + IDirectSound_IDirectSound *This = (IDirectSound_IDirectSound *)iface; + TRACE("(%p, %s)\n", This, debugstr_guid(lpcGuid)); + return DirectSoundDevice_Initialize(&((IDirectSoundImpl *)This->pds)->device,lpcGuid); +} + +static const IDirectSoundVtbl DirectSound_DirectSound_Vtbl = +{ + IDirectSound_IDirectSound_QueryInterface, + IDirectSound_IDirectSound_AddRef, + IDirectSound_IDirectSound_Release, + IDirectSound_IDirectSound_CreateSoundBuffer, + IDirectSound_IDirectSound_GetCaps, + IDirectSound_IDirectSound_DuplicateSoundBuffer, + IDirectSound_IDirectSound_SetCooperativeLevel, + IDirectSound_IDirectSound_Compact, + IDirectSound_IDirectSound_GetSpeakerConfig, + IDirectSound_IDirectSound_SetSpeakerConfig, + IDirectSound_IDirectSound_Initialize +}; + +static HRESULT IDirectSound_IDirectSound_Create( + LPDIRECTSOUND8 pds, + LPDIRECTSOUND * ppds) +{ + IDirectSound_IDirectSound * pdsds; + TRACE("(%p,%p)\n",pds,ppds); + + if (ppds == NULL) { + ERR("invalid parameter: ppds == NULL\n"); + return DSERR_INVALIDPARAM; + } + + if (pds == NULL) { + ERR("invalid parameter: pds == NULL\n"); + *ppds = NULL; + return DSERR_INVALIDPARAM; + } + + pdsds = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsds)); + if (pdsds == NULL) { + WARN("out of memory\n"); + *ppds = NULL; + return DSERR_OUTOFMEMORY; + } + + pdsds->lpVtbl = &DirectSound_DirectSound_Vtbl; + pdsds->ref = 0; + pdsds->pds = pds; + + IDirectSoundImpl_AddRef(pds); + *ppds = (LPDIRECTSOUND)pdsds; + + return DS_OK; +} + +/******************************************************************************* + * IDirectSound8_IUnknown + */ +static HRESULT WINAPI IDirectSound8_IUnknown_QueryInterface( + LPUNKNOWN iface, + REFIID riid, + LPVOID * ppobj) +{ + IDirectSound_IUnknown *This = (IDirectSound_IUnknown *)iface; + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); + return DSOUND_QueryInterface8(This->pds, riid, ppobj); +} + +static ULONG WINAPI IDirectSound8_IUnknown_AddRef( + LPUNKNOWN iface) +{ + IDirectSound_IUnknown *This = (IDirectSound_IUnknown *)iface; + ULONG ref = InterlockedIncrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref - 1); + return ref; +} + +static ULONG WINAPI IDirectSound8_IUnknown_Release( + LPUNKNOWN iface) +{ + IDirectSound_IUnknown *This = (IDirectSound_IUnknown *)iface; + ULONG ref = InterlockedDecrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref + 1); + if (!ref) { + ((IDirectSoundImpl*)This->pds)->pUnknown = NULL; + IDirectSoundImpl_Release(This->pds); + HeapFree(GetProcessHeap(), 0, This); + TRACE("(%p) released\n", This); + } + return ref; +} + +static const IUnknownVtbl DirectSound8_Unknown_Vtbl = +{ + IDirectSound8_IUnknown_QueryInterface, + IDirectSound8_IUnknown_AddRef, + IDirectSound8_IUnknown_Release +}; + +static HRESULT IDirectSound8_IUnknown_Create( + LPDIRECTSOUND8 pds, + LPUNKNOWN * ppunk) +{ + IDirectSound8_IUnknown * pdsunk; + TRACE("(%p,%p)\n",pds,ppunk); + + if (ppunk == NULL) { + ERR("invalid parameter: ppunk == NULL\n"); + return DSERR_INVALIDPARAM; + } + + if (pds == NULL) { + ERR("invalid parameter: pds == NULL\n"); + *ppunk = NULL; + return DSERR_INVALIDPARAM; + } + + pdsunk = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsunk)); + if (pdsunk == NULL) { + WARN("out of memory\n"); + *ppunk = NULL; + return DSERR_OUTOFMEMORY; + } + + pdsunk->lpVtbl = &DirectSound8_Unknown_Vtbl; + pdsunk->ref = 0; + pdsunk->pds = pds; + + IDirectSoundImpl_AddRef(pds); + *ppunk = (LPUNKNOWN)pdsunk; + + return DS_OK; +} + +/******************************************************************************* + * IDirectSound8_IDirectSound + */ +static HRESULT WINAPI IDirectSound8_IDirectSound_QueryInterface( + LPDIRECTSOUND iface, + REFIID riid, + LPVOID * ppobj) +{ + IDirectSound8_IDirectSound *This = (IDirectSound8_IDirectSound *)iface; + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); + return DSOUND_QueryInterface8(This->pds, riid, ppobj); +} + +static ULONG WINAPI IDirectSound8_IDirectSound_AddRef( + LPDIRECTSOUND iface) +{ + IDirectSound8_IDirectSound *This = (IDirectSound8_IDirectSound *)iface; + ULONG ref = InterlockedIncrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref - 1); + return ref; +} + +static ULONG WINAPI IDirectSound8_IDirectSound_Release( + LPDIRECTSOUND iface) +{ + IDirectSound8_IDirectSound *This = (IDirectSound8_IDirectSound *)iface; + ULONG ref = InterlockedDecrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref + 1); + if (!ref) { + ((IDirectSoundImpl*)This->pds)->pDS = NULL; + IDirectSoundImpl_Release(This->pds); + HeapFree(GetProcessHeap(), 0, This); + TRACE("(%p) released\n", This); + } + return ref; +} + +static HRESULT WINAPI IDirectSound8_IDirectSound_CreateSoundBuffer( + LPDIRECTSOUND iface, + LPCDSBUFFERDESC dsbd, + LPLPDIRECTSOUNDBUFFER ppdsb, + LPUNKNOWN lpunk) +{ + IDirectSound8_IDirectSound *This = (IDirectSound8_IDirectSound *)iface; + TRACE("(%p,%p,%p,%p)\n",This,dsbd,ppdsb,lpunk); + return DirectSoundDevice_CreateSoundBuffer(((IDirectSoundImpl *)This->pds)->device,dsbd,ppdsb,lpunk,TRUE); +} + +static HRESULT WINAPI IDirectSound8_IDirectSound_GetCaps( + LPDIRECTSOUND iface, + LPDSCAPS lpDSCaps) +{ + IDirectSound8_IDirectSound *This = (IDirectSound8_IDirectSound *)iface; + TRACE("(%p,%p)\n",This,lpDSCaps); + return DirectSoundDevice_GetCaps(((IDirectSoundImpl *)This->pds)->device, lpDSCaps); +} + +static HRESULT WINAPI IDirectSound8_IDirectSound_DuplicateSoundBuffer( + LPDIRECTSOUND iface, + LPDIRECTSOUNDBUFFER psb, + LPLPDIRECTSOUNDBUFFER ppdsb) +{ + IDirectSound8_IDirectSound *This = (IDirectSound8_IDirectSound *)iface; + TRACE("(%p,%p,%p)\n",This,psb,ppdsb); + return DirectSoundDevice_DuplicateSoundBuffer(((IDirectSoundImpl *)This->pds)->device,psb,ppdsb); +} + +static HRESULT WINAPI IDirectSound8_IDirectSound_SetCooperativeLevel( + LPDIRECTSOUND iface, + HWND hwnd, + DWORD level) +{ + IDirectSound8_IDirectSound *This = (IDirectSound8_IDirectSound *)iface; + TRACE("(%p,%p,%s)\n",This,hwnd,dumpCooperativeLevel(level)); + return DirectSoundDevice_SetCooperativeLevel(((IDirectSoundImpl *)This->pds)->device, hwnd, level); +} + +static HRESULT WINAPI IDirectSound8_IDirectSound_Compact( + LPDIRECTSOUND iface) +{ + IDirectSound8_IDirectSound *This = (IDirectSound8_IDirectSound *)iface; + TRACE("(%p)\n", This); + return DirectSoundDevice_Compact(((IDirectSoundImpl *)This->pds)->device); +} + +static HRESULT WINAPI IDirectSound8_IDirectSound_GetSpeakerConfig( + LPDIRECTSOUND iface, + LPDWORD lpdwSpeakerConfig) +{ + IDirectSound8_IDirectSound *This = (IDirectSound8_IDirectSound *)iface; + TRACE("(%p, %p)\n", This, lpdwSpeakerConfig); + return DirectSoundDevice_GetSpeakerConfig(((IDirectSoundImpl *)This->pds)->device,lpdwSpeakerConfig); +} + +static HRESULT WINAPI IDirectSound8_IDirectSound_SetSpeakerConfig( + LPDIRECTSOUND iface, + DWORD config) +{ + IDirectSound8_IDirectSound *This = (IDirectSound8_IDirectSound *)iface; + TRACE("(%p,0x%08x)\n",This,config); + return DirectSoundDevice_SetSpeakerConfig(((IDirectSoundImpl *)This->pds)->device,config); +} + +static HRESULT WINAPI IDirectSound8_IDirectSound_Initialize( + LPDIRECTSOUND iface, + LPCGUID lpcGuid) +{ + IDirectSound8_IDirectSound *This = (IDirectSound8_IDirectSound *)iface; + TRACE("(%p, %s)\n", This, debugstr_guid(lpcGuid)); + return DirectSoundDevice_Initialize(&((IDirectSoundImpl *)This->pds)->device,lpcGuid); +} + +static const IDirectSoundVtbl DirectSound8_DirectSound_Vtbl = +{ + IDirectSound8_IDirectSound_QueryInterface, + IDirectSound8_IDirectSound_AddRef, + IDirectSound8_IDirectSound_Release, + IDirectSound8_IDirectSound_CreateSoundBuffer, + IDirectSound8_IDirectSound_GetCaps, + IDirectSound8_IDirectSound_DuplicateSoundBuffer, + IDirectSound8_IDirectSound_SetCooperativeLevel, + IDirectSound8_IDirectSound_Compact, + IDirectSound8_IDirectSound_GetSpeakerConfig, + IDirectSound8_IDirectSound_SetSpeakerConfig, + IDirectSound8_IDirectSound_Initialize +}; + +static HRESULT IDirectSound8_IDirectSound_Create( + LPDIRECTSOUND8 pds, + LPDIRECTSOUND * ppds) +{ + IDirectSound8_IDirectSound * pdsds; + TRACE("(%p,%p)\n",pds,ppds); + + if (ppds == NULL) { + ERR("invalid parameter: ppds == NULL\n"); + return DSERR_INVALIDPARAM; + } + + if (pds == NULL) { + ERR("invalid parameter: pds == NULL\n"); + *ppds = NULL; + return DSERR_INVALIDPARAM; + } + + pdsds = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsds)); + if (pdsds == NULL) { + WARN("out of memory\n"); + *ppds = NULL; + return DSERR_OUTOFMEMORY; + } + + pdsds->lpVtbl = &DirectSound8_DirectSound_Vtbl; + pdsds->ref = 0; + pdsds->pds = pds; + + IDirectSoundImpl_AddRef(pds); + *ppds = (LPDIRECTSOUND)pdsds; + + return DS_OK; +} + +/******************************************************************************* + * IDirectSound8_IDirectSound8 + */ +static HRESULT WINAPI IDirectSound8_IDirectSound8_QueryInterface( + LPDIRECTSOUND8 iface, + REFIID riid, + LPVOID * ppobj) +{ + IDirectSound8_IDirectSound8 *This = (IDirectSound8_IDirectSound8 *)iface; + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); + return DSOUND_QueryInterface8(This->pds, riid, ppobj); +} + +static ULONG WINAPI IDirectSound8_IDirectSound8_AddRef( + LPDIRECTSOUND8 iface) +{ + IDirectSound8_IDirectSound8 *This = (IDirectSound8_IDirectSound8 *)iface; + ULONG ref = InterlockedIncrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref - 1); + return ref; +} + +static ULONG WINAPI IDirectSound8_IDirectSound8_Release( + LPDIRECTSOUND8 iface) +{ + IDirectSound8_IDirectSound8 *This = (IDirectSound8_IDirectSound8 *)iface; + ULONG ref = InterlockedDecrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref + 1); + if (!ref) { + ((IDirectSoundImpl*)This->pds)->pDS8 = NULL; + IDirectSoundImpl_Release(This->pds); + HeapFree(GetProcessHeap(), 0, This); + TRACE("(%p) released\n", This); + } + return ref; +} + +static HRESULT WINAPI IDirectSound8_IDirectSound8_CreateSoundBuffer( + LPDIRECTSOUND8 iface, + LPCDSBUFFERDESC dsbd, + LPLPDIRECTSOUNDBUFFER ppdsb, + LPUNKNOWN lpunk) +{ + IDirectSound8_IDirectSound8 *This = (IDirectSound8_IDirectSound8 *)iface; + TRACE("(%p,%p,%p,%p)\n",This,dsbd,ppdsb,lpunk); + return DirectSoundDevice_CreateSoundBuffer(((IDirectSoundImpl *)This->pds)->device,dsbd,ppdsb,lpunk,TRUE); +} + +static HRESULT WINAPI IDirectSound8_IDirectSound8_GetCaps( + LPDIRECTSOUND8 iface, + LPDSCAPS lpDSCaps) +{ + IDirectSound8_IDirectSound *This = (IDirectSound8_IDirectSound *)iface; + TRACE("(%p,%p)\n",This,lpDSCaps); + return DirectSoundDevice_GetCaps(((IDirectSoundImpl *)This->pds)->device, lpDSCaps); +} + +static HRESULT WINAPI IDirectSound8_IDirectSound8_DuplicateSoundBuffer( + LPDIRECTSOUND8 iface, + LPDIRECTSOUNDBUFFER psb, + LPLPDIRECTSOUNDBUFFER ppdsb) +{ + IDirectSound8_IDirectSound8 *This = (IDirectSound8_IDirectSound8 *)iface; + TRACE("(%p,%p,%p)\n",This,psb,ppdsb); + return DirectSoundDevice_DuplicateSoundBuffer(((IDirectSoundImpl *)This->pds)->device,psb,ppdsb); +} + +static HRESULT WINAPI IDirectSound8_IDirectSound8_SetCooperativeLevel( + LPDIRECTSOUND8 iface, + HWND hwnd, + DWORD level) +{ + IDirectSound8_IDirectSound8 *This = (IDirectSound8_IDirectSound8 *)iface; + TRACE("(%p,%p,%s)\n",This,hwnd,dumpCooperativeLevel(level)); + return DirectSoundDevice_SetCooperativeLevel(((IDirectSoundImpl *)This->pds)->device, hwnd, level); +} + +static HRESULT WINAPI IDirectSound8_IDirectSound8_Compact( + LPDIRECTSOUND8 iface) +{ + IDirectSound8_IDirectSound8 *This = (IDirectSound8_IDirectSound8 *)iface; + TRACE("(%p)\n", This); + return DirectSoundDevice_Compact(((IDirectSoundImpl *)This->pds)->device); +} + +static HRESULT WINAPI IDirectSound8_IDirectSound8_GetSpeakerConfig( + LPDIRECTSOUND8 iface, + LPDWORD lpdwSpeakerConfig) +{ + IDirectSound8_IDirectSound8 *This = (IDirectSound8_IDirectSound8 *)iface; + TRACE("(%p, %p)\n", This, lpdwSpeakerConfig); + return DirectSoundDevice_GetSpeakerConfig(((IDirectSoundImpl *)This->pds)->device,lpdwSpeakerConfig); +} + +static HRESULT WINAPI IDirectSound8_IDirectSound8_SetSpeakerConfig( + LPDIRECTSOUND8 iface, + DWORD config) +{ + IDirectSound8_IDirectSound8 *This = (IDirectSound8_IDirectSound8 *)iface; + TRACE("(%p,0x%08x)\n",This,config); + return DirectSoundDevice_SetSpeakerConfig(((IDirectSoundImpl *)This->pds)->device,config); +} + +static HRESULT WINAPI IDirectSound8_IDirectSound8_Initialize( + LPDIRECTSOUND8 iface, + LPCGUID lpcGuid) +{ + IDirectSound8_IDirectSound8 *This = (IDirectSound8_IDirectSound8 *)iface; + TRACE("(%p, %s)\n", This, debugstr_guid(lpcGuid)); + return DirectSoundDevice_Initialize(&((IDirectSoundImpl *)This->pds)->device,lpcGuid); +} + +static HRESULT WINAPI IDirectSound8_IDirectSound8_VerifyCertification( + LPDIRECTSOUND8 iface, + LPDWORD pdwCertified) +{ + IDirectSound8_IDirectSound8 *This = (IDirectSound8_IDirectSound8 *)iface; + TRACE("(%p, %p)\n", This, pdwCertified); + return DirectSoundDevice_VerifyCertification(((IDirectSoundImpl *)This->pds)->device,pdwCertified); +} + +static const IDirectSound8Vtbl DirectSound8_DirectSound8_Vtbl = +{ + IDirectSound8_IDirectSound8_QueryInterface, + IDirectSound8_IDirectSound8_AddRef, + IDirectSound8_IDirectSound8_Release, + IDirectSound8_IDirectSound8_CreateSoundBuffer, + IDirectSound8_IDirectSound8_GetCaps, + IDirectSound8_IDirectSound8_DuplicateSoundBuffer, + IDirectSound8_IDirectSound8_SetCooperativeLevel, + IDirectSound8_IDirectSound8_Compact, + IDirectSound8_IDirectSound8_GetSpeakerConfig, + IDirectSound8_IDirectSound8_SetSpeakerConfig, + IDirectSound8_IDirectSound8_Initialize, + IDirectSound8_IDirectSound8_VerifyCertification +}; + +static HRESULT IDirectSound8_IDirectSound8_Create( + LPDIRECTSOUND8 pds, + LPDIRECTSOUND8 * ppds) +{ + IDirectSound8_IDirectSound8 * pdsds; + TRACE("(%p,%p)\n",pds,ppds); + + if (ppds == NULL) { + ERR("invalid parameter: ppds == NULL\n"); + return DSERR_INVALIDPARAM; + } + + if (pds == NULL) { + ERR("invalid parameter: pds == NULL\n"); + *ppds = NULL; + return DSERR_INVALIDPARAM; + } + + pdsds = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsds)); + if (pdsds == NULL) { + WARN("out of memory\n"); + *ppds = NULL; + return DSERR_OUTOFMEMORY; + } + + pdsds->lpVtbl = &DirectSound8_DirectSound8_Vtbl; + pdsds->ref = 0; + pdsds->pds = pds; + + IDirectSoundImpl_AddRef(pds); + *ppds = (LPDIRECTSOUND8)pdsds; + + return DS_OK; +} + +HRESULT DSOUND_Create( + REFIID riid, + LPDIRECTSOUND *ppDS) +{ + LPDIRECTSOUND8 pDS; + HRESULT hr; + TRACE("(%s, %p)\n", debugstr_guid(riid), ppDS); + + if (!IsEqualIID(riid, &IID_IUnknown) && + !IsEqualIID(riid, &IID_IDirectSound)) { + *ppDS = 0; + return E_NOINTERFACE; + } + + /* Get dsound configuration */ setup_dsound_options(); - obj->IUnknown_inner.lpVtbl = &unk_vtbl; - obj->IDirectSound8_iface.lpVtbl = &ds8_vtbl; - obj->ref = 1; - obj->refds = 0; - obj->numIfaces = 1; - obj->device = NULL; - obj->has_ds8 = has_ds8; - - /* COM aggregation supported only internally */ - if (outer_unk) - obj->outer_unk = outer_unk; - else - obj->outer_unk = &obj->IUnknown_inner; - - hr = IUnknown_QueryInterface(&obj->IUnknown_inner, riid, ppv); - IUnknown_Release(&obj->IUnknown_inner); + hr = IDirectSoundImpl_Create(&pDS); + if (hr == DS_OK) { + hr = IDirectSound_IDirectSound_Create(pDS, ppDS); + if (*ppDS) + IDirectSound_IDirectSound_AddRef(*ppDS); + else { + WARN("IDirectSound_IDirectSound_Create failed\n"); + IDirectSound8_Release(pDS); + } + } else { + WARN("IDirectSoundImpl_Create failed\n"); + *ppDS = 0; + } return hr; } -HRESULT DSOUND_Create(REFIID riid, void **ppv) -{ - return IDirectSoundImpl_Create(NULL, riid, ppv, FALSE); -} - -HRESULT DSOUND_Create8(REFIID riid, void **ppv) -{ - return IDirectSoundImpl_Create(NULL, riid, ppv, TRUE); -} - /******************************************************************************* * DirectSoundCreate (DSOUND.1) * @@ -495,7 +1030,7 @@ HRESULT WINAPI DirectSoundCreate( return DSERR_INVALIDPARAM; } - hr = DSOUND_Create(&IID_IDirectSound, (void **)&pDS); + hr = DSOUND_Create(&IID_IDirectSound, &pDS); if (hr == DS_OK) { hr = IDirectSound_Initialize(pDS, lpcGUID); if (hr != DS_OK) { @@ -512,6 +1047,41 @@ HRESULT WINAPI DirectSoundCreate( return hr; } +HRESULT DSOUND_Create8( + REFIID riid, + LPDIRECTSOUND8 *ppDS) +{ + LPDIRECTSOUND8 pDS; + HRESULT hr; + TRACE("(%s, %p)\n", debugstr_guid(riid), ppDS); + + if (!IsEqualIID(riid, &IID_IUnknown) && + !IsEqualIID(riid, &IID_IDirectSound) && + !IsEqualIID(riid, &IID_IDirectSound8)) { + *ppDS = 0; + return E_NOINTERFACE; + } + + /* Get dsound configuration */ + setup_dsound_options(); + + hr = IDirectSoundImpl_Create(&pDS); + if (hr == DS_OK) { + hr = IDirectSound8_IDirectSound8_Create(pDS, ppDS); + if (*ppDS) + IDirectSound8_IDirectSound8_AddRef(*ppDS); + else { + WARN("IDirectSound8_IDirectSound8_Create failed\n"); + IDirectSound8_Release(pDS); + } + } else { + WARN("IDirectSoundImpl_Create failed\n"); + *ppDS = 0; + } + + return hr; +} + /******************************************************************************* * DirectSoundCreate8 (DSOUND.11) * @@ -548,7 +1118,7 @@ HRESULT WINAPI DirectSoundCreate8( return DSERR_INVALIDPARAM; } - hr = DSOUND_Create8(&IID_IDirectSound8, (void **)&pDS); + hr = DSOUND_Create8(&IID_IDirectSound8, &pDS); if (hr == DS_OK) { hr = IDirectSound8_Initialize(pDS, lpcGUID); if (hr != DS_OK) { @@ -583,7 +1153,7 @@ static HRESULT DirectSoundDevice_Create(DirectSoundDevice ** ppDevice) device->ref = 1; device->priolevel = DSSCL_NORMAL; device->state = STATE_STOPPED; - device->speaker_config = DSSPEAKER_COMBINED(DSSPEAKER_STEREO, DSSPEAKER_GEOMETRY_WIDE); + device->speaker_config = DSSPEAKER_STEREO | (DSSPEAKER_GEOMETRY_NARROW << 16); /* 3D listener initial parameters */ device->ds3dl.dwSize = sizeof(DS3DLISTENER); @@ -607,24 +1177,24 @@ static HRESULT DirectSoundDevice_Create(DirectSoundDevice ** ppDevice) device->guid = GUID_NULL; /* Set default wave format (may need it for waveOutOpen) */ - device->pwfx = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(WAVEFORMATEXTENSIBLE)); - device->primary_pwfx = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(WAVEFORMATEXTENSIBLE)); - if (!device->pwfx || !device->primary_pwfx) { + device->pwfx = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(WAVEFORMATEX)); + if (device->pwfx == NULL) { WARN("out of memory\n"); - HeapFree(GetProcessHeap(),0,device->primary_pwfx); - HeapFree(GetProcessHeap(),0,device->pwfx); HeapFree(GetProcessHeap(),0,device); return DSERR_OUTOFMEMORY; } + /* We rely on the sound driver to return the actual sound format of + * the device if it does not support 22050x8x2 and is given the + * WAVE_DIRECTSOUND flag. + */ device->pwfx->wFormatTag = WAVE_FORMAT_PCM; - device->pwfx->nSamplesPerSec = 22050; - device->pwfx->wBitsPerSample = 8; + device->pwfx->nSamplesPerSec = ds_default_sample_rate; + device->pwfx->wBitsPerSample = ds_default_bits_per_sample; device->pwfx->nChannels = 2; device->pwfx->nBlockAlign = device->pwfx->wBitsPerSample * device->pwfx->nChannels / 8; device->pwfx->nAvgBytesPerSec = device->pwfx->nSamplesPerSec * device->pwfx->nBlockAlign; device->pwfx->cbSize = 0; - memcpy(device->primary_pwfx, device->pwfx, sizeof(*device->pwfx)); InitializeCriticalSection(&(device->mixlock)); device->mixlock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": DirectSoundDevice.mixlock"); @@ -650,41 +1220,46 @@ ULONG DirectSoundDevice_Release(DirectSoundDevice * device) TRACE("(%p) ref was %u\n", device, ref + 1); if (!ref) { int i; + timeKillEvent(device->timerID); + timeEndPeriod(DS_TIME_RES); - SetEvent(device->sleepev); - if (device->thread) { - WaitForSingleObject(device->thread, INFINITE); - CloseHandle(device->thread); - } - CloseHandle(device->sleepev); - - EnterCriticalSection(&DSOUND_renderers_lock); - list_remove(&device->entry); - LeaveCriticalSection(&DSOUND_renderers_lock); + /* The kill event should have allowed the timer process to expire + * but try to grab the lock just in case. Can't hold lock because + * IDirectSoundBufferImpl_Destroy also grabs the lock */ + RtlAcquireResourceShared(&(device->buffer_list_lock), TRUE); + RtlReleaseResource(&(device->buffer_list_lock)); /* It is allowed to release this object even when buffers are playing */ if (device->buffers) { WARN("%d secondary buffers not released\n", device->nrofbuffers); for( i=0;inrofbuffers;i++) - secondarybuffer_destroy(device->buffers[i]); + IDirectSoundBufferImpl_Destroy(device->buffers[i]); + } + + if (device->primary) { + WARN("primary buffer not released\n"); + IDirectSoundBuffer8_Release((LPDIRECTSOUNDBUFFER8)device->primary); } hr = DSOUND_PrimaryDestroy(device); if (hr != DS_OK) WARN("DSOUND_PrimaryDestroy failed\n"); - if(device->client) - IAudioClient_Release(device->client); - if(device->render) - IAudioRenderClient_Release(device->render); - if(device->clock) - IAudioClock_Release(device->clock); - if(device->volume) - IAudioStreamVolume_Release(device->volume); + if (device->driver) + IDsDriver_Close(device->driver); + + if (device->drvdesc.dwFlags & DSDDESC_DOMMSYSTEMOPEN) + waveOutClose(device->hwo); + + if (device->driver) + IDsDriver_Release(device->driver); + + DSOUND_renderer[device->drvdesc.dnDevNode] = NULL; HeapFree(GetProcessHeap(), 0, device->tmp_buffer); HeapFree(GetProcessHeap(), 0, device->mix_buffer); - HeapFree(GetProcessHeap(), 0, device->buffer); + if (device->drvdesc.dwFlags & DSDDESC_USESYSTEMMEMORY) + HeapFree(GetProcessHeap(), 0, device->buffer); RtlDeleteResource(&device->buffer_list_lock); device->mixlock.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&device->mixlock); @@ -694,58 +1269,67 @@ ULONG DirectSoundDevice_Release(DirectSoundDevice * device) return ref; } -BOOL DSOUND_check_supported(IAudioClient *client, DWORD rate, - DWORD depth, WORD channels) +HRESULT DirectSoundDevice_GetCaps( + DirectSoundDevice * device, + LPDSCAPS lpDSCaps) { - WAVEFORMATEX fmt, *junk; - HRESULT hr; + TRACE("(%p,%p)\n",device,lpDSCaps); - fmt.wFormatTag = WAVE_FORMAT_PCM; - fmt.nChannels = channels; - fmt.nSamplesPerSec = rate; - fmt.wBitsPerSample = depth; - fmt.nBlockAlign = (channels * depth) / 8; - fmt.nAvgBytesPerSec = rate * fmt.nBlockAlign; - fmt.cbSize = 0; - - hr = IAudioClient_IsFormatSupported(client, AUDCLNT_SHAREMODE_SHARED, &fmt, &junk); - if(SUCCEEDED(hr)) - CoTaskMemFree(junk); - - return hr == S_OK; -} - -UINT DSOUND_create_timer(LPTIMECALLBACK cb, DWORD_PTR user) -{ - UINT triggertime = DS_TIME_DEL, res = DS_TIME_RES, id; - TIMECAPS time; - - timeGetDevCaps(&time, sizeof(TIMECAPS)); - TRACE("Minimum timer resolution: %u, max timer: %u\n", time.wPeriodMin, time.wPeriodMax); - if (triggertime < time.wPeriodMin) - triggertime = time.wPeriodMin; - if (res < time.wPeriodMin) - res = time.wPeriodMin; - if (timeBeginPeriod(res) == TIMERR_NOCANDO) - WARN("Could not set minimum resolution, don't expect sound\n"); - id = timeSetEvent(triggertime, res, cb, user, TIME_PERIODIC | TIME_KILL_SYNCHRONOUS); - if (!id) - { - WARN("Timer not created! Retrying without TIME_KILL_SYNCHRONOUS\n"); - id = timeSetEvent(triggertime, res, cb, user, TIME_PERIODIC); - if (!id) - ERR("Could not create timer, sound playback will not occur\n"); + if (device == NULL) { + WARN("not initialized\n"); + return DSERR_UNINITIALIZED; } - return id; + + if (lpDSCaps == NULL) { + WARN("invalid parameter: lpDSCaps = NULL\n"); + return DSERR_INVALIDPARAM; + } + + /* check if there is enough room */ + if (lpDSCaps->dwSize < sizeof(*lpDSCaps)) { + WARN("invalid parameter: lpDSCaps->dwSize = %d\n", lpDSCaps->dwSize); + return DSERR_INVALIDPARAM; + } + + lpDSCaps->dwFlags = device->drvcaps.dwFlags; + if (TRACE_ON(dsound)) { + TRACE("(flags=0x%08x:\n",lpDSCaps->dwFlags); + _dump_DSCAPS(lpDSCaps->dwFlags); + TRACE(")\n"); + } + lpDSCaps->dwMinSecondarySampleRate = device->drvcaps.dwMinSecondarySampleRate; + lpDSCaps->dwMaxSecondarySampleRate = device->drvcaps.dwMaxSecondarySampleRate; + lpDSCaps->dwPrimaryBuffers = device->drvcaps.dwPrimaryBuffers; + lpDSCaps->dwMaxHwMixingAllBuffers = device->drvcaps.dwMaxHwMixingAllBuffers; + lpDSCaps->dwMaxHwMixingStaticBuffers = device->drvcaps.dwMaxHwMixingStaticBuffers; + lpDSCaps->dwMaxHwMixingStreamingBuffers = device->drvcaps.dwMaxHwMixingStreamingBuffers; + lpDSCaps->dwFreeHwMixingAllBuffers = device->drvcaps.dwFreeHwMixingAllBuffers; + lpDSCaps->dwFreeHwMixingStaticBuffers = device->drvcaps.dwFreeHwMixingStaticBuffers; + lpDSCaps->dwFreeHwMixingStreamingBuffers = device->drvcaps.dwFreeHwMixingStreamingBuffers; + lpDSCaps->dwMaxHw3DAllBuffers = device->drvcaps.dwMaxHw3DAllBuffers; + lpDSCaps->dwMaxHw3DStaticBuffers = device->drvcaps.dwMaxHw3DStaticBuffers; + lpDSCaps->dwMaxHw3DStreamingBuffers = device->drvcaps.dwMaxHw3DStreamingBuffers; + lpDSCaps->dwFreeHw3DAllBuffers = device->drvcaps.dwFreeHw3DAllBuffers; + lpDSCaps->dwFreeHw3DStaticBuffers = device->drvcaps.dwFreeHw3DStaticBuffers; + lpDSCaps->dwFreeHw3DStreamingBuffers = device->drvcaps.dwFreeHw3DStreamingBuffers; + lpDSCaps->dwTotalHwMemBytes = device->drvcaps.dwTotalHwMemBytes; + lpDSCaps->dwFreeHwMemBytes = device->drvcaps.dwFreeHwMemBytes; + lpDSCaps->dwMaxContigFreeHwMemBytes = device->drvcaps.dwMaxContigFreeHwMemBytes; + + /* driver doesn't have these */ + lpDSCaps->dwUnlockTransferRateHwBuffers = 4096; /* But we have none... */ + lpDSCaps->dwPlayCpuOverheadSwBuffers = 1; /* 1% */ + + return DS_OK; } HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGUID lpcGUID) { HRESULT hr = DS_OK; + unsigned wod, wodn; + BOOLEAN found = FALSE; GUID devGUID; - DirectSoundDevice *device; - IMMDevice *mmdevice; - + DirectSoundDevice * device = *ppDevice; TRACE("(%p,%s)\n",ppDevice,debugstr_guid(lpcGUID)); if (*ppDevice != NULL) { @@ -757,108 +1341,140 @@ HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGUID lpcG if (!lpcGUID || IsEqualGUID(lpcGUID, &GUID_NULL)) lpcGUID = &DSDEVID_DefaultPlayback; - if(IsEqualGUID(lpcGUID, &DSDEVID_DefaultCapture) || - IsEqualGUID(lpcGUID, &DSDEVID_DefaultVoiceCapture)) - return DSERR_NODRIVER; - if (GetDeviceID(lpcGUID, &devGUID) != DS_OK) { WARN("invalid parameter: lpcGUID\n"); return DSERR_INVALIDPARAM; } - hr = get_mmdevice(eRender, &devGUID, &mmdevice); - if(FAILED(hr)) - return hr; + /* Enumerate WINMM audio devices and find the one we want */ + wodn = waveOutGetNumDevs(); + if (!wodn) { + WARN("no driver\n"); + return DSERR_NODRIVER; + } - EnterCriticalSection(&DSOUND_renderers_lock); - - LIST_FOR_EACH_ENTRY(device, &DSOUND_renderers, DirectSoundDevice, entry){ - if(IsEqualGUID(&device->guid, &devGUID)){ - IMMDevice_Release(mmdevice); - DirectSoundDevice_AddRef(device); - *ppDevice = device; - LeaveCriticalSection(&DSOUND_renderers_lock); - return DS_OK; + for (wod=0; wodmmdevice = mmdevice; - device->guid = devGUID; - device->sleepev = CreateEventW(0, 0, 0, 0); + if (DSOUND_renderer[wod]) { + if (IsEqualGUID(&devGUID, &DSOUND_renderer[wod]->guid)) { + device = DSOUND_renderer[wod]; + DirectSoundDevice_AddRef(device); + *ppDevice = device; + return DS_OK; + } else { + ERR("device GUID doesn't match\n"); + hr = DSERR_GENERIC; + return hr; + } + } else { + hr = DirectSoundDevice_Create(&device); + if (hr != DS_OK) { + WARN("DirectSoundDevice_Create failed\n"); + return hr; + } + } + *ppDevice = device; + device->guid = devGUID; + device->driver = NULL; + + device->drvdesc.dnDevNode = wod; hr = DSOUND_ReopenDevice(device, FALSE); if (FAILED(hr)) { - HeapFree(GetProcessHeap(), 0, device); - LeaveCriticalSection(&DSOUND_renderers_lock); - IMMDevice_Release(mmdevice); WARN("DSOUND_ReopenDevice failed: %08x\n", hr); return hr; } - ZeroMemory(&device->drvcaps, sizeof(device->drvcaps)); - - if(DSOUND_check_supported(device->client, 11025, 8, 1) || - DSOUND_check_supported(device->client, 22050, 8, 1) || - DSOUND_check_supported(device->client, 44100, 8, 1) || - DSOUND_check_supported(device->client, 48000, 8, 1) || - DSOUND_check_supported(device->client, 96000, 8, 1)) - device->drvcaps.dwFlags |= DSCAPS_PRIMARY8BIT | DSCAPS_PRIMARYMONO; - - if(DSOUND_check_supported(device->client, 11025, 16, 1) || - DSOUND_check_supported(device->client, 22050, 16, 1) || - DSOUND_check_supported(device->client, 44100, 16, 1) || - DSOUND_check_supported(device->client, 48000, 16, 1) || - DSOUND_check_supported(device->client, 96000, 16, 1)) - device->drvcaps.dwFlags |= DSCAPS_PRIMARY16BIT | DSCAPS_PRIMARYMONO; - - if(DSOUND_check_supported(device->client, 11025, 8, 2) || - DSOUND_check_supported(device->client, 22050, 8, 2) || - DSOUND_check_supported(device->client, 44100, 8, 2) || - DSOUND_check_supported(device->client, 48000, 8, 2) || - DSOUND_check_supported(device->client, 96000, 8, 2)) - device->drvcaps.dwFlags |= DSCAPS_PRIMARY8BIT | DSCAPS_PRIMARYSTEREO; - - if(DSOUND_check_supported(device->client, 11025, 16, 2) || - DSOUND_check_supported(device->client, 22050, 16, 2) || - DSOUND_check_supported(device->client, 44100, 16, 2) || - DSOUND_check_supported(device->client, 48000, 16, 2) || - DSOUND_check_supported(device->client, 96000, 16, 2)) - device->drvcaps.dwFlags |= DSCAPS_PRIMARY16BIT | DSCAPS_PRIMARYSTEREO; - - /* the dsound mixer supports all of the following */ - device->drvcaps.dwFlags |= DSCAPS_SECONDARY8BIT | DSCAPS_SECONDARY16BIT; - device->drvcaps.dwFlags |= DSCAPS_SECONDARYMONO | DSCAPS_SECONDARYSTEREO; - device->drvcaps.dwFlags |= DSCAPS_CONTINUOUSRATE; - - device->drvcaps.dwPrimaryBuffers = 1; - device->drvcaps.dwMinSecondarySampleRate = DSBFREQUENCY_MIN; - device->drvcaps.dwMaxSecondarySampleRate = DSBFREQUENCY_MAX; - device->drvcaps.dwMaxHwMixingAllBuffers = 1; - device->drvcaps.dwMaxHwMixingStaticBuffers = 1; - device->drvcaps.dwMaxHwMixingStreamingBuffers = 1; - - ZeroMemory(&device->volpan, sizeof(device->volpan)); + if (device->driver) { + /* the driver is now open, so it's now allowed to call GetCaps */ + hr = IDsDriver_GetCaps(device->driver,&(device->drvcaps)); + if (hr != DS_OK) { + WARN("IDsDriver_GetCaps failed\n"); + return hr; + } + } else { + WAVEOUTCAPSA woc; + hr = mmErr(waveOutGetDevCapsA(device->drvdesc.dnDevNode, &woc, sizeof(woc))); + if (hr != DS_OK) { + WARN("waveOutGetDevCaps failed\n"); + return hr; + } + ZeroMemory(&device->drvcaps, sizeof(device->drvcaps)); + if ((woc.dwFormats & WAVE_FORMAT_1M08) || + (woc.dwFormats & WAVE_FORMAT_2M08) || + (woc.dwFormats & WAVE_FORMAT_4M08) || + (woc.dwFormats & WAVE_FORMAT_48M08) || + (woc.dwFormats & WAVE_FORMAT_96M08)) { + device->drvcaps.dwFlags |= DSCAPS_PRIMARY8BIT; + device->drvcaps.dwFlags |= DSCAPS_PRIMARYMONO; + } + if ((woc.dwFormats & WAVE_FORMAT_1M16) || + (woc.dwFormats & WAVE_FORMAT_2M16) || + (woc.dwFormats & WAVE_FORMAT_4M16) || + (woc.dwFormats & WAVE_FORMAT_48M16) || + (woc.dwFormats & WAVE_FORMAT_96M16)) { + device->drvcaps.dwFlags |= DSCAPS_PRIMARY16BIT; + device->drvcaps.dwFlags |= DSCAPS_PRIMARYMONO; + } + if ((woc.dwFormats & WAVE_FORMAT_1S08) || + (woc.dwFormats & WAVE_FORMAT_2S08) || + (woc.dwFormats & WAVE_FORMAT_4S08) || + (woc.dwFormats & WAVE_FORMAT_48S08) || + (woc.dwFormats & WAVE_FORMAT_96S08)) { + device->drvcaps.dwFlags |= DSCAPS_PRIMARY8BIT; + device->drvcaps.dwFlags |= DSCAPS_PRIMARYSTEREO; + } + if ((woc.dwFormats & WAVE_FORMAT_1S16) || + (woc.dwFormats & WAVE_FORMAT_2S16) || + (woc.dwFormats & WAVE_FORMAT_4S16) || + (woc.dwFormats & WAVE_FORMAT_48S16) || + (woc.dwFormats & WAVE_FORMAT_96S16)) { + device->drvcaps.dwFlags |= DSCAPS_PRIMARY16BIT; + device->drvcaps.dwFlags |= DSCAPS_PRIMARYSTEREO; + } + if (ds_emuldriver) + device->drvcaps.dwFlags |= DSCAPS_EMULDRIVER; + device->drvcaps.dwMinSecondarySampleRate = DSBFREQUENCY_MIN; + device->drvcaps.dwMaxSecondarySampleRate = DSBFREQUENCY_MAX; + ZeroMemory(&device->volpan, sizeof(device->volpan)); + } hr = DSOUND_PrimaryCreate(device); if (hr == DS_OK) { - device->thread = CreateThread(0, 0, DSOUND_mixthread, device, 0, 0); - SetThreadPriority(device->thread, THREAD_PRIORITY_TIME_CRITICAL); - } else - WARN("DSOUND_PrimaryCreate failed: %08x\n", hr); + UINT triggertime = DS_TIME_DEL, res = DS_TIME_RES, id; + TIMECAPS time; - *ppDevice = device; - list_add_tail(&DSOUND_renderers, &device->entry); - - LeaveCriticalSection(&DSOUND_renderers_lock); + DSOUND_renderer[device->drvdesc.dnDevNode] = device; + timeGetDevCaps(&time, sizeof(TIMECAPS)); + TRACE("Minimum timer resolution: %u, max timer: %u\n", time.wPeriodMin, time.wPeriodMax); + if (triggertime < time.wPeriodMin) + triggertime = time.wPeriodMin; + if (res < time.wPeriodMin) + res = time.wPeriodMin; + if (timeBeginPeriod(res) == TIMERR_NOCANDO) + WARN("Could not set minimum resolution, don't expect sound\n"); + id = timeSetEvent(triggertime, res, DSOUND_timer, (DWORD_PTR)device, TIME_PERIODIC | TIME_KILL_SYNCHRONOUS); + if (!id) + { + WARN("Timer not created! Retrying without TIME_KILL_SYNCHRONOUS\n"); + id = timeSetEvent(triggertime, res, DSOUND_timer, (DWORD_PTR)device, TIME_PERIODIC); + if (!id) ERR("Could not create timer, sound playback will not occur\n"); + } + DSOUND_renderer[device->drvdesc.dnDevNode]->timerID = id; + } else { + WARN("DSOUND_PrimaryCreate failed\n"); + } return hr; } @@ -904,12 +1520,6 @@ HRESULT DirectSoundDevice_CreateSoundBuffer( TRACE("(lpwfxFormat=%p)\n",dsbd->lpwfxFormat); } - if (dsbd->dwFlags & DSBCAPS_LOCHARDWARE && - !(dsbd->dwFlags & DSBCAPS_PRIMARYBUFFER)) { - TRACE("LOCHARDWARE is not supported, returning E_NOTIMPL\n"); - return E_NOTIMPL; - } - if (dsbd->dwFlags & DSBCAPS_PRIMARYBUFFER) { if (dsbd->lpwfxFormat != NULL) { WARN("invalid parameter: dsbd->lpwfxFormat must be NULL for " @@ -926,7 +1536,10 @@ HRESULT DirectSoundDevice_CreateSoundBuffer( if (device->primary) { *ppdsb = (IDirectSoundBuffer*)&device->primary->IDirectSoundBuffer8_iface; device->primary->dsbd.dwFlags &= ~(DSBCAPS_LOCHARDWARE | DSBCAPS_LOCSOFTWARE); - device->primary->dsbd.dwFlags |= DSBCAPS_LOCSOFTWARE; + if (device->hwbuf) + device->primary->dsbd.dwFlags |= DSBCAPS_LOCHARDWARE; + else + device->primary->dsbd.dwFlags |= DSBCAPS_LOCSOFTWARE; } else WARN("primarybuffer_create() failed\n"); } @@ -941,6 +1554,11 @@ HRESULT DirectSoundDevice_CreateSoundBuffer( } pwfxe = (WAVEFORMATEXTENSIBLE*)dsbd->lpwfxFormat; + if (pwfxe->Format.wBitsPerSample != 16 && pwfxe->Format.wBitsPerSample != 8 && pwfxe->Format.wFormatTag != WAVE_FORMAT_EXTENSIBLE) + { + WARN("wBitsPerSample=%d needs a WAVEFORMATEXTENSIBLE\n", dsbd->lpwfxFormat->wBitsPerSample); + return DSERR_CONTROLUNAVAIL; + } if (pwfxe->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE) { /* check if cbSize is at least 22 bytes */ @@ -1041,6 +1659,101 @@ HRESULT DirectSoundDevice_DuplicateSoundBuffer( return hres; } +HRESULT DirectSoundDevice_SetCooperativeLevel( + DirectSoundDevice * device, + HWND hwnd, + DWORD level) +{ + TRACE("(%p,%p,%s)\n",device,hwnd,dumpCooperativeLevel(level)); + + if (device == NULL) { + WARN("not initialized\n"); + return DSERR_UNINITIALIZED; + } + + if (level==DSSCL_PRIORITY || level==DSSCL_EXCLUSIVE) { + WARN("level=%s not fully supported\n", + level==DSSCL_PRIORITY ? "DSSCL_PRIORITY" : "DSSCL_EXCLUSIVE"); + } + + device->priolevel = level; + return DS_OK; +} + +HRESULT DirectSoundDevice_Compact( + DirectSoundDevice * device) +{ + TRACE("(%p)\n", device); + + if (device == NULL) { + WARN("not initialized\n"); + return DSERR_UNINITIALIZED; + } + + if (device->priolevel < DSSCL_PRIORITY) { + WARN("incorrect priority level\n"); + return DSERR_PRIOLEVELNEEDED; + } + + return DS_OK; +} + +HRESULT DirectSoundDevice_GetSpeakerConfig( + DirectSoundDevice * device, + LPDWORD lpdwSpeakerConfig) +{ + TRACE("(%p, %p)\n", device, lpdwSpeakerConfig); + + if (device == NULL) { + WARN("not initialized\n"); + return DSERR_UNINITIALIZED; + } + + if (lpdwSpeakerConfig == NULL) { + WARN("invalid parameter: lpdwSpeakerConfig == NULL\n"); + return DSERR_INVALIDPARAM; + } + + WARN("not fully functional\n"); + *lpdwSpeakerConfig = device->speaker_config; + return DS_OK; +} + +HRESULT DirectSoundDevice_SetSpeakerConfig( + DirectSoundDevice * device, + DWORD config) +{ + TRACE("(%p,0x%08x)\n",device,config); + + if (device == NULL) { + WARN("not initialized\n"); + return DSERR_UNINITIALIZED; + } + + device->speaker_config = config; + WARN("not fully functional\n"); + return DS_OK; +} + +HRESULT DirectSoundDevice_VerifyCertification( + DirectSoundDevice * device, + LPDWORD pdwCertified) +{ + TRACE("(%p, %p)\n",device,pdwCertified); + + if (device == NULL) { + WARN("not initialized\n"); + return DSERR_UNINITIALIZED; + } + + if (device->drvcaps.dwFlags & DSCAPS_CERTIFIED) + *pdwCertified = DS_CERTIFIED; + else + *pdwCertified = DS_UNCERTIFIED; + + return DS_OK; +} + /* * Add secondary buffer to buffer list. * Gets exclusive access to buffer for writing. @@ -1080,29 +1793,35 @@ HRESULT DirectSoundDevice_AddBuffer( * Remove secondary buffer from buffer list. * Gets exclusive access to buffer for writing. */ -void DirectSoundDevice_RemoveBuffer(DirectSoundDevice * device, IDirectSoundBufferImpl * pDSB) +HRESULT DirectSoundDevice_RemoveBuffer( + DirectSoundDevice * device, + IDirectSoundBufferImpl * pDSB) { int i; + HRESULT hr = DS_OK; TRACE("(%p, %p)\n", device, pDSB); RtlAcquireResourceExclusive(&(device->buffer_list_lock), TRUE); - if (device->nrofbuffers == 1) { - assert(device->buffers[0] == pDSB); - HeapFree(GetProcessHeap(), 0, device->buffers); - device->buffers = NULL; - } else { - for (i = 0; i < device->nrofbuffers; i++) { - if (device->buffers[i] == pDSB) { - /* Put the last buffer of the list in the (now empty) position */ - device->buffers[i] = device->buffers[device->nrofbuffers - 1]; - break; - } - } + for (i = 0; i < device->nrofbuffers; i++) + if (device->buffers[i] == pDSB) + break; + + if (i < device->nrofbuffers) { + /* Put the last buffer of the list in the (now empty) position */ + device->buffers[i] = device->buffers[device->nrofbuffers - 1]; + device->nrofbuffers--; + device->buffers = HeapReAlloc(GetProcessHeap(),0,device->buffers,sizeof(LPDIRECTSOUNDBUFFER8)*device->nrofbuffers); + TRACE("buffer count is now %d\n", device->nrofbuffers); + } + + if (device->nrofbuffers == 0) { + HeapFree(GetProcessHeap(),0,device->buffers); + device->buffers = NULL; } - device->nrofbuffers--; - TRACE("buffer count is now %d\n", device->nrofbuffers); RtlReleaseResource(&(device->buffer_list_lock)); + + return hr; } diff --git a/dll/directx/wine/dsound/dsound_convert.c b/dll/directx/wine/dsound/dsound_convert.c index 76c99c1b0a1..1bb9b583680 100644 --- a/dll/directx/wine/dsound/dsound_convert.c +++ b/dll/directx/wine/dsound/dsound_convert.c @@ -44,214 +44,488 @@ #define le32(x) (x) #endif -/* This is an inlined version of lrintf. */ -#if defined(_MSC_VER) -#if defined(_M_AMD64) -#include -#endif - -FORCEINLINE -int -lrintf(float f) +static inline void src_advance(const void **src, UINT stride, INT *count, UINT *freqAcc, UINT adj) { -#if defined(_M_IX86) - int result; - __asm + *freqAcc += adj; + if (*freqAcc >= (1 << DSOUND_FREQSHIFT)) { - fld f; - fistp result; + ULONG adv = (*freqAcc >> DSOUND_FREQSHIFT); + *freqAcc &= (1 << DSOUND_FREQSHIFT) - 1; + *(const char **)src += adv * stride; + *count -= adv; } - return result; -#elif defined(_M_AMD64) - return _mm_cvtss_si32(_mm_load_ss(&f)); -#endif } -#endif -static float get8(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel) +static void convert_8_to_8 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) { - const BYTE* buf = dsb->buffer->memory; - buf += pos + channel; - return (buf[0] - 0x80) / (float)0x80; + while (count > 0) + { + *(BYTE *)dst = *(const BYTE *)src; + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } } -static float get16(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel) +static void convert_8_to_16 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) { - const BYTE* buf = dsb->buffer->memory; - const SHORT *sbuf = (const SHORT*)(buf + pos + 2 * channel); - SHORT sample = (SHORT)le16(*sbuf); - return sample / (float)0x8000; + while (count > 0) + { + WORD dest = *(const BYTE *)src, *dest16 = dst; + *dest16 = le16(dest * 257 - 32768); + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } } -static float get24(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel) +static void convert_8_to_24 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) { - LONG sample; - const BYTE* buf = dsb->buffer->memory; - buf += pos + 3 * channel; - /* The next expression deliberately has an overflow for buf[2] >= 0x80, - this is how negative values are made. - */ - sample = (buf[0] << 8) | (buf[1] << 16) | (buf[2] << 24); - return sample / (float)0x80000000U; + while (count > 0) + { + BYTE dest = *(const BYTE *)src; + BYTE *dest24 = dst; + dest24[0] = dest; + dest24[1] = dest; + dest24[2] = dest - 0x80; + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } } -static float get32(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel) +static void convert_8_to_32 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) { - const BYTE* buf = dsb->buffer->memory; - const LONG *sbuf = (const LONG*)(buf + pos + 4 * channel); - LONG sample = le32(*sbuf); - return sample / (float)0x80000000U; + while (count > 0) + { + DWORD dest = *(const BYTE *)src, *dest32 = dst; + *dest32 = le32(dest * 16843009 - 2147483648U); + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } } -static float getieee32(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel) +static void convert_16_to_8 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) { - const BYTE* buf = dsb->buffer->memory; - const float *sbuf = (const float*)(buf + pos + 4 * channel); - /* The value will be clipped later, when put into some non-float buffer */ - return *sbuf; + while (count > 0) + { + BYTE *dst8 = dst; + *dst8 = (le16(*(const WORD *)src)) / 256; + *dst8 -= 0x80; + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } } -const bitsgetfunc getbpp[5] = {get8, get16, get24, get32, getieee32}; - -float get_mono(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel) +static void convert_16_to_16 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) { - DWORD channels = dsb->pwfx->nChannels; - DWORD c; - float val = 0; - /* XXX: does Windows include LFE into the mix? */ - for (c = 0; c < channels; c++) - val += dsb->get_aux(dsb, pos, c); - val /= channels; - return val; + while (count > 0) + { + *(WORD *)dst = *(const WORD *)src; + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } } -static inline unsigned char f_to_8(float value) +static void convert_16_to_24 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) { - if(value <= -1.f) - return 0; - if(value >= 1.f * 0x7f / 0x80) - return 0xFF; - return lrintf((value + 1.f) * 0x80); + while (count > 0) + { + WORD dest = le16(*(const WORD *)src); + BYTE *dest24 = dst; + + dest24[0] = dest / 256; + dest24[1] = dest; + dest24[2] = dest / 256; + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } } -static inline SHORT f_to_16(float value) +static void convert_16_to_32 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) { - if(value <= -1.f) - return 0x8000; - if(value >= 1.f * 0x7FFF / 0x8000) - return 0x7FFF; - return le16(lrintf(value * 0x8000)); + while (count > 0) + { + DWORD dest = *(const WORD *)src, *dest32 = dst; + *dest32 = dest * 65537; + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } } -static LONG f_to_24(float value) +static void convert_24_to_8 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) { - if(value <= -1.f) - return 0x80000000; - if(value >= 1.f * 0x7FFFFF / 0x800000) - return 0x7FFFFF00; - return lrintf(value * 0x80000000U); + while (count > 0) + { + BYTE *dst8 = dst; + *dst8 = ((const BYTE *)src)[2]; + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } } -static inline LONG f_to_32(float value) +static void convert_24_to_16 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) { - if(value <= -1.f) - return 0x80000000; - if(value >= 1.f * 0x7FFFFFFF / 0x80000000U) /* this rounds to 1.f */ - return 0x7FFFFFFF; - return le32(lrintf(value * 0x80000000U)); + while (count > 0) + { + WORD *dest16 = dst; + const BYTE *source = src; + *dest16 = le16(source[2] * 256 + source[1]); + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } } -void putieee32(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel, float value) +static void convert_24_to_24 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) { - BYTE *buf = (BYTE *)dsb->device->tmp_buffer; - float *fbuf = (float*)(buf + pos + sizeof(float) * channel); - *fbuf = value; + while (count > 0) + { + BYTE *dest24 = dst; + const BYTE *src24 = src; + + dest24[0] = src24[0]; + dest24[1] = src24[1]; + dest24[2] = src24[2]; + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } } -void put_mono2stereo(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel, float value) +static void convert_24_to_32 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) { - dsb->put_aux(dsb, pos, 0, value); - dsb->put_aux(dsb, pos, 1, value); + while (count > 0) + { + DWORD *dest32 = dst; + const BYTE *source = src; + *dest32 = le32(source[2] * 16777217 + source[1] * 65536 + source[0] * 256); + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } } -void mixieee32(float *src, float *dst, unsigned samples) +static void convert_32_to_8 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) { - TRACE("%p - %p %d\n", src, dst, samples); - while (samples--) - *(dst++) += *(src++); + while (count > 0) + { + BYTE *dst8 = dst; + *dst8 = (le32(*(const DWORD *)src) / 16777216); + *dst8 -= 0x80; + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } } -static void norm8(float *src, unsigned char *dst, unsigned len) +static void convert_32_to_16 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) +{ + while (count > 0) + { + WORD *dest16 = dst; + *dest16 = le16(le32(*(const DWORD *)src) / 65536); + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } +} + +static void convert_32_to_24 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) +{ + while (count > 0) + { + DWORD dest = le32(*(const DWORD *)src); + BYTE *dest24 = dst; + + dest24[0] = dest / 256; + dest24[1] = dest / 65536; + dest24[2] = dest / 16777216; + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } +} + +static void convert_32_to_32 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) +{ + while (count > 0) + { + DWORD *dest = dst; + *dest = *(const DWORD *)src; + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } +} + +static void convert_ieee_32_to_8 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) +{ + while (count > 0) + { + DWORD src_le = le32(*(DWORD *) src); + float v = *((float *) &src_le); + INT8 d = 0; + + if (v < -1.0f) + d = -128; + else if (v > 1.0f) + d = 127; + else + d = v * 127.5f - 0.5f; + + *(BYTE *) dst = d ^ 0x80; + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } +} + +static void convert_ieee_32_to_16 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) +{ + while (count > 0) + { + DWORD src_le = le32(*(DWORD *) src); + float v = *((float *) &src_le); + + INT16 *d = (INT16 *) dst; + + if (v < -1.0f) + *d = -32768; + else if (v > 1.0f) + *d = 32767; + else + *d = v * 32767.5f - 0.5f; + + *d = le16(*d); + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } +} + +static void convert_ieee_32_to_24 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) +{ + while (count > 0) + { + DWORD src_le = le32(*(DWORD *) src); + float v = *((float *) &src_le); + BYTE *dest24 = dst; + + if (v < -1.0f) + { + dest24[0] = 0; + dest24[1] = 0; + dest24[2] = 0x80; + } + else if (v > 1.0f) + { + dest24[0] = 0xff; + dest24[1] = 0xff; + dest24[2] = 0x7f; + } + else if (v < 0.0f) + { + dest24[0] = v * 8388608.0f; + dest24[1] = v * 32768.0f; + dest24[2] = v * 128.0f; + } + else if (v >= 0.0f) + { + dest24[0] = v * 8388608.0f; + dest24[1] = v * 32768.0f; + dest24[2] = v * 127.0f; + } + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } +} + +static void convert_ieee_32_to_32 (const void *src, void *dst, UINT src_stride, + UINT dst_stride, INT count, UINT freqAcc, UINT adj) +{ + while (count > 0) + { + DWORD src_le = le32(*(DWORD *) src); + float v = *((float *) &src_le); + INT32 *d = (INT32 *) dst; + + if (v < -1.0f) + *d = -2147483647 - 1; /* silence warning */ + else if (v > 1.0f) + *d = 2147483647; + else + *d = v * 2147483647.5f - 0.5f; + + *d = le32(*d); + + dst = (char *)dst + dst_stride; + src_advance(&src, src_stride, &count, &freqAcc, adj); + } +} + +const bitsconvertfunc convertbpp[5][4] = { + { convert_8_to_8, convert_8_to_16, convert_8_to_24, convert_8_to_32 }, + { convert_16_to_8, convert_16_to_16, convert_16_to_24, convert_16_to_32 }, + { convert_24_to_8, convert_24_to_16, convert_24_to_24, convert_24_to_32 }, + { convert_32_to_8, convert_32_to_16, convert_32_to_24, convert_32_to_32 }, + { convert_ieee_32_to_8, convert_ieee_32_to_16, convert_ieee_32_to_24, convert_ieee_32_to_32 }, +}; + +static void mix8(signed char *src, INT *dst, unsigned len) { TRACE("%p - %p %d\n", src, dst, len); while (len--) - { - *dst = f_to_8(*src); - ++dst; - ++src; - } + /* 8-bit WAV is unsigned, it's here converted to signed, normalize function will convert it back again */ + *(dst++) += (signed char)((BYTE)*(src++) - (BYTE)0x80); } -static void norm16(float *src, SHORT *dst, unsigned len) +static void mix16(SHORT *src, INT *dst, unsigned len) { TRACE("%p - %p %d\n", src, dst, len); len /= 2; while (len--) { - *dst = f_to_16(*src); - ++dst; - ++src; + *dst += le16(*src); + ++dst; ++src; } } -static void norm24(float *src, BYTE *dst, unsigned len) +static void mix24(BYTE *src, INT *dst, unsigned len) { TRACE("%p - %p %d\n", src, dst, len); len /= 3; while (len--) { - LONG t = f_to_24(*src); - dst[0] = (t >> 8) & 0xFF; - dst[1] = (t >> 16) & 0xFF; - dst[2] = t >> 24; - dst += 3; + DWORD field; + field = ((DWORD)src[2] << 16) + ((DWORD)src[1] << 8) + (DWORD)src[0]; + if (src[2] & 0x80) + field |= 0xFF000000U; + *(dst++) += field; ++src; } } -static void norm32(float *src, INT *dst, unsigned len) +static void mix32(INT *src, LONGLONG *dst, unsigned len) { TRACE("%p - %p %d\n", src, dst, len); len /= 4; + while (len--) + *(dst++) += le32(*(src++)); +} + +const mixfunc mixfunctions[4] = { + (mixfunc)mix8, + (mixfunc)mix16, + (mixfunc)mix24, + (mixfunc)mix32 +}; + +static void norm8(INT *src, signed char *dst, unsigned len) +{ + TRACE("%p - %p %d\n", src, dst, len); while (len--) { - *dst = f_to_32(*src); + *dst = (*src) + 0x80; + if (*src < -0x80) + *dst = 0; + else if (*src > 0x7f) + *dst = 0xff; ++dst; ++src; } } -static void normieee32(float *src, float *dst, unsigned len) +static void norm16(INT *src, SHORT *dst, unsigned len) { TRACE("%p - %p %d\n", src, dst, len); - len /= 4; + len /= 2; while (len--) { - if(*src > 1) - *dst = 1; - else if(*src < -1) - *dst = -1; + *dst = le16(*src); + if (*src <= -0x8000) + *dst = le16(0x8000); + else if (*src > 0x7fff) + *dst = le16(0x7fff); + ++dst; + ++src; + } +} + +static void norm24(INT *src, BYTE *dst, unsigned len) +{ + TRACE("%p - %p %d\n", src, dst, len); + len /= 3; + while (len--) + { + if (*src <= -0x800000) + { + dst[0] = 0; + dst[1] = 0; + dst[2] = 0x80; + } + else if (*src > 0x7fffff) + { + dst[0] = 0xff; + dst[1] = 0xff; + dst[2] = 0x7f; + } else - *dst = *src; + { + dst[0] = *src; + dst[1] = *src >> 8; + dst[2] = *src >> 16; + } ++dst; ++src; } } -const normfunc normfunctions[5] = { +static void norm32(LONGLONG *src, INT *dst, unsigned len) +{ + TRACE("%p - %p %d\n", src, dst, len); + len /= 4; + while (len--) + { + *dst = le32(*src); + if (*src <= -(LONGLONG)0x80000000) + *dst = le32(0x80000000); + else if (*src > 0x7fffffff) + *dst = le32(0x7fffffff); + ++dst; + ++src; + } +} + +const normfunc normfunctions[4] = { (normfunc)norm8, (normfunc)norm16, (normfunc)norm24, (normfunc)norm32, - (normfunc)normieee32 }; diff --git a/dll/directx/wine/dsound/dsound_main.c b/dll/directx/wine/dsound/dsound_main.c index c25418d480b..92103f0bb28 100644 --- a/dll/directx/wine/dsound/dsound_main.c +++ b/dll/directx/wine/dsound/dsound_main.c @@ -37,34 +37,48 @@ #include #include -struct list DSOUND_renderers = LIST_INIT(DSOUND_renderers); -CRITICAL_SECTION DSOUND_renderers_lock; -static CRITICAL_SECTION_DEBUG DSOUND_renderers_lock_debug = -{ - 0, 0, &DSOUND_renderers_lock, - { &DSOUND_renderers_lock_debug.ProcessLocksList, &DSOUND_renderers_lock_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": DSOUND_renderers_lock") } -}; -CRITICAL_SECTION DSOUND_renderers_lock = { &DSOUND_renderers_lock_debug, -1, 0, 0, 0, 0 }; - -struct list DSOUND_capturers = LIST_INIT(DSOUND_capturers); -CRITICAL_SECTION DSOUND_capturers_lock; -static CRITICAL_SECTION_DEBUG DSOUND_capturers_lock_debug = -{ - 0, 0, &DSOUND_capturers_lock, - { &DSOUND_capturers_lock_debug.ProcessLocksList, &DSOUND_capturers_lock_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": DSOUND_capturers_lock") } -}; -CRITICAL_SECTION DSOUND_capturers_lock = { &DSOUND_capturers_lock_debug, -1, 0, 0, 0, 0 }; - +DirectSoundDevice* DSOUND_renderer[MAXWAVEDRIVERS]; GUID DSOUND_renderer_guids[MAXWAVEDRIVERS]; GUID DSOUND_capture_guids[MAXWAVEDRIVERS]; -WCHAR wine_vxd_drv[] = { 'w','i','n','e','m','m','.','v','x','d', 0 }; +HRESULT mmErr(UINT err) +{ + switch(err) { + case MMSYSERR_NOERROR: + return DS_OK; + case MMSYSERR_ALLOCATED: + return DSERR_ALLOCATED; + case MMSYSERR_ERROR: + case MMSYSERR_INVALHANDLE: + case WAVERR_STILLPLAYING: + return DSERR_GENERIC; /* FIXME */ + case MMSYSERR_NODRIVER: + return DSERR_NODRIVER; + case MMSYSERR_NOMEM: + return DSERR_OUTOFMEMORY; + case MMSYSERR_INVALPARAM: + case WAVERR_BADFORMAT: + case WAVERR_UNPREPARED: + return DSERR_INVALIDPARAM; + case MMSYSERR_NOTSUPPORTED: + return DSERR_UNSUPPORTED; + default: + FIXME("Unknown MMSYS error %d\n",err); + return DSERR_GENERIC; + } +} /* All default settings, you most likely don't want to touch these, see wiki on UsefulRegistryKeys */ +int ds_emuldriver = 0; int ds_hel_buflen = 32768 * 2; int ds_snd_queue_max = 10; +int ds_snd_queue_min = 6; +int ds_snd_shadow_maxsize = 2; +int ds_hw_accel = DS_HW_ACCEL_FULL; +int ds_default_sample_rate = 44100; +int ds_default_bits_per_sample = 16; +static int ds_default_playback; +static int ds_default_capture; static HINSTANCE instance; /* @@ -114,18 +128,62 @@ void setup_dsound_options(void) /* get options */ + if (!get_config_key( hkey, appkey, "EmulDriver", buffer, MAX_PATH )) + ds_emuldriver = strcmp(buffer, "N"); + if (!get_config_key( hkey, appkey, "HelBuflen", buffer, MAX_PATH )) ds_hel_buflen = atoi(buffer); if (!get_config_key( hkey, appkey, "SndQueueMax", buffer, MAX_PATH )) ds_snd_queue_max = atoi(buffer); + if (!get_config_key( hkey, appkey, "SndQueueMin", buffer, MAX_PATH )) + ds_snd_queue_min = atoi(buffer); + + if (!get_config_key( hkey, appkey, "HardwareAcceleration", buffer, MAX_PATH )) { + if (strcmp(buffer, "Full") == 0) + ds_hw_accel = DS_HW_ACCEL_FULL; + else if (strcmp(buffer, "Standard") == 0) + ds_hw_accel = DS_HW_ACCEL_STANDARD; + else if (strcmp(buffer, "Basic") == 0) + ds_hw_accel = DS_HW_ACCEL_BASIC; + else if (strcmp(buffer, "Emulation") == 0) + ds_hw_accel = DS_HW_ACCEL_EMULATION; + } + + if (!get_config_key( hkey, appkey, "DefaultPlayback", buffer, MAX_PATH )) + ds_default_playback = atoi(buffer); + + if (!get_config_key( hkey, appkey, "MaxShadowSize", buffer, MAX_PATH )) + ds_snd_shadow_maxsize = atoi(buffer); + + if (!get_config_key( hkey, appkey, "DefaultCapture", buffer, MAX_PATH )) + ds_default_capture = atoi(buffer); + + if (!get_config_key( hkey, appkey, "DefaultSampleRate", buffer, MAX_PATH )) + ds_default_sample_rate = atoi(buffer); + + if (!get_config_key( hkey, appkey, "DefaultBitsPerSample", buffer, MAX_PATH )) + ds_default_bits_per_sample = atoi(buffer); if (appkey) RegCloseKey( appkey ); if (hkey) RegCloseKey( hkey ); + TRACE("ds_emuldriver = %d\n", ds_emuldriver); TRACE("ds_hel_buflen = %d\n", ds_hel_buflen); TRACE("ds_snd_queue_max = %d\n", ds_snd_queue_max); + TRACE("ds_snd_queue_min = %d\n", ds_snd_queue_min); + TRACE("ds_hw_accel = %s\n", + ds_hw_accel==DS_HW_ACCEL_FULL ? "Full" : + ds_hw_accel==DS_HW_ACCEL_STANDARD ? "Standard" : + ds_hw_accel==DS_HW_ACCEL_BASIC ? "Basic" : + ds_hw_accel==DS_HW_ACCEL_EMULATION ? "Emulation" : + "Unknown"); + TRACE("ds_default_playback = %d\n", ds_default_playback); + TRACE("ds_default_capture = %d\n", ds_default_playback); + TRACE("ds_default_sample_rate = %d\n", ds_default_sample_rate); + TRACE("ds_default_bits_per_sample = %d\n", ds_default_bits_per_sample); + TRACE("ds_snd_shadow_maxsize = %d\n", ds_snd_shadow_maxsize); } static const char * get_device_id(LPCGUID pGuid) @@ -141,64 +199,6 @@ static const char * get_device_id(LPCGUID pGuid) return debugstr_guid(pGuid); } -static HRESULT get_mmdevenum(IMMDeviceEnumerator **devenum) -{ - HRESULT hr, init_hr; - - init_hr = CoInitialize(NULL); - - hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, - CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, (void**)devenum); - if(FAILED(hr)){ - if(SUCCEEDED(init_hr)) - CoUninitialize(); - *devenum = NULL; - ERR("CoCreateInstance failed: %08x\n", hr); - return hr; - } - - return init_hr; -} - -static void release_mmdevenum(IMMDeviceEnumerator *devenum, HRESULT init_hr) -{ - IMMDeviceEnumerator_Release(devenum); - if(SUCCEEDED(init_hr)) - CoUninitialize(); -} - -static HRESULT get_mmdevice_guid(IMMDevice *device, IPropertyStore *ps, - GUID *guid) -{ - PROPVARIANT pv; - HRESULT hr; - - if(!ps){ - hr = IMMDevice_OpenPropertyStore(device, STGM_READ, &ps); - if(FAILED(hr)){ - WARN("OpenPropertyStore failed: %08x\n", hr); - return hr; - } - }else - IPropertyStore_AddRef(ps); - - PropVariantInit(&pv); - - hr = IPropertyStore_GetValue(ps, &PKEY_AudioEndpoint_GUID, &pv); - if(FAILED(hr)){ - IPropertyStore_Release(ps); - WARN("GetValue(GUID) failed: %08x\n", hr); - return hr; - } - - CLSIDFromString(pv.u.pwszVal, guid); - - PropVariantClear(&pv); - IPropertyStore_Release(ps); - - return S_OK; -} - /*************************************************************************** * GetDeviceID [DSOUND.9] * @@ -221,56 +221,34 @@ static HRESULT get_mmdevice_guid(IMMDevice *device, IPropertyStore *ps, */ HRESULT WINAPI GetDeviceID(LPCGUID pGuidSrc, LPGUID pGuidDest) { - IMMDeviceEnumerator *devenum; - EDataFlow flow = (EDataFlow)-1; - ERole role = (ERole)-1; - HRESULT hr, init_hr; - TRACE("(%s,%p)\n", get_device_id(pGuidSrc),pGuidDest); - if(!pGuidSrc || !pGuidDest) - return DSERR_INVALIDPARAM; - - init_hr = get_mmdevenum(&devenum); - if(!devenum) - return init_hr; - - if(IsEqualGUID(&DSDEVID_DefaultPlayback, pGuidSrc)){ - role = eMultimedia; - flow = eRender; - }else if(IsEqualGUID(&DSDEVID_DefaultVoicePlayback, pGuidSrc)){ - role = eCommunications; - flow = eRender; - }else if(IsEqualGUID(&DSDEVID_DefaultCapture, pGuidSrc)){ - role = eMultimedia; - flow = eCapture; - }else if(IsEqualGUID(&DSDEVID_DefaultVoiceCapture, pGuidSrc)){ - role = eCommunications; - flow = eCapture; + if ( pGuidSrc == NULL) { + WARN("invalid parameter: pGuidSrc == NULL\n"); + return DSERR_INVALIDPARAM; } - if(role != (ERole)-1 && flow != (EDataFlow)-1){ - IMMDevice *device; - - hr = IMMDeviceEnumerator_GetDefaultAudioEndpoint(devenum, - flow, role, &device); - if(FAILED(hr)){ - WARN("GetDefaultAudioEndpoint failed: %08x\n", hr); - release_mmdevenum(devenum, init_hr); - return DSERR_NODRIVER; - } - - hr = get_mmdevice_guid(device, NULL, pGuidDest); - IMMDevice_Release(device); - - release_mmdevenum(devenum, init_hr); - - return (hr == S_OK) ? DS_OK : hr; + if ( pGuidDest == NULL ) { + WARN("invalid parameter: pGuidDest == NULL\n"); + return DSERR_INVALIDPARAM; } - release_mmdevenum(devenum, init_hr); + if ( IsEqualGUID( &DSDEVID_DefaultPlayback, pGuidSrc ) || + IsEqualGUID( &DSDEVID_DefaultVoicePlayback, pGuidSrc ) ) { + *pGuidDest = DSOUND_renderer_guids[ds_default_playback]; + TRACE("returns %s\n", get_device_id(pGuidDest)); + return DS_OK; + } + + if ( IsEqualGUID( &DSDEVID_DefaultCapture, pGuidSrc ) || + IsEqualGUID( &DSDEVID_DefaultVoiceCapture, pGuidSrc ) ) { + *pGuidDest = DSOUND_capture_guids[ds_default_capture]; + TRACE("returns %s\n", get_device_id(pGuidDest)); + return DS_OK; + } *pGuidDest = *pGuidSrc; + TRACE("returns %s\n", get_device_id(pGuidDest)); return DS_OK; } @@ -322,187 +300,6 @@ HRESULT WINAPI DirectSoundEnumerateA( return DirectSoundEnumerateW(a_to_w_callback, &context); } -HRESULT get_mmdevice(EDataFlow flow, const GUID *tgt, IMMDevice **device) -{ - IMMDeviceEnumerator *devenum; - IMMDeviceCollection *coll; - UINT count, i; - HRESULT hr, init_hr; - - init_hr = get_mmdevenum(&devenum); - if(!devenum) - return init_hr; - - hr = IMMDeviceEnumerator_EnumAudioEndpoints(devenum, flow, - DEVICE_STATE_ACTIVE, &coll); - if(FAILED(hr)){ - WARN("EnumAudioEndpoints failed: %08x\n", hr); - release_mmdevenum(devenum, init_hr); - return hr; - } - - hr = IMMDeviceCollection_GetCount(coll, &count); - if(FAILED(hr)){ - IMMDeviceCollection_Release(coll); - release_mmdevenum(devenum, init_hr); - WARN("GetCount failed: %08x\n", hr); - return hr; - } - - for(i = 0; i < count; ++i){ - GUID guid; - - hr = IMMDeviceCollection_Item(coll, i, device); - if(FAILED(hr)) - continue; - - hr = get_mmdevice_guid(*device, NULL, &guid); - if(FAILED(hr)){ - IMMDevice_Release(*device); - continue; - } - - if(IsEqualGUID(&guid, tgt)){ - IMMDeviceCollection_Release(coll); - release_mmdevenum(devenum, init_hr); - return DS_OK; - } - - IMMDevice_Release(*device); - } - - WARN("No device with GUID %s found!\n", wine_dbgstr_guid(tgt)); - - IMMDeviceCollection_Release(coll); - release_mmdevenum(devenum, init_hr); - - return DSERR_INVALIDPARAM; -} - -static BOOL send_device(IMMDevice *device, GUID *guid, - LPDSENUMCALLBACKW cb, void *user) -{ - IPropertyStore *ps; - PROPVARIANT pv; - BOOL keep_going; - HRESULT hr; - - PropVariantInit(&pv); - - hr = IMMDevice_OpenPropertyStore(device, STGM_READ, &ps); - if(FAILED(hr)){ - WARN("OpenPropertyStore failed: %08x\n", hr); - return TRUE; - } - - hr = get_mmdevice_guid(device, ps, guid); - if(FAILED(hr)){ - IPropertyStore_Release(ps); - return TRUE; - } - - hr = IPropertyStore_GetValue(ps, - (const PROPERTYKEY *)&DEVPKEY_Device_FriendlyName, &pv); - if(FAILED(hr)){ - IPropertyStore_Release(ps); - WARN("GetValue(FriendlyName) failed: %08x\n", hr); - return TRUE; - } - - TRACE("Calling back with %s (%s)\n", wine_dbgstr_guid(guid), - wine_dbgstr_w(pv.u.pwszVal)); - - keep_going = cb(guid, pv.u.pwszVal, wine_vxd_drv, user); - - PropVariantClear(&pv); - IPropertyStore_Release(ps); - - return keep_going; -} - -/* S_FALSE means the callback returned FALSE at some point - * S_OK means the callback always returned TRUE */ -HRESULT enumerate_mmdevices(EDataFlow flow, GUID *guids, - LPDSENUMCALLBACKW cb, void *user) -{ - IMMDeviceEnumerator *devenum; - IMMDeviceCollection *coll; - IMMDevice *defdev = NULL; - UINT count, i, n; - BOOL keep_going; - HRESULT hr, init_hr; - - static const WCHAR primary_desc[] = {'P','r','i','m','a','r','y',' ', - 'S','o','u','n','d',' ','D','r','i','v','e','r',0}; - static const WCHAR empty_drv[] = {0}; - - init_hr = get_mmdevenum(&devenum); - if(!devenum) - return init_hr; - - hr = IMMDeviceEnumerator_EnumAudioEndpoints(devenum, flow, - DEVICE_STATE_ACTIVE, &coll); - if(FAILED(hr)){ - release_mmdevenum(devenum, init_hr); - WARN("EnumAudioEndpoints failed: %08x\n", hr); - return DS_OK; - } - - hr = IMMDeviceCollection_GetCount(coll, &count); - if(FAILED(hr)){ - IMMDeviceCollection_Release(coll); - release_mmdevenum(devenum, init_hr); - WARN("GetCount failed: %08x\n", hr); - return DS_OK; - } - - if(count == 0){ - release_mmdevenum(devenum, init_hr); - return DS_OK; - } - - TRACE("Calling back with NULL (%s)\n", wine_dbgstr_w(primary_desc)); - keep_going = cb(NULL, primary_desc, empty_drv, user); - - /* always send the default device first */ - if(keep_going){ - hr = IMMDeviceEnumerator_GetDefaultAudioEndpoint(devenum, flow, - eMultimedia, &defdev); - if(FAILED(hr)){ - defdev = NULL; - n = 0; - }else{ - keep_going = send_device(defdev, &guids[0], cb, user); - n = 1; - } - } - - for(i = 0; keep_going && i < count; ++i){ - IMMDevice *device; - - hr = IMMDeviceCollection_Item(coll, i, &device); - if(FAILED(hr)){ - WARN("Item failed: %08x\n", hr); - continue; - } - - if(device != defdev){ - send_device(device, &guids[n], cb, user); - ++n; - } - - IMMDevice_Release(device); - } - - if(defdev) - IMMDevice_Release(defdev); - IMMDeviceCollection_Release(coll); - - release_mmdevenum(devenum, init_hr); - - return (keep_going == TRUE) ? S_OK : S_FALSE; -} - /*************************************************************************** * DirectSoundEnumerateW [DSOUND.3] * @@ -520,20 +317,61 @@ HRESULT WINAPI DirectSoundEnumerateW( LPDSENUMCALLBACKW lpDSEnumCallback, LPVOID lpContext ) { - HRESULT hr; + unsigned devs, wod; + DSDRIVERDESC desc; + GUID guid; + int err; + WCHAR wDesc[MAXPNAMELEN]; + WCHAR wName[MAXPNAMELEN]; - TRACE("(%p,%p)\n", lpDSEnumCallback, lpContext); + TRACE("lpDSEnumCallback = %p, lpContext = %p\n", + lpDSEnumCallback, lpContext); if (lpDSEnumCallback == NULL) { - WARN("invalid parameter: lpDSEnumCallback == NULL\n"); - return DSERR_INVALIDPARAM; + WARN("invalid parameter: lpDSEnumCallback == NULL\n"); + return DSERR_INVALIDPARAM; } setup_dsound_options(); - hr = enumerate_mmdevices(eRender, DSOUND_renderer_guids, - lpDSEnumCallback, lpContext); - return SUCCEEDED(hr) ? DS_OK : hr; + devs = waveOutGetNumDevs(); + if (devs > 0) { + if (GetDeviceID(&DSDEVID_DefaultPlayback, &guid) == DS_OK) { + static const WCHAR empty[] = { 0 }; + for (wod = 0; wod < devs; ++wod) { + if (IsEqualGUID( &guid, &DSOUND_renderer_guids[wod] ) ) { + err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,ds_hw_accel)); + if (err == DS_OK) { + TRACE("calling lpDSEnumCallback(NULL,\"%s\",\"%s\",%p)\n", + "Primary Sound Driver",desc.szDrvname,lpContext); + MultiByteToWideChar( CP_ACP, 0, "Primary Sound Driver", -1, + wDesc, sizeof(wDesc)/sizeof(WCHAR) ); + if (lpDSEnumCallback(NULL, wDesc, empty, lpContext) == FALSE) + return DS_OK; + } + } + } + } + } + + for (wod = 0; wod < devs; ++wod) { + err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,ds_hw_accel)); + if (err == DS_OK) { + TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n", + debugstr_guid(&DSOUND_renderer_guids[wod]),desc.szDesc,desc.szDrvname,lpContext); + MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, + wDesc, sizeof(wDesc)/sizeof(WCHAR) ); + wDesc[(sizeof(wDesc)/sizeof(WCHAR)) - 1] = '\0'; + + MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, + wName, sizeof(wName)/sizeof(WCHAR) ); + wName[(sizeof(wName)/sizeof(WCHAR)) - 1] = '\0'; + + if (lpDSEnumCallback(&DSOUND_renderer_guids[wod], wDesc, wName, lpContext) == FALSE) + return DS_OK; + } + } + return DS_OK; } /*************************************************************************** @@ -584,20 +422,64 @@ DirectSoundCaptureEnumerateW( LPDSENUMCALLBACKW lpDSEnumCallback, LPVOID lpContext) { - HRESULT hr; + unsigned devs, wid; + DSDRIVERDESC desc; + GUID guid; + int err; + WCHAR wDesc[MAXPNAMELEN]; + WCHAR wName[MAXPNAMELEN]; TRACE("(%p,%p)\n", lpDSEnumCallback, lpContext ); if (lpDSEnumCallback == NULL) { - WARN("invalid parameter: lpDSEnumCallback == NULL\n"); + WARN("invalid parameter: lpDSEnumCallback == NULL\n"); return DSERR_INVALIDPARAM; } setup_dsound_options(); - hr = enumerate_mmdevices(eCapture, DSOUND_capture_guids, - lpDSEnumCallback, lpContext); - return SUCCEEDED(hr) ? DS_OK : hr; + devs = waveInGetNumDevs(); + if (devs > 0) { + if (GetDeviceID(&DSDEVID_DefaultCapture, &guid) == DS_OK) { + for (wid = 0; wid < devs; ++wid) { + if (IsEqualGUID( &guid, &DSOUND_capture_guids[wid] ) ) { + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,ds_hw_accel)); + if (err == DS_OK) { + TRACE("calling lpDSEnumCallback(NULL,\"%s\",\"%s\",%p)\n", + "Primary Sound Capture Driver",desc.szDrvname,lpContext); + MultiByteToWideChar( CP_ACP, 0, "Primary Sound Capture Driver", -1, + wDesc, sizeof(wDesc)/sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, + wName, sizeof(wName)/sizeof(WCHAR) ); + wName[(sizeof(wName)/sizeof(WCHAR)) - 1] = '\0'; + + if (lpDSEnumCallback(NULL, wDesc, wName, lpContext) == FALSE) + return DS_OK; + } + } + } + } + } + + for (wid = 0; wid < devs; ++wid) { + err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,ds_hw_accel)); + if (err == DS_OK) { + TRACE("calling lpDSEnumCallback(%s,\"%s\",\"%s\",%p)\n", + debugstr_guid(&DSOUND_capture_guids[wid]),desc.szDesc,desc.szDrvname,lpContext); + MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, + wDesc, sizeof(wDesc)/sizeof(WCHAR) ); + wDesc[(sizeof(wDesc)/sizeof(WCHAR)) - 1] = '\0'; + + MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, + wName, sizeof(wName)/sizeof(WCHAR) ); + wName[(sizeof(wName)/sizeof(WCHAR)) - 1] = '\0'; + + if (lpDSEnumCallback(&DSOUND_capture_guids[wid], wDesc, wName, lpContext) == FALSE) + return DS_OK; + } + } + + return DS_OK; } /******************************************************************************* @@ -618,7 +500,7 @@ static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) } static HRESULT WINAPI -DSCF_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj) +DSCF_QueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppobj) { IClassFactoryImpl *This = impl_from_IClassFactory(iface); TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppobj); @@ -628,7 +510,7 @@ DSCF_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj) IsEqualIID(riid, &IID_IClassFactory)) { *ppobj = iface; - IClassFactory_AddRef(iface); + IUnknown_AddRef(iface); return S_OK; } *ppobj = NULL; @@ -682,12 +564,12 @@ static const IClassFactoryVtbl DSCF_Vtbl = { }; static IClassFactoryImpl DSOUND_CF[] = { - { { &DSCF_Vtbl }, &CLSID_DirectSound, DSOUND_Create }, - { { &DSCF_Vtbl }, &CLSID_DirectSound8, DSOUND_Create8 }, - { { &DSCF_Vtbl }, &CLSID_DirectSoundCapture, DSOUND_CaptureCreate }, - { { &DSCF_Vtbl }, &CLSID_DirectSoundCapture8, DSOUND_CaptureCreate8 }, - { { &DSCF_Vtbl }, &CLSID_DirectSoundFullDuplex, DSOUND_FullDuplexCreate }, - { { &DSCF_Vtbl }, &CLSID_DirectSoundPrivate, IKsPrivatePropertySetImpl_Create }, + { { &DSCF_Vtbl }, &CLSID_DirectSound, (FnCreateInstance)DSOUND_Create }, + { { &DSCF_Vtbl }, &CLSID_DirectSound8, (FnCreateInstance)DSOUND_Create8 }, + { { &DSCF_Vtbl }, &CLSID_DirectSoundCapture, (FnCreateInstance)DSOUND_CaptureCreate }, + { { &DSCF_Vtbl }, &CLSID_DirectSoundCapture8, (FnCreateInstance)DSOUND_CaptureCreate8 }, + { { &DSCF_Vtbl }, &CLSID_DirectSoundFullDuplex, (FnCreateInstance)DSOUND_FullDuplexCreate }, + { { &DSCF_Vtbl }, &CLSID_DirectSoundPrivate, (FnCreateInstance)IKsPrivatePropertySetImpl_Create }, { { NULL }, NULL, NULL } }; @@ -765,11 +647,18 @@ HRESULT WINAPI DllCanUnloadNow(void) */ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved) { + int i; TRACE("(%p %d %p)\n", hInstDLL, fdwReason, lpvReserved); switch (fdwReason) { case DLL_PROCESS_ATTACH: TRACE("DLL_PROCESS_ATTACH\n"); + for (i = 0; i < MAXWAVEDRIVERS; i++) { + DSOUND_renderer[i] = NULL; + DSOUND_capture[i] = NULL; + INIT_GUID(DSOUND_renderer_guids[i], 0xbd6dd71a, 0x3deb, 0x11d1, 0xb1, 0x71, 0x00, 0xc0, 0x4f, 0xc2, 0x00, 0x00 + i); + INIT_GUID(DSOUND_capture_guids[i], 0xbd6dd71b, 0x3deb, 0x11d1, 0xb1, 0x71, 0x00, 0xc0, 0x4f, 0xc2, 0x00, 0x00 + i); + } instance = hInstDLL; DisableThreadLibraryCalls(hInstDLL); /* Increase refcount on dsound by 1 */ @@ -777,8 +666,6 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved) break; case DLL_PROCESS_DETACH: TRACE("DLL_PROCESS_DETACH\n"); - DeleteCriticalSection(&DSOUND_renderers_lock); - DeleteCriticalSection(&DSOUND_capturers_lock); break; default: TRACE("UNKNOWN REASON\n"); diff --git a/dll/directx/wine/dsound/dsound_private.h b/dll/directx/wine/dsound/dsound_private.h index 0b5fde9b82c..da80e58334d 100644 --- a/dll/directx/wine/dsound/dsound_private.h +++ b/dll/directx/wine/dsound/dsound_private.h @@ -42,13 +42,12 @@ #include #include #include -#include #include -#include +#include #include #include +#include #include -#include #include #include @@ -59,34 +58,48 @@ WINE_DEFAULT_DEBUG_CHANNEL(dsound); #define DS_TIME_RES 2 /* Resolution of multimedia timer */ #define DS_TIME_DEL 10 /* Delay of multimedia timer callback, and duration of HEL fragment */ +/* direct sound hardware acceleration levels */ +#define DS_HW_ACCEL_FULL 0 /* default on Windows 98 */ +#define DS_HW_ACCEL_STANDARD 1 /* default on Windows 2000 */ +#define DS_HW_ACCEL_BASIC 2 +#define DS_HW_ACCEL_EMULATION 3 + +extern int ds_emuldriver DECLSPEC_HIDDEN; extern int ds_hel_buflen DECLSPEC_HIDDEN; extern int ds_snd_queue_max DECLSPEC_HIDDEN; +extern int ds_snd_queue_min DECLSPEC_HIDDEN; +extern int ds_snd_shadow_maxsize DECLSPEC_HIDDEN; +extern int ds_hw_accel DECLSPEC_HIDDEN; +extern int ds_default_sample_rate DECLSPEC_HIDDEN; +extern int ds_default_bits_per_sample DECLSPEC_HIDDEN; /***************************************************************************** * Predeclare the interface implementation structures */ +typedef struct IDirectSoundImpl IDirectSoundImpl; +typedef struct IDirectSound_IUnknown IDirectSound_IUnknown; +typedef struct IDirectSound_IDirectSound IDirectSound_IDirectSound; +typedef struct IDirectSound8_IUnknown IDirectSound8_IUnknown; +typedef struct IDirectSound8_IDirectSound IDirectSound8_IDirectSound; +typedef struct IDirectSound8_IDirectSound8 IDirectSound8_IDirectSound8; typedef struct IDirectSoundBufferImpl IDirectSoundBufferImpl; +typedef struct IDirectSoundCaptureImpl IDirectSoundCaptureImpl; +typedef struct IDirectSoundCaptureBufferImpl IDirectSoundCaptureBufferImpl; +typedef struct IDirectSoundNotifyImpl IDirectSoundNotifyImpl; +typedef struct IDirectSoundCaptureNotifyImpl IDirectSoundCaptureNotifyImpl; +typedef struct IDirectSound3DListenerImpl IDirectSound3DListenerImpl; +typedef struct IDirectSound3DBufferImpl IDirectSound3DBufferImpl; +typedef struct IKsBufferPropertySetImpl IKsBufferPropertySetImpl; typedef struct DirectSoundDevice DirectSoundDevice; +typedef struct DirectSoundCaptureDevice DirectSoundCaptureDevice; /* dsound_convert.h */ -typedef float (*bitsgetfunc)(const IDirectSoundBufferImpl *, DWORD, DWORD); -typedef void (*bitsputfunc)(const IDirectSoundBufferImpl *, DWORD, DWORD, float); -extern const bitsgetfunc getbpp[5] DECLSPEC_HIDDEN; -void putieee32(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel, float value) DECLSPEC_HIDDEN; -void mixieee32(float *src, float *dst, unsigned samples) DECLSPEC_HIDDEN; +typedef void (*bitsconvertfunc)(const void *, void *, UINT, UINT, INT, UINT, UINT); +extern const bitsconvertfunc convertbpp[5][4] DECLSPEC_HIDDEN; +typedef void (*mixfunc)(const void *, void *, unsigned); +extern const mixfunc mixfunctions[4] DECLSPEC_HIDDEN; typedef void (*normfunc)(const void *, void *, unsigned); -extern const normfunc normfunctions[5] DECLSPEC_HIDDEN; - -typedef struct _DSVOLUMEPAN -{ - DWORD dwTotalLeftAmpFactor; - DWORD dwTotalRightAmpFactor; - LONG lVolume; - DWORD dwVolAmpFactor; - LONG lPan; - DWORD dwPanLeftAmpFactor; - DWORD dwPanRightAmpFactor; -} DSVOLUMEPAN,*PDSVOLUMEPAN; +extern const normfunc normfunctions[4] DECLSPEC_HIDDEN; /***************************************************************************** * IDirectSoundDevice implementation structure @@ -96,11 +109,16 @@ struct DirectSoundDevice LONG ref; GUID guid; - DSCAPS drvcaps; - DWORD priolevel, sleeptime; - PWAVEFORMATEX pwfx, primary_pwfx; - UINT playing_offs_bytes, in_mmdev_bytes, prebuf; + PIDSDRIVER driver; + DSDRIVERDESC drvdesc; + DSDRIVERCAPS drvcaps; + DWORD priolevel; + PWAVEFORMATEX pwfx; + HWAVEOUT hwo; + LPWAVEHDR pwave; + UINT timerID, pwplay, pwqueue, prebuf, helfrags; DWORD fraglen; + PIDSDRIVERBUFFER hwbuf; LPBYTE buffer; DWORD writelead, buflen, state, playpos, mixpos; int nrofbuffers; @@ -109,25 +127,18 @@ struct DirectSoundDevice CRITICAL_SECTION mixlock; IDirectSoundBufferImpl *primary; DWORD speaker_config; - float *mix_buffer, *tmp_buffer; + LPBYTE tmp_buffer, mix_buffer; DWORD tmp_buffer_len, mix_buffer_len; DSVOLUMEPAN volpan; + mixfunc mixfunction; normfunc normfunction; /* DirectSound3DListener fields */ + IDirectSound3DListenerImpl* listener; DS3DLISTENER ds3dl; BOOL ds3dl_need_recalc; - - IMMDevice *mmdevice; - IAudioClient *client; - IAudioClock *clock; - IAudioStreamVolume *volume; - IAudioRenderClient *render; - - HANDLE sleepev, thread; - struct list entry; }; /* reference counted buffer memory for duplicated buffer memory */ @@ -145,7 +156,10 @@ HRESULT DirectSoundDevice_Initialize( HRESULT DirectSoundDevice_AddBuffer( DirectSoundDevice * device, IDirectSoundBufferImpl * pDSB) DECLSPEC_HIDDEN; -void DirectSoundDevice_RemoveBuffer(DirectSoundDevice * device, IDirectSoundBufferImpl * pDSB) DECLSPEC_HIDDEN; +HRESULT DirectSoundDevice_RemoveBuffer( + DirectSoundDevice * device, + IDirectSoundBufferImpl * pDSB) DECLSPEC_HIDDEN; +HRESULT DirectSoundDevice_GetCaps(DirectSoundDevice * device, LPDSCAPS lpDSCaps) DECLSPEC_HIDDEN; HRESULT DirectSoundDevice_CreateSoundBuffer( DirectSoundDevice * device, LPCDSBUFFERDESC dsbd, @@ -156,6 +170,19 @@ HRESULT DirectSoundDevice_DuplicateSoundBuffer( DirectSoundDevice * device, LPDIRECTSOUNDBUFFER psb, LPLPDIRECTSOUNDBUFFER ppdsb) DECLSPEC_HIDDEN; +HRESULT DirectSoundDevice_SetCooperativeLevel( + DirectSoundDevice * devcie, + HWND hwnd, + DWORD level) DECLSPEC_HIDDEN; +HRESULT DirectSoundDevice_Compact(DirectSoundDevice * device) DECLSPEC_HIDDEN; +HRESULT DirectSoundDevice_GetSpeakerConfig( + DirectSoundDevice * device, + LPDWORD lpdwSpeakerConfig) DECLSPEC_HIDDEN; +HRESULT DirectSoundDevice_SetSpeakerConfig( + DirectSoundDevice * device, + DWORD config) DECLSPEC_HIDDEN; +HRESULT DirectSoundDevice_VerifyCertification(DirectSoundDevice * device, + LPDWORD pdwCertified) DECLSPEC_HIDDEN; /***************************************************************************** * IDirectSoundBuffer implementation structure @@ -163,74 +190,175 @@ HRESULT DirectSoundDevice_DuplicateSoundBuffer( struct IDirectSoundBufferImpl { IDirectSoundBuffer8 IDirectSoundBuffer8_iface; - IDirectSoundNotify IDirectSoundNotify_iface; - IDirectSound3DListener IDirectSound3DListener_iface; /* only primary buffer */ - IDirectSound3DBuffer IDirectSound3DBuffer_iface; /* only secondary buffer */ - IKsPropertySet IKsPropertySet_iface; LONG numIfaces; /* "in use interfaces" refcount */ - LONG ref, refn, ref3D, refiks; + LONG ref; /* IDirectSoundBufferImpl fields */ DirectSoundDevice* device; RTL_RWLOCK lock; + PIDSDRIVERBUFFER hwbuf; PWAVEFORMATEX pwfx; BufferMemory* buffer; + LPBYTE tmp_buffer; DWORD playflags,state,leadin; DWORD writelead,buflen; DWORD nAvgBytesPerSec; - DWORD freq; + DWORD freq, tmp_buffer_len, max_buffer_len; DSVOLUMEPAN volpan; DSBUFFERDESC dsbd; /* used for frequency conversion (PerfectPitch) */ - ULONG freqneeded; - DWORD firstep; - float freqAcc, freqAdjust, firgain; + ULONG freqneeded, freqAdjust, freqAcc, freqAccNext, resampleinmixer; /* used for mixing */ - DWORD sec_mixpos; + DWORD primary_mixpos, buf_mixpos, sec_mixpos; - /* IDirectSoundNotify fields */ + /* IDirectSoundNotifyImpl fields */ + IDirectSoundNotifyImpl* notify; LPDSBPOSITIONNOTIFY notifies; int nrofnotifies; + PIDSDRIVERNOTIFY hwnotify; + /* DirectSound3DBuffer fields */ + IDirectSound3DBufferImpl* ds3db; DS3DBUFFER ds3db_ds3db; LONG ds3db_lVolume; BOOL ds3db_need_recalc; - /* Used for bit depth conversion */ - int mix_channels; - bitsgetfunc get, get_aux; - bitsputfunc put, put_aux; + /* IKsPropertySet fields */ + IKsBufferPropertySetImpl* iks; + bitsconvertfunc convert; struct list entry; }; -float get_mono(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel) DECLSPEC_HIDDEN; -void put_mono2stereo(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel, float value) DECLSPEC_HIDDEN; - HRESULT IDirectSoundBufferImpl_Create( DirectSoundDevice *device, IDirectSoundBufferImpl **ppdsb, LPCDSBUFFERDESC dsbd) DECLSPEC_HIDDEN; +HRESULT IDirectSoundBufferImpl_Destroy( + IDirectSoundBufferImpl *pdsb) DECLSPEC_HIDDEN; HRESULT IDirectSoundBufferImpl_Duplicate( DirectSoundDevice *device, IDirectSoundBufferImpl **ppdsb, IDirectSoundBufferImpl *pdsb) DECLSPEC_HIDDEN; void secondarybuffer_destroy(IDirectSoundBufferImpl *This) DECLSPEC_HIDDEN; -const IDirectSound3DListenerVtbl ds3dlvt DECLSPEC_HIDDEN; -const IDirectSound3DBufferVtbl ds3dbvt DECLSPEC_HIDDEN; -const IKsPropertySetVtbl iksbvt DECLSPEC_HIDDEN; -HRESULT IKsPrivatePropertySetImpl_Create(REFIID riid, void **ppv) DECLSPEC_HIDDEN; +/***************************************************************************** + * DirectSoundCaptureDevice implementation structure + */ +struct DirectSoundCaptureDevice +{ + /* IDirectSoundCaptureImpl fields */ + GUID guid; + LONG ref; + + /* DirectSound driver stuff */ + PIDSCDRIVER driver; + DSDRIVERDESC drvdesc; + DSCDRIVERCAPS drvcaps; + PIDSCDRIVERBUFFER hwbuf; + + /* wave driver info */ + HWAVEIN hwi; + + /* more stuff */ + LPBYTE buffer; + DWORD buflen; + + PWAVEFORMATEX pwfx; + + IDirectSoundCaptureBufferImpl* capture_buffer; + DWORD state; + LPWAVEHDR pwave; + int nrofpwaves; + int index; + CRITICAL_SECTION lock; +}; + +/***************************************************************************** + * IDirectSoundCaptureBuffer implementation structure + */ +struct IDirectSoundCaptureBufferImpl +{ + /* IUnknown fields */ + const IDirectSoundCaptureBuffer8Vtbl *lpVtbl; + LONG ref; + + /* IDirectSoundCaptureBufferImpl fields */ + DirectSoundCaptureDevice* device; + /* FIXME: don't need this */ + LPDSCBUFFERDESC pdscbd; + DWORD flags; + + /* IDirectSoundCaptureNotifyImpl fields */ + IDirectSoundCaptureNotifyImpl* notify; + LPDSBPOSITIONNOTIFY notifies; + int nrofnotifies; + PIDSDRIVERNOTIFY hwnotify; +}; + +/***************************************************************************** + * IDirectSound3DListener implementation structure + */ +struct IDirectSound3DListenerImpl +{ + /* IUnknown fields */ + const IDirectSound3DListenerVtbl *lpVtbl; + LONG ref; + /* IDirectSound3DListenerImpl fields */ + DirectSoundDevice* device; +}; + +HRESULT IDirectSound3DListenerImpl_Create( + DirectSoundDevice *device, + IDirectSound3DListenerImpl **pdsl) DECLSPEC_HIDDEN; + +/***************************************************************************** + * IKsBufferPropertySet implementation structure + */ +struct IKsBufferPropertySetImpl +{ + /* IUnknown fields */ + const IKsPropertySetVtbl *lpVtbl; + LONG ref; + /* IKsPropertySetImpl fields */ + IDirectSoundBufferImpl* dsb; +}; + +HRESULT IKsBufferPropertySetImpl_Create( + IDirectSoundBufferImpl *dsb, + IKsBufferPropertySetImpl **piks) DECLSPEC_HIDDEN; +HRESULT IKsBufferPropertySetImpl_Destroy( + IKsBufferPropertySetImpl *piks) DECLSPEC_HIDDEN; + +HRESULT IKsPrivatePropertySetImpl_Create(REFIID riid, IKsPropertySet **piks) DECLSPEC_HIDDEN; + +/***************************************************************************** + * IDirectSound3DBuffer implementation structure + */ +struct IDirectSound3DBufferImpl +{ + /* IUnknown fields */ + const IDirectSound3DBufferVtbl *lpVtbl; + LONG ref; + /* IDirectSound3DBufferImpl fields */ + IDirectSoundBufferImpl* dsb; +}; + +HRESULT IDirectSound3DBufferImpl_Create( + IDirectSoundBufferImpl *dsb, + IDirectSound3DBufferImpl **pds3db) DECLSPEC_HIDDEN; +HRESULT IDirectSound3DBufferImpl_Destroy( + IDirectSound3DBufferImpl *pds3db) DECLSPEC_HIDDEN; /******************************************************************************* */ /* dsound.c */ -HRESULT DSOUND_Create(REFIID riid, void **ppv) DECLSPEC_HIDDEN; -HRESULT DSOUND_Create8(REFIID riid, void **ppv) DECLSPEC_HIDDEN; -HRESULT IDirectSoundImpl_Create(IUnknown *outer_unk, REFIID riid, void **ppv, BOOL has_ds8) DECLSPEC_HIDDEN; +HRESULT DSOUND_Create(REFIID riid, LPDIRECTSOUND *ppDS) DECLSPEC_HIDDEN; +HRESULT DSOUND_Create8(REFIID riid, LPDIRECTSOUND8 *ppDS) DECLSPEC_HIDDEN; /* primary.c */ +DWORD DSOUND_fraglen(DWORD nSamplesPerSec, DWORD nBlockAlign) DECLSPEC_HIDDEN; HRESULT DSOUND_PrimaryCreate(DirectSoundDevice *device) DECLSPEC_HIDDEN; HRESULT DSOUND_PrimaryDestroy(DirectSoundDevice *device) DECLSPEC_HIDDEN; HRESULT DSOUND_PrimaryPlay(DirectSoundDevice *device) DECLSPEC_HIDDEN; @@ -238,25 +366,26 @@ HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device) DECLSPEC_HIDDEN; HRESULT DSOUND_PrimaryGetPosition(DirectSoundDevice *device, LPDWORD playpos, LPDWORD writepos) DECLSPEC_HIDDEN; LPWAVEFORMATEX DSOUND_CopyFormat(LPCWAVEFORMATEX wfex) DECLSPEC_HIDDEN; HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) DECLSPEC_HIDDEN; -HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device) DECLSPEC_HIDDEN; HRESULT primarybuffer_create(DirectSoundDevice *device, IDirectSoundBufferImpl **ppdsb, const DSBUFFERDESC *dsbd) DECLSPEC_HIDDEN; void primarybuffer_destroy(IDirectSoundBufferImpl *This) DECLSPEC_HIDDEN; HRESULT primarybuffer_SetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex) DECLSPEC_HIDDEN; -LONG capped_refcount_dec(LONG *ref) DECLSPEC_HIDDEN; /* duplex.c */ - -HRESULT DSOUND_FullDuplexCreate(REFIID riid, void **ppv) DECLSPEC_HIDDEN; + +HRESULT DSOUND_FullDuplexCreate(REFIID riid, LPDIRECTSOUNDFULLDUPLEX* ppDSFD) DECLSPEC_HIDDEN; /* mixer.c */ +DWORD DSOUND_bufpos_to_mixpos(const DirectSoundDevice* device, DWORD pos) DECLSPEC_HIDDEN; void DSOUND_CheckEvent(const IDirectSoundBufferImpl *dsb, DWORD playpos, int len) DECLSPEC_HIDDEN; void DSOUND_RecalcVolPan(PDSVOLUMEPAN volpan) DECLSPEC_HIDDEN; void DSOUND_AmpFactorToVolPan(PDSVOLUMEPAN volpan) DECLSPEC_HIDDEN; void DSOUND_RecalcFormat(IDirectSoundBufferImpl *dsb) DECLSPEC_HIDDEN; -DWORD DSOUND_secpos_to_bufpos(const IDirectSoundBufferImpl *dsb, DWORD secpos, DWORD secmixpos, float *overshot) DECLSPEC_HIDDEN; +void DSOUND_MixToTemporary(const IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD mixlen, BOOL inmixer) DECLSPEC_HIDDEN; +DWORD DSOUND_secpos_to_bufpos(const IDirectSoundBufferImpl *dsb, DWORD secpos, DWORD secmixpos, DWORD* overshot) DECLSPEC_HIDDEN; -DWORD CALLBACK DSOUND_mixthread(void *ptr) DECLSPEC_HIDDEN; +void CALLBACK DSOUND_timer(UINT timerID, UINT msg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2) DECLSPEC_HIDDEN; +void CALLBACK DSOUND_callback(HWAVEOUT hwo, UINT msg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2) DECLSPEC_HIDDEN; /* sound3d.c */ @@ -264,9 +393,8 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb) DECLSPEC_HIDDEN; /* capture.c */ -HRESULT DSOUND_CaptureCreate(REFIID riid, void **ppv) DECLSPEC_HIDDEN; -HRESULT DSOUND_CaptureCreate8(REFIID riid, void **ppv) DECLSPEC_HIDDEN; -HRESULT IDirectSoundCaptureImpl_Create(IUnknown *outer_unk, REFIID riid, void **ppv, BOOL has_dsc8) DECLSPEC_HIDDEN; +HRESULT DSOUND_CaptureCreate(REFIID riid, LPDIRECTSOUNDCAPTURE *ppDSC) DECLSPEC_HIDDEN; +HRESULT DSOUND_CaptureCreate8(REFIID riid, LPDIRECTSOUNDCAPTURE8 *ppDSC8) DECLSPEC_HIDDEN; #define STATE_STOPPED 0 #define STATE_STARTING 1 @@ -274,24 +402,16 @@ HRESULT IDirectSoundCaptureImpl_Create(IUnknown *outer_unk, REFIID riid, void ** #define STATE_CAPTURING 2 #define STATE_STOPPING 3 -extern CRITICAL_SECTION DSOUND_renderers_lock DECLSPEC_HIDDEN; -extern CRITICAL_SECTION DSOUND_capturers_lock DECLSPEC_HIDDEN; -extern struct list DSOUND_capturers DECLSPEC_HIDDEN; -extern struct list DSOUND_renderers DECLSPEC_HIDDEN; +#define DSOUND_FREQSHIFT (20) +extern DirectSoundDevice* DSOUND_renderer[MAXWAVEDRIVERS] DECLSPEC_HIDDEN; extern GUID DSOUND_renderer_guids[MAXWAVEDRIVERS] DECLSPEC_HIDDEN; + +extern DirectSoundCaptureDevice * DSOUND_capture[MAXWAVEDRIVERS] DECLSPEC_HIDDEN; extern GUID DSOUND_capture_guids[MAXWAVEDRIVERS] DECLSPEC_HIDDEN; -extern WCHAR wine_vxd_drv[] DECLSPEC_HIDDEN; - +HRESULT mmErr(UINT err) DECLSPEC_HIDDEN; void setup_dsound_options(void) DECLSPEC_HIDDEN; - -HRESULT get_mmdevice(EDataFlow flow, const GUID *tgt, IMMDevice **device) DECLSPEC_HIDDEN; - -BOOL DSOUND_check_supported(IAudioClient *client, DWORD rate, - DWORD depth, WORD channels) DECLSPEC_HIDDEN; -UINT DSOUND_create_timer(LPTIMECALLBACK cb, DWORD_PTR user) DECLSPEC_HIDDEN; -HRESULT enumerate_mmdevices(EDataFlow flow, GUID *guids, - LPDSENUMCALLBACKW cb, void *user) DECLSPEC_HIDDEN; +const char * dumpCooperativeLevel(DWORD level) DECLSPEC_HIDDEN; #endif /* _DSOUND_PRIVATE_H_ */ diff --git a/dll/directx/wine/dsound/duplex.c b/dll/directx/wine/dsound/duplex.c index 8e1b9fe58e4..dbee1b16ba6 100644 --- a/dll/directx/wine/dsound/duplex.c +++ b/dll/directx/wine/dsound/duplex.c @@ -27,230 +27,567 @@ */ typedef struct IDirectSoundFullDuplexImpl { - IUnknown IUnknown_iface; - IDirectSoundFullDuplex IDirectSoundFullDuplex_iface; - LONG ref, refdsfd, numIfaces; - IUnknown *ds8_unk; /* Aggregated IDirectSound8 */ - IUnknown *dsc8_unk; /* Aggregated IDirectSoundCapture8 */ + /* IUnknown fields */ + const IDirectSoundFullDuplexVtbl *lpVtbl; + LONG ref; + + /* IDirectSoundFullDuplexImpl fields */ + IDirectSound8 *renderer_device; + IDirectSoundCapture *capture_device; + + LPUNKNOWN pUnknown; + LPDIRECTSOUND8 pDS8; + LPDIRECTSOUNDCAPTURE pDSC; } IDirectSoundFullDuplexImpl; -static void fullduplex_destroy(IDirectSoundFullDuplexImpl *This) -{ - IDirectSound8 *ds8; - IDirectSoundCapture8 *dsc8; +typedef struct IDirectSoundFullDuplex_IUnknown { + const IUnknownVtbl *lpVtbl; + LONG ref; + IDirectSoundFullDuplexImpl *pdsfd; +} IDirectSoundFullDuplex_IUnknown; - if (This->ds8_unk) { - IUnknown_QueryInterface(This->ds8_unk, &IID_IDirectSound8, (void**)&ds8); - while(IDirectSound8_Release(ds8) > 0); - IUnknown_Release(This->ds8_unk); +typedef struct IDirectSoundFullDuplex_IDirectSound8 { + const IDirectSound8Vtbl *lpVtbl; + LONG ref; + IDirectSoundFullDuplexImpl *pdsfd; +} IDirectSoundFullDuplex_IDirectSound8; + +typedef struct IDirectSoundFullDuplex_IDirectSoundCapture { + const IDirectSoundCaptureVtbl *lpVtbl; + LONG ref; + IDirectSoundFullDuplexImpl *pdsfd; +} IDirectSoundFullDuplex_IDirectSoundCapture; + +/******************************************************************************* + * IUnknown + */ +static HRESULT WINAPI IDirectSoundFullDuplex_IUnknown_QueryInterface( + LPUNKNOWN iface, + REFIID riid, + LPVOID * ppobj) +{ + IDirectSoundFullDuplex_IUnknown *This = (IDirectSoundFullDuplex_IUnknown *)iface; + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); + return IDirectSoundFullDuplex_QueryInterface((LPDIRECTSOUNDFULLDUPLEX)This->pdsfd, riid, ppobj); +} + +static ULONG WINAPI IDirectSoundFullDuplex_IUnknown_AddRef( + LPUNKNOWN iface) +{ + IDirectSoundFullDuplex_IUnknown *This = (IDirectSoundFullDuplex_IUnknown *)iface; + ULONG ref = InterlockedIncrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref - 1); + return ref; +} + +static ULONG WINAPI IDirectSoundFullDuplex_IUnknown_Release( + LPUNKNOWN iface) +{ + IDirectSoundFullDuplex_IUnknown *This = (IDirectSoundFullDuplex_IUnknown *)iface; + ULONG ref = InterlockedDecrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref + 1); + if (!ref) { + This->pdsfd->pUnknown = NULL; + HeapFree(GetProcessHeap(), 0, This); + TRACE("(%p) released\n", This); } - if (This->dsc8_unk) { - IUnknown_QueryInterface(This->dsc8_unk, &IID_IDirectSoundCapture8, (void**)&dsc8); - while(IDirectSoundCapture_Release(dsc8) > 0); - IUnknown_Release(This->dsc8_unk); + return ref; +} + +static const IUnknownVtbl DirectSoundFullDuplex_Unknown_Vtbl = +{ + IDirectSoundFullDuplex_IUnknown_QueryInterface, + IDirectSoundFullDuplex_IUnknown_AddRef, + IDirectSoundFullDuplex_IUnknown_Release +}; + +static HRESULT IDirectSoundFullDuplex_IUnknown_Create( + LPDIRECTSOUNDFULLDUPLEX pdsfd, + LPUNKNOWN * ppunk) +{ + IDirectSoundFullDuplex_IUnknown * pdsfdunk; + TRACE("(%p,%p)\n",pdsfd,ppunk); + + if (pdsfd == NULL) { + ERR("invalid parameter: pdsfd == NULL\n"); + return DSERR_INVALIDPARAM; } - HeapFree(GetProcessHeap(), 0, This); - TRACE("(%p) released\n", This); + + if (ppunk == NULL) { + ERR("invalid parameter: ppunk == NULL\n"); + return DSERR_INVALIDPARAM; + } + + pdsfdunk = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsfdunk)); + if (pdsfdunk == NULL) { + WARN("out of memory\n"); + *ppunk = NULL; + return DSERR_OUTOFMEMORY; + } + + pdsfdunk->lpVtbl = &DirectSoundFullDuplex_Unknown_Vtbl; + pdsfdunk->ref = 0; + pdsfdunk->pdsfd = (IDirectSoundFullDuplexImpl *)pdsfd; + + *ppunk = (LPUNKNOWN)pdsfdunk; + + return DS_OK; } /******************************************************************************* - * IUnknown implemetation for DirectSoundFullDuplex + * IDirectSoundFullDuplex_IDirectSound8 */ -static inline IDirectSoundFullDuplexImpl *impl_from_IUnknown(IUnknown *iface) +static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_QueryInterface( + LPDIRECTSOUND8 iface, + REFIID riid, + LPVOID * ppobj) { - return CONTAINING_RECORD(iface, IDirectSoundFullDuplexImpl, IUnknown_iface); + IDirectSoundFullDuplex_IDirectSound8 *This = (IDirectSoundFullDuplex_IDirectSound8 *)iface; + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); + return IDirectSoundFullDuplex_QueryInterface((LPDIRECTSOUNDFULLDUPLEX)This->pdsfd, riid, ppobj); } -static HRESULT WINAPI IUnknownImpl_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) +static ULONG WINAPI IDirectSoundFullDuplex_IDirectSound8_AddRef( + LPDIRECTSOUND8 iface) { - IDirectSoundFullDuplexImpl *This = impl_from_IUnknown(iface); + IDirectSoundFullDuplex_IDirectSound8 *This = (IDirectSoundFullDuplex_IDirectSound8 *)iface; + ULONG ref = InterlockedIncrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref - 1); + return ref; +} - TRACE("(%p,%s,%p)\n", This, debugstr_guid(riid), ppv); +static ULONG WINAPI IDirectSoundFullDuplex_IDirectSound8_Release( + LPDIRECTSOUND8 iface) +{ + IDirectSoundFullDuplex_IDirectSound8 *This = (IDirectSoundFullDuplex_IDirectSound8 *)iface; + ULONG ref = InterlockedDecrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref + 1); + if (!ref) { + This->pdsfd->pDS8 = NULL; + HeapFree(GetProcessHeap(), 0, This); + TRACE("(%p) released\n", This); + } + return ref; +} - if (!ppv) { - WARN("invalid parameter\n"); - return E_INVALIDARG; +static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_CreateSoundBuffer( + LPDIRECTSOUND8 iface, + LPCDSBUFFERDESC dsbd, + LPLPDIRECTSOUNDBUFFER ppdsb, + LPUNKNOWN lpunk) +{ + IDirectSoundFullDuplex_IDirectSound8 *This = (IDirectSoundFullDuplex_IDirectSound8 *)iface; + TRACE("(%p,%p,%p,%p)\n",This,dsbd,ppdsb,lpunk); + return IDirectSound8_CreateSoundBuffer(This->pdsfd->renderer_device,dsbd,ppdsb,lpunk); +} + +static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_GetCaps( + LPDIRECTSOUND8 iface, + LPDSCAPS lpDSCaps) +{ + IDirectSoundFullDuplex_IDirectSound8 *This = (IDirectSoundFullDuplex_IDirectSound8 *)iface; + TRACE("(%p,%p)\n",This,lpDSCaps); + return IDirectSound8_GetCaps(This->pdsfd->renderer_device, lpDSCaps); +} + +static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_DuplicateSoundBuffer( + LPDIRECTSOUND8 iface, + LPDIRECTSOUNDBUFFER psb, + LPLPDIRECTSOUNDBUFFER ppdsb) +{ + IDirectSoundFullDuplex_IDirectSound8 *This = (IDirectSoundFullDuplex_IDirectSound8 *)iface; + TRACE("(%p,%p,%p)\n",This,psb,ppdsb); + return IDirectSound8_DuplicateSoundBuffer(This->pdsfd->renderer_device,psb,ppdsb); +} + +static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_SetCooperativeLevel( + LPDIRECTSOUND8 iface, + HWND hwnd, + DWORD level) +{ + IDirectSoundFullDuplex_IDirectSound8 *This = (IDirectSoundFullDuplex_IDirectSound8 *)iface; + TRACE("(%p,%p,%s)\n",This,hwnd,dumpCooperativeLevel(level)); + return IDirectSound8_SetCooperativeLevel(This->pdsfd->renderer_device,hwnd,level); +} + +static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_Compact( + LPDIRECTSOUND8 iface) +{ + IDirectSoundFullDuplex_IDirectSound8 *This = (IDirectSoundFullDuplex_IDirectSound8 *)iface; + TRACE("(%p)\n", This); + return IDirectSound8_Compact(This->pdsfd->renderer_device); +} + +static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_GetSpeakerConfig( + LPDIRECTSOUND8 iface, + LPDWORD lpdwSpeakerConfig) +{ + IDirectSoundFullDuplex_IDirectSound8 *This = (IDirectSoundFullDuplex_IDirectSound8 *)iface; + TRACE("(%p, %p)\n", This, lpdwSpeakerConfig); + return IDirectSound8_GetSpeakerConfig(This->pdsfd->renderer_device,lpdwSpeakerConfig); +} + +static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_SetSpeakerConfig( + LPDIRECTSOUND8 iface, + DWORD config) +{ + IDirectSoundFullDuplex_IDirectSound8 *This = (IDirectSoundFullDuplex_IDirectSound8 *)iface; + TRACE("(%p,0x%08x)\n",This,config); + return IDirectSound8_SetSpeakerConfig(This->pdsfd->renderer_device,config); +} + +static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_Initialize( + LPDIRECTSOUND8 iface, + LPCGUID lpcGuid) +{ + IDirectSoundFullDuplex_IDirectSound8 *This = (IDirectSoundFullDuplex_IDirectSound8 *)iface; + TRACE("(%p, %s)\n", This, debugstr_guid(lpcGuid)); + return IDirectSound8_Initialize(This->pdsfd->renderer_device,lpcGuid); +} + +static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_VerifyCertification( + LPDIRECTSOUND8 iface, + DWORD *cert) +{ + IDirectSoundFullDuplex_IDirectSound8 *This = (IDirectSoundFullDuplex_IDirectSound8 *)iface; + TRACE("(%p, %p)\n", This, cert); + return IDirectSound8_VerifyCertification(This->pdsfd->renderer_device,cert); +} + +static const IDirectSound8Vtbl DirectSoundFullDuplex_DirectSound8_Vtbl = +{ + IDirectSoundFullDuplex_IDirectSound8_QueryInterface, + IDirectSoundFullDuplex_IDirectSound8_AddRef, + IDirectSoundFullDuplex_IDirectSound8_Release, + IDirectSoundFullDuplex_IDirectSound8_CreateSoundBuffer, + IDirectSoundFullDuplex_IDirectSound8_GetCaps, + IDirectSoundFullDuplex_IDirectSound8_DuplicateSoundBuffer, + IDirectSoundFullDuplex_IDirectSound8_SetCooperativeLevel, + IDirectSoundFullDuplex_IDirectSound8_Compact, + IDirectSoundFullDuplex_IDirectSound8_GetSpeakerConfig, + IDirectSoundFullDuplex_IDirectSound8_SetSpeakerConfig, + IDirectSoundFullDuplex_IDirectSound8_Initialize, + IDirectSoundFullDuplex_IDirectSound8_VerifyCertification +}; + +static HRESULT IDirectSoundFullDuplex_IDirectSound8_Create( + LPDIRECTSOUNDFULLDUPLEX pdsfd, + LPDIRECTSOUND8 * ppds8) +{ + IDirectSoundFullDuplex_IDirectSound8 * pdsfdds8; + TRACE("(%p,%p)\n",pdsfd,ppds8); + + if (pdsfd == NULL) { + ERR("invalid parameter: pdsfd == NULL\n"); + return DSERR_INVALIDPARAM; } + if (ppds8 == NULL) { + ERR("invalid parameter: ppds8 == NULL\n"); + return DSERR_INVALIDPARAM; + } + + if (((IDirectSoundFullDuplexImpl*)pdsfd)->renderer_device == NULL) { + WARN("not initialized\n"); + *ppds8 = NULL; + return DSERR_UNINITIALIZED; + } + + pdsfdds8 = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsfdds8)); + if (pdsfdds8 == NULL) { + WARN("out of memory\n"); + *ppds8 = NULL; + return DSERR_OUTOFMEMORY; + } + + pdsfdds8->lpVtbl = &DirectSoundFullDuplex_DirectSound8_Vtbl; + pdsfdds8->ref = 0; + pdsfdds8->pdsfd = (IDirectSoundFullDuplexImpl *)pdsfd; + + *ppds8 = (LPDIRECTSOUND8)pdsfdds8; + + return DS_OK; +} + +/******************************************************************************* + * IDirectSoundFullDuplex_IDirectSoundCapture + */ +static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_QueryInterface( + LPDIRECTSOUNDCAPTURE iface, + REFIID riid, + LPVOID * ppobj) +{ + IDirectSoundFullDuplex_IDirectSoundCapture *This = (IDirectSoundFullDuplex_IDirectSoundCapture *)iface; + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); + return IDirectSoundFullDuplex_QueryInterface((LPDIRECTSOUNDFULLDUPLEX)This->pdsfd, riid, ppobj); +} + +static ULONG WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_AddRef( + LPDIRECTSOUNDCAPTURE iface) +{ + IDirectSoundFullDuplex_IDirectSoundCapture *This = (IDirectSoundFullDuplex_IDirectSoundCapture *)iface; + ULONG ref = InterlockedIncrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref - 1); + return ref; +} + +static ULONG WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_Release( + LPDIRECTSOUNDCAPTURE iface) +{ + IDirectSoundFullDuplex_IDirectSoundCapture *This = (IDirectSoundFullDuplex_IDirectSoundCapture *)iface; + ULONG ref = InterlockedDecrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref + 1); + if (!ref) { + This->pdsfd->pDSC = NULL; + HeapFree(GetProcessHeap(), 0, This); + TRACE("(%p) released\n", This); + } + return ref; +} + +static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_CreateCaptureBuffer( + LPDIRECTSOUNDCAPTURE iface, + LPCDSCBUFFERDESC lpcDSCBufferDesc, + LPDIRECTSOUNDCAPTUREBUFFER* lplpDSCaptureBuffer, + LPUNKNOWN pUnk) +{ + IDirectSoundFullDuplex_IDirectSoundCapture *This = (IDirectSoundFullDuplex_IDirectSoundCapture *)iface; + TRACE("(%p,%p,%p,%p)\n",This,lpcDSCBufferDesc,lplpDSCaptureBuffer,pUnk); + return IDirectSoundCapture_CreateCaptureBuffer(This->pdsfd->capture_device,lpcDSCBufferDesc,lplpDSCaptureBuffer,pUnk); +} + +static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_GetCaps( + LPDIRECTSOUNDCAPTURE iface, + LPDSCCAPS lpDSCCaps) +{ + IDirectSoundFullDuplex_IDirectSoundCapture *This = (IDirectSoundFullDuplex_IDirectSoundCapture *)iface; + TRACE("(%p,%p)\n",This,lpDSCCaps); + return IDirectSoundCapture_GetCaps(This->pdsfd->capture_device, lpDSCCaps); +} + +static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_Initialize( + LPDIRECTSOUNDCAPTURE iface, + LPCGUID lpcGUID) +{ + IDirectSoundFullDuplex_IDirectSoundCapture *This = (IDirectSoundFullDuplex_IDirectSoundCapture *)iface; + TRACE("(%p, %s)\n", This, debugstr_guid(lpcGUID)); + return IDirectSoundCapture_Initialize(This->pdsfd->capture_device,lpcGUID); +} + +static const IDirectSoundCaptureVtbl DirectSoundFullDuplex_DirectSoundCapture_Vtbl = +{ + IDirectSoundFullDuplex_IDirectSoundCapture_QueryInterface, + IDirectSoundFullDuplex_IDirectSoundCapture_AddRef, + IDirectSoundFullDuplex_IDirectSoundCapture_Release, + IDirectSoundFullDuplex_IDirectSoundCapture_CreateCaptureBuffer, + IDirectSoundFullDuplex_IDirectSoundCapture_GetCaps, + IDirectSoundFullDuplex_IDirectSoundCapture_Initialize +}; + +static HRESULT IDirectSoundFullDuplex_IDirectSoundCapture_Create( + LPDIRECTSOUNDFULLDUPLEX pdsfd, + LPDIRECTSOUNDCAPTURE8 * ppdsc8) +{ + IDirectSoundFullDuplex_IDirectSoundCapture * pdsfddsc; + TRACE("(%p,%p)\n",pdsfd,ppdsc8); + + if (pdsfd == NULL) { + ERR("invalid parameter: pdsfd == NULL\n"); + return DSERR_INVALIDPARAM; + } + + if (ppdsc8 == NULL) { + ERR("invalid parameter: ppdsc8 == NULL\n"); + return DSERR_INVALIDPARAM; + } + + if (((IDirectSoundFullDuplexImpl*)pdsfd)->capture_device == NULL) { + WARN("not initialized\n"); + *ppdsc8 = NULL; + return DSERR_UNINITIALIZED; + } + + pdsfddsc = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsfddsc)); + if (pdsfddsc == NULL) { + WARN("out of memory\n"); + *ppdsc8 = NULL; + return DSERR_OUTOFMEMORY; + } + + pdsfddsc->lpVtbl = &DirectSoundFullDuplex_DirectSoundCapture_Vtbl; + pdsfddsc->ref = 0; + pdsfddsc->pdsfd = (IDirectSoundFullDuplexImpl *)pdsfd; + + *ppdsc8 = (LPDIRECTSOUNDCAPTURE)pdsfddsc; + + return DS_OK; +} + +/*************************************************************************** + * IDirectSoundFullDuplexImpl + */ +static ULONG WINAPI +IDirectSoundFullDuplexImpl_AddRef( LPDIRECTSOUNDFULLDUPLEX iface ) +{ + IDirectSoundFullDuplexImpl *This = (IDirectSoundFullDuplexImpl *)iface; + ULONG ref = InterlockedIncrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref - 1); + return ref; +} + +static HRESULT WINAPI +IDirectSoundFullDuplexImpl_QueryInterface( + LPDIRECTSOUNDFULLDUPLEX iface, + REFIID riid, + LPVOID* ppobj ) +{ + IDirectSoundFullDuplexImpl *This = (IDirectSoundFullDuplexImpl *)iface; + TRACE( "(%p,%s,%p)\n", This, debugstr_guid(riid), ppobj ); + + if (ppobj == NULL) { + WARN("invalid parameter\n"); + return E_INVALIDARG; + } + + *ppobj = NULL; + if (IsEqualIID(riid, &IID_IUnknown)) { - IUnknown_AddRef(&This->IUnknown_iface); - *ppv = &This->IUnknown_iface; + if (!This->pUnknown) { + IDirectSoundFullDuplex_IUnknown_Create(iface, &This->pUnknown); + if (!This->pUnknown) { + WARN("IDirectSoundFullDuplex_IUnknown_Create() failed\n"); + *ppobj = NULL; + return E_NOINTERFACE; + } + } + IDirectSoundFullDuplex_IUnknown_AddRef(This->pUnknown); + *ppobj = This->pUnknown; return S_OK; } else if (IsEqualIID(riid, &IID_IDirectSoundFullDuplex)) { - IDirectSoundFullDuplex_AddRef(&This->IDirectSoundFullDuplex_iface); - *ppv = &This->IDirectSoundFullDuplex_iface; + IDirectSoundFullDuplexImpl_AddRef(iface); + *ppobj = This; return S_OK; - } else if (This->ds8_unk && (IsEqualIID(riid, &IID_IDirectSound) || - IsEqualIID(riid, &IID_IDirectSound8))) - return IUnknown_QueryInterface(This->ds8_unk, riid, ppv); - else if (This->dsc8_unk && IsEqualIID(riid, &IID_IDirectSoundCapture)) - return IUnknown_QueryInterface(This->dsc8_unk, riid, ppv); + } else if (IsEqualIID(riid, &IID_IDirectSound) + || IsEqualIID(riid, &IID_IDirectSound8)) { + if (!This->pDS8) { + IDirectSoundFullDuplex_IDirectSound8_Create(iface, &This->pDS8); + if (!This->pDS8) { + WARN("IDirectSoundFullDuplex_IDirectSound8_Create() failed\n"); + *ppobj = NULL; + return E_NOINTERFACE; + } + } + IDirectSoundFullDuplex_IDirectSound8_AddRef(This->pDS8); + *ppobj = This->pDS8; + return S_OK; + } else if (IsEqualIID(riid, &IID_IDirectSoundCapture)) { + if (!This->pDSC) { + IDirectSoundFullDuplex_IDirectSoundCapture_Create(iface, &This->pDSC); + if (!This->pDSC) { + WARN("IDirectSoundFullDuplex_IDirectSoundCapture_Create() failed\n"); + *ppobj = NULL; + return E_NOINTERFACE; + } + } + IDirectSoundFullDuplex_IDirectSoundCapture_AddRef(This->pDSC); + *ppobj = This->pDSC; + return S_OK; + } - *ppv = NULL; return E_NOINTERFACE; } -static ULONG WINAPI IUnknownImpl_AddRef(IUnknown *iface) +static ULONG WINAPI +IDirectSoundFullDuplexImpl_Release( LPDIRECTSOUNDFULLDUPLEX iface ) { - IDirectSoundFullDuplexImpl *This = impl_from_IUnknown(iface); - ULONG ref = InterlockedIncrement(&This->ref); + IDirectSoundFullDuplexImpl *This = (IDirectSoundFullDuplexImpl *)iface; + ULONG ref = InterlockedDecrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref - 1); - TRACE("(%p) ref=%d\n", This, ref); - - if(ref == 1) - InterlockedIncrement(&This->numIfaces); + if (!ref) { + if (This->capture_device) + IDirectSoundCapture_Release(This->capture_device); + if (This->renderer_device) + IDirectSound_Release(This->renderer_device); + HeapFree( GetProcessHeap(), 0, This ); + TRACE("(%p) released\n", This); + } return ref; } -static ULONG WINAPI IUnknownImpl_Release(IUnknown *iface) +static HRESULT WINAPI +IDirectSoundFullDuplexImpl_Initialize( + LPDIRECTSOUNDFULLDUPLEX iface, + LPCGUID pCaptureGuid, + LPCGUID pRendererGuid, + LPCDSCBUFFERDESC lpDscBufferDesc, + LPCDSBUFFERDESC lpDsBufferDesc, + HWND hWnd, + DWORD dwLevel, + LPLPDIRECTSOUNDCAPTUREBUFFER8 lplpDirectSoundCaptureBuffer8, + LPLPDIRECTSOUNDBUFFER8 lplpDirectSoundBuffer8 ) { - IDirectSoundFullDuplexImpl *This = impl_from_IUnknown(iface); - ULONG ref = InterlockedDecrement(&This->ref); - - TRACE("(%p) ref=%d\n", This, ref); - - if (!ref && !InterlockedDecrement(&This->numIfaces)) - fullduplex_destroy(This); - return ref; -} - -static const IUnknownVtbl unk_vtbl = -{ - IUnknownImpl_QueryInterface, - IUnknownImpl_AddRef, - IUnknownImpl_Release -}; - -/*************************************************************************** - * IDirectSoundFullDuplex implementation - */ -static inline IDirectSoundFullDuplexImpl *impl_from_IDirectSoundFullDuplex(IDirectSoundFullDuplex *iface) -{ - return CONTAINING_RECORD(iface, IDirectSoundFullDuplexImpl, IDirectSoundFullDuplex_iface); -} - -static HRESULT WINAPI IDirectSoundFullDuplexImpl_QueryInterface(IDirectSoundFullDuplex *iface, - REFIID riid, void **ppv) -{ - IDirectSoundFullDuplexImpl *This = impl_from_IDirectSoundFullDuplex(iface); - TRACE("(%p,%s,%p)\n", This, debugstr_guid(riid), ppv); - return IUnknown_QueryInterface(&This->IUnknown_iface, riid, ppv); -} - -static ULONG WINAPI IDirectSoundFullDuplexImpl_AddRef(IDirectSoundFullDuplex *iface) -{ - IDirectSoundFullDuplexImpl *This = impl_from_IDirectSoundFullDuplex(iface); - ULONG ref = InterlockedIncrement(&This->refdsfd); - - TRACE("(%p) ref=%d\n", This, ref); - - if(ref == 1) - InterlockedIncrement(&This->numIfaces); - return ref; -} - -static ULONG WINAPI IDirectSoundFullDuplexImpl_Release(IDirectSoundFullDuplex *iface) -{ - IDirectSoundFullDuplexImpl *This = impl_from_IDirectSoundFullDuplex(iface); - ULONG ref = InterlockedDecrement(&This->refdsfd); - - TRACE("(%p) ref=%d\n", This, ref); - - if (!ref && !InterlockedDecrement(&This->numIfaces)) - fullduplex_destroy(This); - return ref; -} - -static HRESULT WINAPI IDirectSoundFullDuplexImpl_Initialize(IDirectSoundFullDuplex *iface, - const GUID *capture_dev, const GUID *render_dev, const DSCBUFFERDESC *cbufdesc, - const DSBUFFERDESC *bufdesc, HWND hwnd, DWORD level, IDirectSoundCaptureBuffer8 **dscb8, - IDirectSoundBuffer8 **dsb8) -{ - IDirectSoundFullDuplexImpl *This = impl_from_IDirectSoundFullDuplex(iface); - IDirectSound8 *ds8 = NULL; - IDirectSoundCapture8 *dsc8 = NULL; HRESULT hr; + IDirectSoundFullDuplexImpl *This = (IDirectSoundFullDuplexImpl *)iface; - TRACE("(%p,%s,%s,%p,%p,%p,%x,%p,%p)\n", This, debugstr_guid(capture_dev), - debugstr_guid(render_dev), cbufdesc, bufdesc, hwnd, level, dscb8, dsb8); + TRACE("(%p,%s,%s,%p,%p,%p,%x,%p,%p)\n", This, + debugstr_guid(pCaptureGuid), debugstr_guid(pRendererGuid), + lpDscBufferDesc, lpDsBufferDesc, hWnd, dwLevel, + lplpDirectSoundCaptureBuffer8, lplpDirectSoundBuffer8); - if (!dscb8 || !dsb8) - return E_INVALIDARG; - - *dscb8 = NULL; - *dsb8 = NULL; - - if (This->ds8_unk || This->dsc8_unk) { + if (This->renderer_device != NULL || This->capture_device != NULL) { WARN("already initialized\n"); + *lplpDirectSoundCaptureBuffer8 = NULL; + *lplpDirectSoundBuffer8 = NULL; return DSERR_ALREADYINITIALIZED; } - hr = IDirectSoundImpl_Create(&This->IUnknown_iface, &IID_IUnknown, (void**)&This->ds8_unk, - TRUE); - if (SUCCEEDED(hr)) { - IUnknown_QueryInterface(This->ds8_unk, &IID_IDirectSound8, (void**)&ds8); - hr = IDirectSound_Initialize(ds8, render_dev); - } + hr = DSOUND_Create8(&IID_IDirectSound8, &This->renderer_device); + if (SUCCEEDED(hr)) + hr = IDirectSound_Initialize(This->renderer_device, pRendererGuid); if (hr != DS_OK) { - WARN("Creating/initializing IDirectSound8 failed\n"); - goto error; + WARN("DirectSoundDevice_Initialize() failed\n"); + *lplpDirectSoundCaptureBuffer8 = NULL; + *lplpDirectSoundBuffer8 = NULL; + return hr; } - IDirectSound8_SetCooperativeLevel(ds8, hwnd, level); + IDirectSound8_SetCooperativeLevel(This->renderer_device, hWnd, dwLevel); - hr = IDirectSound8_CreateSoundBuffer(ds8, bufdesc, (IDirectSoundBuffer**)dsb8, NULL); + hr = IDirectSound8_CreateSoundBuffer(This->renderer_device, lpDsBufferDesc, + (IDirectSoundBuffer**)lplpDirectSoundBuffer8, NULL); if (hr != DS_OK) { - WARN("IDirectSoundBuffer_Create() failed\n"); - goto error; + WARN("IDirectSoundBufferImpl_Create() failed\n"); + *lplpDirectSoundCaptureBuffer8 = NULL; + *lplpDirectSoundBuffer8 = NULL; + return hr; } - hr = IDirectSoundCaptureImpl_Create(&This->IUnknown_iface, &IID_IUnknown, - (void**)&This->dsc8_unk, TRUE); - if (SUCCEEDED(hr)) { - IUnknown_QueryInterface(This->dsc8_unk, &IID_IDirectSoundCapture8, (void**)&dsc8); - hr = IDirectSoundCapture_Initialize(dsc8, capture_dev); - } + hr = DSOUND_CaptureCreate8(&IID_IDirectSoundCapture8, &This->capture_device); + if (SUCCEEDED(hr)) + hr = IDirectSoundCapture_Initialize(This->capture_device, pCaptureGuid); if (hr != DS_OK) { - WARN("Creating/initializing IDirectSoundCapture8 failed\n"); - goto error; + WARN("DirectSoundCaptureDevice_Initialize() failed\n"); + *lplpDirectSoundCaptureBuffer8 = NULL; + *lplpDirectSoundBuffer8 = NULL; + return hr; } - hr = IDirectSoundCapture_CreateCaptureBuffer(dsc8, cbufdesc, - (IDirectSoundCaptureBuffer**)dscb8, NULL); + hr = IDirectSoundCapture_CreateCaptureBuffer(This->capture_device, + lpDscBufferDesc, + (IDirectSoundCaptureBuffer**)lplpDirectSoundCaptureBuffer8, + NULL); if (hr != DS_OK) { - WARN("IDirectSoundCapture_CreateCaptureBuffer() failed\n"); - goto error; + WARN("IDirectSoundCaptureBufferImpl_Create() failed\n"); + *lplpDirectSoundCaptureBuffer8 = NULL; + *lplpDirectSoundBuffer8 = NULL; + return hr; } - IDirectSound8_Release(ds8); - IDirectSoundCapture_Release(dsc8); - return DS_OK; - -error: - if (*dsb8) { - IDirectSoundBuffer8_Release(*dsb8); - *dsb8 = NULL; - } - if (ds8) - IDirectSound8_Release(ds8); - if (This->ds8_unk) { - IUnknown_Release(This->ds8_unk); - This->ds8_unk = NULL; - } - if (*dscb8) { - IDirectSoundCaptureBuffer8_Release(*dscb8); - *dscb8 = NULL; - } - if (dsc8) - IDirectSoundCapture_Release(dsc8); - if (This->dsc8_unk) { - IUnknown_Release(This->dsc8_unk); - This->dsc8_unk = NULL; - } return hr; } -static const IDirectSoundFullDuplexVtbl dsfd_vtbl = +static const IDirectSoundFullDuplexVtbl dsfdvt = { /* IUnknown methods */ IDirectSoundFullDuplexImpl_QueryInterface, @@ -261,32 +598,44 @@ static const IDirectSoundFullDuplexVtbl dsfd_vtbl = IDirectSoundFullDuplexImpl_Initialize }; -HRESULT DSOUND_FullDuplexCreate(REFIID riid, void **ppv) +HRESULT DSOUND_FullDuplexCreate( + REFIID riid, + LPDIRECTSOUNDFULLDUPLEX* ppDSFD) { - IDirectSoundFullDuplexImpl *obj; - HRESULT hr; + IDirectSoundFullDuplexImpl *This = NULL; + TRACE("(%s, %p)\n", debugstr_guid(riid), ppDSFD); - TRACE("(%s, %p)\n", debugstr_guid(riid), ppv); + if (ppDSFD == NULL) { + WARN("invalid parameter: ppDSFD == NULL\n"); + return DSERR_INVALIDPARAM; + } - *ppv = NULL; - obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*obj)); - if (!obj) { + if (!IsEqualIID(riid, &IID_IUnknown) && + !IsEqualIID(riid, &IID_IDirectSoundFullDuplex)) { + *ppDSFD = 0; + return E_NOINTERFACE; + } + + /* Get dsound configuration */ + setup_dsound_options(); + + This = HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, sizeof(IDirectSoundFullDuplexImpl)); + + if (This == NULL) { WARN("out of memory\n"); + *ppDSFD = NULL; return DSERR_OUTOFMEMORY; } - setup_dsound_options(); + This->lpVtbl = &dsfdvt; + This->ref = 1; + This->capture_device = NULL; + This->renderer_device = NULL; - obj->IDirectSoundFullDuplex_iface.lpVtbl = &dsfd_vtbl; - obj->IUnknown_iface.lpVtbl = &unk_vtbl; - obj->ref = 1; - obj->refdsfd = 0; - obj->numIfaces = 1; + *ppDSFD = (LPDIRECTSOUNDFULLDUPLEX)This; - hr = IUnknown_QueryInterface(&obj->IUnknown_iface, riid, ppv); - IUnknown_Release(&obj->IUnknown_iface); - - return hr; + return DS_OK; } /*************************************************************************** @@ -295,50 +644,93 @@ HRESULT DSOUND_FullDuplexCreate(REFIID riid, void **ppv) * Create and initialize a DirectSoundFullDuplex interface. * * PARAMS - * capture_dev [I] Address of sound capture device GUID. - * render_dev [I] Address of sound render device GUID. - * cbufdesc [I] Address of capture buffer description. - * bufdesc [I] Address of render buffer description. - * hwnd [I] Handle to application window. - * level [I] Cooperative level. - * dsfd [O] Address where full duplex interface returned. - * dscb8 [0] Address where capture buffer interface returned. - * dsb8 [0] Address where render buffer interface returned. - * outer_unk [I] Must be NULL. + * pcGuidCaptureDevice [I] Address of sound capture device GUID. + * pcGuidRenderDevice [I] Address of sound render device GUID. + * pcDSCBufferDesc [I] Address of capture buffer description. + * pcDSBufferDesc [I] Address of render buffer description. + * hWnd [I] Handle to application window. + * dwLevel [I] Cooperative level. + * ppDSFD [O] Address where full duplex interface returned. + * ppDSCBuffer8 [0] Address where capture buffer interface returned. + * ppDSBuffer8 [0] Address where render buffer interface returned. + * pUnkOuter [I] Must be NULL. * * RETURNS * Success: DS_OK * Failure: DSERR_NOAGGREGATION, DSERR_ALLOCATED, DSERR_INVALIDPARAM, * DSERR_OUTOFMEMORY DSERR_INVALIDCALL DSERR_NODRIVER */ -HRESULT WINAPI DirectSoundFullDuplexCreate(const GUID *capture_dev, const GUID *render_dev, - const DSCBUFFERDESC *cbufdesc, const DSBUFFERDESC *bufdesc, HWND hwnd, DWORD level, - IDirectSoundFullDuplex **dsfd, IDirectSoundCaptureBuffer8 **dscb8, - IDirectSoundBuffer8 **dsb8, IUnknown *outer_unk) +HRESULT WINAPI +DirectSoundFullDuplexCreate( + LPCGUID pcGuidCaptureDevice, + LPCGUID pcGuidRenderDevice, + LPCDSCBUFFERDESC pcDSCBufferDesc, + LPCDSBUFFERDESC pcDSBufferDesc, + HWND hWnd, + DWORD dwLevel, + LPDIRECTSOUNDFULLDUPLEX *ppDSFD, + LPDIRECTSOUNDCAPTUREBUFFER8 *ppDSCBuffer8, + LPDIRECTSOUNDBUFFER8 *ppDSBuffer8, + LPUNKNOWN pUnkOuter) { - HRESULT hr; + HRESULT hres; + IDirectSoundFullDuplexImpl *This = NULL; + TRACE("(%s,%s,%p,%p,%p,%x,%p,%p,%p,%p)\n", + debugstr_guid(pcGuidCaptureDevice), debugstr_guid(pcGuidRenderDevice), + pcDSCBufferDesc, pcDSBufferDesc, hWnd, dwLevel, ppDSFD, ppDSCBuffer8, + ppDSBuffer8, pUnkOuter); - TRACE("(%s,%s,%p,%p,%p,%x,%p,%p,%p,%p)\n", debugstr_guid(capture_dev), - debugstr_guid(render_dev), cbufdesc, bufdesc, hwnd, level, dsfd, dscb8, dsb8, - outer_unk); - - if (!dsfd) - return DSERR_INVALIDPARAM; - if (outer_unk) { - *dsfd = NULL; + if (pUnkOuter) { + WARN("pUnkOuter != 0\n"); + *ppDSFD = NULL; return DSERR_NOAGGREGATION; } - hr = DSOUND_FullDuplexCreate(&IID_IDirectSoundFullDuplex, (void**)dsfd); - if (hr == DS_OK) { - hr = IDirectSoundFullDuplex_Initialize(*dsfd, capture_dev, render_dev, cbufdesc, bufdesc, - hwnd, level, dscb8, dsb8); - if (hr != DS_OK) { - IDirectSoundFullDuplex_Release(*dsfd); - *dsfd = NULL; - WARN("IDirectSoundFullDuplexImpl_Initialize failed\n"); - } + if (pcDSCBufferDesc == NULL) { + WARN("invalid parameter: pcDSCBufferDesc == NULL\n"); + *ppDSFD = NULL; + return DSERR_INVALIDPARAM; } - return hr; + if (pcDSBufferDesc == NULL) { + WARN("invalid parameter: pcDSBufferDesc == NULL\n"); + *ppDSFD = NULL; + return DSERR_INVALIDPARAM; + } + + if (ppDSFD == NULL) { + WARN("invalid parameter: ppDSFD == NULL\n"); + return DSERR_INVALIDPARAM; + } + + if (ppDSCBuffer8 == NULL) { + WARN("invalid parameter: ppDSCBuffer8 == NULL\n"); + *ppDSFD = NULL; + return DSERR_INVALIDPARAM; + } + + if (ppDSBuffer8 == NULL) { + WARN("invalid parameter: ppDSBuffer8 == NULL\n"); + *ppDSFD = NULL; + return DSERR_INVALIDPARAM; + } + + hres = DSOUND_FullDuplexCreate(&IID_IDirectSoundFullDuplex, (LPDIRECTSOUNDFULLDUPLEX*)&This); + if (FAILED(hres)) return hres; + + hres = IDirectSoundFullDuplexImpl_Initialize((LPDIRECTSOUNDFULLDUPLEX)This, + pcGuidCaptureDevice, + pcGuidRenderDevice, + pcDSCBufferDesc, + pcDSBufferDesc, + hWnd, dwLevel, ppDSCBuffer8, + ppDSBuffer8); + if (hres != DS_OK) { + IUnknown_Release((LPDIRECTSOUNDFULLDUPLEX)This); + WARN("IDirectSoundFullDuplexImpl_Initialize failed\n"); + *ppDSFD = NULL; + } else + *ppDSFD = (LPDIRECTSOUNDFULLDUPLEX)This; + + return hres; } diff --git a/dll/directx/wine/dsound/fir.h b/dll/directx/wine/dsound/fir.h deleted file mode 100644 index 399fbd4d414..00000000000 --- a/dll/directx/wine/dsound/fir.h +++ /dev/null @@ -1,1591 +0,0 @@ -#ifdef _MSC_VER -#pragma warning (disable:4305) -#endif - -/* generated by tools/make_fir; DO NOT EDIT! */ -static const int fir_len = 7907; -static const int fir_step = 120; -static const float fir[] = { --0.0000000000, -0.0000021601, -0.0000043304, -0.0000065096, -0.0000086969, --0.0000108911, -0.0000130912, -0.0000152960, -0.0000175046, -0.0000197157, --0.0000219284, -0.0000241414, -0.0000263537, -0.0000285642, -0.0000307717, --0.0000329751, -0.0000351732, -0.0000373650, -0.0000395493, -0.0000417249, --0.0000438907, -0.0000460456, -0.0000481885, -0.0000503180, -0.0000524333, --0.0000545330, -0.0000566161, -0.0000586814, -0.0000607277, -0.0000627541, --0.0000647592, -0.0000667421, -0.0000687015, -0.0000706365, -0.0000725458, --0.0000744284, -0.0000762832, -0.0000781091, -0.0000799051, -0.0000816701, --0.0000834030, -0.0000851028, -0.0000867685, -0.0000883990, -0.0000899935, --0.0000915507, -0.0000930699, -0.0000945500, -0.0000959901, -0.0000973892, --0.0000987464, -0.0001000609, -0.0001013318, -0.0001025581, -0.0001037391, --0.0001048739, -0.0001059617, -0.0001070018, -0.0001079932, -0.0001089354, --0.0001098276, -0.0001106690, -0.0001114590, -0.0001121969, -0.0001128821, --0.0001135140, -0.0001140920, -0.0001146154, -0.0001150839, -0.0001154968, --0.0001158536, -0.0001161540, -0.0001163974, -0.0001165834, -0.0001167117, --0.0001167819, -0.0001167937, -0.0001167467, -0.0001166408, -0.0001164755, --0.0001162508, -0.0001159664, -0.0001156222, -0.0001152181, -0.0001147539, --0.0001142295, -0.0001136450, -0.0001130003, -0.0001122954, -0.0001115305, --0.0001107055, -0.0001098205, -0.0001088758, -0.0001078715, -0.0001068078, --0.0001056850, -0.0001045032, -0.0001032628, -0.0001019642, -0.0001006076, --0.0000991935, -0.0000977224, -0.0000961945, -0.0000946105, -0.0000929709, --0.0000912761, -0.0000895269, -0.0000877237, -0.0000858672, -0.0000839581, --0.0000819970, -0.0000799848, -0.0000779221, -0.0000758098, -0.0000736486, --0.0000714395, -0.0000691832, -0.0000668807, -0.0000645329, -0.0000621407, --0.0000597052, -0.0000572273, -0.0000547082, -0.0000521487, -0.0000495501, --0.0000469135, -0.0000442399, -0.0000415306, -0.0000387867, -0.0000360095, --0.0000332001, -0.0000303599, -0.0000274901, -0.0000245920, -0.0000216669, --0.0000187162, -0.0000157412, -0.0000127433, -0.0000097239, -0.0000066844, --0.0000036262, -0.0000005509, 0.0000025402, 0.0000056456, 0.0000087637, -0.0000118931, 0.0000150322, 0.0000181796, 0.0000213335, 0.0000244926, -0.0000276553, 0.0000308199, 0.0000339848, 0.0000371486, 0.0000403095, -0.0000434660, 0.0000466164, 0.0000497592, 0.0000528927, 0.0000560153, -0.0000591253, 0.0000622212, 0.0000653013, 0.0000683639, 0.0000714075, -0.0000744303, 0.0000774309, 0.0000804075, 0.0000833585, 0.0000862823, -0.0000891774, 0.0000920420, 0.0000948747, 0.0000976737, 0.0001004377, -0.0001031648, 0.0001058537, 0.0001085028, 0.0001111105, 0.0001136753, -0.0001161957, 0.0001186702, 0.0001210974, 0.0001234757, 0.0001258038, -0.0001280801, 0.0001303034, 0.0001324722, 0.0001345852, 0.0001366410, -0.0001386382, 0.0001405757, 0.0001424521, 0.0001442661, 0.0001460166, -0.0001477024, 0.0001493222, 0.0001508749, 0.0001523595, 0.0001537748, -0.0001551198, 0.0001563934, 0.0001575947, 0.0001587227, 0.0001597764, -0.0001607549, 0.0001616575, 0.0001624832, 0.0001632313, 0.0001639010, -0.0001644915, 0.0001650023, 0.0001654325, 0.0001657817, 0.0001660492, -0.0001662345, 0.0001663371, 0.0001663566, 0.0001662924, 0.0001661444, -0.0001659120, 0.0001655949, 0.0001651931, 0.0001647061, 0.0001641339, -0.0001634764, 0.0001627333, 0.0001619047, 0.0001609906, 0.0001599910, -0.0001589060, 0.0001577357, 0.0001564803, 0.0001551400, 0.0001537151, -0.0001522058, 0.0001506125, 0.0001489356, 0.0001471756, 0.0001453328, -0.0001434079, 0.0001414014, 0.0001393138, 0.0001371460, 0.0001348984, -0.0001325720, 0.0001301674, 0.0001276856, 0.0001251273, 0.0001224936, -0.0001197852, 0.0001170033, 0.0001141489, 0.0001112231, 0.0001082270, -0.0001051617, 0.0001020285, 0.0000988286, 0.0000955632, 0.0000922338, -0.0000888417, 0.0000853883, 0.0000818750, 0.0000783033, 0.0000746747, -0.0000709908, 0.0000672531, 0.0000634633, 0.0000596230, 0.0000557339, -0.0000517978, 0.0000478164, 0.0000437914, 0.0000397247, 0.0000356181, -0.0000314736, 0.0000272929, 0.0000230781, 0.0000188311, 0.0000145539, -0.0000102485, 0.0000059168, 0.0000015611, -0.0000028167, -0.0000072145, --0.0000116301, -0.0000160614, -0.0000205062, -0.0000249624, -0.0000294277, --0.0000339001, -0.0000383772, -0.0000428568, -0.0000473367, -0.0000518146, --0.0000562883, -0.0000607554, -0.0000652138, -0.0000696610, -0.0000740949, --0.0000785131, -0.0000829133, -0.0000872932, -0.0000916505, -0.0000959829, --0.0001002881, -0.0001045638, -0.0001088077, -0.0001130175, -0.0001171909, --0.0001213257, -0.0001254195, -0.0001294702, -0.0001334754, -0.0001374329, --0.0001413406, -0.0001451961, -0.0001489973, -0.0001527420, -0.0001564281, --0.0001600534, -0.0001636158, -0.0001671132, -0.0001705435, -0.0001739047, --0.0001771947, -0.0001804116, -0.0001835533, -0.0001866179, -0.0001896036, --0.0001925083, -0.0001953304, -0.0001980679, -0.0002007190, -0.0002032820, --0.0002057553, -0.0002081370, -0.0002104256, -0.0002126195, -0.0002147171, --0.0002167169, -0.0002186173, -0.0002204171, -0.0002221147, -0.0002237089, --0.0002251983, -0.0002265817, -0.0002278578, -0.0002290256, -0.0002300839, --0.0002310316, -0.0002318677, -0.0002325913, -0.0002332015, -0.0002336975, --0.0002340783, -0.0002343433, -0.0002344918, -0.0002345232, -0.0002344368, --0.0002342322, -0.0002339089, -0.0002334665, -0.0002329046, -0.0002322229, --0.0002314213, -0.0002304995, -0.0002294574, -0.0002282950, -0.0002270123, --0.0002256094, -0.0002240864, -0.0002224434, -0.0002206808, -0.0002187988, --0.0002167979, -0.0002146784, -0.0002124409, -0.0002100859, -0.0002076141, --0.0002050261, -0.0002023227, -0.0001995047, -0.0001965730, -0.0001935285, --0.0001903722, -0.0001871051, -0.0001837284, -0.0001802433, -0.0001766509, --0.0001729527, -0.0001691499, -0.0001652439, -0.0001612363, -0.0001571285, --0.0001529222, -0.0001486190, -0.0001442206, -0.0001397288, -0.0001351454, --0.0001304723, -0.0001257113, -0.0001208645, -0.0001159339, -0.0001109216, --0.0001058298, -0.0001006605, -0.0000954161, -0.0000900988, -0.0000847109, --0.0000792549, -0.0000737331, -0.0000681481, -0.0000625023, -0.0000567983, --0.0000510387, -0.0000452261, -0.0000393633, -0.0000334528, -0.0000274975, --0.0000215001, -0.0000154635, -0.0000093905, -0.0000032841, 0.0000028530, -0.0000090176, 0.0000152070, 0.0000214180, 0.0000276476, 0.0000338928, -0.0000401505, 0.0000464177, 0.0000526912, 0.0000589678, 0.0000652446, -0.0000715181, 0.0000777854, 0.0000840433, 0.0000902884, 0.0000965177, -0.0001027279, 0.0001089158, 0.0001150782, 0.0001212119, 0.0001273136, -0.0001333801, 0.0001394082, 0.0001453946, 0.0001513363, 0.0001572299, -0.0001630723, 0.0001688602, 0.0001745906, 0.0001802603, 0.0001858661, -0.0001914049, 0.0001968736, 0.0002022692, 0.0002075885, 0.0002128285, -0.0002179862, 0.0002230587, 0.0002280430, 0.0002329361, 0.0002377352, -0.0002424374, 0.0002470399, 0.0002515399, 0.0002559347, 0.0002602215, -0.0002643977, 0.0002684607, 0.0002724079, 0.0002762367, 0.0002799448, -0.0002835296, 0.0002869888, 0.0002903200, 0.0002935210, 0.0002965895, -0.0002995235, 0.0003023207, 0.0003049791, 0.0003074968, 0.0003098718, -0.0003121023, 0.0003141865, 0.0003161226, 0.0003179089, 0.0003195440, -0.0003210261, 0.0003223540, 0.0003235261, 0.0003245412, 0.0003253981, -0.0003260955, 0.0003266324, 0.0003270078, 0.0003272206, 0.0003272702, -0.0003271556, 0.0003268761, 0.0003264312, 0.0003258202, 0.0003250428, -0.0003240985, 0.0003229871, 0.0003217083, 0.0003202619, 0.0003186480, -0.0003168666, 0.0003149178, 0.0003128017, 0.0003105187, 0.0003080692, -0.0003054536, 0.0003026725, 0.0002997264, 0.0002966162, 0.0002933425, -0.0002899064, 0.0002863087, 0.0002825506, 0.0002786332, 0.0002745577, -0.0002703254, 0.0002659378, 0.0002613963, 0.0002567025, 0.0002518580, -0.0002468647, 0.0002417243, 0.0002364387, 0.0002310100, 0.0002254401, -0.0002197313, 0.0002138857, 0.0002079058, 0.0002017938, 0.0001955522, -0.0001891836, 0.0001826906, 0.0001760759, 0.0001693423, 0.0001624925, -0.0001555296, 0.0001484564, 0.0001412761, 0.0001339917, 0.0001266065, -0.0001191237, 0.0001115465, 0.0001038785, 0.0000961230, 0.0000882835, -0.0000803636, 0.0000723668, 0.0000642970, 0.0000561577, 0.0000479528, -0.0000396861, 0.0000313614, 0.0000229828, 0.0000145541, 0.0000060793, --0.0000024374, -0.0000109920, -0.0000195804, -0.0000281984, -0.0000368418, --0.0000455063, -0.0000541878, -0.0000628818, -0.0000715842, -0.0000802906, --0.0000889965, -0.0000976976, -0.0001063896, -0.0001150680, -0.0001237283, --0.0001323662, -0.0001409772, -0.0001495568, -0.0001581006, -0.0001666042, --0.0001750629, -0.0001834725, -0.0001918284, -0.0002001262, -0.0002083615, --0.0002165298, -0.0002246267, -0.0002326478, -0.0002405888, -0.0002484452, --0.0002562128, -0.0002638872, -0.0002714641, -0.0002789393, -0.0002863086, --0.0002935678, -0.0003007127, -0.0003077392, -0.0003146432, -0.0003214208, --0.0003280679, -0.0003345805, -0.0003409549, -0.0003471871, -0.0003532734, --0.0003592101, -0.0003649934, -0.0003706199, -0.0003760859, -0.0003813879, --0.0003865227, -0.0003914867, -0.0003962768, -0.0004008897, -0.0004053224, --0.0004095717, -0.0004136348, -0.0004175087, -0.0004211906, -0.0004246778, --0.0004279676, -0.0004310576, -0.0004339452, -0.0004366281, -0.0004391040, --0.0004413708, -0.0004434263, -0.0004452685, -0.0004468956, -0.0004483058, --0.0004494974, -0.0004504687, -0.0004512184, -0.0004517450, -0.0004520473, --0.0004521241, -0.0004519743, -0.0004515970, -0.0004509913, -0.0004501566, --0.0004490922, -0.0004477977, -0.0004462725, -0.0004445166, -0.0004425296, --0.0004403116, -0.0004378626, -0.0004351828, -0.0004322726, -0.0004291324, --0.0004257626, -0.0004221641, -0.0004183374, -0.0004142837, -0.0004100037, --0.0004054988, -0.0004007702, -0.0003958191, -0.0003906472, -0.0003852560, --0.0003796473, -0.0003738228, -0.0003677846, -0.0003615348, -0.0003550754, --0.0003484089, -0.0003415377, -0.0003344642, -0.0003271912, -0.0003197214, --0.0003120577, -0.0003042030, -0.0002961605, -0.0002879334, -0.0002795249, --0.0002709385, -0.0002621777, -0.0002532462, -0.0002441476, -0.0002348857, --0.0002254646, -0.0002158883, -0.0002061608, -0.0001962863, -0.0001862693, --0.0001761140, -0.0001658250, -0.0001554068, -0.0001448641, -0.0001342017, --0.0001234244, -0.0001125370, -0.0001015446, -0.0000904522, -0.0000792650, --0.0000679881, -0.0000566268, -0.0000451865, -0.0000336725, -0.0000220904, --0.0000104456, 0.0000012563, 0.0000130097, 0.0000248089, 0.0000366481, -0.0000485216, 0.0000604235, 0.0000723481, 0.0000842894, 0.0000962415, -0.0001081984, 0.0001201541, 0.0001321027, 0.0001440381, 0.0001559542, -0.0001678449, 0.0001797043, 0.0001915261, 0.0002033042, 0.0002150326, -0.0002267052, 0.0002383157, 0.0002498582, 0.0002613264, 0.0002727144, -0.0002840160, 0.0002952252, 0.0003063359, 0.0003173421, 0.0003282378, -0.0003390171, 0.0003496739, 0.0003602026, 0.0003705970, 0.0003808515, -0.0003909603, 0.0004009177, 0.0004107179, 0.0004203554, 0.0004298245, -0.0004391199, 0.0004482360, 0.0004571676, 0.0004659092, 0.0004744556, -0.0004828018, 0.0004909425, 0.0004988729, 0.0005065881, 0.0005140831, -0.0005213533, 0.0005283939, 0.0005352006, 0.0005417688, 0.0005480941, -0.0005541724, 0.0005599994, 0.0005655712, 0.0005708838, 0.0005759334, -0.0005807164, 0.0005852291, 0.0005894681, 0.0005934301, 0.0005971119, -0.0006005103, 0.0006036225, 0.0006064456, 0.0006089769, 0.0006112139, -0.0006131542, 0.0006147954, 0.0006161355, 0.0006171725, 0.0006179045, -0.0006183298, 0.0006184469, 0.0006182543, 0.0006177508, 0.0006169354, -0.0006158069, 0.0006143647, 0.0006126081, 0.0006105366, 0.0006081498, -0.0006054476, 0.0006024300, 0.0005990971, 0.0005954492, 0.0005914868, -0.0005872105, 0.0005826210, 0.0005777193, 0.0005725066, 0.0005669840, -0.0005611530, 0.0005550152, 0.0005485724, 0.0005418263, 0.0005347792, -0.0005274332, 0.0005197908, 0.0005118544, 0.0005036269, 0.0004951109, -0.0004863097, 0.0004772264, 0.0004678642, 0.0004582267, 0.0004483176, -0.0004381406, 0.0004276998, 0.0004169991, 0.0004060428, 0.0003948354, -0.0003833814, 0.0003716854, 0.0003597523, 0.0003475871, 0.0003351948, -0.0003225808, 0.0003097503, 0.0002967089, 0.0002834622, 0.0002700161, -0.0002563763, 0.0002425489, 0.0002285401, 0.0002143560, 0.0002000031, -0.0001854879, 0.0001708168, 0.0001559967, 0.0001410343, 0.0001259365, -0.0001107104, 0.0000953630, 0.0000799015, 0.0000643331, 0.0000486653, -0.0000329055, 0.0000170612, 0.0000011400, -0.0000148505, -0.0000309025, --0.0000470081, -0.0000631597, -0.0000793491, -0.0000955685, -0.0001118099, --0.0001280652, -0.0001443262, -0.0001605849, -0.0001768330, -0.0001930624, --0.0002092648, -0.0002254319, -0.0002415556, -0.0002576275, -0.0002736393, --0.0002895827, -0.0003054494, -0.0003212311, -0.0003369196, -0.0003525065, --0.0003679835, -0.0003833426, -0.0003985753, -0.0004136736, -0.0004286292, --0.0004434340, -0.0004580801, -0.0004725592, -0.0004868635, -0.0005009850, --0.0005149159, -0.0005286483, -0.0005421744, -0.0005554866, -0.0005685774, --0.0005814391, -0.0005940644, -0.0006064459, -0.0006185763, -0.0006304484, --0.0006420553, -0.0006533899, -0.0006644455, -0.0006752151, -0.0006856923, --0.0006958705, -0.0007057433, -0.0007153045, -0.0007245480, -0.0007334676, --0.0007420577, -0.0007503124, -0.0007582263, -0.0007657937, -0.0007730096, --0.0007798688, -0.0007863663, -0.0007924973, -0.0007982572, -0.0008036415, --0.0008086459, -0.0008132662, -0.0008174987, -0.0008213393, -0.0008247847, --0.0008278313, -0.0008304759, -0.0008327155, -0.0008345473, -0.0008359687, --0.0008369770, -0.0008375702, -0.0008377461, -0.0008375030, -0.0008368390, --0.0008357529, -0.0008342432, -0.0008323091, -0.0008299497, -0.0008271644, --0.0008239527, -0.0008203145, -0.0008162498, -0.0008117589, -0.0008068421, --0.0008015002, -0.0007957340, -0.0007895447, -0.0007829336, -0.0007759022, --0.0007684523, -0.0007605858, -0.0007523049, -0.0007436121, -0.0007345100, --0.0007250014, -0.0007150893, -0.0007047771, -0.0006940683, -0.0006829665, --0.0006714757, -0.0006596000, -0.0006473437, -0.0006347115, -0.0006217080, --0.0006083382, -0.0005946073, -0.0005805207, -0.0005660839, -0.0005513028, --0.0005361833, -0.0005207315, -0.0005049539, -0.0004888569, -0.0004724474, --0.0004557322, -0.0004387185, -0.0004214136, -0.0004038248, -0.0003859599, --0.0003678267, -0.0003494331, -0.0003307873, -0.0003118976, -0.0002927724, --0.0002734204, -0.0002538504, -0.0002340711, -0.0002140918, -0.0001939216, --0.0001735697, -0.0001530458, -0.0001323593, -0.0001115200, -0.0000905376, --0.0000694222, -0.0000481837, -0.0000268323, -0.0000053783, 0.0000161680, -0.0000377962, 0.0000594957, 0.0000812561, 0.0001030665, 0.0001249163, -0.0001467946, 0.0001686906, 0.0001905934, 0.0002124920, 0.0002343754, -0.0002562326, 0.0002780524, 0.0002998238, 0.0003215357, 0.0003431768, -0.0003647361, 0.0003862023, 0.0004075644, 0.0004288111, 0.0004499314, -0.0004709140, 0.0004917479, 0.0005124220, 0.0005329253, 0.0005532468, -0.0005733755, 0.0005933005, 0.0006130110, 0.0006324962, 0.0006517454, -0.0006707479, 0.0006894932, 0.0007079708, 0.0007261704, 0.0007440816, -0.0007616942, 0.0007789982, 0.0007959837, 0.0008126407, 0.0008289596, -0.0008449308, 0.0008605448, 0.0008757923, 0.0008906642, 0.0009051513, -0.0009192450, 0.0009329365, 0.0009462171, 0.0009590787, 0.0009715130, -0.0009835120, 0.0009950678, 0.0010061729, 0.0010168199, 0.0010270014, -0.0010367105, 0.0010459403, 0.0010546843, 0.0010629361, 0.0010706894, -0.0010779384, 0.0010846773, 0.0010909007, 0.0010966033, 0.0011017801, -0.0011064263, 0.0011105375, 0.0011141094, 0.0011171379, 0.0011196193, -0.0011215502, 0.0011229273, 0.0011237476, 0.0011240084, 0.0011237074, -0.0011228423, 0.0011214113, 0.0011194127, 0.0011168454, 0.0011137081, -0.0011100002, 0.0011057211, 0.0011008708, 0.0010954492, 0.0010894568, -0.0010828942, 0.0010757624, 0.0010680626, 0.0010597965, 0.0010509657, -0.0010415725, 0.0010316192, 0.0010211086, 0.0010100437, 0.0009984277, -0.0009862642, 0.0009735571, 0.0009603105, 0.0009465290, 0.0009322172, -0.0009173801, 0.0009020230, 0.0008861516, 0.0008697717, 0.0008528894, -0.0008355112, 0.0008176438, 0.0007992941, 0.0007804694, 0.0007611772, -0.0007414252, 0.0007212216, 0.0007005745, 0.0006794927, 0.0006579848, -0.0006360599, 0.0006137274, 0.0005909967, 0.0005678777, 0.0005443804, -0.0005205151, 0.0004962922, 0.0004717224, 0.0004468167, 0.0004215861, -0.0003960420, 0.0003701960, 0.0003440598, 0.0003176453, 0.0002909647, -0.0002640303, 0.0002368545, 0.0002094500, 0.0001818296, 0.0001540064, -0.0001259933, 0.0000978039, 0.0000694513, 0.0000409493, 0.0000123115, --0.0000164483, -0.0000453161, -0.0000742779, -0.0001033196, -0.0001324268, --0.0001615854, -0.0001907807, -0.0002199984, -0.0002492239, -0.0002784426, --0.0003076398, -0.0003368006, -0.0003659105, -0.0003949545, -0.0004239178, --0.0004527857, -0.0004815431, -0.0005101753, -0.0005386673, -0.0005670044, --0.0005951717, -0.0006231543, -0.0006509376, -0.0006785067, -0.0007058470, --0.0007329438, -0.0007597826, -0.0007863489, -0.0008126283, -0.0008386063, --0.0008642689, -0.0008896018, -0.0009145911, -0.0009392227, -0.0009634830, --0.0009873583, -0.0010108350, -0.0010338998, -0.0010565395, -0.0010787410, --0.0011004914, -0.0011217780, -0.0011425883, -0.0011629099, -0.0011827307, --0.0012020388, -0.0012208223, -0.0012390699, -0.0012567701, -0.0012739120, --0.0012904848, -0.0013064777, -0.0013218805, -0.0013366832, -0.0013508758, --0.0013644489, -0.0013773932, -0.0013896996, -0.0014013595, -0.0014123644, --0.0014227062, -0.0014323770, -0.0014413695, -0.0014496762, -0.0014572904, --0.0014642055, -0.0014704152, -0.0014759136, -0.0014806951, -0.0014847545, --0.0014880868, -0.0014906875, -0.0014925524, -0.0014936777, -0.0014940597, --0.0014936955, -0.0014925821, -0.0014907172, -0.0014880988, -0.0014847251, --0.0014805949, -0.0014757072, -0.0014700615, -0.0014636576, -0.0014564957, --0.0014485764, -0.0014399006, -0.0014304698, -0.0014202856, -0.0014093503, --0.0013976662, -0.0013852363, -0.0013720639, -0.0013581526, -0.0013435065, --0.0013281301, -0.0013120281, -0.0012952058, -0.0012776687, -0.0012594229, --0.0012404746, -0.0012208306, -0.0012004980, -0.0011794844, -0.0011577974, --0.0011354454, -0.0011124369, -0.0010887809, -0.0010644867, -0.0010395640, --0.0010140227, -0.0009878733, -0.0009611264, -0.0009337931, -0.0009058849, --0.0008774134, -0.0008483907, -0.0008188291, -0.0007887415, -0.0007581408, --0.0007270403, -0.0006954536, -0.0006633947, -0.0006308778, -0.0005979174, --0.0005645283, -0.0005307256, -0.0004965245, -0.0004619406, -0.0004269898, --0.0003916882, -0.0003560521, -0.0003200980, -0.0002838427, -0.0002473033, --0.0002104968, -0.0001734408, -0.0001361528, -0.0000986506, -0.0000609521, --0.0000230756, 0.0000149607, 0.0000531385, 0.0000914390, 0.0001298435, -0.0001683333, 0.0002068894, 0.0002454926, 0.0002841239, 0.0003227639, -0.0003613934, 0.0003999929, 0.0004385430, 0.0004770241, 0.0005154167, -0.0005537012, 0.0005918580, 0.0006298674, 0.0006677099, 0.0007053659, -0.0007428156, 0.0007800396, 0.0008170183, 0.0008537322, 0.0008901619, -0.0009262880, 0.0009620912, 0.0009975524, 0.0010326524, 0.0010673723, -0.0011016931, 0.0011355960, 0.0011690626, 0.0012020743, 0.0012346128, -0.0012666600, 0.0012981978, 0.0013292086, 0.0013596746, 0.0013895787, -0.0014189035, 0.0014476321, 0.0014757478, 0.0015032342, 0.0015300751, -0.0015562544, 0.0015817566, 0.0016065662, 0.0016306680, 0.0016540474, -0.0016766897, 0.0016985808, 0.0017197068, 0.0017400541, 0.0017596096, -0.0017783603, 0.0017962939, 0.0018133981, 0.0018296611, 0.0018450717, -0.0018596186, 0.0018732914, 0.0018860799, 0.0018979741, 0.0019089647, -0.0019190427, 0.0019281995, 0.0019364271, 0.0019437176, 0.0019500638, -0.0019554590, 0.0019598967, 0.0019633710, 0.0019658766, 0.0019674083, -0.0019679618, 0.0019675329, 0.0019661182, 0.0019637144, 0.0019603191, -0.0019559301, 0.0019505458, 0.0019441651, 0.0019367874, 0.0019284124, -0.0019190407, 0.0019086731, 0.0018973109, 0.0018849560, 0.0018716109, -0.0018572784, 0.0018419618, 0.0018256652, 0.0018083930, 0.0017901499, -0.0017709416, 0.0017507738, 0.0017296531, 0.0017075864, 0.0016845811, -0.0016606451, 0.0016357870, 0.0016100155, 0.0015833403, 0.0015557711, -0.0015273183, 0.0014979929, 0.0014678062, 0.0014367701, 0.0014048968, -0.0013721991, 0.0013386903, 0.0013043841, 0.0012692947, 0.0012334365, -0.0011968247, 0.0011594747, 0.0011214025, 0.0010826243, 0.0010431569, -0.0010030174, 0.0009622235, 0.0009207930, 0.0008787443, 0.0008360961, -0.0007928675, 0.0007490779, 0.0007047472, 0.0006598955, 0.0006145433, -0.0005687114, 0.0005224210, 0.0004756935, 0.0004285507, 0.0003810145, -0.0003331074, 0.0002848520, 0.0002362710, 0.0001873876, 0.0001382251, -0.0000888071, 0.0000391574, -0.0000107000, -0.0000607409, -0.0001109410, --0.0001612757, -0.0002117203, -0.0002622499, -0.0003128396, -0.0003634642, --0.0004140985, -0.0004647171, -0.0005152948, -0.0005658059, -0.0006162249, --0.0006665263, -0.0007166843, -0.0007666733, -0.0008164676, -0.0008660416, --0.0009153695, -0.0009644258, -0.0010131848, -0.0010616211, -0.0011097090, --0.0011574233, -0.0012047386, -0.0012516297, -0.0012980715, -0.0013440391, --0.0013895077, -0.0014344526, -0.0014788493, -0.0015226735, -0.0015659012, --0.0016085084, -0.0016504714, -0.0016917669, -0.0017323716, -0.0017722626, --0.0018114173, -0.0018498132, -0.0018874283, -0.0019242408, -0.0019602293, --0.0019953726, -0.0020296500, -0.0020630411, -0.0020955259, -0.0021270845, --0.0021576979, -0.0021873471, -0.0022160136, -0.0022436795, -0.0022703270, --0.0022959392, -0.0023204992, -0.0023439908, -0.0023663983, -0.0023877064, --0.0024079004, -0.0024269658, -0.0024448891, -0.0024616569, -0.0024772565, --0.0024916758, -0.0025049031, -0.0025169273, -0.0025277381, -0.0025373253, --0.0025456797, -0.0025527924, -0.0025586554, -0.0025632609, -0.0025666021, --0.0025686724, -0.0025694663, -0.0025689784, -0.0025672043, -0.0025641401, --0.0025597826, -0.0025541290, -0.0025471774, -0.0025389266, -0.0025293756, --0.0025185247, -0.0025063742, -0.0024929256, -0.0024781806, -0.0024621419, --0.0024448128, -0.0024261971, -0.0024062993, -0.0023851246, -0.0023626791, --0.0023389690, -0.0023140018, -0.0022877851, -0.0022603275, -0.0022316382, --0.0022017270, -0.0021706043, -0.0021382811, -0.0021047694, -0.0020700814, --0.0020342302, -0.0019972294, -0.0019590932, -0.0019198367, -0.0018794753, --0.0018380252, -0.0017955030, -0.0017519262, -0.0017073126, -0.0016616808, --0.0016150498, -0.0015674393, -0.0015188696, -0.0014693614, -0.0014189360, --0.0013676154, -0.0013154219, -0.0012623785, -0.0012085085, -0.0011538359, --0.0010983851, -0.0010421811, -0.0009852491, -0.0009276151, -0.0008693052, --0.0008103463, -0.0007507654, -0.0006905900, -0.0006298483, -0.0005685683, --0.0005067789, -0.0004445092, -0.0003817885, -0.0003186466, -0.0002551136, --0.0001912198, -0.0001269959, -0.0000624728, 0.0000023182, 0.0000673457, -0.0001325780, 0.0001979832, 0.0002635292, 0.0003291837, 0.0003949141, -0.0004606880, 0.0005264724, 0.0005922346, 0.0006579415, 0.0007235600, -0.0007890569, 0.0008543990, 0.0009195531, 0.0009844857, 0.0010491637, -0.0011135537, 0.0011776223, 0.0012413365, 0.0013046629, 0.0013675684, -0.0014300201, 0.0014919850, 0.0015534303, 0.0016143233, 0.0016746316, -0.0017343229, 0.0017933649, 0.0018517259, 0.0019093741, 0.0019662779, -0.0020224064, 0.0020777285, 0.0021322135, 0.0021858313, 0.0022385517, -0.0022903452, 0.0023411825, 0.0023910345, 0.0024398728, 0.0024876693, -0.0025343963, 0.0025800264, 0.0026245328, 0.0026678893, 0.0027100699, -0.0027510492, 0.0027908024, 0.0028293051, 0.0028665336, 0.0029024645, -0.0029370752, 0.0029703436, 0.0030022482, 0.0030327680, 0.0030618828, -0.0030895730, 0.0031158194, 0.0031406037, 0.0031639083, 0.0031857162, -0.0032060109, 0.0032247769, 0.0032419993, 0.0032576639, 0.0032717571, -0.0032842663, 0.0032951796, 0.0033044855, 0.0033121739, 0.0033182348, -0.0033226595, 0.0033254397, 0.0033265683, 0.0033260387, 0.0033238451, -0.0033199827, 0.0033144474, 0.0033072359, 0.0032983458, 0.0032877756, -0.0032755244, 0.0032615923, 0.0032459804, 0.0032286903, 0.0032097246, -0.0031890869, 0.0031667815, 0.0031428134, 0.0031171889, 0.0030899146, -0.0030609984, 0.0030304488, 0.0029982753, 0.0029644882, 0.0029290984, -0.0028921181, 0.0028535600, 0.0028134378, 0.0027717659, 0.0027285596, -0.0026838351, 0.0026376093, 0.0025899000, 0.0025407257, 0.0024901057, -0.0024380603, 0.0023846105, 0.0023297778, 0.0022735848, 0.0022160549, -0.0021572119, 0.0020970806, 0.0020356866, 0.0019730560, 0.0019092157, -0.0018441934, 0.0017780175, 0.0017107168, 0.0016423212, 0.0015728608, -0.0015023666, 0.0014308703, 0.0013584040, 0.0012850006, 0.0012106934, -0.0011355164, 0.0010595042, 0.0009826917, 0.0009051145, 0.0008268089, -0.0007478113, 0.0006681588, 0.0005878890, 0.0005070398, 0.0004256495, -0.0003437572, 0.0002614018, 0.0001786230, 0.0000954606, 0.0000119550, --0.0000718533, -0.0001559234, -0.0002402143, -0.0003246844, -0.0004092923, --0.0004939960, -0.0005787535, -0.0006635226, -0.0007482608, -0.0008329258, --0.0009174749, -0.0010018654, -0.0010860544, -0.0011699992, -0.0012536568, --0.0013369845, -0.0014199393, -0.0015024785, -0.0015845592, -0.0016661388, --0.0017471747, -0.0018276244, -0.0019074456, -0.0019865962, -0.0020650342, --0.0021427177, -0.0022196054, -0.0022956558, -0.0023708281, -0.0024450815, --0.0025183756, -0.0025906704, -0.0026619261, -0.0027321035, -0.0028011637, --0.0028690681, -0.0029357788, -0.0030012581, -0.0030654689, -0.0031283747, --0.0031899394, -0.0032501275, -0.0033089041, -0.0033662347, -0.0034220855, --0.0034764236, -0.0035292163, -0.0035804318, -0.0036300389, -0.0036780073, --0.0037243070, -0.0037689092, -0.0038117856, -0.0038529085, -0.0038922514, --0.0039297883, -0.0039654940, -0.0039993444, -0.0040313159, -0.0040613860, --0.0040895329, -0.0041157359, -0.0041399751, -0.0041622314, -0.0041824868, --0.0042007241, -0.0042169271, -0.0042310807, -0.0042431705, -0.0042531833, --0.0042611069, -0.0042669299, -0.0042706422, -0.0042722345, -0.0042716985, --0.0042690272, -0.0042642143, -0.0042572549, -0.0042481449, -0.0042368814, --0.0042234624, -0.0042078873, -0.0041901562, -0.0041702705, -0.0041482326, --0.0041240461, -0.0040977156, -0.0040692468, -0.0040386465, -0.0040059225, --0.0039710838, -0.0039341405, -0.0038951038, -0.0038539859, -0.0038108001, --0.0037655608, -0.0037182836, -0.0036689849, -0.0036176824, -0.0035643948, --0.0035091419, -0.0034519445, -0.0033928243, -0.0033318045, -0.0032689087, --0.0032041620, -0.0031375904, -0.0030692209, -0.0029990813, -0.0029272006, --0.0028536087, -0.0027783366, -0.0027014160, -0.0026228797, -0.0025427614, --0.0024610956, -0.0023779179, -0.0022932646, -0.0022071730, -0.0021196811, --0.0020308278, -0.0019406529, -0.0018491969, -0.0017565011, -0.0016626076, --0.0015675591, -0.0014713993, -0.0013741725, -0.0012759234, -0.0011766978, --0.0010765418, -0.0009755024, -0.0008736271, -0.0007709638, -0.0006675613, --0.0005634687, -0.0004587356, -0.0003534123, -0.0002475493, -0.0001411978, --0.0000344092, 0.0000727645, 0.0001802712, 0.0002880581, 0.0003960723, -0.0005042607, 0.0006125697, 0.0007209455, 0.0008293342, 0.0009376817, -0.0010459336, 0.0011540355, 0.0012619327, 0.0013695707, 0.0014768947, -0.0015838501, 0.0016903819, 0.0017964356, 0.0019019563, 0.0020068897, -0.0021111811, 0.0022147762, 0.0023176209, 0.0024196611, 0.0025208431, -0.0026211132, 0.0027204184, 0.0028187055, 0.0029159221, 0.0030120157, -0.0031069345, 0.0032006271, 0.0032930424, 0.0033841298, 0.0034738392, -0.0035621211, 0.0036489264, 0.0037342067, 0.0038179142, 0.0039000017, -0.0039804224, 0.0040591307, 0.0041360811, 0.0042112294, 0.0042845317, -0.0043559452, 0.0044254276, 0.0044929376, 0.0045584348, 0.0046218796, -0.0046832332, 0.0047424579, 0.0047995168, 0.0048543739, 0.0049069944, -0.0049573443, 0.0050053908, 0.0050511019, 0.0050944469, 0.0051353961, -0.0051739208, 0.0052099936, 0.0052435880, 0.0052746789, 0.0053032421, -0.0053292549, 0.0053526956, 0.0053735437, 0.0053917800, 0.0054073864, -0.0054203464, 0.0054306444, 0.0054382662, 0.0054431990, 0.0054454311, -0.0054449524, 0.0054417538, 0.0054358277, 0.0054271679, 0.0054157694, -0.0054016287, 0.0053847435, 0.0053651130, 0.0053427377, 0.0053176194, -0.0052897616, 0.0052591688, 0.0052258471, 0.0051898039, 0.0051510480, -0.0051095896, 0.0050654404, 0.0050186133, 0.0049691226, 0.0049169842, -0.0048622151, 0.0048048338, 0.0047448602, 0.0046823156, 0.0046172225, -0.0045496048, 0.0044794879, 0.0044068984, 0.0043318642, 0.0042544146, -0.0041745801, 0.0040923927, 0.0040078855, 0.0039210929, 0.0038320506, -0.0037407955, 0.0036473659, 0.0035518011, 0.0034541416, 0.0033544293, -0.0032527070, 0.0031490190, 0.0030434103, 0.0029359274, 0.0028266176, -0.0027155294, 0.0026027124, 0.0024882172, 0.0023720954, 0.0022543995, -0.0021351832, 0.0020145008, 0.0018924077, 0.0017689604, 0.0016442159, -0.0015182322, 0.0013910681, 0.0012627833, 0.0011334381, 0.0010030935, -0.0008718115, 0.0007396544, 0.0006066854, 0.0004729683, 0.0003385673, -0.0002035473, 0.0000679738, -0.0000680874, -0.0002045699, -0.0003414068, --0.0004785311, -0.0006158750, -0.0007533707, -0.0008909501, -0.0010285445, --0.0011660854, -0.0013035038, -0.0014407305, -0.0015776965, -0.0017143323, --0.0018505686, -0.0019863359, -0.0021215650, -0.0022561863, -0.0023901305, --0.0025233286, -0.0026557114, -0.0027872101, -0.0029177559, -0.0030472806, --0.0031757159, -0.0033029941, -0.0034290478, -0.0035538097, -0.0036772133, --0.0037991925, -0.0039196815, -0.0040386151, -0.0041559288, -0.0042715586, --0.0043854410, -0.0044975134, -0.0046077137, -0.0047159807, -0.0048222538, --0.0049264734, -0.0050285805, -0.0051285171, -0.0052262260, -0.0053216511, --0.0054147371, -0.0055054298, -0.0055936757, -0.0056794229, -0.0057626201, --0.0058432173, -0.0059211657, -0.0059964175, -0.0060689262, -0.0061386464, --0.0062055342, -0.0062695467, -0.0063306424, -0.0063887812, -0.0064439242, --0.0064960339, -0.0065450743, -0.0065910108, -0.0066338102, -0.0066734406, --0.0067098718, -0.0067430751, -0.0067730233, -0.0067996905, -0.0068230526, --0.0068430871, -0.0068597730, -0.0068730909, -0.0068830230, -0.0068895532, --0.0068926670, -0.0068923516, -0.0068885959, -0.0068813904, -0.0068707273, --0.0068566006, -0.0068390059, -0.0068179406, -0.0067934038, -0.0067653964, --0.0067339208, -0.0066989815, -0.0066605844, -0.0066187374, -0.0065734501, --0.0065247337, -0.0064726014, -0.0064170679, -0.0063581499, -0.0062958655, --0.0062302350, -0.0061612801, -0.0060890242, -0.0060134928, -0.0059347128, --0.0058527128, -0.0057675233, -0.0056791763, -0.0055877057, -0.0054931469, --0.0053955370, -0.0052949147, -0.0051913206, -0.0050847965, -0.0049753861, --0.0048631346, -0.0047480887, -0.0046302969, -0.0045098089, -0.0043866761, --0.0042609514, -0.0041326891, -0.0040019449, -0.0038687761, -0.0037332412, --0.0035954003, -0.0034553146, -0.0033130467, -0.0031686607, -0.0030222217, --0.0028737961, -0.0027234517, -0.0025712572, -0.0024172826, -0.0022615991, --0.0021042788, -0.0019453950, -0.0017850218, -0.0016232347, -0.0014601097, --0.0012957241, -0.0011301557, -0.0009634835, -0.0007957871, -0.0006271469, --0.0004576441, -0.0002873606, -0.0001163788, 0.0000552181, 0.0002273465, -0.0003999219, 0.0005728599, 0.0007460750, 0.0009194817, 0.0010929941, -0.0012665257, 0.0014399901, 0.0016133002, 0.0017863692, 0.0019591096, -0.0021314343, 0.0023032557, 0.0024744865, 0.0026450392, 0.0028148263, -0.0029837607, 0.0031517551, 0.0033187227, 0.0034845767, 0.0036492306, -0.0038125983, 0.0039745941, 0.0041351326, 0.0042941290, 0.0044514987, -0.0046071580, 0.0047610235, 0.0049130126, 0.0050630433, 0.0052110344, -0.0053569054, 0.0055005764, 0.0056419687, 0.0057810043, 0.0059176061, -0.0060516980, 0.0061832049, 0.0063120528, 0.0064381688, 0.0065614810, -0.0066819189, 0.0067994129, 0.0069138948, 0.0070252979, 0.0071335564, -0.0072386063, 0.0073403846, 0.0074388300, 0.0075338826, 0.0076254839, -0.0077135771, 0.0077981068, 0.0078790195, 0.0079562629, 0.0080297867, -0.0080995421, 0.0081654823, 0.0082275620, 0.0082857377, 0.0083399679, -0.0083902126, 0.0084364341, 0.0084785963, 0.0085166650, 0.0085506081, -0.0085803953, 0.0086059984, 0.0086273912, 0.0086445494, 0.0086574509, -0.0086660755, 0.0086704051, 0.0086704239, 0.0086661178, 0.0086574753, -0.0086444866, 0.0086271443, 0.0086054431, 0.0085793798, 0.0085489535, -0.0085141652, 0.0084750184, 0.0084315187, 0.0083836737, 0.0083314935, -0.0082749902, 0.0082141782, 0.0081490739, 0.0080796962, 0.0080060659, -0.0079282063, 0.0078461426, 0.0077599023, 0.0076695152, 0.0075750131, -0.0074764299, 0.0073738019, 0.0072671672, 0.0071565665, 0.0070420421, -0.0069236387, 0.0068014030, 0.0066753838, 0.0065456319, 0.0064122001, -0.0062751433, 0.0061345183, 0.0059903840, 0.0058428010, 0.0056918321, -0.0055375418, 0.0053799965, 0.0052192645, 0.0050554159, 0.0048885224, -0.0047186578, 0.0045458972, 0.0043703178, 0.0041919982, 0.0040110187, -0.0038274611, 0.0036414089, 0.0034529470, 0.0032621617, 0.0030691410, -0.0028739740, 0.0026767514, 0.0024775651, 0.0022765082, 0.0020736751, -0.0018691616, 0.0016630642, 0.0014554808, 0.0012465104, 0.0010362529, -0.0008248091, 0.0006122807, 0.0003987705, 0.0001843818, -0.0000307810, --0.0002466130, -0.0004630087, -0.0006798618, -0.0008970655, -0.0011145124, --0.0013320949, -0.0015497047, -0.0017672333, -0.0019845719, -0.0022016113, --0.0024182424, -0.0026343555, -0.0028498413, -0.0030645902, -0.0032784925, --0.0034914390, -0.0037033203, -0.0039140271, -0.0041234507, -0.0043314824, --0.0045380139, -0.0047429375, -0.0049461458, -0.0051475318, -0.0053469893, --0.0055444126, -0.0057396967, -0.0059327375, -0.0061234313, -0.0063116757, --0.0064973689, -0.0066804102, -0.0068606997, -0.0070381389, -0.0072126301, --0.0073840769, -0.0075523841, -0.0077174578, -0.0078792054, -0.0080375355, --0.0081923585, -0.0083435859, -0.0084911310, -0.0086349083, -0.0087748343, --0.0089108270, -0.0090428060, -0.0091706929, -0.0092944108, -0.0094138849, --0.0095290421, -0.0096398114, -0.0097461236, -0.0098479117, -0.0099451104, --0.0100376569, -0.0101254902, -0.0102085518, -0.0102867850, -0.0103601356, --0.0104285517, -0.0104919834, -0.0105503836, -0.0106037071, -0.0106519113, --0.0106949562, -0.0107328038, -0.0107654191, -0.0107927692, -0.0108148239, --0.0108315555, -0.0108429390, -0.0108489518, -0.0108495740, -0.0108447883, --0.0108345802, -0.0108189376, -0.0107978513, -0.0107713147, -0.0107393238, --0.0107018776, -0.0106589775, -0.0106106278, -0.0105568355, -0.0104976103, --0.0104329648, -0.0103629142, -0.0102874763, -0.0102066721, -0.0101205249, --0.0100290609, -0.0099323091, -0.0098303012, -0.0097230716, -0.0096106574, --0.0094930984, -0.0093704371, -0.0092427188, -0.0091099913, -0.0089723051, --0.0088297134, -0.0086822719, -0.0085300391, -0.0083730758, -0.0082114456, --0.0080452144, -0.0078744508, -0.0076992258, -0.0075196129, -0.0073356879, --0.0071475291, -0.0069552170, -0.0067588348, -0.0065584675, -0.0063542028, --0.0061461303, -0.0059343419, -0.0057189316, -0.0054999956, -0.0052776322, --0.0050519414, -0.0048230256, -0.0045909889, -0.0043559371, -0.0041179783, --0.0038772221, -0.0036337797, -0.0033877643, -0.0031392906, -0.0028884748, --0.0026354347, -0.0023802898, -0.0021231606, -0.0018641693, -0.0016034392, --0.0013410951, -0.0010772627, -0.0008120690, -0.0005456421, -0.0002781110, --0.0000096058, 0.0002597426, 0.0005298025, 0.0008004413, 0.0010715259, -0.0013429225, 0.0016144965, 0.0018861131, 0.0021576369, 0.0024289322, -0.0026998629, 0.0029702926, 0.0032400851, 0.0035091036, 0.0037772115, -0.0040442724, 0.0043101496, 0.0045747069, 0.0048378082, 0.0050993177, -0.0053591000, 0.0056170202, 0.0058729437, 0.0061267367, 0.0063782659, -0.0066273989, 0.0068740040, 0.0071179501, 0.0073591075, 0.0075973470, -0.0078325408, 0.0080645621, 0.0082932854, 0.0085185861, 0.0087403414, -0.0089584296, 0.0091727305, 0.0093831254, 0.0095894973, 0.0097917307, -0.0099897118, 0.0101833288, 0.0103724714, 0.0105570314, 0.0107369026, -0.0109119807, 0.0110821634, 0.0112473506, 0.0114074445, 0.0115623494, -0.0117119718, 0.0118562209, 0.0119950079, 0.0121282468, 0.0122558537, -0.0123777476, 0.0124938499, 0.0126040849, 0.0127083792, 0.0128066625, -0.0128988671, 0.0129849281, 0.0130647837, 0.0131383746, 0.0132056448, -0.0132665411, 0.0133210134, 0.0133690146, 0.0134105007, 0.0134454309, -0.0134737674, 0.0134954756, 0.0135105241, 0.0135188849, 0.0135205330, -0.0135154468, 0.0135036081, 0.0134850017, 0.0134596160, 0.0134274427, -0.0133884768, 0.0133427167, 0.0132901641, 0.0132308244, 0.0131647059, -0.0130918209, 0.0130121845, 0.0129258157, 0.0128327367, 0.0127329732, -0.0126265542, 0.0125135122, 0.0123938831, 0.0122677061, 0.0121350239, -0.0119958827, 0.0118503317, 0.0116984238, 0.0115402150, 0.0113757647, -0.0112051357, 0.0110283940, 0.0108456087, 0.0106568524, 0.0104622007, -0.0102617324, 0.0100555296, 0.0098436773, 0.0096262638, 0.0094033802, -0.0091751208, 0.0089415828, 0.0087028663, 0.0084590744, 0.0082103130, -0.0079566907, 0.0076983191, 0.0074353122, 0.0071677869, 0.0068958626, -0.0066196614, 0.0063393077, 0.0060549285, 0.0057666532, 0.0054746135, -0.0051789434, 0.0048797791, 0.0045772590, 0.0042715235, 0.0039627152, -0.0036509786, 0.0033364600, 0.0030193077, 0.0026996717, 0.0023777036, -0.0020535569, 0.0017273863, 0.0013993484, 0.0010696008, 0.0007383027, -0.0004056145, 0.0000716978, -0.0002632848, -0.0005991694, -0.0009357916, --0.0012729856, -0.0016105852, -0.0019484233, -0.0022863322, -0.0026241437, --0.0029616890, -0.0032987991, -0.0036353045, -0.0039710357, -0.0043058228, --0.0046394962, -0.0049718859, -0.0053028224, -0.0056321361, -0.0059596580, --0.0062852192, -0.0066086514, -0.0069297868, -0.0072484582, -0.0075644993, --0.0078777443, -0.0081880284, -0.0084951880, -0.0087990603, -0.0090994836, --0.0093962976, -0.0096893433, -0.0099784629, -0.0102635002, -0.0105443006, --0.0108207111, -0.0110925803, -0.0113597589, -0.0116220991, -0.0118794553, --0.0121316840, -0.0123786435, -0.0126201946, -0.0128562002, -0.0130865257, --0.0133110387, -0.0135296094, -0.0137421107, -0.0139484179, -0.0141484092, --0.0143419654, -0.0145289703, -0.0147093105, -0.0148828756, -0.0150495583, --0.0152092543, -0.0153618625, -0.0155072851, -0.0156454275, -0.0157761985, --0.0158995102, -0.0160152781, -0.0161234215, -0.0162238629, -0.0163165287, --0.0164013487, -0.0164782565, -0.0165471894, -0.0166080887, -0.0166608992, --0.0167055697, -0.0167420530, -0.0167703057, -0.0167902885, -0.0168019658, --0.0168053065, -0.0168002831, -0.0167868725, -0.0167650556, -0.0167348174, --0.0166961471, -0.0166490381, -0.0165934878, -0.0165294981, -0.0164570748, --0.0163762282, -0.0162869726, -0.0161893267, -0.0160833133, -0.0159689596, --0.0158462969, -0.0157153607, -0.0155761910, -0.0154288318, -0.0152733313, --0.0151097420, -0.0149381205, -0.0147585277, -0.0145710286, -0.0143756923, --0.0141725921, -0.0139618053, -0.0137434133, -0.0135175016, -0.0132841597, --0.0130434809, -0.0127955627, -0.0125405063, -0.0122784169, -0.0120094035, --0.0117335789, -0.0114510595, -0.0111619655, -0.0108664208, -0.0105645529, --0.0102564926, -0.0099423745, -0.0096223365, -0.0092965198, -0.0089650690, --0.0086281320, -0.0082858597, -0.0079384063, -0.0075859290, -0.0072285880, --0.0068665463, -0.0064999700, -0.0061290276, -0.0057538906, -0.0053747331, --0.0049917315, -0.0046050648, -0.0042149145, -0.0038214642, -0.0034248998, --0.0030254092, -0.0026231826, -0.0022184119, -0.0018112910, -0.0014020154, --0.0009907824, -0.0005777908, -0.0001632411, 0.0002526650, 0.0006697246, -0.0010877333, 0.0015064860, 0.0019257762, 0.0023453967, 0.0027651394, -0.0031847958, 0.0036041564, 0.0040230114, 0.0044411507, 0.0048583636, -0.0052744396, 0.0056891678, 0.0061023376, 0.0065137383, 0.0069231595, -0.0073303912, 0.0077352238, 0.0081374483, 0.0085368563, 0.0089332402, -0.0093263932, 0.0097161095, 0.0101021845, 0.0104844146, 0.0108625976, -0.0112365327, 0.0116060206, 0.0119708635, 0.0123308655, 0.0126858322, -0.0130355714, 0.0133798928, 0.0137186083, 0.0140515319, 0.0143784798, -0.0146992710, 0.0150137267, 0.0153216706, 0.0156229295, 0.0159173327, -0.0162047124, 0.0164849039, 0.0167577456, 0.0170230788, 0.0172807484, -0.0175306024, 0.0177724922, 0.0180062730, 0.0182318033, 0.0184489453, -0.0186575650, 0.0188575324, 0.0190487212, 0.0192310091, 0.0194042780, -0.0195684137, 0.0197233063, 0.0198688503, 0.0200049443, 0.0201314915, -0.0202483994, 0.0203555801, 0.0204529502, 0.0205404311, 0.0206179485, -0.0206854333, 0.0207428209, 0.0207900516, 0.0208270705, 0.0208538278, -0.0208702784, 0.0208763824, 0.0208721048, 0.0208574158, 0.0208322904, -0.0207967092, 0.0207506574, 0.0206941258, 0.0206271102, 0.0205496115, -0.0204616360, 0.0203631952, 0.0202543057, 0.0201349897, 0.0200052742, -0.0198651918, 0.0197147802, 0.0195540825, 0.0193831468, 0.0192020266, -0.0190107807, 0.0188094731, 0.0185981728, 0.0183769543, 0.0181458969, -0.0179050854, 0.0176546096, 0.0173945641, 0.0171250491, 0.0168461693, -0.0165580347, 0.0162607600, 0.0159544652, 0.0156392747, 0.0153153180, -0.0149827292, 0.0146416472, 0.0142922156, 0.0139345826, 0.0135689006, -0.0131953271, 0.0128140234, 0.0124251554, 0.0120288935, 0.0116254119, -0.0112148892, 0.0107975079, 0.0103734546, 0.0099429197, 0.0095060974, -0.0090631859, 0.0086143866, 0.0081599047, 0.0076999490, 0.0072347313, -0.0067644670, 0.0062893745, 0.0058096753, 0.0053255940, 0.0048373579, -0.0043451972, 0.0038493447, 0.0033500357, 0.0028475082, 0.0023420022, -0.0018337601, 0.0013230264, 0.0008100476, 0.0002950720, -0.0002216501, --0.0007398671, -0.0012593256, -0.0017797709, -0.0023009471, -0.0028225970, --0.0033444625, -0.0038662845, -0.0043878030, -0.0049087577, -0.0054288875, --0.0059479308, -0.0064656261, -0.0069817115, -0.0074959251, -0.0080080052, --0.0085176902, -0.0090247190, -0.0095288312, -0.0100297665, -0.0105272660, --0.0110210713, -0.0115109251, -0.0119965714, -0.0124777553, -0.0129542235, --0.0134257242, -0.0138920072, -0.0143528243, -0.0148079291, -0.0152570773, --0.0157000268, -0.0161365379, -0.0165663733, -0.0169892981, -0.0174050805, --0.0178134913, -0.0182143041, -0.0186072958, -0.0189922466, -0.0193689396, --0.0197371617, -0.0200967031, -0.0204473579, -0.0207889239, -0.0211212026, --0.0214439997, -0.0217571249, -0.0220603922, -0.0223536199, -0.0226366307, --0.0229092517, -0.0231713149, -0.0234226568, -0.0236631188, -0.0238925473, --0.0241107934, -0.0243177136, -0.0245131696, -0.0246970280, -0.0248691612, --0.0250294468, -0.0251777677, -0.0253140129, -0.0254380765, -0.0255498588, --0.0256492655, -0.0257362083, -0.0258106050, -0.0258723791, -0.0259214603, --0.0259577843, -0.0259812930, -0.0259919344, -0.0259896629, -0.0259744389, --0.0259462294, -0.0259050075, -0.0258507529, -0.0257834515, -0.0257030959, --0.0256096849, -0.0255032239, -0.0253837247, -0.0252512059, -0.0251056924, --0.0249472155, -0.0247758133, -0.0245915303, -0.0243944177, -0.0241845329, --0.0239619403, -0.0237267103, -0.0234789202, -0.0232186535, -0.0229460004, --0.0226610575, -0.0223639275, -0.0220547199, -0.0217335503, -0.0214005407, --0.0210558192, -0.0206995203, -0.0203317846, -0.0199527589, -0.0195625960, --0.0191614546, -0.0187494996, -0.0183269017, -0.0178938372, -0.0174504885, --0.0169970434, -0.0165336956, -0.0160606440, -0.0155780931, -0.0150862529, --0.0145853384, -0.0140755700, -0.0135571731, -0.0130303781, -0.0124954204, --0.0119525400, -0.0114019817, -0.0108439950, -0.0102788338, -0.0097067561, --0.0091280246, -0.0085429059, -0.0079516706, -0.0073545932, -0.0067519520, --0.0061440290, -0.0055311097, -0.0049134828, -0.0042914406, -0.0036652782, --0.0030352938, -0.0024017885, -0.0017650660, -0.0011254327, -0.0004831972, -0.0001613293, 0.0008078339, 0.0014560012, 0.0021055145, 0.0027560551, -0.0034073028, 0.0040589362, 0.0047106324, 0.0053620678, 0.0060129176, -0.0066628564, 0.0073115581, 0.0079586963, 0.0086039444, 0.0092469753, -0.0098874625, 0.0105250794, 0.0111594997, 0.0117903979, 0.0124174490, -0.0130403290, 0.0136587149, 0.0142722848, 0.0148807183, 0.0154836965, -0.0160809021, 0.0166720197, 0.0172567358, 0.0178347393, 0.0184057213, -0.0189693753, 0.0195253977, 0.0200734874, 0.0206133465, 0.0211446801, -0.0216671967, 0.0221806081, 0.0226846298, 0.0231789810, 0.0236633848, -0.0241375683, 0.0246012629, 0.0250542041, 0.0254961322, 0.0259267919, -0.0263459327, 0.0267533090, 0.0271486805, 0.0275318116, 0.0279024723, -0.0282604381, 0.0286054900, 0.0289374145, 0.0292560042, 0.0295610575, -0.0298523789, 0.0301297791, 0.0303930749, 0.0306420898, 0.0308766536, -0.0310966027, 0.0313017804, 0.0314920367, 0.0316672284, 0.0318272194, -0.0319718809, 0.0321010909, 0.0322147348, 0.0323127056, 0.0323949034, -0.0324612358, 0.0325116182, 0.0325459735, 0.0325642322, 0.0325663326, -0.0325522210, 0.0325218512, 0.0324751853, 0.0324121930, 0.0323328523, -0.0322371490, 0.0321250770, 0.0319966384, 0.0318518433, 0.0316907100, -0.0315132649, 0.0313195427, 0.0311095860, 0.0308834460, 0.0306411817, -0.0303828605, 0.0301085578, 0.0298183574, 0.0295123510, 0.0291906387, -0.0288533284, 0.0285005363, 0.0281323866, 0.0277490115, 0.0273505511, -0.0269371536, 0.0265089750, 0.0260661791, 0.0256089375, 0.0251374295, -0.0246518421, 0.0241523699, 0.0236392150, 0.0231125868, 0.0225727023, -0.0220197857, 0.0214540682, 0.0208757885, 0.0202851918, 0.0196825308, -0.0190680644, 0.0184420586, 0.0178047860, 0.0171565254, 0.0164975622, -0.0158281880, 0.0151487004, 0.0144594032, 0.0137606059, 0.0130526237, -0.0123357777, 0.0116103940, 0.0108768043, 0.0101353455, 0.0093863594, -0.0086301925, 0.0078671964, 0.0070977270, 0.0063221446, 0.0055408137, -0.0047541030, 0.0039623850, 0.0031660360, 0.0023654356, 0.0015609671, -0.0007530169, -0.0000580258, -0.0008717687, -0.0016878170, -0.0025057733, --0.0033252381, -0.0041458096, -0.0049670844, -0.0057886571, -0.0066101210, --0.0074310679, -0.0082510887, -0.0090697732, -0.0098867106, -0.0107014895, --0.0115136982, -0.0123229249, -0.0131287579, -0.0139307858, -0.0147285976, --0.0155217831, -0.0163099329, -0.0170926389, -0.0178694941, -0.0186400931, --0.0194040323, -0.0201609098, -0.0209103260, -0.0216518837, -0.0223851881, --0.0231098472, -0.0238254719, -0.0245316762, -0.0252280776, -0.0259142971, --0.0265899594, -0.0272546930, -0.0279081308, -0.0285499099, -0.0291796719, --0.0297970631, -0.0304017349, -0.0309933435, -0.0315715507, -0.0321360235, --0.0326864346, -0.0332224626, -0.0337437921, -0.0342501139, -0.0347411250, --0.0352165291, -0.0356760366, -0.0361193646, -0.0365462373, -0.0369563861, --0.0373495498, -0.0377254745, -0.0380839142, -0.0384246304, -0.0387473928, --0.0390519790, -0.0393381748, -0.0396057745, -0.0398545807, -0.0400844047, --0.0402950665, -0.0404863949, -0.0406582277, -0.0408104118, -0.0409428031, --0.0410552669, -0.0411476780, -0.0412199204, -0.0412718878, -0.0413034835, --0.0413146206, -0.0413052219, -0.0412752200, -0.0412245577, -0.0411531875, --0.0410610721, -0.0409481843, -0.0408145071, -0.0406600336, -0.0404847672, --0.0402887216, -0.0400719206, -0.0398343986, -0.0395762002, -0.0392973804, --0.0389980046, -0.0386781484, -0.0383378980, -0.0379773497, -0.0375966105, --0.0371957974, -0.0367750379, -0.0363344698, -0.0358742410, -0.0353945098, --0.0348954445, -0.0343772237, -0.0338400360, -0.0332840800, -0.0327095642, --0.0321167073, -0.0315057374, -0.0308768926, -0.0302304205, -0.0295665785, --0.0288856333, -0.0281878610, -0.0274735469, -0.0267429858, -0.0259964811, --0.0252343455, -0.0244569004, -0.0236644758, -0.0228574104, -0.0220360513, --0.0212007538, -0.0203518815, -0.0194898058, -0.0186149061, -0.0177275694, --0.0168281903, -0.0159171706, -0.0149949194, -0.0140618528, -0.0131183937, --0.0121649716, -0.0112020226, -0.0102299890, -0.0092493190, -0.0082604669, --0.0072638927, -0.0062600617, -0.0052494445, -0.0042325168, -0.0032097591, --0.0021816566, -0.0011486988, -0.0001113794, 0.0009298040, 0.0019743499, -0.0030217536, 0.0040715069, 0.0051230987, 0.0061760151, 0.0072297398, -0.0082837539, 0.0093375368, 0.0103905658, 0.0114423169, 0.0124922647, -0.0135398828, 0.0145846438, 0.0156260201, 0.0166634836, 0.0176965062, -0.0187245601, 0.0197471179, 0.0207636531, 0.0217736400, 0.0227765544, -0.0237718735, 0.0247590762, 0.0257376438, 0.0267070595, 0.0276668094, -0.0286163823, 0.0295552701, 0.0304829681, 0.0313989751, 0.0323027939, -0.0331939315, 0.0340718990, 0.0349362125, 0.0357863927, 0.0366219656, -0.0374424626, 0.0382474207, 0.0390363829, 0.0398088980, 0.0405645217, -0.0413028159, 0.0420233496, 0.0427256986, 0.0434094465, 0.0440741841, -0.0447195100, 0.0453450309, 0.0459503619, 0.0465351261, 0.0470989558, -0.0476414918, 0.0481623841, 0.0486612920, 0.0491378843, 0.0495918395, -0.0500228460, 0.0504306021, 0.0508148166, 0.0511752086, 0.0515115078, -0.0518234548, 0.0521108010, 0.0523733090, 0.0526107526, 0.0528229172, -0.0530095996, 0.0531706083, 0.0533057638, 0.0534148984, 0.0534978568, -0.0535544955, 0.0535846837, 0.0535883030, 0.0535652475, 0.0535154239, -0.0534387518, 0.0533351636, 0.0532046046, 0.0530470330, 0.0528624204, -0.0526507512, 0.0524120231, 0.0521462471, 0.0518534476, 0.0515336620, -0.0511869413, 0.0508133500, 0.0504129657, 0.0499858797, 0.0495321967, -0.0490520346, 0.0485455250, 0.0480128128, 0.0474540563, 0.0468694272, -0.0462591107, 0.0456233049, 0.0449622216, 0.0442760856, 0.0435651348, -0.0428296204, 0.0420698064, 0.0412859698, 0.0404784006, 0.0396474015, -0.0387932877, 0.0379163872, 0.0370170403, 0.0360955999, 0.0351524307, -0.0341879100, 0.0332024265, 0.0321963813, 0.0311701866, 0.0301242667, -0.0290590567, 0.0279750034, 0.0268725642, 0.0257522075, 0.0246144125, -0.0234596687, 0.0222884760, 0.0211013441, 0.0198987930, 0.0186813520, -0.0174495601, 0.0162039652, 0.0149451245, 0.0136736037, 0.0123899774, -0.0110948280, 0.0097887463, 0.0084723306, 0.0071461869, 0.0058109285, -0.0044671755, 0.0031155547, 0.0017566996, 0.0003912497, -0.0009801497, --0.0023568476, -0.0037381876, -0.0051235086, -0.0065121445, -0.0079034250, --0.0092966754, -0.0106912177, -0.0120863699, -0.0134814472, -0.0148757617, --0.0162686232, -0.0176593392, -0.0190472153, -0.0204315554, -0.0218116625, --0.0231868384, -0.0245563845, -0.0259196020, -0.0272757920, -0.0286242563, --0.0299642972, -0.0312952185, -0.0326163250, -0.0339269237, -0.0352263234, --0.0365138356, -0.0377887747, -0.0390504580, -0.0402982064, -0.0415313447, --0.0427492019, -0.0439511115, -0.0451364118, -0.0463044463, -0.0474545642, --0.0485861203, -0.0496984759, -0.0507909987, -0.0518630632, -0.0529140513, --0.0539433522, -0.0549503631, -0.0559344894, -0.0568951448, -0.0578317521, --0.0587437430, -0.0596305587, -0.0604916501, -0.0613264784, -0.0621345148, --0.0629152414, -0.0636681511, -0.0643927482, -0.0650885482, -0.0657550788, --0.0663918795, -0.0669985022, -0.0675745116, -0.0681194850, -0.0686330131, --0.0691146997, -0.0695641626, -0.0699810331, -0.0703649569, -0.0707155940, --0.0710326189, -0.0713157209, -0.0715646043, -0.0717789887, -0.0719586091, --0.0721032160, -0.0722125759, -0.0722864709, -0.0723246997, -0.0723270771, --0.0722934344, -0.0722236195, -0.0721174972, -0.0719749490, -0.0717958738, --0.0715801873, -0.0713278227, -0.0710387307, -0.0707128793, -0.0703502542, --0.0699508588, -0.0695147141, -0.0690418592, -0.0685323510, -0.0679862642, --0.0674036916, -0.0667847442, -0.0661295508, -0.0654382585, -0.0647110323, --0.0639480554, -0.0631495291, -0.0623156729, -0.0614467242, -0.0605429384, --0.0596045891, -0.0586319676, -0.0576253834, -0.0565851636, -0.0555116532, --0.0544052146, -0.0532662283, -0.0520950917, -0.0508922201, -0.0496580458, --0.0483930182, -0.0470976040, -0.0457722864, -0.0444175657, -0.0430339585, --0.0416219979, -0.0401822332, -0.0387152298, -0.0372215690, -0.0357018476, --0.0341566780, -0.0325866877, -0.0309925194, -0.0293748304, -0.0277342927, --0.0260715924, -0.0243874299, -0.0226825192, -0.0209575878, -0.0192133766, --0.0174506393, -0.0156701424, -0.0138726645, -0.0120589966, -0.0102299412, --0.0083863124, -0.0065289352, -0.0046586456, -0.0027762899, -0.0008827244, -0.0010211847, 0.0029345619, 0.0048565227, 0.0067861739, 0.0087226141, -0.0106649339, 0.0126122165, 0.0145635380, 0.0165179676, 0.0184745685, -0.0204323977, 0.0223905068, 0.0243479423, 0.0263037461, 0.0282569558, -0.0302066051, 0.0321517244, 0.0340913411, 0.0360244802, 0.0379501644, -0.0398674149, 0.0417752518, 0.0436726943, 0.0455587612, 0.0474324718, -0.0492928457, 0.0511389038, 0.0529696683, 0.0547841636, 0.0565814165, -0.0583604566, 0.0601203169, 0.0618600345, 0.0635786504, 0.0652752107, -0.0669487665, 0.0685983747, 0.0702230985, 0.0718220074, 0.0733941783, -0.0749386954, 0.0764546512, 0.0779411463, 0.0793972906, 0.0808222031, -0.0822150126, 0.0835748586, 0.0849008908, 0.0861922705, 0.0874481703, -0.0886677751, 0.0898502822, 0.0909949018, 0.0921008575, 0.0931673867, -0.0941937410, 0.0951791867, 0.0961230049, 0.0970244924, 0.0978829617, -0.0986977416, 0.0994681776, 0.1001936321, 0.1008734849, 0.1015071339, -0.1020939947, 0.1026335017, 0.1031251081, 0.1035682863, 0.1039625284, -0.1043073461, 0.1046022718, 0.1048468579, 0.1050406782, 0.1051833274, -0.1052744216, 0.1053135989, 0.1053005193, 0.1052348653, 0.1051163417, -0.1049446764, 0.1047196204, 0.1044409479, 0.1041084567, 0.1037219686, -0.1032813291, 0.1027864082, 0.1022371001, 0.1016333237, 0.1009750227, -0.1002621657, 0.0994947463, 0.0986727834, 0.0977963213, 0.0968654299, -0.0958802044, 0.0948407661, 0.0937472617, 0.0925998642, 0.0913987723, -0.0901442107, 0.0888364304, 0.0874757082, 0.0860623475, 0.0845966773, -0.0830790532, 0.0815098568, 0.0798894959, 0.0782184043, 0.0764970420, -0.0747258951, 0.0729054754, 0.0710363210, 0.0691189955, 0.0671540883, -0.0651422145, 0.0630840147, 0.0609801548, 0.0588313260, 0.0566382445, -0.0544016516, 0.0521223131, 0.0498010197, 0.0474385862, 0.0450358517, -0.0425936791, 0.0401129553, 0.0375945904, 0.0350395180, 0.0324486944, -0.0298230988, 0.0271637328, 0.0244716200, 0.0217478060, 0.0189933578, -0.0162093637, 0.0133969326, 0.0105571942, 0.0076912982, 0.0048004142, -0.0018857311, -0.0010515431, -0.0040101818, -0.0069889400, -0.0099865552, --0.0130017470, -0.0160332186, -0.0190796561, -0.0221397300, -0.0252120948, --0.0282953900, -0.0313882404, -0.0344892565, -0.0375970350, -0.0407101596, --0.0438272010, -0.0469467180, -0.0500672573, -0.0531873547, -0.0563055352, --0.0594203139, -0.0625301961, -0.0656336781, -0.0687292478, -0.0718153853, --0.0748905633, -0.0779532475, -0.0810018979, -0.0840349685, -0.0870509084, --0.0900481623, -0.0930251712, -0.0959803727, -0.0989122018, -0.1018190916, --0.1046994738, -0.1075517791, -0.1103744383, -0.1131658825, -0.1159245439, --0.1186488564, -0.1213372563, -0.1239881827, -0.1266000784, -0.1291713903, --0.1317005702, -0.1341860754, -0.1366263692, -0.1390199217, -0.1413652104, --0.1436607206, -0.1459049465, -0.1480963913, -0.1502335681, -0.1523150008, --0.1543392240, -0.1563047842, -0.1582102405, -0.1600541646, -0.1618351421, --0.1635517727, -0.1652026708, -0.1667864664, -0.1683018055, -0.1697473506, --0.1711217816, -0.1724237959, -0.1736521096, -0.1748054577, -0.1758825945, --0.1768822946, -0.1778033533, -0.1786445870, -0.1794048340, -0.1800829546, --0.1806778324, -0.1811883740, -0.1816135100, -0.1819521956, -0.1822034106, --0.1823661605, -0.1824394765, -0.1824224162, -0.1823140643, -0.1821135324, --0.1818199604, -0.1814325160, -0.1809503957, -0.1803728252, -0.1796990596, --0.1789283840, -0.1780601136, -0.1770935947, -0.1760282042, -0.1748633509, --0.1735984751, -0.1722330493, -0.1707665787, -0.1691986010, -0.1675286871, --0.1657564415, -0.1638815022, -0.1619035412, -0.1598222647, -0.1576374137, --0.1553487634, -0.1529561244, -0.1504593422, -0.1478582978, -0.1451529077, --0.1423431241, -0.1394289353, -0.1364103652, -0.1332874743, -0.1300603591, --0.1267291528, -0.1232940247, -0.1197551811, -0.1161128647, -0.1123673549, --0.1085189679, -0.1045680566, -0.1005150108, -0.0963602570, -0.0921042585, --0.0877475152, -0.0832905640, -0.0787339781, -0.0740783674, -0.0693243784, --0.0644726937, -0.0595240325, -0.0544791499, -0.0493388371, -0.0441039212, --0.0387752649, -0.0333537664, -0.0278403591, -0.0222360119, -0.0165417281, --0.0107585458, -0.0048875377, 0.0010701897, 0.0071134959, 0.0132412068, -0.0194521151, 0.0257449807, 0.0321185306, 0.0385714598, 0.0451024313, -0.0517100765, 0.0583929957, 0.0651497585, 0.0719789041, 0.0788789416, -0.0858483508, 0.0928855823, 0.0999890582, 0.1071571724, 0.1143882911, -0.1216807533, 0.1290328713, 0.1364429314, 0.1439091941, 0.1514298947, -0.1590032442, 0.1666274291, 0.1743006130, 0.1820209363, 0.1897865170, -0.1975954515, 0.2054458153, 0.2133356630, 0.2212630296, 0.2292259307, -0.2372223633, 0.2452503065, 0.2533077219, 0.2613925546, 0.2695027336, -0.2776361727, 0.2857907708, 0.2939644130, 0.3021549712, 0.3103603046, -0.3185782607, 0.3268066755, 0.3350433750, 0.3432861752, 0.3515328833, -0.3597812980, 0.3680292108, 0.3762744061, 0.3845146625, 0.3927477532, -0.4009714470, 0.4091835086, 0.4173817001, 0.4255637810, 0.4337275094, -0.4418706427, 0.4499909381, 0.4580861540, 0.4661540499, 0.4741923878, -0.4821989328, 0.4901714538, 0.4981077244, 0.5060055234, 0.5138626359, -0.5216768538, 0.5294459766, 0.5371678125, 0.5448401785, 0.5524609020, -0.5600278206, 0.5675387836, 0.5749916526, 0.5823843019, 0.5897146196, -0.5969805081, 0.6041798851, 0.6113106841, 0.6183708551, 0.6253583655, -0.6322712007, 0.6391073649, 0.6458648816, 0.6525417945, 0.6591361680, -0.6656460881, 0.6720696629, 0.6784050234, 0.6846503240, 0.6908037433, -0.6968634846, 0.7028277766, 0.7086948742, 0.7144630588, 0.7201306391, -0.7256959517, 0.7311573616, 0.7365132628, 0.7417620790, 0.7469022639, -0.7519323022, 0.7568507094, 0.7616560333, 0.7663468534, 0.7709217826, -0.7753794666, 0.7797185851, 0.7839378519, 0.7880360158, 0.7920118604, -0.7958642049, 0.7995919047, 0.8031938516, 0.8066689739, 0.8100162374, -0.8132346454, 0.8163232389, 0.8192810973, 0.8221073386, 0.8248011197, -0.8273616366, 0.8297881248, 0.8320798597, 0.8342361565, 0.8362563709, -0.8381398988, 0.8398861771, 0.8414946834, 0.8429649364, 0.8442964963, -0.8454889644, 0.8465419838, 0.8474552392, 0.8482284572, 0.8488614061, -0.8493538965, 0.8497057807, 0.8499169534, 0.8499873514, 0.8499169534, -0.8497057807, 0.8493538965, 0.8488614061, 0.8482284572, 0.8474552392, -0.8465419838, 0.8454889644, 0.8442964963, 0.8429649364, 0.8414946834, -0.8398861771, 0.8381398988, 0.8362563709, 0.8342361565, 0.8320798597, -0.8297881248, 0.8273616366, 0.8248011197, 0.8221073386, 0.8192810973, -0.8163232389, 0.8132346454, 0.8100162374, 0.8066689739, 0.8031938516, -0.7995919047, 0.7958642049, 0.7920118604, 0.7880360158, 0.7839378519, -0.7797185851, 0.7753794666, 0.7709217826, 0.7663468534, 0.7616560333, -0.7568507094, 0.7519323022, 0.7469022639, 0.7417620790, 0.7365132628, -0.7311573616, 0.7256959517, 0.7201306391, 0.7144630588, 0.7086948742, -0.7028277766, 0.6968634846, 0.6908037433, 0.6846503240, 0.6784050234, -0.6720696629, 0.6656460881, 0.6591361680, 0.6525417945, 0.6458648816, -0.6391073649, 0.6322712007, 0.6253583655, 0.6183708551, 0.6113106841, -0.6041798851, 0.5969805081, 0.5897146196, 0.5823843019, 0.5749916526, -0.5675387836, 0.5600278206, 0.5524609020, 0.5448401785, 0.5371678125, -0.5294459766, 0.5216768538, 0.5138626359, 0.5060055234, 0.4981077244, -0.4901714538, 0.4821989328, 0.4741923878, 0.4661540499, 0.4580861540, -0.4499909381, 0.4418706427, 0.4337275094, 0.4255637810, 0.4173817001, -0.4091835086, 0.4009714470, 0.3927477532, 0.3845146625, 0.3762744061, -0.3680292108, 0.3597812980, 0.3515328833, 0.3432861752, 0.3350433750, -0.3268066755, 0.3185782607, 0.3103603046, 0.3021549712, 0.2939644130, -0.2857907708, 0.2776361727, 0.2695027336, 0.2613925546, 0.2533077219, -0.2452503065, 0.2372223633, 0.2292259307, 0.2212630296, 0.2133356630, -0.2054458153, 0.1975954515, 0.1897865170, 0.1820209363, 0.1743006130, -0.1666274291, 0.1590032442, 0.1514298947, 0.1439091941, 0.1364429314, -0.1290328713, 0.1216807533, 0.1143882911, 0.1071571724, 0.0999890582, -0.0928855823, 0.0858483508, 0.0788789416, 0.0719789041, 0.0651497585, -0.0583929957, 0.0517100765, 0.0451024313, 0.0385714598, 0.0321185306, -0.0257449807, 0.0194521151, 0.0132412068, 0.0071134959, 0.0010701897, --0.0048875377, -0.0107585458, -0.0165417281, -0.0222360119, -0.0278403591, --0.0333537664, -0.0387752649, -0.0441039212, -0.0493388371, -0.0544791499, --0.0595240325, -0.0644726937, -0.0693243784, -0.0740783674, -0.0787339781, --0.0832905640, -0.0877475152, -0.0921042585, -0.0963602570, -0.1005150108, --0.1045680566, -0.1085189679, -0.1123673549, -0.1161128647, -0.1197551811, --0.1232940247, -0.1267291528, -0.1300603591, -0.1332874743, -0.1364103652, --0.1394289353, -0.1423431241, -0.1451529077, -0.1478582978, -0.1504593422, --0.1529561244, -0.1553487634, -0.1576374137, -0.1598222647, -0.1619035412, --0.1638815022, -0.1657564415, -0.1675286871, -0.1691986010, -0.1707665787, --0.1722330493, -0.1735984751, -0.1748633509, -0.1760282042, -0.1770935947, --0.1780601136, -0.1789283840, -0.1796990596, -0.1803728252, -0.1809503957, --0.1814325160, -0.1818199604, -0.1821135324, -0.1823140643, -0.1824224162, --0.1824394765, -0.1823661605, -0.1822034106, -0.1819521956, -0.1816135100, --0.1811883740, -0.1806778324, -0.1800829546, -0.1794048340, -0.1786445870, --0.1778033533, -0.1768822946, -0.1758825945, -0.1748054577, -0.1736521096, --0.1724237959, -0.1711217816, -0.1697473506, -0.1683018055, -0.1667864664, --0.1652026708, -0.1635517727, -0.1618351421, -0.1600541646, -0.1582102405, --0.1563047842, -0.1543392240, -0.1523150008, -0.1502335681, -0.1480963913, --0.1459049465, -0.1436607206, -0.1413652104, -0.1390199217, -0.1366263692, --0.1341860754, -0.1317005702, -0.1291713903, -0.1266000784, -0.1239881827, --0.1213372563, -0.1186488564, -0.1159245439, -0.1131658825, -0.1103744383, --0.1075517791, -0.1046994738, -0.1018190916, -0.0989122018, -0.0959803727, --0.0930251712, -0.0900481623, -0.0870509084, -0.0840349685, -0.0810018979, --0.0779532475, -0.0748905633, -0.0718153853, -0.0687292478, -0.0656336781, --0.0625301961, -0.0594203139, -0.0563055352, -0.0531873547, -0.0500672573, --0.0469467180, -0.0438272010, -0.0407101596, -0.0375970350, -0.0344892565, --0.0313882404, -0.0282953900, -0.0252120948, -0.0221397300, -0.0190796561, --0.0160332186, -0.0130017470, -0.0099865552, -0.0069889400, -0.0040101818, --0.0010515431, 0.0018857311, 0.0048004142, 0.0076912982, 0.0105571942, -0.0133969326, 0.0162093637, 0.0189933578, 0.0217478060, 0.0244716200, -0.0271637328, 0.0298230988, 0.0324486944, 0.0350395180, 0.0375945904, -0.0401129553, 0.0425936791, 0.0450358517, 0.0474385862, 0.0498010197, -0.0521223131, 0.0544016516, 0.0566382445, 0.0588313260, 0.0609801548, -0.0630840147, 0.0651422145, 0.0671540883, 0.0691189955, 0.0710363210, -0.0729054754, 0.0747258951, 0.0764970420, 0.0782184043, 0.0798894959, -0.0815098568, 0.0830790532, 0.0845966773, 0.0860623475, 0.0874757082, -0.0888364304, 0.0901442107, 0.0913987723, 0.0925998642, 0.0937472617, -0.0948407661, 0.0958802044, 0.0968654299, 0.0977963213, 0.0986727834, -0.0994947463, 0.1002621657, 0.1009750227, 0.1016333237, 0.1022371001, -0.1027864082, 0.1032813291, 0.1037219686, 0.1041084567, 0.1044409479, -0.1047196204, 0.1049446764, 0.1051163417, 0.1052348653, 0.1053005193, -0.1053135989, 0.1052744216, 0.1051833274, 0.1050406782, 0.1048468579, -0.1046022718, 0.1043073461, 0.1039625284, 0.1035682863, 0.1031251081, -0.1026335017, 0.1020939947, 0.1015071339, 0.1008734849, 0.1001936321, -0.0994681776, 0.0986977416, 0.0978829617, 0.0970244924, 0.0961230049, -0.0951791867, 0.0941937410, 0.0931673867, 0.0921008575, 0.0909949018, -0.0898502822, 0.0886677751, 0.0874481703, 0.0861922705, 0.0849008908, -0.0835748586, 0.0822150126, 0.0808222031, 0.0793972906, 0.0779411463, -0.0764546512, 0.0749386954, 0.0733941783, 0.0718220074, 0.0702230985, -0.0685983747, 0.0669487665, 0.0652752107, 0.0635786504, 0.0618600345, -0.0601203169, 0.0583604566, 0.0565814165, 0.0547841636, 0.0529696683, -0.0511389038, 0.0492928457, 0.0474324718, 0.0455587612, 0.0436726943, -0.0417752518, 0.0398674149, 0.0379501644, 0.0360244802, 0.0340913411, -0.0321517244, 0.0302066051, 0.0282569558, 0.0263037461, 0.0243479423, -0.0223905068, 0.0204323977, 0.0184745685, 0.0165179676, 0.0145635380, -0.0126122165, 0.0106649339, 0.0087226141, 0.0067861739, 0.0048565227, -0.0029345619, 0.0010211847, -0.0008827244, -0.0027762899, -0.0046586456, --0.0065289352, -0.0083863124, -0.0102299412, -0.0120589966, -0.0138726645, --0.0156701424, -0.0174506393, -0.0192133766, -0.0209575878, -0.0226825192, --0.0243874299, -0.0260715924, -0.0277342927, -0.0293748304, -0.0309925194, --0.0325866877, -0.0341566780, -0.0357018476, -0.0372215690, -0.0387152298, --0.0401822332, -0.0416219979, -0.0430339585, -0.0444175657, -0.0457722864, --0.0470976040, -0.0483930182, -0.0496580458, -0.0508922201, -0.0520950917, --0.0532662283, -0.0544052146, -0.0555116532, -0.0565851636, -0.0576253834, --0.0586319676, -0.0596045891, -0.0605429384, -0.0614467242, -0.0623156729, --0.0631495291, -0.0639480554, -0.0647110323, -0.0654382585, -0.0661295508, --0.0667847442, -0.0674036916, -0.0679862642, -0.0685323510, -0.0690418592, --0.0695147141, -0.0699508588, -0.0703502542, -0.0707128793, -0.0710387307, --0.0713278227, -0.0715801873, -0.0717958738, -0.0719749490, -0.0721174972, --0.0722236195, -0.0722934344, -0.0723270771, -0.0723246997, -0.0722864709, --0.0722125759, -0.0721032160, -0.0719586091, -0.0717789887, -0.0715646043, --0.0713157209, -0.0710326189, -0.0707155940, -0.0703649569, -0.0699810331, --0.0695641626, -0.0691146997, -0.0686330131, -0.0681194850, -0.0675745116, --0.0669985022, -0.0663918795, -0.0657550788, -0.0650885482, -0.0643927482, --0.0636681511, -0.0629152414, -0.0621345148, -0.0613264784, -0.0604916501, --0.0596305587, -0.0587437430, -0.0578317521, -0.0568951448, -0.0559344894, --0.0549503631, -0.0539433522, -0.0529140513, -0.0518630632, -0.0507909987, --0.0496984759, -0.0485861203, -0.0474545642, -0.0463044463, -0.0451364118, --0.0439511115, -0.0427492019, -0.0415313447, -0.0402982064, -0.0390504580, --0.0377887747, -0.0365138356, -0.0352263234, -0.0339269237, -0.0326163250, --0.0312952185, -0.0299642972, -0.0286242563, -0.0272757920, -0.0259196020, --0.0245563845, -0.0231868384, -0.0218116625, -0.0204315554, -0.0190472153, --0.0176593392, -0.0162686232, -0.0148757617, -0.0134814472, -0.0120863699, --0.0106912177, -0.0092966754, -0.0079034250, -0.0065121445, -0.0051235086, --0.0037381876, -0.0023568476, -0.0009801497, 0.0003912497, 0.0017566996, -0.0031155547, 0.0044671755, 0.0058109285, 0.0071461869, 0.0084723306, -0.0097887463, 0.0110948280, 0.0123899774, 0.0136736037, 0.0149451245, -0.0162039652, 0.0174495601, 0.0186813520, 0.0198987930, 0.0211013441, -0.0222884760, 0.0234596687, 0.0246144125, 0.0257522075, 0.0268725642, -0.0279750034, 0.0290590567, 0.0301242667, 0.0311701866, 0.0321963813, -0.0332024265, 0.0341879100, 0.0351524307, 0.0360955999, 0.0370170403, -0.0379163872, 0.0387932877, 0.0396474015, 0.0404784006, 0.0412859698, -0.0420698064, 0.0428296204, 0.0435651348, 0.0442760856, 0.0449622216, -0.0456233049, 0.0462591107, 0.0468694272, 0.0474540563, 0.0480128128, -0.0485455250, 0.0490520346, 0.0495321967, 0.0499858797, 0.0504129657, -0.0508133500, 0.0511869413, 0.0515336620, 0.0518534476, 0.0521462471, -0.0524120231, 0.0526507512, 0.0528624204, 0.0530470330, 0.0532046046, -0.0533351636, 0.0534387518, 0.0535154239, 0.0535652475, 0.0535883030, -0.0535846837, 0.0535544955, 0.0534978568, 0.0534148984, 0.0533057638, -0.0531706083, 0.0530095996, 0.0528229172, 0.0526107526, 0.0523733090, -0.0521108010, 0.0518234548, 0.0515115078, 0.0511752086, 0.0508148166, -0.0504306021, 0.0500228460, 0.0495918395, 0.0491378843, 0.0486612920, -0.0481623841, 0.0476414918, 0.0470989558, 0.0465351261, 0.0459503619, -0.0453450309, 0.0447195100, 0.0440741841, 0.0434094465, 0.0427256986, -0.0420233496, 0.0413028159, 0.0405645217, 0.0398088980, 0.0390363829, -0.0382474207, 0.0374424626, 0.0366219656, 0.0357863927, 0.0349362125, -0.0340718990, 0.0331939315, 0.0323027939, 0.0313989751, 0.0304829681, -0.0295552701, 0.0286163823, 0.0276668094, 0.0267070595, 0.0257376438, -0.0247590762, 0.0237718735, 0.0227765544, 0.0217736400, 0.0207636531, -0.0197471179, 0.0187245601, 0.0176965062, 0.0166634836, 0.0156260201, -0.0145846438, 0.0135398828, 0.0124922647, 0.0114423169, 0.0103905658, -0.0093375368, 0.0082837539, 0.0072297398, 0.0061760151, 0.0051230987, -0.0040715069, 0.0030217536, 0.0019743499, 0.0009298040, -0.0001113794, --0.0011486988, -0.0021816566, -0.0032097591, -0.0042325168, -0.0052494445, --0.0062600617, -0.0072638927, -0.0082604669, -0.0092493190, -0.0102299890, --0.0112020226, -0.0121649716, -0.0131183937, -0.0140618528, -0.0149949194, --0.0159171706, -0.0168281903, -0.0177275694, -0.0186149061, -0.0194898058, --0.0203518815, -0.0212007538, -0.0220360513, -0.0228574104, -0.0236644758, --0.0244569004, -0.0252343455, -0.0259964811, -0.0267429858, -0.0274735469, --0.0281878610, -0.0288856333, -0.0295665785, -0.0302304205, -0.0308768926, --0.0315057374, -0.0321167073, -0.0327095642, -0.0332840800, -0.0338400360, --0.0343772237, -0.0348954445, -0.0353945098, -0.0358742410, -0.0363344698, --0.0367750379, -0.0371957974, -0.0375966105, -0.0379773497, -0.0383378980, --0.0386781484, -0.0389980046, -0.0392973804, -0.0395762002, -0.0398343986, --0.0400719206, -0.0402887216, -0.0404847672, -0.0406600336, -0.0408145071, --0.0409481843, -0.0410610721, -0.0411531875, -0.0412245577, -0.0412752200, --0.0413052219, -0.0413146206, -0.0413034835, -0.0412718878, -0.0412199204, --0.0411476780, -0.0410552669, -0.0409428031, -0.0408104118, -0.0406582277, --0.0404863949, -0.0402950665, -0.0400844047, -0.0398545807, -0.0396057745, --0.0393381748, -0.0390519790, -0.0387473928, -0.0384246304, -0.0380839142, --0.0377254745, -0.0373495498, -0.0369563861, -0.0365462373, -0.0361193646, --0.0356760366, -0.0352165291, -0.0347411250, -0.0342501139, -0.0337437921, --0.0332224626, -0.0326864346, -0.0321360235, -0.0315715507, -0.0309933435, --0.0304017349, -0.0297970631, -0.0291796719, -0.0285499099, -0.0279081308, --0.0272546930, -0.0265899594, -0.0259142971, -0.0252280776, -0.0245316762, --0.0238254719, -0.0231098472, -0.0223851881, -0.0216518837, -0.0209103260, --0.0201609098, -0.0194040323, -0.0186400931, -0.0178694941, -0.0170926389, --0.0163099329, -0.0155217831, -0.0147285976, -0.0139307858, -0.0131287579, --0.0123229249, -0.0115136982, -0.0107014895, -0.0098867106, -0.0090697732, --0.0082510887, -0.0074310679, -0.0066101210, -0.0057886571, -0.0049670844, --0.0041458096, -0.0033252381, -0.0025057733, -0.0016878170, -0.0008717687, --0.0000580258, 0.0007530169, 0.0015609671, 0.0023654356, 0.0031660360, -0.0039623850, 0.0047541030, 0.0055408137, 0.0063221446, 0.0070977270, -0.0078671964, 0.0086301925, 0.0093863594, 0.0101353455, 0.0108768043, -0.0116103940, 0.0123357777, 0.0130526237, 0.0137606059, 0.0144594032, -0.0151487004, 0.0158281880, 0.0164975622, 0.0171565254, 0.0178047860, -0.0184420586, 0.0190680644, 0.0196825308, 0.0202851918, 0.0208757885, -0.0214540682, 0.0220197857, 0.0225727023, 0.0231125868, 0.0236392150, -0.0241523699, 0.0246518421, 0.0251374295, 0.0256089375, 0.0260661791, -0.0265089750, 0.0269371536, 0.0273505511, 0.0277490115, 0.0281323866, -0.0285005363, 0.0288533284, 0.0291906387, 0.0295123510, 0.0298183574, -0.0301085578, 0.0303828605, 0.0306411817, 0.0308834460, 0.0311095860, -0.0313195427, 0.0315132649, 0.0316907100, 0.0318518433, 0.0319966384, -0.0321250770, 0.0322371490, 0.0323328523, 0.0324121930, 0.0324751853, -0.0325218512, 0.0325522210, 0.0325663326, 0.0325642322, 0.0325459735, -0.0325116182, 0.0324612358, 0.0323949034, 0.0323127056, 0.0322147348, -0.0321010909, 0.0319718809, 0.0318272194, 0.0316672284, 0.0314920367, -0.0313017804, 0.0310966027, 0.0308766536, 0.0306420898, 0.0303930749, -0.0301297791, 0.0298523789, 0.0295610575, 0.0292560042, 0.0289374145, -0.0286054900, 0.0282604381, 0.0279024723, 0.0275318116, 0.0271486805, -0.0267533090, 0.0263459327, 0.0259267919, 0.0254961322, 0.0250542041, -0.0246012629, 0.0241375683, 0.0236633848, 0.0231789810, 0.0226846298, -0.0221806081, 0.0216671967, 0.0211446801, 0.0206133465, 0.0200734874, -0.0195253977, 0.0189693753, 0.0184057213, 0.0178347393, 0.0172567358, -0.0166720197, 0.0160809021, 0.0154836965, 0.0148807183, 0.0142722848, -0.0136587149, 0.0130403290, 0.0124174490, 0.0117903979, 0.0111594997, -0.0105250794, 0.0098874625, 0.0092469753, 0.0086039444, 0.0079586963, -0.0073115581, 0.0066628564, 0.0060129176, 0.0053620678, 0.0047106324, -0.0040589362, 0.0034073028, 0.0027560551, 0.0021055145, 0.0014560012, -0.0008078339, 0.0001613293, -0.0004831972, -0.0011254327, -0.0017650660, --0.0024017885, -0.0030352938, -0.0036652782, -0.0042914406, -0.0049134828, --0.0055311097, -0.0061440290, -0.0067519520, -0.0073545932, -0.0079516706, --0.0085429059, -0.0091280246, -0.0097067561, -0.0102788338, -0.0108439950, --0.0114019817, -0.0119525400, -0.0124954204, -0.0130303781, -0.0135571731, --0.0140755700, -0.0145853384, -0.0150862529, -0.0155780931, -0.0160606440, --0.0165336956, -0.0169970434, -0.0174504885, -0.0178938372, -0.0183269017, --0.0187494996, -0.0191614546, -0.0195625960, -0.0199527589, -0.0203317846, --0.0206995203, -0.0210558192, -0.0214005407, -0.0217335503, -0.0220547199, --0.0223639275, -0.0226610575, -0.0229460004, -0.0232186535, -0.0234789202, --0.0237267103, -0.0239619403, -0.0241845329, -0.0243944177, -0.0245915303, --0.0247758133, -0.0249472155, -0.0251056924, -0.0252512059, -0.0253837247, --0.0255032239, -0.0256096849, -0.0257030959, -0.0257834515, -0.0258507529, --0.0259050075, -0.0259462294, -0.0259744389, -0.0259896629, -0.0259919344, --0.0259812930, -0.0259577843, -0.0259214603, -0.0258723791, -0.0258106050, --0.0257362083, -0.0256492655, -0.0255498588, -0.0254380765, -0.0253140129, --0.0251777677, -0.0250294468, -0.0248691612, -0.0246970280, -0.0245131696, --0.0243177136, -0.0241107934, -0.0238925473, -0.0236631188, -0.0234226568, --0.0231713149, -0.0229092517, -0.0226366307, -0.0223536199, -0.0220603922, --0.0217571249, -0.0214439997, -0.0211212026, -0.0207889239, -0.0204473579, --0.0200967031, -0.0197371617, -0.0193689396, -0.0189922466, -0.0186072958, --0.0182143041, -0.0178134913, -0.0174050805, -0.0169892981, -0.0165663733, --0.0161365379, -0.0157000268, -0.0152570773, -0.0148079291, -0.0143528243, --0.0138920072, -0.0134257242, -0.0129542235, -0.0124777553, -0.0119965714, --0.0115109251, -0.0110210713, -0.0105272660, -0.0100297665, -0.0095288312, --0.0090247190, -0.0085176902, -0.0080080052, -0.0074959251, -0.0069817115, --0.0064656261, -0.0059479308, -0.0054288875, -0.0049087577, -0.0043878030, --0.0038662845, -0.0033444625, -0.0028225970, -0.0023009471, -0.0017797709, --0.0012593256, -0.0007398671, -0.0002216501, 0.0002950720, 0.0008100476, -0.0013230264, 0.0018337601, 0.0023420022, 0.0028475082, 0.0033500357, -0.0038493447, 0.0043451972, 0.0048373579, 0.0053255940, 0.0058096753, -0.0062893745, 0.0067644670, 0.0072347313, 0.0076999490, 0.0081599047, -0.0086143866, 0.0090631859, 0.0095060974, 0.0099429197, 0.0103734546, -0.0107975079, 0.0112148892, 0.0116254119, 0.0120288935, 0.0124251554, -0.0128140234, 0.0131953271, 0.0135689006, 0.0139345826, 0.0142922156, -0.0146416472, 0.0149827292, 0.0153153180, 0.0156392747, 0.0159544652, -0.0162607600, 0.0165580347, 0.0168461693, 0.0171250491, 0.0173945641, -0.0176546096, 0.0179050854, 0.0181458969, 0.0183769543, 0.0185981728, -0.0188094731, 0.0190107807, 0.0192020266, 0.0193831468, 0.0195540825, -0.0197147802, 0.0198651918, 0.0200052742, 0.0201349897, 0.0202543057, -0.0203631952, 0.0204616360, 0.0205496115, 0.0206271102, 0.0206941258, -0.0207506574, 0.0207967092, 0.0208322904, 0.0208574158, 0.0208721048, -0.0208763824, 0.0208702784, 0.0208538278, 0.0208270705, 0.0207900516, -0.0207428209, 0.0206854333, 0.0206179485, 0.0205404311, 0.0204529502, -0.0203555801, 0.0202483994, 0.0201314915, 0.0200049443, 0.0198688503, -0.0197233063, 0.0195684137, 0.0194042780, 0.0192310091, 0.0190487212, -0.0188575324, 0.0186575650, 0.0184489453, 0.0182318033, 0.0180062730, -0.0177724922, 0.0175306024, 0.0172807484, 0.0170230788, 0.0167577456, -0.0164849039, 0.0162047124, 0.0159173327, 0.0156229295, 0.0153216706, -0.0150137267, 0.0146992710, 0.0143784798, 0.0140515319, 0.0137186083, -0.0133798928, 0.0130355714, 0.0126858322, 0.0123308655, 0.0119708635, -0.0116060206, 0.0112365327, 0.0108625976, 0.0104844146, 0.0101021845, -0.0097161095, 0.0093263932, 0.0089332402, 0.0085368563, 0.0081374483, -0.0077352238, 0.0073303912, 0.0069231595, 0.0065137383, 0.0061023376, -0.0056891678, 0.0052744396, 0.0048583636, 0.0044411507, 0.0040230114, -0.0036041564, 0.0031847958, 0.0027651394, 0.0023453967, 0.0019257762, -0.0015064860, 0.0010877333, 0.0006697246, 0.0002526650, -0.0001632411, --0.0005777908, -0.0009907824, -0.0014020154, -0.0018112910, -0.0022184119, --0.0026231826, -0.0030254092, -0.0034248998, -0.0038214642, -0.0042149145, --0.0046050648, -0.0049917315, -0.0053747331, -0.0057538906, -0.0061290276, --0.0064999700, -0.0068665463, -0.0072285880, -0.0075859290, -0.0079384063, --0.0082858597, -0.0086281320, -0.0089650690, -0.0092965198, -0.0096223365, --0.0099423745, -0.0102564926, -0.0105645529, -0.0108664208, -0.0111619655, --0.0114510595, -0.0117335789, -0.0120094035, -0.0122784169, -0.0125405063, --0.0127955627, -0.0130434809, -0.0132841597, -0.0135175016, -0.0137434133, --0.0139618053, -0.0141725921, -0.0143756923, -0.0145710286, -0.0147585277, --0.0149381205, -0.0151097420, -0.0152733313, -0.0154288318, -0.0155761910, --0.0157153607, -0.0158462969, -0.0159689596, -0.0160833133, -0.0161893267, --0.0162869726, -0.0163762282, -0.0164570748, -0.0165294981, -0.0165934878, --0.0166490381, -0.0166961471, -0.0167348174, -0.0167650556, -0.0167868725, --0.0168002831, -0.0168053065, -0.0168019658, -0.0167902885, -0.0167703057, --0.0167420530, -0.0167055697, -0.0166608992, -0.0166080887, -0.0165471894, --0.0164782565, -0.0164013487, -0.0163165287, -0.0162238629, -0.0161234215, --0.0160152781, -0.0158995102, -0.0157761985, -0.0156454275, -0.0155072851, --0.0153618625, -0.0152092543, -0.0150495583, -0.0148828756, -0.0147093105, --0.0145289703, -0.0143419654, -0.0141484092, -0.0139484179, -0.0137421107, --0.0135296094, -0.0133110387, -0.0130865257, -0.0128562002, -0.0126201946, --0.0123786435, -0.0121316840, -0.0118794553, -0.0116220991, -0.0113597589, --0.0110925803, -0.0108207111, -0.0105443006, -0.0102635002, -0.0099784629, --0.0096893433, -0.0093962976, -0.0090994836, -0.0087990603, -0.0084951880, --0.0081880284, -0.0078777443, -0.0075644993, -0.0072484582, -0.0069297868, --0.0066086514, -0.0062852192, -0.0059596580, -0.0056321361, -0.0053028224, --0.0049718859, -0.0046394962, -0.0043058228, -0.0039710357, -0.0036353045, --0.0032987991, -0.0029616890, -0.0026241437, -0.0022863322, -0.0019484233, --0.0016105852, -0.0012729856, -0.0009357916, -0.0005991694, -0.0002632848, -0.0000716978, 0.0004056145, 0.0007383027, 0.0010696008, 0.0013993484, -0.0017273863, 0.0020535569, 0.0023777036, 0.0026996717, 0.0030193077, -0.0033364600, 0.0036509786, 0.0039627152, 0.0042715235, 0.0045772590, -0.0048797791, 0.0051789434, 0.0054746135, 0.0057666532, 0.0060549285, -0.0063393077, 0.0066196614, 0.0068958626, 0.0071677869, 0.0074353122, -0.0076983191, 0.0079566907, 0.0082103130, 0.0084590744, 0.0087028663, -0.0089415828, 0.0091751208, 0.0094033802, 0.0096262638, 0.0098436773, -0.0100555296, 0.0102617324, 0.0104622007, 0.0106568524, 0.0108456087, -0.0110283940, 0.0112051357, 0.0113757647, 0.0115402150, 0.0116984238, -0.0118503317, 0.0119958827, 0.0121350239, 0.0122677061, 0.0123938831, -0.0125135122, 0.0126265542, 0.0127329732, 0.0128327367, 0.0129258157, -0.0130121845, 0.0130918209, 0.0131647059, 0.0132308244, 0.0132901641, -0.0133427167, 0.0133884768, 0.0134274427, 0.0134596160, 0.0134850017, -0.0135036081, 0.0135154468, 0.0135205330, 0.0135188849, 0.0135105241, -0.0134954756, 0.0134737674, 0.0134454309, 0.0134105007, 0.0133690146, -0.0133210134, 0.0132665411, 0.0132056448, 0.0131383746, 0.0130647837, -0.0129849281, 0.0128988671, 0.0128066625, 0.0127083792, 0.0126040849, -0.0124938499, 0.0123777476, 0.0122558537, 0.0121282468, 0.0119950079, -0.0118562209, 0.0117119718, 0.0115623494, 0.0114074445, 0.0112473506, -0.0110821634, 0.0109119807, 0.0107369026, 0.0105570314, 0.0103724714, -0.0101833288, 0.0099897118, 0.0097917307, 0.0095894973, 0.0093831254, -0.0091727305, 0.0089584296, 0.0087403414, 0.0085185861, 0.0082932854, -0.0080645621, 0.0078325408, 0.0075973470, 0.0073591075, 0.0071179501, -0.0068740040, 0.0066273989, 0.0063782659, 0.0061267367, 0.0058729437, -0.0056170202, 0.0053591000, 0.0050993177, 0.0048378082, 0.0045747069, -0.0043101496, 0.0040442724, 0.0037772115, 0.0035091036, 0.0032400851, -0.0029702926, 0.0026998629, 0.0024289322, 0.0021576369, 0.0018861131, -0.0016144965, 0.0013429225, 0.0010715259, 0.0008004413, 0.0005298025, -0.0002597426, -0.0000096058, -0.0002781110, -0.0005456421, -0.0008120690, --0.0010772627, -0.0013410951, -0.0016034392, -0.0018641693, -0.0021231606, --0.0023802898, -0.0026354347, -0.0028884748, -0.0031392906, -0.0033877643, --0.0036337797, -0.0038772221, -0.0041179783, -0.0043559371, -0.0045909889, --0.0048230256, -0.0050519414, -0.0052776322, -0.0054999956, -0.0057189316, --0.0059343419, -0.0061461303, -0.0063542028, -0.0065584675, -0.0067588348, --0.0069552170, -0.0071475291, -0.0073356879, -0.0075196129, -0.0076992258, --0.0078744508, -0.0080452144, -0.0082114456, -0.0083730758, -0.0085300391, --0.0086822719, -0.0088297134, -0.0089723051, -0.0091099913, -0.0092427188, --0.0093704371, -0.0094930984, -0.0096106574, -0.0097230716, -0.0098303012, --0.0099323091, -0.0100290609, -0.0101205249, -0.0102066721, -0.0102874763, --0.0103629142, -0.0104329648, -0.0104976103, -0.0105568355, -0.0106106278, --0.0106589775, -0.0107018776, -0.0107393238, -0.0107713147, -0.0107978513, --0.0108189376, -0.0108345802, -0.0108447883, -0.0108495740, -0.0108489518, --0.0108429390, -0.0108315555, -0.0108148239, -0.0107927692, -0.0107654191, --0.0107328038, -0.0106949562, -0.0106519113, -0.0106037071, -0.0105503836, --0.0104919834, -0.0104285517, -0.0103601356, -0.0102867850, -0.0102085518, --0.0101254902, -0.0100376569, -0.0099451104, -0.0098479117, -0.0097461236, --0.0096398114, -0.0095290421, -0.0094138849, -0.0092944108, -0.0091706929, --0.0090428060, -0.0089108270, -0.0087748343, -0.0086349083, -0.0084911310, --0.0083435859, -0.0081923585, -0.0080375355, -0.0078792054, -0.0077174578, --0.0075523841, -0.0073840769, -0.0072126301, -0.0070381389, -0.0068606997, --0.0066804102, -0.0064973689, -0.0063116757, -0.0061234313, -0.0059327375, --0.0057396967, -0.0055444126, -0.0053469893, -0.0051475318, -0.0049461458, --0.0047429375, -0.0045380139, -0.0043314824, -0.0041234507, -0.0039140271, --0.0037033203, -0.0034914390, -0.0032784925, -0.0030645902, -0.0028498413, --0.0026343555, -0.0024182424, -0.0022016113, -0.0019845719, -0.0017672333, --0.0015497047, -0.0013320949, -0.0011145124, -0.0008970655, -0.0006798618, --0.0004630087, -0.0002466130, -0.0000307810, 0.0001843818, 0.0003987705, -0.0006122807, 0.0008248091, 0.0010362529, 0.0012465104, 0.0014554808, -0.0016630642, 0.0018691616, 0.0020736751, 0.0022765082, 0.0024775651, -0.0026767514, 0.0028739740, 0.0030691410, 0.0032621617, 0.0034529470, -0.0036414089, 0.0038274611, 0.0040110187, 0.0041919982, 0.0043703178, -0.0045458972, 0.0047186578, 0.0048885224, 0.0050554159, 0.0052192645, -0.0053799965, 0.0055375418, 0.0056918321, 0.0058428010, 0.0059903840, -0.0061345183, 0.0062751433, 0.0064122001, 0.0065456319, 0.0066753838, -0.0068014030, 0.0069236387, 0.0070420421, 0.0071565665, 0.0072671672, -0.0073738019, 0.0074764299, 0.0075750131, 0.0076695152, 0.0077599023, -0.0078461426, 0.0079282063, 0.0080060659, 0.0080796962, 0.0081490739, -0.0082141782, 0.0082749902, 0.0083314935, 0.0083836737, 0.0084315187, -0.0084750184, 0.0085141652, 0.0085489535, 0.0085793798, 0.0086054431, -0.0086271443, 0.0086444866, 0.0086574753, 0.0086661178, 0.0086704239, -0.0086704051, 0.0086660755, 0.0086574509, 0.0086445494, 0.0086273912, -0.0086059984, 0.0085803953, 0.0085506081, 0.0085166650, 0.0084785963, -0.0084364341, 0.0083902126, 0.0083399679, 0.0082857377, 0.0082275620, -0.0081654823, 0.0080995421, 0.0080297867, 0.0079562629, 0.0078790195, -0.0077981068, 0.0077135771, 0.0076254839, 0.0075338826, 0.0074388300, -0.0073403846, 0.0072386063, 0.0071335564, 0.0070252979, 0.0069138948, -0.0067994129, 0.0066819189, 0.0065614810, 0.0064381688, 0.0063120528, -0.0061832049, 0.0060516980, 0.0059176061, 0.0057810043, 0.0056419687, -0.0055005764, 0.0053569054, 0.0052110344, 0.0050630433, 0.0049130126, -0.0047610235, 0.0046071580, 0.0044514987, 0.0042941290, 0.0041351326, -0.0039745941, 0.0038125983, 0.0036492306, 0.0034845767, 0.0033187227, -0.0031517551, 0.0029837607, 0.0028148263, 0.0026450392, 0.0024744865, -0.0023032557, 0.0021314343, 0.0019591096, 0.0017863692, 0.0016133002, -0.0014399901, 0.0012665257, 0.0010929941, 0.0009194817, 0.0007460750, -0.0005728599, 0.0003999219, 0.0002273465, 0.0000552181, -0.0001163788, --0.0002873606, -0.0004576441, -0.0006271469, -0.0007957871, -0.0009634835, --0.0011301557, -0.0012957241, -0.0014601097, -0.0016232347, -0.0017850218, --0.0019453950, -0.0021042788, -0.0022615991, -0.0024172826, -0.0025712572, --0.0027234517, -0.0028737961, -0.0030222217, -0.0031686607, -0.0033130467, --0.0034553146, -0.0035954003, -0.0037332412, -0.0038687761, -0.0040019449, --0.0041326891, -0.0042609514, -0.0043866761, -0.0045098089, -0.0046302969, --0.0047480887, -0.0048631346, -0.0049753861, -0.0050847965, -0.0051913206, --0.0052949147, -0.0053955370, -0.0054931469, -0.0055877057, -0.0056791763, --0.0057675233, -0.0058527128, -0.0059347128, -0.0060134928, -0.0060890242, --0.0061612801, -0.0062302350, -0.0062958655, -0.0063581499, -0.0064170679, --0.0064726014, -0.0065247337, -0.0065734501, -0.0066187374, -0.0066605844, --0.0066989815, -0.0067339208, -0.0067653964, -0.0067934038, -0.0068179406, --0.0068390059, -0.0068566006, -0.0068707273, -0.0068813904, -0.0068885959, --0.0068923516, -0.0068926670, -0.0068895532, -0.0068830230, -0.0068730909, --0.0068597730, -0.0068430871, -0.0068230526, -0.0067996905, -0.0067730233, --0.0067430751, -0.0067098718, -0.0066734406, -0.0066338102, -0.0065910108, --0.0065450743, -0.0064960339, -0.0064439242, -0.0063887812, -0.0063306424, --0.0062695467, -0.0062055342, -0.0061386464, -0.0060689262, -0.0059964175, --0.0059211657, -0.0058432173, -0.0057626201, -0.0056794229, -0.0055936757, --0.0055054298, -0.0054147371, -0.0053216511, -0.0052262260, -0.0051285171, --0.0050285805, -0.0049264734, -0.0048222538, -0.0047159807, -0.0046077137, --0.0044975134, -0.0043854410, -0.0042715586, -0.0041559288, -0.0040386151, --0.0039196815, -0.0037991925, -0.0036772133, -0.0035538097, -0.0034290478, --0.0033029941, -0.0031757159, -0.0030472806, -0.0029177559, -0.0027872101, --0.0026557114, -0.0025233286, -0.0023901305, -0.0022561863, -0.0021215650, --0.0019863359, -0.0018505686, -0.0017143323, -0.0015776965, -0.0014407305, --0.0013035038, -0.0011660854, -0.0010285445, -0.0008909501, -0.0007533707, --0.0006158750, -0.0004785311, -0.0003414068, -0.0002045699, -0.0000680874, -0.0000679738, 0.0002035473, 0.0003385673, 0.0004729683, 0.0006066854, -0.0007396544, 0.0008718115, 0.0010030935, 0.0011334381, 0.0012627833, -0.0013910681, 0.0015182322, 0.0016442159, 0.0017689604, 0.0018924077, -0.0020145008, 0.0021351832, 0.0022543995, 0.0023720954, 0.0024882172, -0.0026027124, 0.0027155294, 0.0028266176, 0.0029359274, 0.0030434103, -0.0031490190, 0.0032527070, 0.0033544293, 0.0034541416, 0.0035518011, -0.0036473659, 0.0037407955, 0.0038320506, 0.0039210929, 0.0040078855, -0.0040923927, 0.0041745801, 0.0042544146, 0.0043318642, 0.0044068984, -0.0044794879, 0.0045496048, 0.0046172225, 0.0046823156, 0.0047448602, -0.0048048338, 0.0048622151, 0.0049169842, 0.0049691226, 0.0050186133, -0.0050654404, 0.0051095896, 0.0051510480, 0.0051898039, 0.0052258471, -0.0052591688, 0.0052897616, 0.0053176194, 0.0053427377, 0.0053651130, -0.0053847435, 0.0054016287, 0.0054157694, 0.0054271679, 0.0054358277, -0.0054417538, 0.0054449524, 0.0054454311, 0.0054431990, 0.0054382662, -0.0054306444, 0.0054203464, 0.0054073864, 0.0053917800, 0.0053735437, -0.0053526956, 0.0053292549, 0.0053032421, 0.0052746789, 0.0052435880, -0.0052099936, 0.0051739208, 0.0051353961, 0.0050944469, 0.0050511019, -0.0050053908, 0.0049573443, 0.0049069944, 0.0048543739, 0.0047995168, -0.0047424579, 0.0046832332, 0.0046218796, 0.0045584348, 0.0044929376, -0.0044254276, 0.0043559452, 0.0042845317, 0.0042112294, 0.0041360811, -0.0040591307, 0.0039804224, 0.0039000017, 0.0038179142, 0.0037342067, -0.0036489264, 0.0035621211, 0.0034738392, 0.0033841298, 0.0032930424, -0.0032006271, 0.0031069345, 0.0030120157, 0.0029159221, 0.0028187055, -0.0027204184, 0.0026211132, 0.0025208431, 0.0024196611, 0.0023176209, -0.0022147762, 0.0021111811, 0.0020068897, 0.0019019563, 0.0017964356, -0.0016903819, 0.0015838501, 0.0014768947, 0.0013695707, 0.0012619327, -0.0011540355, 0.0010459336, 0.0009376817, 0.0008293342, 0.0007209455, -0.0006125697, 0.0005042607, 0.0003960723, 0.0002880581, 0.0001802712, -0.0000727645, -0.0000344092, -0.0001411978, -0.0002475493, -0.0003534123, --0.0004587356, -0.0005634687, -0.0006675613, -0.0007709638, -0.0008736271, --0.0009755024, -0.0010765418, -0.0011766978, -0.0012759234, -0.0013741725, --0.0014713993, -0.0015675591, -0.0016626076, -0.0017565011, -0.0018491969, --0.0019406529, -0.0020308278, -0.0021196811, -0.0022071730, -0.0022932646, --0.0023779179, -0.0024610956, -0.0025427614, -0.0026228797, -0.0027014160, --0.0027783366, -0.0028536087, -0.0029272006, -0.0029990813, -0.0030692209, --0.0031375904, -0.0032041620, -0.0032689087, -0.0033318045, -0.0033928243, --0.0034519445, -0.0035091419, -0.0035643948, -0.0036176824, -0.0036689849, --0.0037182836, -0.0037655608, -0.0038108001, -0.0038539859, -0.0038951038, --0.0039341405, -0.0039710838, -0.0040059225, -0.0040386465, -0.0040692468, --0.0040977156, -0.0041240461, -0.0041482326, -0.0041702705, -0.0041901562, --0.0042078873, -0.0042234624, -0.0042368814, -0.0042481449, -0.0042572549, --0.0042642143, -0.0042690272, -0.0042716985, -0.0042722345, -0.0042706422, --0.0042669299, -0.0042611069, -0.0042531833, -0.0042431705, -0.0042310807, --0.0042169271, -0.0042007241, -0.0041824868, -0.0041622314, -0.0041399751, --0.0041157359, -0.0040895329, -0.0040613860, -0.0040313159, -0.0039993444, --0.0039654940, -0.0039297883, -0.0038922514, -0.0038529085, -0.0038117856, --0.0037689092, -0.0037243070, -0.0036780073, -0.0036300389, -0.0035804318, --0.0035292163, -0.0034764236, -0.0034220855, -0.0033662347, -0.0033089041, --0.0032501275, -0.0031899394, -0.0031283747, -0.0030654689, -0.0030012581, --0.0029357788, -0.0028690681, -0.0028011637, -0.0027321035, -0.0026619261, --0.0025906704, -0.0025183756, -0.0024450815, -0.0023708281, -0.0022956558, --0.0022196054, -0.0021427177, -0.0020650342, -0.0019865962, -0.0019074456, --0.0018276244, -0.0017471747, -0.0016661388, -0.0015845592, -0.0015024785, --0.0014199393, -0.0013369845, -0.0012536568, -0.0011699992, -0.0010860544, --0.0010018654, -0.0009174749, -0.0008329258, -0.0007482608, -0.0006635226, --0.0005787535, -0.0004939960, -0.0004092923, -0.0003246844, -0.0002402143, --0.0001559234, -0.0000718533, 0.0000119550, 0.0000954606, 0.0001786230, -0.0002614018, 0.0003437572, 0.0004256495, 0.0005070398, 0.0005878890, -0.0006681588, 0.0007478113, 0.0008268089, 0.0009051145, 0.0009826917, -0.0010595042, 0.0011355164, 0.0012106934, 0.0012850006, 0.0013584040, -0.0014308703, 0.0015023666, 0.0015728608, 0.0016423212, 0.0017107168, -0.0017780175, 0.0018441934, 0.0019092157, 0.0019730560, 0.0020356866, -0.0020970806, 0.0021572119, 0.0022160549, 0.0022735848, 0.0023297778, -0.0023846105, 0.0024380603, 0.0024901057, 0.0025407257, 0.0025899000, -0.0026376093, 0.0026838351, 0.0027285596, 0.0027717659, 0.0028134378, -0.0028535600, 0.0028921181, 0.0029290984, 0.0029644882, 0.0029982753, -0.0030304488, 0.0030609984, 0.0030899146, 0.0031171889, 0.0031428134, -0.0031667815, 0.0031890869, 0.0032097246, 0.0032286903, 0.0032459804, -0.0032615923, 0.0032755244, 0.0032877756, 0.0032983458, 0.0033072359, -0.0033144474, 0.0033199827, 0.0033238451, 0.0033260387, 0.0033265683, -0.0033254397, 0.0033226595, 0.0033182348, 0.0033121739, 0.0033044855, -0.0032951796, 0.0032842663, 0.0032717571, 0.0032576639, 0.0032419993, -0.0032247769, 0.0032060109, 0.0031857162, 0.0031639083, 0.0031406037, -0.0031158194, 0.0030895730, 0.0030618828, 0.0030327680, 0.0030022482, -0.0029703436, 0.0029370752, 0.0029024645, 0.0028665336, 0.0028293051, -0.0027908024, 0.0027510492, 0.0027100699, 0.0026678893, 0.0026245328, -0.0025800264, 0.0025343963, 0.0024876693, 0.0024398728, 0.0023910345, -0.0023411825, 0.0022903452, 0.0022385517, 0.0021858313, 0.0021322135, -0.0020777285, 0.0020224064, 0.0019662779, 0.0019093741, 0.0018517259, -0.0017933649, 0.0017343229, 0.0016746316, 0.0016143233, 0.0015534303, -0.0014919850, 0.0014300201, 0.0013675684, 0.0013046629, 0.0012413365, -0.0011776223, 0.0011135537, 0.0010491637, 0.0009844857, 0.0009195531, -0.0008543990, 0.0007890569, 0.0007235600, 0.0006579415, 0.0005922346, -0.0005264724, 0.0004606880, 0.0003949141, 0.0003291837, 0.0002635292, -0.0001979832, 0.0001325780, 0.0000673457, 0.0000023182, -0.0000624728, --0.0001269959, -0.0001912198, -0.0002551136, -0.0003186466, -0.0003817885, --0.0004445092, -0.0005067789, -0.0005685683, -0.0006298483, -0.0006905900, --0.0007507654, -0.0008103463, -0.0008693052, -0.0009276151, -0.0009852491, --0.0010421811, -0.0010983851, -0.0011538359, -0.0012085085, -0.0012623785, --0.0013154219, -0.0013676154, -0.0014189360, -0.0014693614, -0.0015188696, --0.0015674393, -0.0016150498, -0.0016616808, -0.0017073126, -0.0017519262, --0.0017955030, -0.0018380252, -0.0018794753, -0.0019198367, -0.0019590932, --0.0019972294, -0.0020342302, -0.0020700814, -0.0021047694, -0.0021382811, --0.0021706043, -0.0022017270, -0.0022316382, -0.0022603275, -0.0022877851, --0.0023140018, -0.0023389690, -0.0023626791, -0.0023851246, -0.0024062993, --0.0024261971, -0.0024448128, -0.0024621419, -0.0024781806, -0.0024929256, --0.0025063742, -0.0025185247, -0.0025293756, -0.0025389266, -0.0025471774, --0.0025541290, -0.0025597826, -0.0025641401, -0.0025672043, -0.0025689784, --0.0025694663, -0.0025686724, -0.0025666021, -0.0025632609, -0.0025586554, --0.0025527924, -0.0025456797, -0.0025373253, -0.0025277381, -0.0025169273, --0.0025049031, -0.0024916758, -0.0024772565, -0.0024616569, -0.0024448891, --0.0024269658, -0.0024079004, -0.0023877064, -0.0023663983, -0.0023439908, --0.0023204992, -0.0022959392, -0.0022703270, -0.0022436795, -0.0022160136, --0.0021873471, -0.0021576979, -0.0021270845, -0.0020955259, -0.0020630411, --0.0020296500, -0.0019953726, -0.0019602293, -0.0019242408, -0.0018874283, --0.0018498132, -0.0018114173, -0.0017722626, -0.0017323716, -0.0016917669, --0.0016504714, -0.0016085084, -0.0015659012, -0.0015226735, -0.0014788493, --0.0014344526, -0.0013895077, -0.0013440391, -0.0012980715, -0.0012516297, --0.0012047386, -0.0011574233, -0.0011097090, -0.0010616211, -0.0010131848, --0.0009644258, -0.0009153695, -0.0008660416, -0.0008164676, -0.0007666733, --0.0007166843, -0.0006665263, -0.0006162249, -0.0005658059, -0.0005152948, --0.0004647171, -0.0004140985, -0.0003634642, -0.0003128396, -0.0002622499, --0.0002117203, -0.0001612757, -0.0001109410, -0.0000607409, -0.0000107000, -0.0000391574, 0.0000888071, 0.0001382251, 0.0001873876, 0.0002362710, -0.0002848520, 0.0003331074, 0.0003810145, 0.0004285507, 0.0004756935, -0.0005224210, 0.0005687114, 0.0006145433, 0.0006598955, 0.0007047472, -0.0007490779, 0.0007928675, 0.0008360961, 0.0008787443, 0.0009207930, -0.0009622235, 0.0010030174, 0.0010431569, 0.0010826243, 0.0011214025, -0.0011594747, 0.0011968247, 0.0012334365, 0.0012692947, 0.0013043841, -0.0013386903, 0.0013721991, 0.0014048968, 0.0014367701, 0.0014678062, -0.0014979929, 0.0015273183, 0.0015557711, 0.0015833403, 0.0016100155, -0.0016357870, 0.0016606451, 0.0016845811, 0.0017075864, 0.0017296531, -0.0017507738, 0.0017709416, 0.0017901499, 0.0018083930, 0.0018256652, -0.0018419618, 0.0018572784, 0.0018716109, 0.0018849560, 0.0018973109, -0.0019086731, 0.0019190407, 0.0019284124, 0.0019367874, 0.0019441651, -0.0019505458, 0.0019559301, 0.0019603191, 0.0019637144, 0.0019661182, -0.0019675329, 0.0019679618, 0.0019674083, 0.0019658766, 0.0019633710, -0.0019598967, 0.0019554590, 0.0019500638, 0.0019437176, 0.0019364271, -0.0019281995, 0.0019190427, 0.0019089647, 0.0018979741, 0.0018860799, -0.0018732914, 0.0018596186, 0.0018450717, 0.0018296611, 0.0018133981, -0.0017962939, 0.0017783603, 0.0017596096, 0.0017400541, 0.0017197068, -0.0016985808, 0.0016766897, 0.0016540474, 0.0016306680, 0.0016065662, -0.0015817566, 0.0015562544, 0.0015300751, 0.0015032342, 0.0014757478, -0.0014476321, 0.0014189035, 0.0013895787, 0.0013596746, 0.0013292086, -0.0012981978, 0.0012666600, 0.0012346128, 0.0012020743, 0.0011690626, -0.0011355960, 0.0011016931, 0.0010673723, 0.0010326524, 0.0009975524, -0.0009620912, 0.0009262880, 0.0008901619, 0.0008537322, 0.0008170183, -0.0007800396, 0.0007428156, 0.0007053659, 0.0006677099, 0.0006298674, -0.0005918580, 0.0005537012, 0.0005154167, 0.0004770241, 0.0004385430, -0.0003999929, 0.0003613934, 0.0003227639, 0.0002841239, 0.0002454926, -0.0002068894, 0.0001683333, 0.0001298435, 0.0000914390, 0.0000531385, -0.0000149607, -0.0000230756, -0.0000609521, -0.0000986506, -0.0001361528, --0.0001734408, -0.0002104968, -0.0002473033, -0.0002838427, -0.0003200980, --0.0003560521, -0.0003916882, -0.0004269898, -0.0004619406, -0.0004965245, --0.0005307256, -0.0005645283, -0.0005979174, -0.0006308778, -0.0006633947, --0.0006954536, -0.0007270403, -0.0007581408, -0.0007887415, -0.0008188291, --0.0008483907, -0.0008774134, -0.0009058849, -0.0009337931, -0.0009611264, --0.0009878733, -0.0010140227, -0.0010395640, -0.0010644867, -0.0010887809, --0.0011124369, -0.0011354454, -0.0011577974, -0.0011794844, -0.0012004980, --0.0012208306, -0.0012404746, -0.0012594229, -0.0012776687, -0.0012952058, --0.0013120281, -0.0013281301, -0.0013435065, -0.0013581526, -0.0013720639, --0.0013852363, -0.0013976662, -0.0014093503, -0.0014202856, -0.0014304698, --0.0014399006, -0.0014485764, -0.0014564957, -0.0014636576, -0.0014700615, --0.0014757072, -0.0014805949, -0.0014847251, -0.0014880988, -0.0014907172, --0.0014925821, -0.0014936955, -0.0014940597, -0.0014936777, -0.0014925524, --0.0014906875, -0.0014880868, -0.0014847545, -0.0014806951, -0.0014759136, --0.0014704152, -0.0014642055, -0.0014572904, -0.0014496762, -0.0014413695, --0.0014323770, -0.0014227062, -0.0014123644, -0.0014013595, -0.0013896996, --0.0013773932, -0.0013644489, -0.0013508758, -0.0013366832, -0.0013218805, --0.0013064777, -0.0012904848, -0.0012739120, -0.0012567701, -0.0012390699, --0.0012208223, -0.0012020388, -0.0011827307, -0.0011629099, -0.0011425883, --0.0011217780, -0.0011004914, -0.0010787410, -0.0010565395, -0.0010338998, --0.0010108350, -0.0009873583, -0.0009634830, -0.0009392227, -0.0009145911, --0.0008896018, -0.0008642689, -0.0008386063, -0.0008126283, -0.0007863489, --0.0007597826, -0.0007329438, -0.0007058470, -0.0006785067, -0.0006509376, --0.0006231543, -0.0005951717, -0.0005670044, -0.0005386673, -0.0005101753, --0.0004815431, -0.0004527857, -0.0004239178, -0.0003949545, -0.0003659105, --0.0003368006, -0.0003076398, -0.0002784426, -0.0002492239, -0.0002199984, --0.0001907807, -0.0001615854, -0.0001324268, -0.0001033196, -0.0000742779, --0.0000453161, -0.0000164483, 0.0000123115, 0.0000409493, 0.0000694513, -0.0000978039, 0.0001259933, 0.0001540064, 0.0001818296, 0.0002094500, -0.0002368545, 0.0002640303, 0.0002909647, 0.0003176453, 0.0003440598, -0.0003701960, 0.0003960420, 0.0004215861, 0.0004468167, 0.0004717224, -0.0004962922, 0.0005205151, 0.0005443804, 0.0005678777, 0.0005909967, -0.0006137274, 0.0006360599, 0.0006579848, 0.0006794927, 0.0007005745, -0.0007212216, 0.0007414252, 0.0007611772, 0.0007804694, 0.0007992941, -0.0008176438, 0.0008355112, 0.0008528894, 0.0008697717, 0.0008861516, -0.0009020230, 0.0009173801, 0.0009322172, 0.0009465290, 0.0009603105, -0.0009735571, 0.0009862642, 0.0009984277, 0.0010100437, 0.0010211086, -0.0010316192, 0.0010415725, 0.0010509657, 0.0010597965, 0.0010680626, -0.0010757624, 0.0010828942, 0.0010894568, 0.0010954492, 0.0011008708, -0.0011057211, 0.0011100002, 0.0011137081, 0.0011168454, 0.0011194127, -0.0011214113, 0.0011228423, 0.0011237074, 0.0011240084, 0.0011237476, -0.0011229273, 0.0011215502, 0.0011196193, 0.0011171379, 0.0011141094, -0.0011105375, 0.0011064263, 0.0011017801, 0.0010966033, 0.0010909007, -0.0010846773, 0.0010779384, 0.0010706894, 0.0010629361, 0.0010546843, -0.0010459403, 0.0010367105, 0.0010270014, 0.0010168199, 0.0010061729, -0.0009950678, 0.0009835120, 0.0009715130, 0.0009590787, 0.0009462171, -0.0009329365, 0.0009192450, 0.0009051513, 0.0008906642, 0.0008757923, -0.0008605448, 0.0008449308, 0.0008289596, 0.0008126407, 0.0007959837, -0.0007789982, 0.0007616942, 0.0007440816, 0.0007261704, 0.0007079708, -0.0006894932, 0.0006707479, 0.0006517454, 0.0006324962, 0.0006130110, -0.0005933005, 0.0005733755, 0.0005532468, 0.0005329253, 0.0005124220, -0.0004917479, 0.0004709140, 0.0004499314, 0.0004288111, 0.0004075644, -0.0003862023, 0.0003647361, 0.0003431768, 0.0003215357, 0.0002998238, -0.0002780524, 0.0002562326, 0.0002343754, 0.0002124920, 0.0001905934, -0.0001686906, 0.0001467946, 0.0001249163, 0.0001030665, 0.0000812561, -0.0000594957, 0.0000377962, 0.0000161680, -0.0000053783, -0.0000268323, --0.0000481837, -0.0000694222, -0.0000905376, -0.0001115200, -0.0001323593, --0.0001530458, -0.0001735697, -0.0001939216, -0.0002140918, -0.0002340711, --0.0002538504, -0.0002734204, -0.0002927724, -0.0003118976, -0.0003307873, --0.0003494331, -0.0003678267, -0.0003859599, -0.0004038248, -0.0004214136, --0.0004387185, -0.0004557322, -0.0004724474, -0.0004888569, -0.0005049539, --0.0005207315, -0.0005361833, -0.0005513028, -0.0005660839, -0.0005805207, --0.0005946073, -0.0006083382, -0.0006217080, -0.0006347115, -0.0006473437, --0.0006596000, -0.0006714757, -0.0006829665, -0.0006940683, -0.0007047771, --0.0007150893, -0.0007250014, -0.0007345100, -0.0007436121, -0.0007523049, --0.0007605858, -0.0007684523, -0.0007759022, -0.0007829336, -0.0007895447, --0.0007957340, -0.0008015002, -0.0008068421, -0.0008117589, -0.0008162498, --0.0008203145, -0.0008239527, -0.0008271644, -0.0008299497, -0.0008323091, --0.0008342432, -0.0008357529, -0.0008368390, -0.0008375030, -0.0008377461, --0.0008375702, -0.0008369770, -0.0008359687, -0.0008345473, -0.0008327155, --0.0008304759, -0.0008278313, -0.0008247847, -0.0008213393, -0.0008174987, --0.0008132662, -0.0008086459, -0.0008036415, -0.0007982572, -0.0007924973, --0.0007863663, -0.0007798688, -0.0007730096, -0.0007657937, -0.0007582263, --0.0007503124, -0.0007420577, -0.0007334676, -0.0007245480, -0.0007153045, --0.0007057433, -0.0006958705, -0.0006856923, -0.0006752151, -0.0006644455, --0.0006533899, -0.0006420553, -0.0006304484, -0.0006185763, -0.0006064459, --0.0005940644, -0.0005814391, -0.0005685774, -0.0005554866, -0.0005421744, --0.0005286483, -0.0005149159, -0.0005009850, -0.0004868635, -0.0004725592, --0.0004580801, -0.0004434340, -0.0004286292, -0.0004136736, -0.0003985753, --0.0003833426, -0.0003679835, -0.0003525065, -0.0003369196, -0.0003212311, --0.0003054494, -0.0002895827, -0.0002736393, -0.0002576275, -0.0002415556, --0.0002254319, -0.0002092648, -0.0001930624, -0.0001768330, -0.0001605849, --0.0001443262, -0.0001280652, -0.0001118099, -0.0000955685, -0.0000793491, --0.0000631597, -0.0000470081, -0.0000309025, -0.0000148505, 0.0000011400, -0.0000170612, 0.0000329055, 0.0000486653, 0.0000643331, 0.0000799015, -0.0000953630, 0.0001107104, 0.0001259365, 0.0001410343, 0.0001559967, -0.0001708168, 0.0001854879, 0.0002000031, 0.0002143560, 0.0002285401, -0.0002425489, 0.0002563763, 0.0002700161, 0.0002834622, 0.0002967089, -0.0003097503, 0.0003225808, 0.0003351948, 0.0003475871, 0.0003597523, -0.0003716854, 0.0003833814, 0.0003948354, 0.0004060428, 0.0004169991, -0.0004276998, 0.0004381406, 0.0004483176, 0.0004582267, 0.0004678642, -0.0004772264, 0.0004863097, 0.0004951109, 0.0005036269, 0.0005118544, -0.0005197908, 0.0005274332, 0.0005347792, 0.0005418263, 0.0005485724, -0.0005550152, 0.0005611530, 0.0005669840, 0.0005725066, 0.0005777193, -0.0005826210, 0.0005872105, 0.0005914868, 0.0005954492, 0.0005990971, -0.0006024300, 0.0006054476, 0.0006081498, 0.0006105366, 0.0006126081, -0.0006143647, 0.0006158069, 0.0006169354, 0.0006177508, 0.0006182543, -0.0006184469, 0.0006183298, 0.0006179045, 0.0006171725, 0.0006161355, -0.0006147954, 0.0006131542, 0.0006112139, 0.0006089769, 0.0006064456, -0.0006036225, 0.0006005103, 0.0005971119, 0.0005934301, 0.0005894681, -0.0005852291, 0.0005807164, 0.0005759334, 0.0005708838, 0.0005655712, -0.0005599994, 0.0005541724, 0.0005480941, 0.0005417688, 0.0005352006, -0.0005283939, 0.0005213533, 0.0005140831, 0.0005065881, 0.0004988729, -0.0004909425, 0.0004828018, 0.0004744556, 0.0004659092, 0.0004571676, -0.0004482360, 0.0004391199, 0.0004298245, 0.0004203554, 0.0004107179, -0.0004009177, 0.0003909603, 0.0003808515, 0.0003705970, 0.0003602026, -0.0003496739, 0.0003390171, 0.0003282378, 0.0003173421, 0.0003063359, -0.0002952252, 0.0002840160, 0.0002727144, 0.0002613264, 0.0002498582, -0.0002383157, 0.0002267052, 0.0002150326, 0.0002033042, 0.0001915261, -0.0001797043, 0.0001678449, 0.0001559542, 0.0001440381, 0.0001321027, -0.0001201541, 0.0001081984, 0.0000962415, 0.0000842894, 0.0000723481, -0.0000604235, 0.0000485216, 0.0000366481, 0.0000248089, 0.0000130097, -0.0000012563, -0.0000104456, -0.0000220904, -0.0000336725, -0.0000451865, --0.0000566268, -0.0000679881, -0.0000792650, -0.0000904522, -0.0001015446, --0.0001125370, -0.0001234244, -0.0001342017, -0.0001448641, -0.0001554068, --0.0001658250, -0.0001761140, -0.0001862693, -0.0001962863, -0.0002061608, --0.0002158883, -0.0002254646, -0.0002348857, -0.0002441476, -0.0002532462, --0.0002621777, -0.0002709385, -0.0002795249, -0.0002879334, -0.0002961605, --0.0003042030, -0.0003120577, -0.0003197214, -0.0003271912, -0.0003344642, --0.0003415377, -0.0003484089, -0.0003550754, -0.0003615348, -0.0003677846, --0.0003738228, -0.0003796473, -0.0003852560, -0.0003906472, -0.0003958191, --0.0004007702, -0.0004054988, -0.0004100037, -0.0004142837, -0.0004183374, --0.0004221641, -0.0004257626, -0.0004291324, -0.0004322726, -0.0004351828, --0.0004378626, -0.0004403116, -0.0004425296, -0.0004445166, -0.0004462725, --0.0004477977, -0.0004490922, -0.0004501566, -0.0004509913, -0.0004515970, --0.0004519743, -0.0004521241, -0.0004520473, -0.0004517450, -0.0004512184, --0.0004504687, -0.0004494974, -0.0004483058, -0.0004468956, -0.0004452685, --0.0004434263, -0.0004413708, -0.0004391040, -0.0004366281, -0.0004339452, --0.0004310576, -0.0004279676, -0.0004246778, -0.0004211906, -0.0004175087, --0.0004136348, -0.0004095717, -0.0004053224, -0.0004008897, -0.0003962768, --0.0003914867, -0.0003865227, -0.0003813879, -0.0003760859, -0.0003706199, --0.0003649934, -0.0003592101, -0.0003532734, -0.0003471871, -0.0003409549, --0.0003345805, -0.0003280679, -0.0003214208, -0.0003146432, -0.0003077392, --0.0003007127, -0.0002935678, -0.0002863086, -0.0002789393, -0.0002714641, --0.0002638872, -0.0002562128, -0.0002484452, -0.0002405888, -0.0002326478, --0.0002246267, -0.0002165298, -0.0002083615, -0.0002001262, -0.0001918284, --0.0001834725, -0.0001750629, -0.0001666042, -0.0001581006, -0.0001495568, --0.0001409772, -0.0001323662, -0.0001237283, -0.0001150680, -0.0001063896, --0.0000976976, -0.0000889965, -0.0000802906, -0.0000715842, -0.0000628818, --0.0000541878, -0.0000455063, -0.0000368418, -0.0000281984, -0.0000195804, --0.0000109920, -0.0000024374, 0.0000060793, 0.0000145541, 0.0000229828, -0.0000313614, 0.0000396861, 0.0000479528, 0.0000561577, 0.0000642970, -0.0000723668, 0.0000803636, 0.0000882835, 0.0000961230, 0.0001038785, -0.0001115465, 0.0001191237, 0.0001266065, 0.0001339917, 0.0001412761, -0.0001484564, 0.0001555296, 0.0001624925, 0.0001693423, 0.0001760759, -0.0001826906, 0.0001891836, 0.0001955522, 0.0002017938, 0.0002079058, -0.0002138857, 0.0002197313, 0.0002254401, 0.0002310100, 0.0002364387, -0.0002417243, 0.0002468647, 0.0002518580, 0.0002567025, 0.0002613963, -0.0002659378, 0.0002703254, 0.0002745577, 0.0002786332, 0.0002825506, -0.0002863087, 0.0002899064, 0.0002933425, 0.0002966162, 0.0002997264, -0.0003026725, 0.0003054536, 0.0003080692, 0.0003105187, 0.0003128017, -0.0003149178, 0.0003168666, 0.0003186480, 0.0003202619, 0.0003217083, -0.0003229871, 0.0003240985, 0.0003250428, 0.0003258202, 0.0003264312, -0.0003268761, 0.0003271556, 0.0003272702, 0.0003272206, 0.0003270078, -0.0003266324, 0.0003260955, 0.0003253981, 0.0003245412, 0.0003235261, -0.0003223540, 0.0003210261, 0.0003195440, 0.0003179089, 0.0003161226, -0.0003141865, 0.0003121023, 0.0003098718, 0.0003074968, 0.0003049791, -0.0003023207, 0.0002995235, 0.0002965895, 0.0002935210, 0.0002903200, -0.0002869888, 0.0002835296, 0.0002799448, 0.0002762367, 0.0002724079, -0.0002684607, 0.0002643977, 0.0002602215, 0.0002559347, 0.0002515399, -0.0002470399, 0.0002424374, 0.0002377352, 0.0002329361, 0.0002280430, -0.0002230587, 0.0002179862, 0.0002128285, 0.0002075885, 0.0002022692, -0.0001968736, 0.0001914049, 0.0001858661, 0.0001802603, 0.0001745906, -0.0001688602, 0.0001630723, 0.0001572299, 0.0001513363, 0.0001453946, -0.0001394082, 0.0001333801, 0.0001273136, 0.0001212119, 0.0001150782, -0.0001089158, 0.0001027279, 0.0000965177, 0.0000902884, 0.0000840433, -0.0000777854, 0.0000715181, 0.0000652446, 0.0000589678, 0.0000526912, -0.0000464177, 0.0000401505, 0.0000338928, 0.0000276476, 0.0000214180, -0.0000152070, 0.0000090176, 0.0000028530, -0.0000032841, -0.0000093905, --0.0000154635, -0.0000215001, -0.0000274975, -0.0000334528, -0.0000393633, --0.0000452261, -0.0000510387, -0.0000567983, -0.0000625023, -0.0000681481, --0.0000737331, -0.0000792549, -0.0000847109, -0.0000900988, -0.0000954161, --0.0001006605, -0.0001058298, -0.0001109216, -0.0001159339, -0.0001208645, --0.0001257113, -0.0001304723, -0.0001351454, -0.0001397288, -0.0001442206, --0.0001486190, -0.0001529222, -0.0001571285, -0.0001612363, -0.0001652439, --0.0001691499, -0.0001729527, -0.0001766509, -0.0001802433, -0.0001837284, --0.0001871051, -0.0001903722, -0.0001935285, -0.0001965730, -0.0001995047, --0.0002023227, -0.0002050261, -0.0002076141, -0.0002100859, -0.0002124409, --0.0002146784, -0.0002167979, -0.0002187988, -0.0002206808, -0.0002224434, --0.0002240864, -0.0002256094, -0.0002270123, -0.0002282950, -0.0002294574, --0.0002304995, -0.0002314213, -0.0002322229, -0.0002329046, -0.0002334665, --0.0002339089, -0.0002342322, -0.0002344368, -0.0002345232, -0.0002344918, --0.0002343433, -0.0002340783, -0.0002336975, -0.0002332015, -0.0002325913, --0.0002318677, -0.0002310316, -0.0002300839, -0.0002290256, -0.0002278578, --0.0002265817, -0.0002251983, -0.0002237089, -0.0002221147, -0.0002204171, --0.0002186173, -0.0002167169, -0.0002147171, -0.0002126195, -0.0002104256, --0.0002081370, -0.0002057553, -0.0002032820, -0.0002007190, -0.0001980679, --0.0001953304, -0.0001925083, -0.0001896036, -0.0001866179, -0.0001835533, --0.0001804116, -0.0001771947, -0.0001739047, -0.0001705435, -0.0001671132, --0.0001636158, -0.0001600534, -0.0001564281, -0.0001527420, -0.0001489973, --0.0001451961, -0.0001413406, -0.0001374329, -0.0001334754, -0.0001294702, --0.0001254195, -0.0001213257, -0.0001171909, -0.0001130175, -0.0001088077, --0.0001045638, -0.0001002881, -0.0000959829, -0.0000916505, -0.0000872932, --0.0000829133, -0.0000785131, -0.0000740949, -0.0000696610, -0.0000652138, --0.0000607554, -0.0000562883, -0.0000518146, -0.0000473367, -0.0000428568, --0.0000383772, -0.0000339001, -0.0000294277, -0.0000249624, -0.0000205062, --0.0000160614, -0.0000116301, -0.0000072145, -0.0000028167, 0.0000015611, -0.0000059168, 0.0000102485, 0.0000145539, 0.0000188311, 0.0000230781, -0.0000272929, 0.0000314736, 0.0000356181, 0.0000397247, 0.0000437914, -0.0000478164, 0.0000517978, 0.0000557339, 0.0000596230, 0.0000634633, -0.0000672531, 0.0000709908, 0.0000746747, 0.0000783033, 0.0000818750, -0.0000853883, 0.0000888417, 0.0000922338, 0.0000955632, 0.0000988286, -0.0001020285, 0.0001051617, 0.0001082270, 0.0001112231, 0.0001141489, -0.0001170033, 0.0001197852, 0.0001224936, 0.0001251273, 0.0001276856, -0.0001301674, 0.0001325720, 0.0001348984, 0.0001371460, 0.0001393138, -0.0001414014, 0.0001434079, 0.0001453328, 0.0001471756, 0.0001489356, -0.0001506125, 0.0001522058, 0.0001537151, 0.0001551400, 0.0001564803, -0.0001577357, 0.0001589060, 0.0001599910, 0.0001609906, 0.0001619047, -0.0001627333, 0.0001634764, 0.0001641339, 0.0001647061, 0.0001651931, -0.0001655949, 0.0001659120, 0.0001661444, 0.0001662924, 0.0001663566, -0.0001663371, 0.0001662345, 0.0001660492, 0.0001657817, 0.0001654325, -0.0001650023, 0.0001644915, 0.0001639010, 0.0001632313, 0.0001624832, -0.0001616575, 0.0001607549, 0.0001597764, 0.0001587227, 0.0001575947, -0.0001563934, 0.0001551198, 0.0001537748, 0.0001523595, 0.0001508749, -0.0001493222, 0.0001477024, 0.0001460166, 0.0001442661, 0.0001424521, -0.0001405757, 0.0001386382, 0.0001366410, 0.0001345852, 0.0001324722, -0.0001303034, 0.0001280801, 0.0001258038, 0.0001234757, 0.0001210974, -0.0001186702, 0.0001161957, 0.0001136753, 0.0001111105, 0.0001085028, -0.0001058537, 0.0001031648, 0.0001004377, 0.0000976737, 0.0000948747, -0.0000920420, 0.0000891774, 0.0000862823, 0.0000833585, 0.0000804075, -0.0000774309, 0.0000744303, 0.0000714075, 0.0000683639, 0.0000653013, -0.0000622212, 0.0000591253, 0.0000560153, 0.0000528927, 0.0000497592, -0.0000466164, 0.0000434660, 0.0000403095, 0.0000371486, 0.0000339848, -0.0000308199, 0.0000276553, 0.0000244926, 0.0000213335, 0.0000181796, -0.0000150322, 0.0000118931, 0.0000087637, 0.0000056456, 0.0000025402, --0.0000005509, -0.0000036262, -0.0000066844, -0.0000097239, -0.0000127433, --0.0000157412, -0.0000187162, -0.0000216669, -0.0000245920, -0.0000274901, --0.0000303599, -0.0000332001, -0.0000360095, -0.0000387867, -0.0000415306, --0.0000442399, -0.0000469135, -0.0000495501, -0.0000521487, -0.0000547082, --0.0000572273, -0.0000597052, -0.0000621407, -0.0000645329, -0.0000668807, --0.0000691832, -0.0000714395, -0.0000736486, -0.0000758098, -0.0000779221, --0.0000799848, -0.0000819970, -0.0000839581, -0.0000858672, -0.0000877237, --0.0000895269, -0.0000912761, -0.0000929709, -0.0000946105, -0.0000961945, --0.0000977224, -0.0000991935, -0.0001006076, -0.0001019642, -0.0001032628, --0.0001045032, -0.0001056850, -0.0001068078, -0.0001078715, -0.0001088758, --0.0001098205, -0.0001107055, -0.0001115305, -0.0001122954, -0.0001130003, --0.0001136450, -0.0001142295, -0.0001147539, -0.0001152181, -0.0001156222, --0.0001159664, -0.0001162508, -0.0001164755, -0.0001166408, -0.0001167467, --0.0001167937, -0.0001167819, -0.0001167117, -0.0001165834, -0.0001163974, --0.0001161540, -0.0001158536, -0.0001154968, -0.0001150839, -0.0001146154, --0.0001140920, -0.0001135140, -0.0001128821, -0.0001121969, -0.0001114590, --0.0001106690, -0.0001098276, -0.0001089354, -0.0001079932, -0.0001070018, --0.0001059617, -0.0001048739, -0.0001037391, -0.0001025581, -0.0001013318, --0.0001000609, -0.0000987464, -0.0000973892, -0.0000959901, -0.0000945500, --0.0000930699, -0.0000915507, -0.0000899935, -0.0000883990, -0.0000867685, --0.0000851028, -0.0000834030, -0.0000816701, -0.0000799051, -0.0000781091, --0.0000762832, -0.0000744284, -0.0000725458, -0.0000706365, -0.0000687015, --0.0000667421, -0.0000647592, -0.0000627541, -0.0000607277, -0.0000586814, --0.0000566161, -0.0000545330, -0.0000524333, -0.0000503180, -0.0000481885, --0.0000460456, -0.0000438907, -0.0000417249, -0.0000395493, -0.0000373650, --0.0000351732, -0.0000329751, -0.0000307717, -0.0000285642, -0.0000263537, --0.0000241414, -0.0000219284, -0.0000197157, -0.0000175046, -0.0000152960, --0.0000130912, -0.0000108911, -0.0000086969, -0.0000065096, -0.0000043304, --0.0000021601, -0.0000000000 -}; diff --git a/dll/directx/wine/dsound/guid.c b/dll/directx/wine/dsound/guid.c index ff912c5620e..bd861d37228 100644 --- a/dll/directx/wine/dsound/guid.c +++ b/dll/directx/wine/dsound/guid.c @@ -1,18 +1,13 @@ /* DO NOT USE THE PRECOMPILED HEADER FOR THIS FILE! */ -#include - #define WIN32_NO_STATUS #define _INC_WINDOWS #define COM_NO_WINDOWS_H #include -#include -#include -#include +#include +#include #include -#include -#include -#include +#include /* NO CODE HERE, THIS IS JUST REQUIRED FOR THE GUID DEFINITIONS */ diff --git a/dll/directx/wine/dsound/mixer.c b/dll/directx/wine/dsound/mixer.c index bf81b1f0b64..115d15c0fda 100644 --- a/dll/directx/wine/dsound/mixer.c +++ b/dll/directx/wine/dsound/mixer.c @@ -24,8 +24,6 @@ #include "dsound_private.h" -#include "fir.h" - void DSOUND_RecalcVolPan(PDSVOLUMEPAN volpan) { double temp; @@ -78,81 +76,138 @@ void DSOUND_AmpFactorToVolPan(PDSVOLUMEPAN volpan) TRACE("Vol=%d Pan=%d\n", volpan->lVolume, volpan->lPan); } +/** Convert a primary buffer position to a pointer position for device->mix_buffer + * device: DirectSoundDevice for which to calculate + * pos: Primary buffer position to converts + * Returns: Offset for mix_buffer + */ +DWORD DSOUND_bufpos_to_mixpos(const DirectSoundDevice* device, DWORD pos) +{ + DWORD ret = pos * 32 / device->pwfx->wBitsPerSample; + if (device->pwfx->wBitsPerSample == 32) + ret *= 2; + return ret; +} + +/* NOTE: Not all secpos have to always be mapped to a bufpos, other way around is always the case + * DWORD64 is used here because a single DWORD wouldn't be big enough to fit the freqAcc for big buffers + */ +/** This function converts a 'native' sample pointer to a resampled pointer that fits for primary + * secmixpos is used to decide which freqAcc is needed + * overshot tells what the 'actual' secpos is now (optional) + */ +DWORD DSOUND_secpos_to_bufpos(const IDirectSoundBufferImpl *dsb, DWORD secpos, DWORD secmixpos, DWORD* overshot) +{ + DWORD64 framelen = secpos / dsb->pwfx->nBlockAlign; + DWORD64 freqAdjust = dsb->freqAdjust; + DWORD64 acc, freqAcc; + + if (secpos < secmixpos) + freqAcc = dsb->freqAccNext; + else freqAcc = dsb->freqAcc; + acc = (framelen << DSOUND_FREQSHIFT) + (freqAdjust - 1 - freqAcc); + acc /= freqAdjust; + if (overshot) + { + DWORD64 oshot = acc * freqAdjust + freqAcc; + assert(oshot >= framelen << DSOUND_FREQSHIFT); + oshot -= framelen << DSOUND_FREQSHIFT; + *overshot = (DWORD)oshot; + assert(*overshot < dsb->freqAdjust); + } + return (DWORD)acc * dsb->device->pwfx->nBlockAlign; +} + +/** Convert a resampled pointer that fits for primary to a 'native' sample pointer + * freqAccNext is used here rather than freqAcc: In case the app wants to fill up to + * the play position it won't overwrite it + */ +static DWORD DSOUND_bufpos_to_secpos(const IDirectSoundBufferImpl *dsb, DWORD bufpos) +{ + DWORD oAdv = dsb->device->pwfx->nBlockAlign, iAdv = dsb->pwfx->nBlockAlign, pos; + DWORD64 framelen; + DWORD64 acc; + + framelen = bufpos/oAdv; + acc = framelen * (DWORD64)dsb->freqAdjust + (DWORD64)dsb->freqAccNext; + acc = acc >> DSOUND_FREQSHIFT; + pos = (DWORD)acc * iAdv; + if (pos >= dsb->buflen) + /* Because of differences between freqAcc and freqAccNext, this might happen */ + pos = dsb->buflen - iAdv; + TRACE("Converted %d/%d to %d/%d\n", bufpos, dsb->tmp_buffer_len, pos, dsb->buflen); + return pos; +} + +/** + * Move freqAccNext to freqAcc, and find new values for buffer length and freqAccNext + */ +static void DSOUND_RecalcFreqAcc(IDirectSoundBufferImpl *dsb) +{ + if (!dsb->freqneeded) return; + dsb->freqAcc = dsb->freqAccNext; + dsb->tmp_buffer_len = DSOUND_secpos_to_bufpos(dsb, dsb->buflen, 0, &dsb->freqAccNext); + TRACE("New freqadjust: %04x, new buflen: %d\n", dsb->freqAccNext, dsb->tmp_buffer_len); +} + /** * Recalculate the size for temporary buffer, and new writelead * Should be called when one of the following things occur: * - Primary buffer format is changed * - This buffer format (frequency) is changed + * + * After this, DSOUND_MixToTemporary(dsb, 0, dsb->buflen) should + * be called to refill the temporary buffer with data. */ void DSOUND_RecalcFormat(IDirectSoundBufferImpl *dsb) { - DWORD ichannels = dsb->pwfx->nChannels; - DWORD ochannels = dsb->device->pwfx->nChannels; + BOOL needremix = TRUE, needresample = (dsb->freq != dsb->device->pwfx->nSamplesPerSec); + DWORD bAlign = dsb->pwfx->nBlockAlign, pAlign = dsb->device->pwfx->nBlockAlign; WAVEFORMATEXTENSIBLE *pwfxe; BOOL ieee = FALSE; TRACE("(%p)\n",dsb); pwfxe = (WAVEFORMATEXTENSIBLE *) dsb->pwfx; - dsb->freqAdjust = (float)dsb->freq / dsb->device->pwfx->nSamplesPerSec; if ((pwfxe->Format.wFormatTag == WAVE_FORMAT_IEEE_FLOAT) || ((pwfxe->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE) && (IsEqualGUID(&pwfxe->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT)))) ieee = TRUE; - /** - * Recalculate FIR step and gain. - * - * firstep says how many points of the FIR exist per one - * sample in the secondary buffer. firgain specifies what - * to multiply the FIR output by in order to attenuate it correctly. - */ - if (dsb->freqAdjust > 1.0f) { - /** - * Yes, round it a bit to make sure that the - * linear interpolation factor never changes. - */ - dsb->firstep = ceil(fir_step / dsb->freqAdjust); - } else { - dsb->firstep = fir_step; - } - dsb->firgain = (float)dsb->firstep / fir_step; - /* calculate the 10ms write lead */ dsb->writelead = (dsb->freq / 100) * dsb->pwfx->nBlockAlign; - dsb->freqAcc = 0; + if ((dsb->pwfx->wBitsPerSample == dsb->device->pwfx->wBitsPerSample) && + (dsb->pwfx->nChannels == dsb->device->pwfx->nChannels) && !needresample && !ieee) + needremix = FALSE; + HeapFree(GetProcessHeap(), 0, dsb->tmp_buffer); + dsb->tmp_buffer = NULL; + dsb->max_buffer_len = dsb->freqAcc = dsb->freqAccNext = 0; + dsb->freqneeded = needresample; - dsb->get_aux = ieee ? getbpp[4] : getbpp[dsb->pwfx->wBitsPerSample/8 - 1]; - dsb->put_aux = putieee32; - - dsb->get = dsb->get_aux; - dsb->put = dsb->put_aux; - - if (ichannels == ochannels) - { - dsb->mix_channels = ichannels; - if (ichannels > 32) { - FIXME("Copying %u channels is unsupported, limiting to first 32\n", ichannels); - dsb->mix_channels = 32; - } - } - else if (ichannels == 1) - { - dsb->mix_channels = 1; - dsb->put = put_mono2stereo; - } - else if (ochannels == 1) - { - dsb->mix_channels = 1; - dsb->get = get_mono; - } + if (ieee) + dsb->convert = convertbpp[4][dsb->device->pwfx->wBitsPerSample/8 - 1]; else + dsb->convert = convertbpp[dsb->pwfx->wBitsPerSample/8 - 1][dsb->device->pwfx->wBitsPerSample/8 - 1]; + + dsb->resampleinmixer = FALSE; + + if (needremix) { - if (ichannels > 2) - FIXME("Conversion from %u to %u channels is not implemented, falling back to stereo\n", ichannels, ochannels); - dsb->mix_channels = 2; + if (needresample) + DSOUND_RecalcFreqAcc(dsb); + else + dsb->tmp_buffer_len = dsb->buflen / bAlign * pAlign; + dsb->max_buffer_len = dsb->tmp_buffer_len; + if ((dsb->max_buffer_len <= dsb->device->buflen || dsb->max_buffer_len < ds_snd_shadow_maxsize * 1024 * 1024) && ds_snd_shadow_maxsize >= 0) + dsb->tmp_buffer = HeapAlloc(GetProcessHeap(), 0, dsb->max_buffer_len); + if (dsb->tmp_buffer) + FillMemory(dsb->tmp_buffer, dsb->tmp_buffer_len, dsb->device->pwfx->wBitsPerSample == 8 ? 128 : 0); + else + dsb->resampleinmixer = TRUE; } + else dsb->max_buffer_len = dsb->tmp_buffer_len = dsb->buflen; + dsb->buf_mixpos = DSOUND_secpos_to_bufpos(dsb, dsb->sec_mixpos, 0, NULL); } /** @@ -209,114 +264,41 @@ void DSOUND_CheckEvent(const IDirectSoundBufferImpl *dsb, DWORD playpos, int len } } -static inline float get_current_sample(const IDirectSoundBufferImpl *dsb, - DWORD mixpos, DWORD channel) +/** + * Copy a single frame from the given input buffer to the given output buffer. + * Translate 8 <-> 16 bits and mono <-> stereo + */ +static inline void cp_fields(const IDirectSoundBufferImpl *dsb, const BYTE *ibuf, BYTE *obuf, + UINT istride, UINT ostride, UINT count, UINT freqAcc, UINT adj) { - if (mixpos >= dsb->buflen && !(dsb->playflags & DSBPLAY_LOOPING)) - return 0.0f; - return dsb->get(dsb, mixpos % dsb->buflen, channel); -} + DirectSoundDevice *device = dsb->device; + INT istep = dsb->pwfx->wBitsPerSample / 8, ostep = device->pwfx->wBitsPerSample / 8; -static UINT cp_fields_noresample(IDirectSoundBufferImpl *dsb, UINT count) -{ - UINT istride = dsb->pwfx->nBlockAlign; - UINT ostride = dsb->device->pwfx->nChannels * sizeof(float); - DWORD channel, i; - for (i = 0; i < count; i++) - for (channel = 0; channel < dsb->mix_channels; channel++) - dsb->put(dsb, i * ostride, channel, get_current_sample(dsb, - dsb->sec_mixpos + i * istride, channel)); - return count; -} - -static UINT cp_fields_resample(IDirectSoundBufferImpl *dsb, UINT count, float *freqAcc) -{ - UINT i, channel; - UINT istride = dsb->pwfx->nBlockAlign; - UINT ostride = dsb->device->pwfx->nChannels * sizeof(float); - - float freqAdjust = dsb->freqAdjust; - float freqAcc_start = *freqAcc; - float freqAcc_end = freqAcc_start + count * freqAdjust; - UINT dsbfirstep = dsb->firstep; - UINT channels = dsb->mix_channels; - UINT max_ipos = freqAcc_start + count * freqAdjust; - - UINT fir_cachesize = (fir_len + dsbfirstep - 2) / dsbfirstep; - UINT required_input = max_ipos + fir_cachesize; - - float* intermediate = HeapAlloc(GetProcessHeap(), 0, - sizeof(float) * required_input * channels); - - float* fir_copy = HeapAlloc(GetProcessHeap(), 0, - sizeof(float) * fir_cachesize); - - /* Important: this buffer MUST be non-interleaved - * if you want -msse3 to have any effect. - * This is good for CPU cache effects, too. - */ - float* itmp = intermediate; - for (channel = 0; channel < channels; channel++) - for (i = 0; i < required_input; i++) - *(itmp++) = get_current_sample(dsb, - dsb->sec_mixpos + i * istride, channel); - - for(i = 0; i < count; ++i) { - float total_fir_steps = (freqAcc_start + i * freqAdjust) * dsbfirstep; - UINT int_fir_steps = total_fir_steps; - UINT ipos = int_fir_steps / dsbfirstep; - - UINT idx = (ipos + 1) * dsbfirstep - int_fir_steps - 1; - float rem = int_fir_steps + 1.0 - total_fir_steps; - - int fir_used = 0; - while (idx < fir_len - 1) { - fir_copy[fir_used++] = fir[idx] * (1.0 - rem) + fir[idx + 1] * rem; - idx += dsb->firstep; - } - - assert(fir_used <= fir_cachesize); - assert(ipos + fir_used <= required_input); - - for (channel = 0; channel < dsb->mix_channels; channel++) { - int j; - float sum = 0.0; - float* cache = &intermediate[channel * required_input + ipos]; - for (j = 0; j < fir_used; j++) - sum += fir_copy[j] * cache[j]; - dsb->put(dsb, i * ostride, channel, sum * dsb->firgain); - } + if (device->pwfx->nChannels == dsb->pwfx->nChannels || + (device->pwfx->nChannels == 2 && dsb->pwfx->nChannels == 6) || + (device->pwfx->nChannels == 8 && dsb->pwfx->nChannels == 2) || + (device->pwfx->nChannels == 6 && dsb->pwfx->nChannels == 2)) { + dsb->convert(ibuf, obuf, istride, ostride, count, freqAcc, adj); + if (device->pwfx->nChannels == 2 || dsb->pwfx->nChannels == 2) + dsb->convert(ibuf + istep, obuf + ostep, istride, ostride, count, freqAcc, adj); + return; } - freqAcc_end -= (int)freqAcc_end; - *freqAcc = freqAcc_end; - - HeapFree(GetProcessHeap(), 0, fir_copy); - HeapFree(GetProcessHeap(), 0, intermediate); - - return max_ipos; -} - -static void cp_fields(IDirectSoundBufferImpl *dsb, UINT count, float *freqAcc) -{ - DWORD ipos, adv; - - if (dsb->freqAdjust == 1.0) - adv = cp_fields_noresample(dsb, count); /* *freqAcc is unmodified */ - else - adv = cp_fields_resample(dsb, count, freqAcc); - - ipos = dsb->sec_mixpos + adv * dsb->pwfx->nBlockAlign; - if (ipos >= dsb->buflen) { - if (dsb->playflags & DSBPLAY_LOOPING) - ipos %= dsb->buflen; - else { - ipos = 0; - dsb->state = STATE_STOPPED; - } + if (device->pwfx->nChannels == 1 && dsb->pwfx->nChannels == 2) + { + dsb->convert(ibuf, obuf, istride, ostride, count, freqAcc, adj); + return; } - dsb->sec_mixpos = ipos; + if (device->pwfx->nChannels == 2 && dsb->pwfx->nChannels == 1) + { + dsb->convert(ibuf, obuf, istride, ostride, count, freqAcc, adj); + dsb->convert(ibuf, obuf + ostep, istride, ostride, count, freqAcc, adj); + return; + } + + WARN("Unable to remap channels: device=%u, buffer=%u\n", device->pwfx->nChannels, + dsb->pwfx->nChannels); } /** @@ -347,53 +329,158 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2) * * NOTE: writepos + len <= buflen. When called by mixer, MixOne makes sure of this. */ -static void DSOUND_MixToTemporary(IDirectSoundBufferImpl *dsb, DWORD frames) +void DSOUND_MixToTemporary(const IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD len, BOOL inmixer) { - UINT size_bytes = frames * sizeof(float) * dsb->device->pwfx->nChannels; + INT size; + BYTE *ibp, *obp, *obp_begin; + INT iAdvance = dsb->pwfx->nBlockAlign; + INT oAdvance = dsb->device->pwfx->nBlockAlign; + DWORD freqAcc, target_writepos = 0, overshot, maxlen; - if (dsb->device->tmp_buffer_len < size_bytes || !dsb->device->tmp_buffer) + /* We resample only when needed */ + if ((dsb->tmp_buffer && inmixer) || (!dsb->tmp_buffer && !inmixer) || dsb->resampleinmixer != inmixer) + return; + + assert(writepos + len <= dsb->buflen); + if (inmixer && writepos + len < dsb->buflen) + len += dsb->pwfx->nBlockAlign; + + maxlen = DSOUND_secpos_to_bufpos(dsb, len, 0, NULL); + + ibp = dsb->buffer->memory + writepos; + if (!inmixer) + obp_begin = dsb->tmp_buffer; + else if (dsb->device->tmp_buffer_len < maxlen || !dsb->device->tmp_buffer) { - dsb->device->tmp_buffer_len = size_bytes; + dsb->device->tmp_buffer_len = maxlen; if (dsb->device->tmp_buffer) - dsb->device->tmp_buffer = HeapReAlloc(GetProcessHeap(), 0, dsb->device->tmp_buffer, size_bytes); + dsb->device->tmp_buffer = HeapReAlloc(GetProcessHeap(), 0, dsb->device->tmp_buffer, maxlen); else - dsb->device->tmp_buffer = HeapAlloc(GetProcessHeap(), 0, size_bytes); + dsb->device->tmp_buffer = HeapAlloc(GetProcessHeap(), 0, maxlen); + obp_begin = dsb->device->tmp_buffer; + } + else + obp_begin = dsb->device->tmp_buffer; + + TRACE("(%p, %p)\n", dsb, ibp); + size = len / iAdvance; + + /* Check for same sample rate */ + if (dsb->freq == dsb->device->pwfx->nSamplesPerSec) { + TRACE("(%p) Same sample rate %d = primary %d\n", dsb, + dsb->freq, dsb->device->pwfx->nSamplesPerSec); + obp = obp_begin; + if (!inmixer) + obp += writepos/iAdvance*oAdvance; + + cp_fields(dsb, ibp, obp, iAdvance, oAdvance, size, 0, 1 << DSOUND_FREQSHIFT); + return; } - cp_fields(dsb, frames, &dsb->freqAcc); + /* Mix in different sample rates */ + TRACE("(%p) Adjusting frequency: %d -> %d\n", dsb, dsb->freq, dsb->device->pwfx->nSamplesPerSec); + + target_writepos = DSOUND_secpos_to_bufpos(dsb, writepos, dsb->sec_mixpos, &freqAcc); + overshot = freqAcc >> DSOUND_FREQSHIFT; + if (overshot) + { + if (overshot >= size) + return; + size -= overshot; + writepos += overshot * iAdvance; + if (writepos >= dsb->buflen) + return; + ibp = dsb->buffer->memory + writepos; + freqAcc &= (1 << DSOUND_FREQSHIFT) - 1; + TRACE("Overshot: %d, freqAcc: %04x\n", overshot, freqAcc); + } + + if (!inmixer) + obp = obp_begin + target_writepos; + else obp = obp_begin; + + /* FIXME: Small problem here when we're overwriting buf_mixpos, it then STILL uses old freqAcc, not sure if it matters or not */ + cp_fields(dsb, ibp, obp, iAdvance, oAdvance, size, freqAcc, dsb->freqAdjust); } -static void DSOUND_MixerVol(const IDirectSoundBufferImpl *dsb, INT frames) +/** Apply volume to the given soundbuffer from (primary) position writepos and length len + * Returns: NULL if no volume needs to be applied + * or else a memory handle that holds 'len' volume adjusted buffer */ +static LPBYTE DSOUND_MixerVol(const IDirectSoundBufferImpl *dsb, INT len) { INT i; - float vLeft, vRight; - UINT channels = dsb->device->pwfx->nChannels, chan; + BYTE *bpc; + INT16 *bps, *mems; + DWORD vLeft, vRight; + INT nChannels = dsb->device->pwfx->nChannels; + LPBYTE mem = (dsb->tmp_buffer ? dsb->tmp_buffer : dsb->buffer->memory) + dsb->buf_mixpos; - TRACE("(%p,%d)\n",dsb,frames); + if (dsb->resampleinmixer) + mem = dsb->device->tmp_buffer; + + TRACE("(%p,%d)\n",dsb,len); TRACE("left = %x, right = %x\n", dsb->volpan.dwTotalLeftAmpFactor, dsb->volpan.dwTotalRightAmpFactor); if ((!(dsb->dsbd.dwFlags & DSBCAPS_CTRLPAN) || (dsb->volpan.lPan == 0)) && (!(dsb->dsbd.dwFlags & DSBCAPS_CTRLVOLUME) || (dsb->volpan.lVolume == 0)) && !(dsb->dsbd.dwFlags & DSBCAPS_CTRL3D)) - return; /* Nothing to do */ + return NULL; /* Nothing to do */ - if (channels != 1 && channels != 2) + if (nChannels != 1 && nChannels != 2) { - FIXME("There is no support for %u channels\n", channels); - return; + FIXME("There is no support for %d channels\n", nChannels); + return NULL; } - vLeft = dsb->volpan.dwTotalLeftAmpFactor / ((float)0xFFFF); - vRight = dsb->volpan.dwTotalRightAmpFactor / ((float)0xFFFF); - for(i = 0; i < frames; ++i){ - for(chan = 0; chan < channels; ++chan){ - if(chan == 0) - dsb->device->tmp_buffer[i * channels + chan] *= vLeft; - else - dsb->device->tmp_buffer[i * channels + chan] *= vRight; - } + if (dsb->device->pwfx->wBitsPerSample != 8 && dsb->device->pwfx->wBitsPerSample != 16) + { + FIXME("There is no support for %d bpp\n", dsb->device->pwfx->wBitsPerSample); + return NULL; } + + if (dsb->device->tmp_buffer_len < len || !dsb->device->tmp_buffer) + { + /* If we just resampled in DSOUND_MixToTemporary, we shouldn't need to resize here */ + assert(!dsb->resampleinmixer); + dsb->device->tmp_buffer_len = len; + if (dsb->device->tmp_buffer) + dsb->device->tmp_buffer = HeapReAlloc(GetProcessHeap(), 0, dsb->device->tmp_buffer, len); + else + dsb->device->tmp_buffer = HeapAlloc(GetProcessHeap(), 0, len); + } + + bpc = dsb->device->tmp_buffer; + bps = (INT16 *)bpc; + mems = (INT16 *)mem; + vLeft = dsb->volpan.dwTotalLeftAmpFactor; + if (nChannels > 1) + vRight = dsb->volpan.dwTotalRightAmpFactor; + else + vRight = vLeft; + + switch (dsb->device->pwfx->wBitsPerSample) { + case 8: + /* 8-bit WAV is unsigned, but we need to operate */ + /* on signed data for this to work properly */ + for (i = 0; i < len-1; i+=2) { + *(bpc++) = (((*(mem++) - 128) * vLeft) >> 16) + 128; + *(bpc++) = (((*(mem++) - 128) * vRight) >> 16) + 128; + } + if (len % 2 == 1 && nChannels == 1) + *(bpc++) = (((*(mem++) - 128) * vLeft) >> 16) + 128; + break; + case 16: + /* 16-bit WAV is signed -- much better */ + for (i = 0; i < len-3; i += 4) { + *(bps++) = (*(mems++) * vLeft) >> 16; + *(bps++) = (*(mems++) * vRight) >> 16; + } + if (len % 4 == 2 && nChannels == 1) + *(bps++) = ((INT)*(mems++) * vLeft) >> 16; + break; + } + return dsb->device->tmp_buffer; } /** @@ -411,14 +498,15 @@ static void DSOUND_MixerVol(const IDirectSoundBufferImpl *dsb, INT frames) */ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD fraglen) { - INT len = fraglen; - float *ibuf; - DWORD oldpos; - UINT frames = fraglen / dsb->device->pwfx->nBlockAlign; + INT len = fraglen, ilen; + BYTE *ibuf = (dsb->tmp_buffer ? dsb->tmp_buffer : dsb->buffer->memory) + dsb->buf_mixpos, *volbuf; + DWORD oldpos, mixbufpos; - TRACE("sec_mixpos=%d/%d\n", dsb->sec_mixpos, dsb->buflen); + TRACE("buf_mixpos=%d/%d sec_mixpos=%d/%d\n", dsb->buf_mixpos, dsb->tmp_buffer_len, dsb->sec_mixpos, dsb->buflen); TRACE("(%p,%d,%d)\n",dsb,writepos,fraglen); + assert(dsb->buf_mixpos + len <= dsb->tmp_buffer_len); + if (len % dsb->device->pwfx->nBlockAlign) { INT nBlockAlign = dsb->device->pwfx->nBlockAlign; ERR("length not a multiple of block size, len = %d, block size = %d\n", len, nBlockAlign); @@ -426,23 +514,53 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWO } /* Resample buffer to temporary buffer specifically allocated for this purpose, if needed */ - oldpos = dsb->sec_mixpos; - - DSOUND_MixToTemporary(dsb, frames); - ibuf = dsb->device->tmp_buffer; + DSOUND_MixToTemporary(dsb, dsb->sec_mixpos, DSOUND_bufpos_to_secpos(dsb, dsb->buf_mixpos+len) - dsb->sec_mixpos, TRUE); + if (dsb->resampleinmixer) + ibuf = dsb->device->tmp_buffer; /* Apply volume if needed */ - DSOUND_MixerVol(dsb, frames); + volbuf = DSOUND_MixerVol(dsb, len); + if (volbuf) + ibuf = volbuf; - mixieee32(ibuf, dsb->device->mix_buffer, frames * dsb->device->pwfx->nChannels); + mixbufpos = DSOUND_bufpos_to_mixpos(dsb->device, writepos); + /* Now mix the temporary buffer into the devices main buffer */ + if ((writepos + len) <= dsb->device->buflen) + dsb->device->mixfunction(ibuf, dsb->device->mix_buffer + mixbufpos, len); + else + { + DWORD todo = dsb->device->buflen - writepos; + dsb->device->mixfunction(ibuf, dsb->device->mix_buffer + mixbufpos, todo); + dsb->device->mixfunction(ibuf + todo, dsb->device->mix_buffer, len - todo); + } + oldpos = dsb->sec_mixpos; + dsb->buf_mixpos += len; + + if (dsb->buf_mixpos >= dsb->tmp_buffer_len) { + if (dsb->buf_mixpos > dsb->tmp_buffer_len) + ERR("Mixpos (%u) past buflen (%u), capping...\n", dsb->buf_mixpos, dsb->tmp_buffer_len); + if (dsb->playflags & DSBPLAY_LOOPING) { + dsb->buf_mixpos -= dsb->tmp_buffer_len; + } else if (dsb->buf_mixpos >= dsb->tmp_buffer_len) { + dsb->buf_mixpos = dsb->sec_mixpos = 0; + dsb->state = STATE_STOPPED; + } + DSOUND_RecalcFreqAcc(dsb); + } + + dsb->sec_mixpos = DSOUND_bufpos_to_secpos(dsb, dsb->buf_mixpos); + ilen = DSOUND_BufPtrDiff(dsb->buflen, dsb->sec_mixpos, oldpos); /* check for notification positions */ if (dsb->dsbd.dwFlags & DSBCAPS_CTRLPOSITIONNOTIFY && dsb->state != STATE_STARTING) { - INT ilen = DSOUND_BufPtrDiff(dsb->buflen, dsb->sec_mixpos, oldpos); DSOUND_CheckEvent(dsb, oldpos, ilen); } + /* increase mix position */ + dsb->primary_mixpos += len; + if (dsb->primary_mixpos >= dsb->device->buflen) + dsb->primary_mixpos -= dsb->device->buflen; return len; } @@ -460,34 +578,69 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWO */ static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD mixlen) { - DWORD primary_done = 0; + /* The buffer's primary_mixpos may be before or after the device + * buffer's mixpos, but both must be ahead of writepos. */ + DWORD primary_done; TRACE("(%p,%d,%d)\n",dsb,writepos,mixlen); - TRACE("writepos=%d, mixlen=%d\n", writepos, mixlen); - TRACE("looping=%d, leadin=%d\n", dsb->playflags, dsb->leadin); + TRACE("writepos=%d, buf_mixpos=%d, primary_mixpos=%d, mixlen=%d\n", writepos, dsb->buf_mixpos, dsb->primary_mixpos, mixlen); + TRACE("looping=%d, leadin=%d, buflen=%d\n", dsb->playflags, dsb->leadin, dsb->tmp_buffer_len); /* If leading in, only mix about 20 ms, and 'skip' mixing the rest, for more fluid pointer advancement */ - /* FIXME: Is this needed? */ - if (dsb->leadin && dsb->state == STATE_STARTING) { - if (mixlen > 2 * dsb->device->fraglen) { - primary_done = mixlen - 2 * dsb->device->fraglen; - mixlen = 2 * dsb->device->fraglen; - writepos += primary_done; - dsb->sec_mixpos += (primary_done / dsb->device->pwfx->nBlockAlign) * - dsb->pwfx->nBlockAlign * dsb->freqAdjust; + if (dsb->leadin && dsb->state == STATE_STARTING) + { + if (mixlen > 2 * dsb->device->fraglen) + { + dsb->primary_mixpos += mixlen - 2 * dsb->device->fraglen; + dsb->primary_mixpos %= dsb->device->buflen; } } - dsb->leadin = FALSE; - TRACE("mixlen (primary) = %i\n", mixlen); + /* calculate how much pre-buffering has already been done for this buffer */ + primary_done = DSOUND_BufPtrDiff(dsb->device->buflen, dsb->primary_mixpos, writepos); + + /* sanity */ + if(mixlen < primary_done) + { + /* Should *NEVER* happen */ + ERR("Fatal error. Under/Overflow? primary_done=%d, mixpos=%d/%d (%d/%d), primary_mixpos=%d, writepos=%d, mixlen=%d\n", primary_done,dsb->buf_mixpos,dsb->tmp_buffer_len,dsb->sec_mixpos, dsb->buflen, dsb->primary_mixpos, writepos, mixlen); + dsb->primary_mixpos = writepos + mixlen; + dsb->primary_mixpos %= dsb->device->buflen; + return mixlen; + } + + /* take into account already mixed data */ + mixlen -= primary_done; + + TRACE("primary_done=%d, mixlen (primary) = %i\n", primary_done, mixlen); + + if (!mixlen) + return primary_done; /* First try to mix to the end of the buffer if possible * Theoretically it would allow for better optimization */ - primary_done += DSOUND_MixInBuffer(dsb, writepos, mixlen); + if (mixlen + dsb->buf_mixpos >= dsb->tmp_buffer_len) + { + DWORD newmixed, mixfirst = dsb->tmp_buffer_len - dsb->buf_mixpos; + newmixed = DSOUND_MixInBuffer(dsb, dsb->primary_mixpos, mixfirst); + mixlen -= newmixed; - TRACE("total mixed data=%d\n", primary_done); + if (dsb->playflags & DSBPLAY_LOOPING) + while (newmixed && mixlen) + { + mixfirst = (dsb->tmp_buffer_len < mixlen ? dsb->tmp_buffer_len : mixlen); + newmixed = DSOUND_MixInBuffer(dsb, dsb->primary_mixpos, mixfirst); + mixlen -= newmixed; + } + } + else DSOUND_MixInBuffer(dsb, dsb->primary_mixpos, mixlen); + + /* re-calculate the primary done */ + primary_done = DSOUND_BufPtrDiff(dsb->device->buflen, dsb->primary_mixpos, writepos); + + TRACE("new primary_mixpos=%d, total mixed data=%d\n", dsb->primary_mixpos, primary_done); /* Report back the total prebuffered amount for this buffer */ return primary_done; @@ -507,9 +660,10 @@ static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD mi * Returns: the length beyond the writepos that was mixed to. */ -static void DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD writepos, DWORD mixlen, BOOL recover, BOOL *all_stopped) +static DWORD DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD writepos, DWORD mixlen, BOOL recover, BOOL *all_stopped) { - INT i; + INT i, len; + DWORD minlen = 0; IDirectSoundBufferImpl *dsb; /* unless we find a running buffer, all have stopped */ @@ -521,7 +675,7 @@ static void DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD writepos, TRACE("MixToPrimary for %p, state=%d\n", dsb, dsb->state); - if (dsb->buflen && dsb->state) { + if (dsb->buflen && dsb->state && !dsb->hwbuf) { TRACE("Checking %p, mixlen=%d\n", dsb, mixlen); RtlAcquireResourceShared(&dsb->lock, TRUE); /* if buffer is stopping it is stopped now */ @@ -530,18 +684,32 @@ static void DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD writepos, DSOUND_CheckEvent(dsb, 0, 0); } else if (dsb->state != STATE_STOPPED) { + /* if recovering, reset the mix position */ + if ((dsb->state == STATE_STARTING) || recover) { + dsb->primary_mixpos = writepos; + } + /* if the buffer was starting, it must be playing now */ if (dsb->state == STATE_STARTING) dsb->state = STATE_PLAYING; /* mix next buffer into the main buffer */ - DSOUND_MixOne(dsb, writepos, mixlen); + len = DSOUND_MixOne(dsb, writepos, mixlen); + + if (!minlen) minlen = len; + + /* record the minimum length mixed from all buffers */ + /* we only want to return the length which *all* buffers have mixed */ + else if (len) minlen = (len < minlen) ? len : minlen; *all_stopped = FALSE; } RtlReleaseResource(&dsb->lock); } } + + TRACE("Mixed at least %d from all buffers\n", minlen); + return minlen; } /** @@ -556,130 +724,78 @@ static void DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD writepos, static void DSOUND_WaveQueue(DirectSoundDevice *device, BOOL force) { - DWORD prebuf_frames, prebuf_bytes, read_offs_bytes; - BYTE *buffer; - HRESULT hr; - + DWORD prebuf_frags, wave_writepos, wave_fragpos, i; TRACE("(%p)\n", device); - read_offs_bytes = (device->playing_offs_bytes + device->in_mmdev_bytes) % device->buflen; + /* calculate the current wave frag position */ + wave_fragpos = (device->pwplay + device->pwqueue) % device->helfrags; - TRACE("read_offs_bytes = %u, playing_offs_bytes = %u, in_mmdev_bytes: %u, prebuf = %u\n", - read_offs_bytes, device->playing_offs_bytes, device->in_mmdev_bytes, device->prebuf); + /* calculate the current wave write position */ + wave_writepos = wave_fragpos * device->fraglen; + + TRACE("wave_fragpos = %i, wave_writepos = %i, pwqueue = %i, prebuf = %i\n", + wave_fragpos, wave_writepos, device->pwqueue, device->prebuf); if (!force) { - if(device->mixpos < device->playing_offs_bytes) - prebuf_bytes = device->mixpos + device->buflen - device->playing_offs_bytes; - else - prebuf_bytes = device->mixpos - device->playing_offs_bytes; + /* check remaining prebuffered frags */ + prebuf_frags = device->mixpos / device->fraglen; + if (prebuf_frags == device->helfrags) + --prebuf_frags; + TRACE("wave_fragpos = %d, mixpos_frags = %d\n", wave_fragpos, prebuf_frags); + if (prebuf_frags < wave_fragpos) + prebuf_frags += device->helfrags; + prebuf_frags -= wave_fragpos; + TRACE("wanted prebuf_frags = %d\n", prebuf_frags); } else /* buffer the maximum amount of frags */ - prebuf_bytes = device->prebuf * device->fraglen; + prebuf_frags = device->prebuf; /* limit to the queue we have left */ - if(device->in_mmdev_bytes + prebuf_bytes > device->prebuf * device->fraglen) - prebuf_bytes = device->prebuf * device->fraglen - device->in_mmdev_bytes; + if ((prebuf_frags + device->pwqueue) > device->prebuf) + prebuf_frags = device->prebuf - device->pwqueue; - TRACE("prebuf_bytes = %u\n", prebuf_bytes); + TRACE("prebuf_frags = %i\n", prebuf_frags); - if(!prebuf_bytes) - return; + /* adjust queue */ + device->pwqueue += prebuf_frags; - device->in_mmdev_bytes += prebuf_bytes; + /* get out of CS when calling the wave system */ + LeaveCriticalSection(&(device->mixlock)); + /* **** */ - if(prebuf_bytes + read_offs_bytes > device->buflen){ - DWORD chunk_bytes = device->buflen - read_offs_bytes; - prebuf_frames = chunk_bytes / device->pwfx->nBlockAlign; - prebuf_bytes -= chunk_bytes; - }else{ - prebuf_frames = prebuf_bytes / device->pwfx->nBlockAlign; - prebuf_bytes = 0; + /* queue up the new buffers */ + for(i=0; ihwo, &device->pwave[wave_fragpos], sizeof(WAVEHDR)); + wave_fragpos++; + wave_fragpos %= device->helfrags; } - hr = IAudioRenderClient_GetBuffer(device->render, prebuf_frames, &buffer); - if(FAILED(hr)){ - WARN("GetBuffer failed: %08x\n", hr); - return; - } + /* **** */ + EnterCriticalSection(&(device->mixlock)); - memcpy(buffer, device->buffer + read_offs_bytes, - prebuf_frames * device->pwfx->nBlockAlign); - - hr = IAudioRenderClient_ReleaseBuffer(device->render, prebuf_frames, 0); - if(FAILED(hr)){ - WARN("ReleaseBuffer failed: %08x\n", hr); - return; - } - - /* check if anything wrapped */ - if(prebuf_bytes > 0){ - prebuf_frames = prebuf_bytes / device->pwfx->nBlockAlign; - - hr = IAudioRenderClient_GetBuffer(device->render, prebuf_frames, &buffer); - if(FAILED(hr)){ - WARN("GetBuffer failed: %08x\n", hr); - return; - } - - memcpy(buffer, device->buffer, prebuf_frames * device->pwfx->nBlockAlign); - - hr = IAudioRenderClient_ReleaseBuffer(device->render, prebuf_frames, 0); - if(FAILED(hr)){ - WARN("ReleaseBuffer failed: %08x\n", hr); - return; - } - } - - TRACE("in_mmdev_bytes now = %i\n", device->in_mmdev_bytes); + TRACE("queue now = %i\n", device->pwqueue); } /** * Perform mixing for a Direct Sound device. That is, go through all the * secondary buffers (the sound bites currently playing) and mix them in * to the primary buffer (the device buffer). - * - * The mixing procedure goes: - * - * secondary->buffer (secondary format) - * =[Resample]=> device->tmp_buffer (float format) - * =[Volume]=> device->tmp_buffer (float format) - * =[Mix]=> device->mix_buffer (float format) - * =[Reformat]=> device->buffer (device format) */ static void DSOUND_PerformMix(DirectSoundDevice *device) { - UINT32 pad, to_mix_frags, to_mix_bytes; - HRESULT hr; - TRACE("(%p)\n", device); /* **** */ - EnterCriticalSection(&device->mixlock); - - hr = IAudioClient_GetCurrentPadding(device->client, &pad); - if(FAILED(hr)){ - WARN("GetCurrentPadding failed: %08x\n", hr); - LeaveCriticalSection(&device->mixlock); - return; - } - - to_mix_frags = device->prebuf - (pad * device->pwfx->nBlockAlign + device->fraglen - 1) / device->fraglen; - - to_mix_bytes = to_mix_frags * device->fraglen; - - if(device->in_mmdev_bytes > 0){ - DWORD delta_bytes = min(to_mix_bytes, device->in_mmdev_bytes); - device->in_mmdev_bytes -= delta_bytes; - device->playing_offs_bytes += delta_bytes; - device->playing_offs_bytes %= device->buflen; - } + EnterCriticalSection(&(device->mixlock)); if (device->priolevel != DSSCL_WRITEPRIMARY) { BOOL recover = FALSE, all_stopped = FALSE; - DWORD playpos, writepos, writelead, maxq, prebuff_max, prebuff_left, size1, size2; + DWORD playpos, writepos, writelead, maxq, frag, prebuff_max, prebuff_left, size1, size2, mixplaypos, mixplaypos2; LPVOID buf1, buf2; + BOOL lock = (device->hwbuf && !(device->drvdesc.dwFlags & DSDDESC_DONTNEEDPRIMARYLOCK)); int nfiller; /* the sound of silence */ @@ -692,11 +808,16 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) } TRACE("primary playpos=%d, writepos=%d, clrpos=%d, mixpos=%d, buflen=%d\n", - playpos,writepos,device->playpos,device->mixpos,device->buflen); + playpos,writepos,device->playpos,device->mixpos,device->buflen); assert(device->playpos < device->buflen); + mixplaypos = DSOUND_bufpos_to_mixpos(device, device->playpos); + mixplaypos2 = DSOUND_bufpos_to_mixpos(device, playpos); + /* calc maximum prebuff */ prebuff_max = (device->prebuf * device->fraglen); + if (!device->hwbuf && playpos + prebuff_max >= device->helfrags * device->fraglen) + prebuff_max += device->buflen - device->helfrags * device->fraglen; /* check how close we are to an underrun. It occurs when the writepos overtakes the mixpos */ prebuff_left = DSOUND_BufPtrDiff(device->buflen, device->mixpos, playpos); @@ -715,22 +836,39 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) /* reset mix position to write position */ device->mixpos = writepos; + ZeroMemory(device->mix_buffer, device->mix_buffer_len); ZeroMemory(device->buffer, device->buflen); } else if (playpos < device->playpos) { buf1 = device->buffer + device->playpos; buf2 = device->buffer; size1 = device->buflen - device->playpos; size2 = playpos; + FillMemory(device->mix_buffer + mixplaypos, device->mix_buffer_len - mixplaypos, 0); + FillMemory(device->mix_buffer, mixplaypos2, 0); + if (lock) + IDsDriverBuffer_Lock(device->hwbuf, &buf1, &size1, &buf2, &size2, device->playpos, size1+size2, 0); FillMemory(buf1, size1, nfiller); if (playpos && (!buf2 || !size2)) FIXME("%d: (%d, %d)=>(%d, %d) There should be an additional buffer here!!\n", __LINE__, device->playpos, device->mixpos, playpos, writepos); FillMemory(buf2, size2, nfiller); + if (lock) + IDsDriverBuffer_Unlock(device->hwbuf, buf1, size1, buf2, size2); } else { buf1 = device->buffer + device->playpos; buf2 = NULL; size1 = playpos - device->playpos; size2 = 0; + FillMemory(device->mix_buffer + mixplaypos, mixplaypos2 - mixplaypos, 0); + if (lock) + IDsDriverBuffer_Lock(device->hwbuf, &buf1, &size1, &buf2, &size2, device->playpos, size1+size2, 0); FillMemory(buf1, size1, nfiller); + if (buf2 && size2) + { + FIXME("%d: There should be no additional buffer here!!\n", __LINE__); + FillMemory(buf2, size2, nfiller); + } + if (lock) + IDsDriverBuffer_Unlock(device->hwbuf, buf1, size1, buf2, size2); } device->playpos = playpos; @@ -740,33 +878,46 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) TRACE("prebuff_left = %d, prebuff_max = %dx%d=%d, writelead=%d\n", prebuff_left, device->prebuf, device->fraglen, prebuff_max, writelead); - ZeroMemory(device->mix_buffer, device->mix_buffer_len); + if (lock) + IDsDriverBuffer_Lock(device->hwbuf, &buf1, &size1, &buf2, &size2, writepos, maxq, 0); /* do the mixing */ - DSOUND_MixToPrimary(device, writepos, maxq, recover, &all_stopped); + frag = DSOUND_MixToPrimary(device, writepos, maxq, recover, &all_stopped); - if (maxq + writepos > device->buflen) + if (frag + writepos > device->buflen) { DWORD todo = device->buflen - writepos; - DWORD offs_float = (todo / device->pwfx->nBlockAlign) * device->pwfx->nChannels; - device->normfunction(device->mix_buffer, device->buffer + writepos, todo); - device->normfunction(device->mix_buffer + offs_float, device->buffer, maxq - todo); + device->normfunction(device->mix_buffer + DSOUND_bufpos_to_mixpos(device, writepos), device->buffer + writepos, todo); + device->normfunction(device->mix_buffer, device->buffer, frag - todo); } else - device->normfunction(device->mix_buffer, device->buffer + writepos, maxq); + device->normfunction(device->mix_buffer + DSOUND_bufpos_to_mixpos(device, writepos), device->buffer + writepos, frag); /* update the mix position, taking wrap-around into account */ - device->mixpos = writepos + maxq; + device->mixpos = writepos + frag; device->mixpos %= device->buflen; + if (lock) + { + DWORD frag2 = (frag > size1 ? frag - size1 : 0); + frag -= frag2; + if (frag2 > size2) + { + FIXME("Buffering too much! (%d, %d, %d, %d)\n", maxq, frag, size2, frag2 - size2); + frag2 = size2; + } + IDsDriverBuffer_Unlock(device->hwbuf, buf1, frag, buf2, frag2); + } + /* update prebuff left */ prebuff_left = DSOUND_BufPtrDiff(device->buflen, device->mixpos, playpos); /* check if have a whole fragment */ if (prebuff_left >= device->fraglen){ - /* update the wave queue */ - DSOUND_WaveQueue(device, FALSE); + /* update the wave queue if using wave system */ + if (!device->hwbuf) + DSOUND_WaveQueue(device, FALSE); /* buffers are full. start playing if applicable */ if(device->state == STATE_STARTING){ @@ -802,9 +953,14 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) DSOUND_PrimaryStop(device); } - } else if (device->state != STATE_STOPPED) { + } else { - DSOUND_WaveQueue(device, TRUE); + /* update the wave queue if using wave system */ + if (!device->hwbuf) + DSOUND_WaveQueue(device, TRUE); + else + /* Keep alsa happy, which needs GetPosition called once every 10 ms */ + IDsDriverBuffer_GetPosition(device->hwbuf, NULL, NULL); /* in the DSSCL_WRITEPRIMARY mode, the app is totally in charge... */ if (device->state == STATE_STARTING) { @@ -825,29 +981,63 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) /* **** */ } -DWORD CALLBACK DSOUND_mixthread(void *p) +void CALLBACK DSOUND_timer(UINT timerID, UINT msg, DWORD_PTR dwUser, + DWORD_PTR dw1, DWORD_PTR dw2) { - DirectSoundDevice *dev = p; - TRACE("(%p)\n", dev); + DirectSoundDevice * device = (DirectSoundDevice*)dwUser; + DWORD start_time = GetTickCount(); + DWORD end_time; + TRACE("(%d,%d,0x%lx,0x%lx,0x%lx)\n",timerID,msg,dwUser,dw1,dw2); + TRACE("entering at %d\n", start_time); - while (dev->ref) { - DWORD ret; - - /* - * Some audio drivers are retarded and won't fire after being - * stopped, add a timeout to handle this. - */ - ret = WaitForSingleObject(dev->sleepev, dev->sleeptime); - if (ret == WAIT_FAILED) - WARN("wait returned error %u %08x!\n", GetLastError(), GetLastError()); - else if (ret != WAIT_OBJECT_0) - WARN("wait returned %08x!\n", ret); - if (!dev->ref) - break; - - RtlAcquireResourceShared(&(dev->buffer_list_lock), TRUE); - DSOUND_PerformMix(dev); - RtlReleaseResource(&(dev->buffer_list_lock)); + if (DSOUND_renderer[device->drvdesc.dnDevNode] != device) { + ERR("dsound died without killing us?\n"); + timeKillEvent(timerID); + timeEndPeriod(DS_TIME_RES); + return; } - return 0; + + RtlAcquireResourceShared(&(device->buffer_list_lock), TRUE); + + if (device->ref) + DSOUND_PerformMix(device); + + RtlReleaseResource(&(device->buffer_list_lock)); + + end_time = GetTickCount(); + TRACE("completed processing at %d, duration = %d\n", end_time, end_time - start_time); +} + +void CALLBACK DSOUND_callback(HWAVEOUT hwo, UINT msg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2) +{ + DirectSoundDevice * device = (DirectSoundDevice*)dwUser; + TRACE("(%p,%x,%lx,%lx,%lx)\n",hwo,msg,dwUser,dw1,dw2); + TRACE("entering at %d, msg=%08x(%s)\n", GetTickCount(), msg, + msg==MM_WOM_DONE ? "MM_WOM_DONE" : msg==MM_WOM_CLOSE ? "MM_WOM_CLOSE" : + msg==MM_WOM_OPEN ? "MM_WOM_OPEN" : "UNKNOWN"); + + /* check if packet completed from wave driver */ + if (msg == MM_WOM_DONE) { + + /* **** */ + EnterCriticalSection(&(device->mixlock)); + + TRACE("done playing primary pos=%d\n", device->pwplay * device->fraglen); + + /* update playpos */ + device->pwplay++; + device->pwplay %= device->helfrags; + + /* sanity */ + if(device->pwqueue == 0){ + ERR("Wave queue corrupted!\n"); + } + + /* update queue */ + device->pwqueue--; + + LeaveCriticalSection(&(device->mixlock)); + /* **** */ + } + TRACE("completed\n"); } diff --git a/dll/directx/wine/dsound/primary.c b/dll/directx/wine/dsound/primary.c index fd1dbb75cc8..0df7850b12f 100644 --- a/dll/directx/wine/dsound/primary.c +++ b/dll/directx/wine/dsound/primary.c @@ -25,315 +25,280 @@ #include "dsound_private.h" -static DWORD DSOUND_fraglen(DirectSoundDevice *device) +/** Calculate how long a fragment length of about 10 ms should be in frames + * + * nSamplesPerSec: Frequency rate in samples per second + * nBlockAlign: Size of a single blockalign + * + * Returns: + * Size in bytes of a single fragment + */ +DWORD DSOUND_fraglen(DWORD nSamplesPerSec, DWORD nBlockAlign) { - REFERENCE_TIME period; - HRESULT hr; - DWORD ret; + /* Given a timer delay of 10ms, the fragment size is approximately: + * fraglen = (nSamplesPerSec * 10 / 1000) * nBlockAlign + * ==> fraglen = (nSamplesPerSec / 100) * nBlockSize + * + * ALSA uses buffers that are powers of 2. Because of this, fraglen + * is rounded up to the nearest power of 2: + */ - hr = IAudioClient_GetDevicePeriod(device->client, &period, NULL); - if(FAILED(hr)){ - /* just guess at 10ms */ - WARN("GetDevicePeriod failed: %08x\n", hr); - ret = MulDiv(device->pwfx->nBlockAlign, device->pwfx->nSamplesPerSec, 100); - }else - ret = MulDiv(device->pwfx->nSamplesPerSec * device->pwfx->nBlockAlign, period, 10000000); + if (nSamplesPerSec <= 12800) + return 128 * nBlockAlign; - ret -= ret % device->pwfx->nBlockAlign; - return ret; + if (nSamplesPerSec <= 25600) + return 256 * nBlockAlign; + + if (nSamplesPerSec <= 51200) + return 512 * nBlockAlign; + + return 1024 * nBlockAlign; } -static HRESULT DSOUND_WaveFormat(DirectSoundDevice *device, IAudioClient *client, - BOOL forcewave, WAVEFORMATEX **wfx) +static void DSOUND_RecalcPrimary(DirectSoundDevice *device) { - WAVEFORMATEXTENSIBLE *retwfe = NULL; - WAVEFORMATEX *w; - HRESULT hr; + TRACE("(%p)\n", device); - if (!forcewave) { - WAVEFORMATEXTENSIBLE *mixwfe; - hr = IAudioClient_GetMixFormat(client, (WAVEFORMATEX**)&mixwfe); + device->fraglen = DSOUND_fraglen(device->pwfx->nSamplesPerSec, device->pwfx->nBlockAlign); + device->helfrags = device->buflen / device->fraglen; + TRACE("fraglen=%d helfrags=%d\n", device->fraglen, device->helfrags); - if (FAILED(hr)) - return hr; - - if (mixwfe->Format.nChannels > 2) { - static int once; - if (!once++) - FIXME("Limiting channels to 2 due to lack of multichannel support\n"); - - mixwfe->Format.nChannels = 2; - mixwfe->Format.nBlockAlign = mixwfe->Format.nChannels * mixwfe->Format.wBitsPerSample / 8; - mixwfe->Format.nAvgBytesPerSec = mixwfe->Format.nSamplesPerSec * mixwfe->Format.nBlockAlign; - mixwfe->dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT; - } - - if (!IsEqualGUID(&mixwfe->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT)) { - WAVEFORMATEXTENSIBLE testwfe = *mixwfe; - - testwfe.SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; - testwfe.Samples.wValidBitsPerSample = testwfe.Format.wBitsPerSample = 32; - testwfe.Format.nBlockAlign = testwfe.Format.nChannels * testwfe.Format.wBitsPerSample / 8; - testwfe.Format.nAvgBytesPerSec = testwfe.Format.nSamplesPerSec * testwfe.Format.nBlockAlign; - - if (FAILED(IAudioClient_IsFormatSupported(client, AUDCLNT_SHAREMODE_SHARED, &testwfe.Format, (WAVEFORMATEX**)&retwfe))) - w = DSOUND_CopyFormat(&mixwfe->Format); - else if (retwfe) - w = DSOUND_CopyFormat(&retwfe->Format); - else - w = DSOUND_CopyFormat(&testwfe.Format); - CoTaskMemFree(retwfe); - retwfe = NULL; - } else - w = DSOUND_CopyFormat(&mixwfe->Format); - CoTaskMemFree(mixwfe); - } else if (device->primary_pwfx->wFormatTag == WAVE_FORMAT_PCM || - device->primary_pwfx->wFormatTag == WAVE_FORMAT_IEEE_FLOAT) { - WAVEFORMATEX *wi = device->primary_pwfx; - WAVEFORMATEXTENSIBLE *wfe; - - /* Convert to WAVEFORMATEXTENSIBLE */ - w = HeapAlloc(GetProcessHeap(), 0, sizeof(WAVEFORMATEXTENSIBLE)); - wfe = (WAVEFORMATEXTENSIBLE*)w; - if (!wfe) - return DSERR_OUTOFMEMORY; - - wfe->Format = *wi; - w->wFormatTag = WAVE_FORMAT_EXTENSIBLE; - w->cbSize = sizeof(*wfe) - sizeof(*w); - w->nBlockAlign = w->nChannels * w->wBitsPerSample / 8; - w->nAvgBytesPerSec = w->nSamplesPerSec * w->nBlockAlign; - - wfe->dwChannelMask = 0; - if (wi->wFormatTag == WAVE_FORMAT_IEEE_FLOAT) { - w->wBitsPerSample = 32; - wfe->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; - } else - wfe->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; - wfe->Samples.wValidBitsPerSample = w->wBitsPerSample; - } else - w = DSOUND_CopyFormat(device->primary_pwfx); - - if (!w) - return DSERR_OUTOFMEMORY; - - hr = IAudioClient_IsFormatSupported(client, AUDCLNT_SHAREMODE_SHARED, w, (WAVEFORMATEX**)&retwfe); - if (retwfe) { - memcpy(w, retwfe, sizeof(WAVEFORMATEX) + retwfe->Format.cbSize); - CoTaskMemFree(retwfe); - } - if (FAILED(hr)) { - WARN("IsFormatSupported failed: %08x\n", hr); - HeapFree(GetProcessHeap(), 0, w); - return hr; - } - *wfx = w; - return S_OK; + if (device->hwbuf && device->drvdesc.dwFlags & DSDDESC_DONTNEEDWRITELEAD) + device->writelead = 0; + else + /* calculate the 10ms write lead */ + device->writelead = (device->pwfx->nSamplesPerSec / 100) * device->pwfx->nBlockAlign; } HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) { - UINT prebuf_frames; - REFERENCE_TIME prebuf_rt; - WAVEFORMATEX *wfx = NULL; - HRESULT hres; - REFERENCE_TIME period; - DWORD period_ms; + HRESULT hres = DS_OK; + TRACE("(%p, %d)\n", device, forcewave); - TRACE("(%p, %d)\n", device, forcewave); + if (device->driver) + { + IDsDriver_Close(device->driver); + if (device->drvdesc.dwFlags & DSDDESC_DOMMSYSTEMOPEN) + waveOutClose(device->hwo); + IDsDriver_Release(device->driver); + device->driver = NULL; + device->buffer = NULL; + device->hwo = 0; + } + else if (device->drvdesc.dwFlags & DSDDESC_DOMMSYSTEMOPEN) + waveOutClose(device->hwo); - if(device->client){ - IAudioClient_Release(device->client); - device->client = NULL; - } - if(device->render){ - IAudioRenderClient_Release(device->render); - device->render = NULL; - } - if(device->clock){ - IAudioClock_Release(device->clock); - device->clock = NULL; - } - if(device->volume){ - IAudioStreamVolume_Release(device->volume); - device->volume = NULL; - } + /* DRV_QUERYDSOUNDIFACE is a "Wine extension" to get the DSound interface */ + if (ds_hw_accel != DS_HW_ACCEL_EMULATION && !forcewave) + waveOutMessage((HWAVEOUT)device->drvdesc.dnDevNode, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&device->driver, 0); - hres = IMMDevice_Activate(device->mmdevice, &IID_IAudioClient, - CLSCTX_INPROC_SERVER, NULL, (void **)&device->client); - if(FAILED(hres)) { - WARN("Activate failed: %08x\n", hres); - return hres; - } + /* Get driver description */ + if (device->driver) { + DWORD wod = device->drvdesc.dnDevNode; + hres = IDsDriver_GetDriverDesc(device->driver,&(device->drvdesc)); + device->drvdesc.dnDevNode = wod; + if (FAILED(hres)) { + WARN("IDsDriver_GetDriverDesc failed: %08x\n", hres); + IDsDriver_Release(device->driver); + device->driver = NULL; + } + } - hres = DSOUND_WaveFormat(device, device->client, forcewave, &wfx); - if (FAILED(hres)) { - IAudioClient_Release(device->client); - device->client = NULL; - return hres; - } - HeapFree(GetProcessHeap(), 0, device->pwfx); - device->pwfx = wfx; + /* if no DirectSound interface available, use WINMM API instead */ + if (!device->driver) + device->drvdesc.dwFlags = DSDDESC_DOMMSYSTEMOPEN | DSDDESC_DOMMSYSTEMSETFORMAT; - prebuf_frames = device->prebuf * DSOUND_fraglen(device) / device->pwfx->nBlockAlign; - prebuf_rt = (10000000 * (UINT64)prebuf_frames) / device->pwfx->nSamplesPerSec; + if (device->drvdesc.dwFlags & DSDDESC_DOMMSYSTEMOPEN) + { + DWORD flags = CALLBACK_FUNCTION | WAVE_MAPPED; - hres = IAudioClient_Initialize(device->client, - AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST | - AUDCLNT_STREAMFLAGS_EVENTCALLBACK, prebuf_rt, 0, device->pwfx, NULL); - if(FAILED(hres)){ - IAudioClient_Release(device->client); - device->client = NULL; - WARN("Initialize failed: %08x\n", hres); - return hres; - } - IAudioClient_SetEventHandle(device->client, device->sleepev); + if (device->driver) + flags |= WAVE_DIRECTSOUND; - hres = IAudioClient_GetService(device->client, &IID_IAudioRenderClient, - (void**)&device->render); - if(FAILED(hres)){ - IAudioClient_Release(device->client); - device->client = NULL; - WARN("GetService failed: %08x\n", hres); - return hres; - } + hres = mmErr(waveOutOpen(&(device->hwo), device->drvdesc.dnDevNode, device->pwfx, (DWORD_PTR)DSOUND_callback, (DWORD_PTR)device, flags)); + if (FAILED(hres)) { + WARN("waveOutOpen failed\n"); + if (device->driver) + { + IDsDriver_Release(device->driver); + device->driver = NULL; + } + return hres; + } + } - hres = IAudioClient_GetService(device->client, &IID_IAudioClock, - (void**)&device->clock); - if(FAILED(hres)){ - IAudioClient_Release(device->client); - IAudioRenderClient_Release(device->render); - device->client = NULL; - device->render = NULL; - WARN("GetService failed: %08x\n", hres); - return hres; - } + if (device->driver) + hres = IDsDriver_Open(device->driver); - hres = IAudioClient_GetService(device->client, &IID_IAudioStreamVolume, - (void**)&device->volume); - if(FAILED(hres)){ - IAudioClient_Release(device->client); - IAudioRenderClient_Release(device->render); - IAudioClock_Release(device->clock); - device->client = NULL; - device->render = NULL; - device->clock = NULL; - WARN("GetService failed: %08x\n", hres); - return hres; - } - - /* Now kick off the timer so the event fires periodically */ - hres = IAudioClient_Start(device->client); - if (FAILED(hres)) - WARN("starting failed with %08x\n", hres); - - hres = IAudioClient_GetStreamLatency(device->client, &period); - if (FAILED(hres)) { - WARN("GetStreamLatency failed with %08x\n", hres); - period_ms = 10; - } else - period_ms = (period + 9999) / 10000; - TRACE("period %u ms fraglen %u prebuf %u\n", period_ms, device->fraglen, device->prebuf); - - if (period_ms < 3) - device->sleeptime = 5; - else - device->sleeptime = period_ms * 5 / 2; - - return S_OK; + return hres; } -HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device) +static HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device) { - IDirectSoundBufferImpl** dsb = device->buffers; - LPBYTE newbuf; - int i; - + DWORD buflen; + HRESULT err = DS_OK; TRACE("(%p)\n", device); - device->fraglen = DSOUND_fraglen(device); - /* on original windows, the buffer it set to a fixed size, no matter what the settings are. on windows this size is always fixed (tested on win-xp) */ if (!device->buflen) device->buflen = ds_hel_buflen; - device->buflen -= device->buflen % device->pwfx->nBlockAlign; - while(device->buflen < device->fraglen * device->prebuf){ - device->buflen += ds_hel_buflen; - device->buflen -= device->buflen % device->pwfx->nBlockAlign; + buflen = device->buflen; + buflen -= buflen % device->pwfx->nBlockAlign; + device->buflen = buflen; + + if (device->driver) + { + err = IDsDriver_CreateSoundBuffer(device->driver,device->pwfx, + DSBCAPS_PRIMARYBUFFER,0, + &(device->buflen),&(device->buffer), + (LPVOID*)&(device->hwbuf)); + + if (err != DS_OK) { + WARN("IDsDriver_CreateSoundBuffer failed (%08x), falling back to waveout\n", err); + err = DSOUND_ReopenDevice(device, TRUE); + if (FAILED(err)) + { + WARN("Falling back to waveout failed too! Giving up\n"); + return err; + } + } + if (device->hwbuf) + IDsDriverBuffer_SetVolumePan(device->hwbuf, &device->volpan); + + DSOUND_RecalcPrimary(device); + device->prebuf = ds_snd_queue_max; + if (device->helfrags < ds_snd_queue_min) + { + WARN("Too little sound buffer to be effective (%d/%d) falling back to waveout\n", device->buflen, ds_snd_queue_min * device->fraglen); + device->buflen = buflen; + IDsDriverBuffer_Release(device->hwbuf); + device->hwbuf = NULL; + err = DSOUND_ReopenDevice(device, TRUE); + if (FAILED(err)) + { + WARN("Falling back to waveout failed too! Giving up\n"); + return err; + } + } + else if (device->helfrags < ds_snd_queue_max) + device->prebuf = device->helfrags; } - HeapFree(GetProcessHeap(), 0, device->mix_buffer); - device->mix_buffer_len = (device->buflen / (device->pwfx->wBitsPerSample / 8)) * sizeof(float); - device->mix_buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, device->mix_buffer_len); + device->mix_buffer_len = DSOUND_bufpos_to_mixpos(device, device->buflen); + device->mix_buffer = HeapAlloc(GetProcessHeap(), 0, device->mix_buffer_len); if (!device->mix_buffer) + { + if (device->hwbuf) + IDsDriverBuffer_Release(device->hwbuf); + device->hwbuf = NULL; return DSERR_OUTOFMEMORY; + } if (device->state == STATE_PLAYING) device->state = STATE_STARTING; else if (device->state == STATE_STOPPING) device->state = STATE_STOPPED; - /* reallocate emulated primary buffer */ - if (device->buffer) - newbuf = HeapReAlloc(GetProcessHeap(),0,device->buffer, device->buflen); - else - newbuf = HeapAlloc(GetProcessHeap(),0, device->buflen); + /* are we using waveOut stuff? */ + if (!device->driver) { + LPBYTE newbuf; + LPWAVEHDR headers = NULL; + DWORD overshot; + unsigned int c; - if (!newbuf) { - ERR("failed to allocate primary buffer\n"); - return DSERR_OUTOFMEMORY; - /* but the old buffer might still exist and must be re-prepared */ - } + /* Start in pause mode, to allow buffers to get filled */ + waveOutPause(device->hwo); - device->writelead = (device->pwfx->nSamplesPerSec / 100) * device->pwfx->nBlockAlign; + TRACE("desired buflen=%d, old buffer=%p\n", buflen, device->buffer); - device->buffer = newbuf; + /* reallocate emulated primary buffer */ + if (device->buffer) + newbuf = HeapReAlloc(GetProcessHeap(),0,device->buffer, buflen); + else + newbuf = HeapAlloc(GetProcessHeap(),0, buflen); - TRACE("buflen: %u, fraglen: %u, mix_buffer_len: %u\n", - device->buflen, device->fraglen, device->mix_buffer_len); + if (!newbuf) { + ERR("failed to allocate primary buffer\n"); + return DSERR_OUTOFMEMORY; + /* but the old buffer might still exist and must be re-prepared */ + } - if(device->pwfx->wFormatTag == WAVE_FORMAT_IEEE_FLOAT || - (device->pwfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE && - IsEqualGUID(&((WAVEFORMATEXTENSIBLE*)device->pwfx)->SubFormat, - &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT))) - device->normfunction = normfunctions[4]; - else - device->normfunction = normfunctions[device->pwfx->wBitsPerSample/8 - 1]; + DSOUND_RecalcPrimary(device); + if (device->pwave) + headers = HeapReAlloc(GetProcessHeap(),0,device->pwave, device->helfrags * sizeof(WAVEHDR)); + else + headers = HeapAlloc(GetProcessHeap(),0,device->helfrags * sizeof(WAVEHDR)); - FillMemory(device->buffer, device->buflen, (device->pwfx->wBitsPerSample == 8) ? 128 : 0); - FillMemory(device->mix_buffer, device->mix_buffer_len, 0); - device->playpos = 0; + if (!headers) { + ERR("failed to allocate wave headers\n"); + HeapFree(GetProcessHeap(), 0, newbuf); + DSOUND_RecalcPrimary(device); + return DSERR_OUTOFMEMORY; + } - if (device->pwfx->wFormatTag == WAVE_FORMAT_IEEE_FLOAT || - (device->pwfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE && - IsEqualGUID(&((WAVEFORMATEXTENSIBLE*)device->pwfx)->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT))) - device->normfunction = normfunctions[4]; - else - device->normfunction = normfunctions[device->pwfx->wBitsPerSample/8 - 1]; + device->buffer = newbuf; + device->pwave = headers; - for (i = 0; i < device->nrofbuffers; i++) { - RtlAcquireResourceExclusive(&dsb[i]->lock, TRUE); - DSOUND_RecalcFormat(dsb[i]); - RtlReleaseResource(&dsb[i]->lock); - } + /* prepare fragment headers */ + for (c=0; chelfrags; c++) { + device->pwave[c].lpData = (char*)device->buffer + c*device->fraglen; + device->pwave[c].dwBufferLength = device->fraglen; + device->pwave[c].dwUser = (DWORD_PTR)device; + device->pwave[c].dwFlags = 0; + device->pwave[c].dwLoops = 0; + err = mmErr(waveOutPrepareHeader(device->hwo,&device->pwave[c],sizeof(WAVEHDR))); + if (err != DS_OK) { + while (c--) + waveOutUnprepareHeader(device->hwo,&device->pwave[c],sizeof(WAVEHDR)); + break; + } + } - return DS_OK; + overshot = device->buflen % device->fraglen; + /* sanity */ + if(overshot) + { + overshot -= overshot % device->pwfx->nBlockAlign; + device->pwave[device->helfrags - 1].dwBufferLength += overshot; + } + + TRACE("fraglen=%d, overshot=%d\n", device->fraglen, overshot); + } + device->mixfunction = mixfunctions[device->pwfx->wBitsPerSample/8 - 1]; + device->normfunction = normfunctions[device->pwfx->wBitsPerSample/8 - 1]; + FillMemory(device->buffer, device->buflen, (device->pwfx->wBitsPerSample == 8) ? 128 : 0); + FillMemory(device->mix_buffer, device->mix_buffer_len, 0); + device->pwplay = device->pwqueue = device->playpos = device->mixpos = 0; + return err; } static void DSOUND_PrimaryClose(DirectSoundDevice *device) { - HRESULT hr; + TRACE("(%p)\n", device); - TRACE("(%p)\n", device); + /* are we using waveOut stuff? */ + if (!device->hwbuf) { + unsigned c; - if(device->client){ - hr = IAudioClient_Stop(device->client); - if(FAILED(hr)) - WARN("Stop failed: %08x\n", hr); - } + /* get out of CS when calling the wave system */ + LeaveCriticalSection(&(device->mixlock)); + /* **** */ + device->pwqueue = (DWORD)-1; /* resetting queues */ + waveOutReset(device->hwo); + for (c=0; chelfrags; c++) + waveOutUnprepareHeader(device->hwo, &device->pwave[c], sizeof(WAVEHDR)); + /* **** */ + EnterCriticalSection(&(device->mixlock)); - /* clear the queue */ - device->in_mmdev_bytes = 0; + /* clear the queue */ + device->pwqueue = 0; + } else { + ULONG ref = IDsDriverBuffer_Release(device->hwbuf); + if (!ref) + device->hwbuf = 0; + else + ERR("Still %d references on primary buffer, refcount leak?\n", ref); + } } HRESULT DSOUND_PrimaryCreate(DirectSoundDevice *device) @@ -361,16 +326,15 @@ HRESULT DSOUND_PrimaryDestroy(DirectSoundDevice *device) EnterCriticalSection(&(device->mixlock)); DSOUND_PrimaryClose(device); - - if(device->primary && (device->primary->ref || device->primary->numIfaces)) - WARN("Destroying primary buffer while references held (%u %u)\n", device->primary->ref, device->primary->numIfaces); - - HeapFree(GetProcessHeap(), 0, device->primary); - device->primary = NULL; - - HeapFree(GetProcessHeap(),0,device->primary_pwfx); - HeapFree(GetProcessHeap(),0,device->pwfx); - device->pwfx=NULL; + if (device->driver) { + if (device->hwbuf) { + if (IDsDriverBuffer_Release(device->hwbuf) == 0) + device->hwbuf = 0; + } + } else + HeapFree(GetProcessHeap(),0,device->pwave); + HeapFree(GetProcessHeap(),0,device->pwfx); + device->pwfx=NULL; LeaveCriticalSection(&(device->mixlock)); /* **** */ @@ -380,47 +344,84 @@ HRESULT DSOUND_PrimaryDestroy(DirectSoundDevice *device) HRESULT DSOUND_PrimaryPlay(DirectSoundDevice *device) { - HRESULT hr; + HRESULT err = DS_OK; + TRACE("(%p)\n", device); - TRACE("(%p)\n", device); + if (device->hwbuf) { + err = IDsDriverBuffer_Play(device->hwbuf, 0, 0, DSBPLAY_LOOPING); + if (err != DS_OK) + WARN("IDsDriverBuffer_Play failed\n"); + } else { + err = mmErr(waveOutRestart(device->hwo)); + if (err != DS_OK) + WARN("waveOutRestart failed\n"); + } - hr = IAudioClient_Start(device->client); - if(FAILED(hr) && hr != AUDCLNT_E_NOT_STOPPED){ - WARN("Start failed: %08x\n", hr); - return hr; - } - - return DS_OK; + return err; } HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device) { - HRESULT hr; + HRESULT err = DS_OK; + TRACE("(%p)\n", device); - TRACE("(%p)\n", device); + if (device->hwbuf) { + err = IDsDriverBuffer_Stop(device->hwbuf); + if (err == DSERR_BUFFERLOST) { + DSOUND_PrimaryClose(device); + err = DSOUND_ReopenDevice(device, FALSE); + if (FAILED(err)) + ERR("DSOUND_ReopenDevice failed\n"); + else + { + err = DSOUND_PrimaryOpen(device); + if (FAILED(err)) + WARN("DSOUND_PrimaryOpen failed\n"); + } + } else if (err != DS_OK) { + WARN("IDsDriverBuffer_Stop failed\n"); + } + } else { - hr = IAudioClient_Stop(device->client); - if(FAILED(hr)){ - WARN("Stop failed: %08x\n", hr); - return hr; - } + /* don't call the wave system with the lock set */ + LeaveCriticalSection(&(device->mixlock)); + /* **** */ - return DS_OK; + err = mmErr(waveOutPause(device->hwo)); + + /* **** */ + EnterCriticalSection(&(device->mixlock)); + + if (err != DS_OK) + WARN("waveOutPause failed\n"); + } + + return err; } HRESULT DSOUND_PrimaryGetPosition(DirectSoundDevice *device, LPDWORD playpos, LPDWORD writepos) { TRACE("(%p,%p,%p)\n", device, playpos, writepos); - /* check if playpos was requested */ - if (playpos) - *playpos = device->playing_offs_bytes; + if (device->hwbuf) { + HRESULT err=IDsDriverBuffer_GetPosition(device->hwbuf,playpos,writepos); + if (err != S_OK) { + WARN("IDsDriverBuffer_GetPosition failed\n"); + return err; + } + } else { + TRACE("pwplay=%i, pwqueue=%i\n", device->pwplay, device->pwqueue); - /* check if writepos was requested */ - if (writepos) - /* the writepos is the first non-queued position */ - *writepos = (device->playing_offs_bytes + device->in_mmdev_bytes) % device->buflen; + /* check if playpos was requested */ + if (playpos) + /* use the cached play position */ + *playpos = device->pwplay * device->fraglen; + /* check if writepos was requested */ + if (writepos) + /* the writepos is the first non-queued position */ + *writepos = ((device->pwplay + device->pwqueue) % device->helfrags) * device->fraglen; + } TRACE("playpos = %d, writepos = %d (%p, time=%d)\n", playpos?*playpos:-1, writepos?*writepos:-1, device, GetTickCount()); return DS_OK; } @@ -456,14 +457,15 @@ LPWAVEFORMATEX DSOUND_CopyFormat(LPCWAVEFORMATEX wfex) return pwfx; } -HRESULT primarybuffer_SetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX passed_fmt) +HRESULT primarybuffer_SetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex) { - HRESULT err = S_OK; - WAVEFORMATEX *old_fmt; - WAVEFORMATEXTENSIBLE *fmtex, *passed_fmtex = (WAVEFORMATEXTENSIBLE*)passed_fmt; - BOOL forced = (device->priolevel == DSSCL_WRITEPRIMARY); + HRESULT err = DSERR_BUFFERLOST; + int i; + DWORD nSamplesPerSec, bpp, chans; + LPWAVEFORMATEX oldpwfx; + BOOL forced = device->priolevel == DSSCL_WRITEPRIMARY; - TRACE("(%p,%p)\n", device, passed_fmt); + TRACE("(%p,%p)\n", device, wfex); if (device->priolevel == DSSCL_NORMAL) { WARN("failed priority check!\n"); @@ -471,93 +473,129 @@ HRESULT primarybuffer_SetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX passe } /* Let's be pedantic! */ - if (passed_fmt == NULL) { - WARN("invalid parameter: passed_fmt==NULL!\n"); + if (wfex == NULL) { + WARN("invalid parameter: wfex==NULL!\n"); return DSERR_INVALIDPARAM; } TRACE("(formattag=0x%04x,chans=%d,samplerate=%d," - "bytespersec=%d,blockalign=%d,bitspersamp=%d,cbSize=%d)\n", - passed_fmt->wFormatTag, passed_fmt->nChannels, passed_fmt->nSamplesPerSec, - passed_fmt->nAvgBytesPerSec, passed_fmt->nBlockAlign, - passed_fmt->wBitsPerSample, passed_fmt->cbSize); - - if(passed_fmt->wBitsPerSample < 8 || passed_fmt->wBitsPerSample % 8 != 0 || - passed_fmt->nChannels == 0 || passed_fmt->nSamplesPerSec == 0 || - passed_fmt->nAvgBytesPerSec == 0 || - passed_fmt->nBlockAlign != passed_fmt->nChannels * passed_fmt->wBitsPerSample / 8) - return DSERR_INVALIDPARAM; - - if(passed_fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE){ - if(passed_fmtex->Samples.wValidBitsPerSample > passed_fmtex->Format.wBitsPerSample) - return DSERR_INVALIDPARAM; - } + "bytespersec=%d,blockalign=%d,bitspersamp=%d,cbSize=%d)\n", + wfex->wFormatTag, wfex->nChannels, wfex->nSamplesPerSec, + wfex->nAvgBytesPerSec, wfex->nBlockAlign, + wfex->wBitsPerSample, wfex->cbSize); /* **** */ RtlAcquireResourceExclusive(&(device->buffer_list_lock), TRUE); EnterCriticalSection(&(device->mixlock)); - if (device->priolevel == DSSCL_WRITEPRIMARY) { - old_fmt = device->primary_pwfx; - device->primary_pwfx = DSOUND_CopyFormat(passed_fmt); - fmtex = (WAVEFORMATEXTENSIBLE *)device->primary_pwfx; - if (device->primary_pwfx == NULL) { - err = DSERR_OUTOFMEMORY; - goto out; - } + nSamplesPerSec = device->pwfx->nSamplesPerSec; + bpp = device->pwfx->wBitsPerSample; + chans = device->pwfx->nChannels; - if (fmtex->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE && - fmtex->Samples.wValidBitsPerSample == 0) { - TRACE("Correcting 0 valid bits per sample\n"); - fmtex->Samples.wValidBitsPerSample = fmtex->Format.wBitsPerSample; - } - - DSOUND_PrimaryClose(device); - - err = DSOUND_ReopenDevice(device, forced); - if (FAILED(err)) { - ERR("No formats could be opened\n"); - goto done; - } - - err = DSOUND_PrimaryOpen(device); - if (err != DS_OK) { - ERR("DSOUND_PrimaryOpen failed\n"); - goto done; - } - -done: - if (err != DS_OK) - device->primary_pwfx = old_fmt; - else - HeapFree(GetProcessHeap(), 0, old_fmt); - } else if (passed_fmt->wFormatTag == WAVE_FORMAT_PCM || - passed_fmt->wFormatTag == WAVE_FORMAT_IEEE_FLOAT) { - /* Fill in "real" values to primary_pwfx */ - WAVEFORMATEX *fmt = device->primary_pwfx; - - *fmt = *device->pwfx; - fmtex = (void*)device->pwfx; - - if (IsEqualGUID(&fmtex->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) && - passed_fmt->wFormatTag == WAVE_FORMAT_IEEE_FLOAT) { - fmt->wFormatTag = WAVE_FORMAT_IEEE_FLOAT; - } else { - fmt->wFormatTag = WAVE_FORMAT_PCM; - fmt->wBitsPerSample = 16; - } - fmt->nBlockAlign = fmt->nChannels * fmt->wBitsPerSample / 8; - fmt->nAvgBytesPerSec = fmt->nBlockAlign * fmt->nSamplesPerSec; - fmt->cbSize = 0; - } else { - device->primary_pwfx = HeapReAlloc(GetProcessHeap(), 0, device->primary_pwfx, sizeof(*fmtex)); - memcpy(device->primary_pwfx, device->pwfx, sizeof(*fmtex)); + oldpwfx = device->pwfx; + device->pwfx = DSOUND_CopyFormat(wfex); + if (device->pwfx == NULL) { + device->pwfx = oldpwfx; + oldpwfx = NULL; + err = DSERR_OUTOFMEMORY; + goto done; } -out: + if (!(device->drvdesc.dwFlags & DSDDESC_DOMMSYSTEMSETFORMAT) && device->hwbuf) { + err = IDsDriverBuffer_SetFormat(device->hwbuf, device->pwfx); + + /* On bad format, try to re-create, big chance it will work then, only do this if we to */ + if (forced && (device->pwfx->nSamplesPerSec/100 != wfex->nSamplesPerSec/100 || err == DSERR_BADFORMAT)) + { + DWORD cp_size = wfex->wFormatTag == WAVE_FORMAT_PCM ? + sizeof(PCMWAVEFORMAT) : sizeof(WAVEFORMATEX) + wfex->cbSize; + err = DSERR_BUFFERLOST; + CopyMemory(device->pwfx, wfex, cp_size); + } + + if (err != DSERR_BUFFERLOST && FAILED(err)) { + DWORD size = DSOUND_GetFormatSize(oldpwfx); + WARN("IDsDriverBuffer_SetFormat failed\n"); + if (!forced) { + CopyMemory(device->pwfx, oldpwfx, size); + err = DS_OK; + } + goto done; + } + + if (err == S_FALSE) + { + /* ALSA specific: S_FALSE tells that recreation was successful, + * but size and location may be changed, and buffer has to be restarted + * I put it here, so if frequency doesn't match the error will be changed to DSERR_BUFFERLOST + * and the entire re-initialization will occur anyway + */ + IDsDriverBuffer_Lock(device->hwbuf, (LPVOID *)&device->buffer, &device->buflen, NULL, NULL, 0, 0, DSBLOCK_ENTIREBUFFER); + IDsDriverBuffer_Unlock(device->hwbuf, device->buffer, 0, NULL, 0); + + if (device->state == STATE_PLAYING) device->state = STATE_STARTING; + else if (device->state == STATE_STOPPING) device->state = STATE_STOPPED; + device->pwplay = device->pwqueue = device->playpos = device->mixpos = 0; + err = DS_OK; + } + DSOUND_RecalcPrimary(device); + } + + if (err == DSERR_BUFFERLOST) + { + DSOUND_PrimaryClose(device); + + err = DSOUND_ReopenDevice(device, FALSE); + if (FAILED(err)) + { + WARN("DSOUND_ReopenDevice failed: %08x\n", err); + goto done; + } + err = DSOUND_PrimaryOpen(device); + if (err != DS_OK) { + WARN("DSOUND_PrimaryOpen failed\n"); + goto done; + } + + if (wfex->nSamplesPerSec/100 != device->pwfx->nSamplesPerSec/100 && forced && device->buffer) + { + DSOUND_PrimaryClose(device); + device->pwfx->nSamplesPerSec = wfex->nSamplesPerSec; + err = DSOUND_ReopenDevice(device, TRUE); + if (FAILED(err)) + WARN("DSOUND_ReopenDevice(2) failed: %08x\n", err); + else if (FAILED((err = DSOUND_PrimaryOpen(device)))) + WARN("DSOUND_PrimaryOpen(2) failed: %08x\n", err); + } + } + + device->mix_buffer_len = DSOUND_bufpos_to_mixpos(device, device->buflen); + device->mix_buffer = HeapReAlloc(GetProcessHeap(), 0, device->mix_buffer, device->mix_buffer_len); + FillMemory(device->mix_buffer, device->mix_buffer_len, 0); + device->mixfunction = mixfunctions[device->pwfx->wBitsPerSample/8 - 1]; + device->normfunction = normfunctions[device->pwfx->wBitsPerSample/8 - 1]; + + if (nSamplesPerSec != device->pwfx->nSamplesPerSec || bpp != device->pwfx->wBitsPerSample || chans != device->pwfx->nChannels) { + IDirectSoundBufferImpl** dsb = device->buffers; + for (i = 0; i < device->nrofbuffers; i++, dsb++) { + /* **** */ + RtlAcquireResourceExclusive(&(*dsb)->lock, TRUE); + + (*dsb)->freqAdjust = ((DWORD64)(*dsb)->freq << DSOUND_FREQSHIFT) / device->pwfx->nSamplesPerSec; + DSOUND_RecalcFormat((*dsb)); + DSOUND_MixToTemporary((*dsb), 0, (*dsb)->buflen, FALSE); + (*dsb)->primary_mixpos = 0; + + RtlReleaseResource(&(*dsb)->lock); + /* **** */ + } + } + +done: LeaveCriticalSection(&(device->mixlock)); RtlReleaseResource(&(device->buffer_list_lock)); /* **** */ + HeapFree(GetProcessHeap(), 0, oldpwfx); return err; } @@ -570,22 +608,24 @@ static inline IDirectSoundBufferImpl *impl_from_IDirectSoundBuffer(IDirectSoundB return CONTAINING_RECORD(iface, IDirectSoundBufferImpl, IDirectSoundBuffer8_iface); } -/* This sets this format for the primary buffer only */ -static HRESULT WINAPI PrimaryBufferImpl_SetFormat(IDirectSoundBuffer *iface, - const WAVEFORMATEX *wfex) +/* This sets this format for the Primary Buffer Only */ +/* See file:///cdrom/sdk52/docs/worddoc/dsound.doc page 120 */ +static HRESULT WINAPI PrimaryBufferImpl_SetFormat( + LPDIRECTSOUNDBUFFER iface, + LPCWAVEFORMATEX wfex) { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); TRACE("(%p,%p)\n", iface, wfex); return primarybuffer_SetFormat(This->device, wfex); } -static HRESULT WINAPI PrimaryBufferImpl_SetVolume(IDirectSoundBuffer *iface, LONG vol) -{ - IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); - DirectSoundDevice *device = This->device; - HRESULT hr; - float lvol, rvol; - +static HRESULT WINAPI PrimaryBufferImpl_SetVolume( + LPDIRECTSOUNDBUFFER iface,LONG vol +) { + IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); + DirectSoundDevice *device = This->device; + DWORD ampfactors; + HRESULT hres = DS_OK; TRACE("(%p,%d)\n", iface, vol); if (!(This->dsbd.dwFlags & DSBCAPS_CTRLVOLUME)) { @@ -599,63 +639,37 @@ static HRESULT WINAPI PrimaryBufferImpl_SetVolume(IDirectSoundBuffer *iface, LON } /* **** */ - EnterCriticalSection(&device->mixlock); + EnterCriticalSection(&(device->mixlock)); - hr = IAudioStreamVolume_GetChannelVolume(device->volume, 0, &lvol); - if(FAILED(hr)){ - LeaveCriticalSection(&device->mixlock); - WARN("GetChannelVolume failed: %08x\n", hr); - return hr; - } - - if(device->pwfx->nChannels > 1){ - hr = IAudioStreamVolume_GetChannelVolume(device->volume, 1, &rvol); - if(FAILED(hr)){ - LeaveCriticalSection(&device->mixlock); - WARN("GetChannelVolume failed: %08x\n", hr); - return hr; - } - }else - rvol = 1; - - device->volpan.dwTotalLeftAmpFactor = ((UINT16)(lvol * (DWORD)0xFFFF)); - device->volpan.dwTotalRightAmpFactor = ((UINT16)(rvol * (DWORD)0xFFFF)); - - DSOUND_AmpFactorToVolPan(&device->volpan); - if (vol != device->volpan.lVolume) { - device->volpan.lVolume=vol; - DSOUND_RecalcVolPan(&device->volpan); - lvol = (float)((DWORD)(device->volpan.dwTotalLeftAmpFactor & 0xFFFF) / (float)0xFFFF); - hr = IAudioStreamVolume_SetChannelVolume(device->volume, 0, lvol); - if(FAILED(hr)){ - LeaveCriticalSection(&device->mixlock); - WARN("SetChannelVolume failed: %08x\n", hr); - return hr; - } - - if(device->pwfx->nChannels > 1){ - rvol = (float)((DWORD)(device->volpan.dwTotalRightAmpFactor & 0xFFFF) / (float)0xFFFF); - hr = IAudioStreamVolume_SetChannelVolume(device->volume, 1, rvol); - if(FAILED(hr)){ - LeaveCriticalSection(&device->mixlock); - WARN("SetChannelVolume failed: %08x\n", hr); - return hr; - } - } - } + waveOutGetVolume(device->hwo, &factors); + device->volpan.dwTotalLeftAmpFactor=ampfactors & 0xffff; + device->volpan.dwTotalRightAmpFactor=ampfactors >> 16; + DSOUND_AmpFactorToVolPan(&device->volpan); + if (vol != device->volpan.lVolume) { + device->volpan.lVolume=vol; + DSOUND_RecalcVolPan(&device->volpan); + if (device->hwbuf) { + hres = IDsDriverBuffer_SetVolumePan(device->hwbuf, &device->volpan); + if (hres != DS_OK) + WARN("IDsDriverBuffer_SetVolumePan failed\n"); + } else { + ampfactors = (device->volpan.dwTotalLeftAmpFactor & 0xffff) | (device->volpan.dwTotalRightAmpFactor << 16); + waveOutSetVolume(device->hwo, ampfactors); + } + } LeaveCriticalSection(&(device->mixlock)); /* **** */ - return DS_OK; + return hres; } -static HRESULT WINAPI PrimaryBufferImpl_GetVolume(IDirectSoundBuffer *iface, LONG *vol) -{ - IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); - DirectSoundDevice *device = This->device; - float lvol, rvol; - HRESULT hr; +static HRESULT WINAPI PrimaryBufferImpl_GetVolume( + LPDIRECTSOUNDBUFFER iface,LPLONG vol +) { + IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); + DirectSoundDevice *device = This->device; + DWORD ampfactors; TRACE("(%p,%p)\n", iface, vol); if (!(This->dsbd.dwFlags & DSBCAPS_CTRLVOLUME)) { @@ -668,38 +682,20 @@ static HRESULT WINAPI PrimaryBufferImpl_GetVolume(IDirectSoundBuffer *iface, LON return DSERR_INVALIDPARAM; } - EnterCriticalSection(&device->mixlock); - - hr = IAudioStreamVolume_GetChannelVolume(device->volume, 0, &lvol); - if(FAILED(hr)){ - LeaveCriticalSection(&device->mixlock); - WARN("GetChannelVolume failed: %08x\n", hr); - return hr; - } - - if(device->pwfx->nChannels > 1){ - hr = IAudioStreamVolume_GetChannelVolume(device->volume, 1, &rvol); - if(FAILED(hr)){ - LeaveCriticalSection(&device->mixlock); - WARN("GetChannelVolume failed: %08x\n", hr); - return hr; - } - }else - rvol = 1; - - device->volpan.dwTotalLeftAmpFactor = ((UINT16)(lvol * (DWORD)0xFFFF)); - device->volpan.dwTotalRightAmpFactor = ((UINT16)(rvol * (DWORD)0xFFFF)); - - DSOUND_AmpFactorToVolPan(&device->volpan); - *vol = device->volpan.lVolume; - - LeaveCriticalSection(&device->mixlock); - + if (!device->hwbuf) + { + waveOutGetVolume(device->hwo, &factors); + device->volpan.dwTotalLeftAmpFactor=ampfactors & 0xffff; + device->volpan.dwTotalRightAmpFactor=ampfactors >> 16; + DSOUND_AmpFactorToVolPan(&device->volpan); + } + *vol = device->volpan.lVolume; return DS_OK; } -static HRESULT WINAPI PrimaryBufferImpl_SetFrequency(IDirectSoundBuffer *iface, DWORD freq) -{ +static HRESULT WINAPI PrimaryBufferImpl_SetFrequency( + LPDIRECTSOUNDBUFFER iface,DWORD freq +) { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); TRACE("(%p,%d)\n",This,freq); @@ -708,9 +704,9 @@ static HRESULT WINAPI PrimaryBufferImpl_SetFrequency(IDirectSoundBuffer *iface, return DSERR_CONTROLUNAVAIL; } -static HRESULT WINAPI PrimaryBufferImpl_Play(IDirectSoundBuffer *iface, DWORD reserved1, - DWORD reserved2, DWORD flags) -{ +static HRESULT WINAPI PrimaryBufferImpl_Play( + LPDIRECTSOUNDBUFFER iface,DWORD reserved1,DWORD reserved2,DWORD flags +) { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); DirectSoundDevice *device = This->device; TRACE("(%p,%08x,%08x,%08x)\n", iface, reserved1, reserved2, flags); @@ -734,7 +730,7 @@ static HRESULT WINAPI PrimaryBufferImpl_Play(IDirectSoundBuffer *iface, DWORD re return DS_OK; } -static HRESULT WINAPI PrimaryBufferImpl_Stop(IDirectSoundBuffer *iface) +static HRESULT WINAPI PrimaryBufferImpl_Stop(LPDIRECTSOUNDBUFFER iface) { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); DirectSoundDevice *device = This->device; @@ -754,7 +750,7 @@ static HRESULT WINAPI PrimaryBufferImpl_Stop(IDirectSoundBuffer *iface) return DS_OK; } -static ULONG WINAPI PrimaryBufferImpl_AddRef(IDirectSoundBuffer *iface) +static ULONG WINAPI PrimaryBufferImpl_AddRef(LPDIRECTSOUNDBUFFER iface) { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); ULONG ref = InterlockedIncrement(&(This->ref)); @@ -764,37 +760,27 @@ static ULONG WINAPI PrimaryBufferImpl_AddRef(IDirectSoundBuffer *iface) return ref; } -/* Decreases *out by 1 to no less than 0. - * Returns the new value of *out. */ -LONG capped_refcount_dec(LONG *out) +void primarybuffer_destroy(IDirectSoundBufferImpl *This) { - LONG ref, oldref; - do { - ref = *out; - if(!ref) - return 0; - oldref = InterlockedCompareExchange(out, ref - 1, ref); - } while(oldref != ref); - return ref - 1; + This->device->primary = NULL; + HeapFree(GetProcessHeap(), 0, This); + TRACE("(%p) released\n", This); } -static ULONG WINAPI PrimaryBufferImpl_Release(IDirectSoundBuffer *iface) +static ULONG WINAPI PrimaryBufferImpl_Release(LPDIRECTSOUNDBUFFER iface) { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); - ULONG ref; - - ref = capped_refcount_dec(&This->ref); - if(!ref) - capped_refcount_dec(&This->numIfaces); - - TRACE("(%p) primary ref is now %d\n", This, ref); + DWORD ref = InterlockedDecrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref + 1); + if (!ref && !InterlockedDecrement(&This->numIfaces)) + primarybuffer_destroy(This); return ref; } -static HRESULT WINAPI PrimaryBufferImpl_GetCurrentPosition(IDirectSoundBuffer *iface, - DWORD *playpos, DWORD *writepos) -{ +static HRESULT WINAPI PrimaryBufferImpl_GetCurrentPosition( + LPDIRECTSOUNDBUFFER iface,LPDWORD playpos,LPDWORD writepos +) { HRESULT hres; IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); DirectSoundDevice *device = This->device; @@ -823,8 +809,9 @@ static HRESULT WINAPI PrimaryBufferImpl_GetCurrentPosition(IDirectSoundBuffer *i return DS_OK; } -static HRESULT WINAPI PrimaryBufferImpl_GetStatus(IDirectSoundBuffer *iface, DWORD *status) -{ +static HRESULT WINAPI PrimaryBufferImpl_GetStatus( + LPDIRECTSOUNDBUFFER iface,LPDWORD status +) { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); DirectSoundDevice *device = This->device; TRACE("(%p,%p)\n", iface, status); @@ -844,19 +831,22 @@ static HRESULT WINAPI PrimaryBufferImpl_GetStatus(IDirectSoundBuffer *iface, DWO } -static HRESULT WINAPI PrimaryBufferImpl_GetFormat(IDirectSoundBuffer *iface, WAVEFORMATEX *lpwf, - DWORD wfsize, DWORD *wfwritten) +static HRESULT WINAPI PrimaryBufferImpl_GetFormat( + LPDIRECTSOUNDBUFFER iface, + LPWAVEFORMATEX lpwf, + DWORD wfsize, + LPDWORD wfwritten) { DWORD size; IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); DirectSoundDevice *device = This->device; TRACE("(%p,%p,%d,%p)\n", iface, lpwf, wfsize, wfwritten); - size = sizeof(WAVEFORMATEX) + device->primary_pwfx->cbSize; + size = sizeof(WAVEFORMATEX) + device->pwfx->cbSize; if (lpwf) { /* NULL is valid */ if (wfsize >= size) { - CopyMemory(lpwf,device->primary_pwfx,size); + CopyMemory(lpwf,device->pwfx,size); if (wfwritten) *wfwritten = size; } else { @@ -867,7 +857,7 @@ static HRESULT WINAPI PrimaryBufferImpl_GetFormat(IDirectSoundBuffer *iface, WAV } } else { if (wfwritten) - *wfwritten = sizeof(WAVEFORMATEX) + device->primary_pwfx->cbSize; + *wfwritten = sizeof(WAVEFORMATEX) + device->pwfx->cbSize; else { WARN("invalid parameter: wfwritten == NULL\n"); return DSERR_INVALIDPARAM; @@ -877,10 +867,9 @@ static HRESULT WINAPI PrimaryBufferImpl_GetFormat(IDirectSoundBuffer *iface, WAV return DS_OK; } -static HRESULT WINAPI PrimaryBufferImpl_Lock(IDirectSoundBuffer *iface, DWORD writecursor, - DWORD writebytes, void **lplpaudioptr1, DWORD *audiobytes1, void **lplpaudioptr2, - DWORD *audiobytes2, DWORD flags) -{ +static HRESULT WINAPI PrimaryBufferImpl_Lock( + LPDIRECTSOUNDBUFFER iface,DWORD writecursor,DWORD writebytes,LPVOID *lplpaudioptr1,LPDWORD audiobytes1,LPVOID *lplpaudioptr2,LPDWORD audiobytes2,DWORD flags +) { HRESULT hres; IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); DirectSoundDevice *device = This->device; @@ -930,28 +919,41 @@ static HRESULT WINAPI PrimaryBufferImpl_Lock(IDirectSoundBuffer *iface, DWORD wr return DSERR_INVALIDPARAM; } - if (writecursor+writebytes <= device->buflen) { - *(LPBYTE*)lplpaudioptr1 = device->buffer+writecursor; - *audiobytes1 = writebytes; - if (lplpaudioptr2) - *(LPBYTE*)lplpaudioptr2 = NULL; - if (audiobytes2) - *audiobytes2 = 0; - TRACE("->%d.0\n",writebytes); + if (!(device->drvdesc.dwFlags & DSDDESC_DONTNEEDPRIMARYLOCK) && device->hwbuf) { + hres = IDsDriverBuffer_Lock(device->hwbuf, + lplpaudioptr1, audiobytes1, + lplpaudioptr2, audiobytes2, + writecursor, writebytes, + 0); + if (hres != DS_OK) { + WARN("IDsDriverBuffer_Lock failed\n"); + return hres; + } } else { - *(LPBYTE*)lplpaudioptr1 = device->buffer+writecursor; - *audiobytes1 = device->buflen-writecursor; - if (lplpaudioptr2) - *(LPBYTE*)lplpaudioptr2 = device->buffer; - if (audiobytes2) - *audiobytes2 = writebytes-(device->buflen-writecursor); - TRACE("->%d.%d\n",*audiobytes1,audiobytes2?*audiobytes2:0); + if (writecursor+writebytes <= device->buflen) { + *(LPBYTE*)lplpaudioptr1 = device->buffer+writecursor; + *audiobytes1 = writebytes; + if (lplpaudioptr2) + *(LPBYTE*)lplpaudioptr2 = NULL; + if (audiobytes2) + *audiobytes2 = 0; + TRACE("->%d.0\n",writebytes); + } else { + *(LPBYTE*)lplpaudioptr1 = device->buffer+writecursor; + *audiobytes1 = device->buflen-writecursor; + if (lplpaudioptr2) + *(LPBYTE*)lplpaudioptr2 = device->buffer; + if (audiobytes2) + *audiobytes2 = writebytes-(device->buflen-writecursor); + TRACE("->%d.%d\n",*audiobytes1,audiobytes2?*audiobytes2:0); + } } return DS_OK; } -static HRESULT WINAPI PrimaryBufferImpl_SetCurrentPosition(IDirectSoundBuffer *iface, DWORD newpos) -{ +static HRESULT WINAPI PrimaryBufferImpl_SetCurrentPosition( + LPDIRECTSOUNDBUFFER iface,DWORD newpos +) { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); TRACE("(%p,%d)\n",This,newpos); @@ -960,12 +962,13 @@ static HRESULT WINAPI PrimaryBufferImpl_SetCurrentPosition(IDirectSoundBuffer *i return DSERR_INVALIDCALL; } -static HRESULT WINAPI PrimaryBufferImpl_SetPan(IDirectSoundBuffer *iface, LONG pan) -{ - IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); - DirectSoundDevice *device = This->device; - float lvol, rvol; - HRESULT hr; +static HRESULT WINAPI PrimaryBufferImpl_SetPan( + LPDIRECTSOUNDBUFFER iface,LONG pan +) { + IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); + DirectSoundDevice *device = This->device; + DWORD ampfactors; + HRESULT hres = DS_OK; TRACE("(%p,%d)\n", iface, pan); if (!(This->dsbd.dwFlags & DSBCAPS_CTRLPAN)) { @@ -979,64 +982,40 @@ static HRESULT WINAPI PrimaryBufferImpl_SetPan(IDirectSoundBuffer *iface, LONG p } /* **** */ - EnterCriticalSection(&device->mixlock); + EnterCriticalSection(&(device->mixlock)); - hr = IAudioStreamVolume_GetChannelVolume(device->volume, 0, &lvol); - if(FAILED(hr)){ - LeaveCriticalSection(&device->mixlock); - WARN("GetChannelVolume failed: %08x\n", hr); - return hr; - } + if (!device->hwbuf) + { + waveOutGetVolume(device->hwo, &factors); + device->volpan.dwTotalLeftAmpFactor=ampfactors & 0xffff; + device->volpan.dwTotalRightAmpFactor=ampfactors >> 16; + DSOUND_AmpFactorToVolPan(&device->volpan); + } + if (pan != device->volpan.lPan) { + device->volpan.lPan=pan; + DSOUND_RecalcVolPan(&device->volpan); + if (device->hwbuf) { + hres = IDsDriverBuffer_SetVolumePan(device->hwbuf, &device->volpan); + if (hres != DS_OK) + WARN("IDsDriverBuffer_SetVolumePan failed\n"); + } else { + ampfactors = (device->volpan.dwTotalLeftAmpFactor & 0xffff) | (device->volpan.dwTotalRightAmpFactor << 16); + waveOutSetVolume(device->hwo, ampfactors); + } + } - if(device->pwfx->nChannels > 1){ - hr = IAudioStreamVolume_GetChannelVolume(device->volume, 1, &rvol); - if(FAILED(hr)){ - LeaveCriticalSection(&device->mixlock); - WARN("GetChannelVolume failed: %08x\n", hr); - return hr; - } - }else - rvol = 1; - - device->volpan.dwTotalLeftAmpFactor = ((UINT16)(lvol * (DWORD)0xFFFF)); - device->volpan.dwTotalRightAmpFactor = ((UINT16)(rvol * (DWORD)0xFFFF)); - - DSOUND_AmpFactorToVolPan(&device->volpan); - if (pan != device->volpan.lPan) { - device->volpan.lPan=pan; - DSOUND_RecalcVolPan(&device->volpan); - - lvol = (float)((DWORD)(device->volpan.dwTotalLeftAmpFactor & 0xFFFF) / (float)0xFFFF); - hr = IAudioStreamVolume_SetChannelVolume(device->volume, 0, lvol); - if(FAILED(hr)){ - LeaveCriticalSection(&device->mixlock); - WARN("SetChannelVolume failed: %08x\n", hr); - return hr; - } - - if(device->pwfx->nChannels > 1){ - rvol = (float)((DWORD)(device->volpan.dwTotalRightAmpFactor & 0xFFFF) / (float)0xFFFF); - hr = IAudioStreamVolume_SetChannelVolume(device->volume, 1, rvol); - if(FAILED(hr)){ - LeaveCriticalSection(&device->mixlock); - WARN("SetChannelVolume failed: %08x\n", hr); - return hr; - } - } - } - - LeaveCriticalSection(&device->mixlock); + LeaveCriticalSection(&(device->mixlock)); /* **** */ - return DS_OK; + return hres; } -static HRESULT WINAPI PrimaryBufferImpl_GetPan(IDirectSoundBuffer *iface, LONG *pan) -{ - IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); - DirectSoundDevice *device = This->device; - float lvol, rvol; - HRESULT hr; +static HRESULT WINAPI PrimaryBufferImpl_GetPan( + LPDIRECTSOUNDBUFFER iface,LPLONG pan +) { + IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); + DirectSoundDevice *device = This->device; + DWORD ampfactors; TRACE("(%p,%p)\n", iface, pan); if (!(This->dsbd.dwFlags & DSBCAPS_CTRLPAN)) { @@ -1049,39 +1028,20 @@ static HRESULT WINAPI PrimaryBufferImpl_GetPan(IDirectSoundBuffer *iface, LONG * return DSERR_INVALIDPARAM; } - EnterCriticalSection(&device->mixlock); - - hr = IAudioStreamVolume_GetChannelVolume(device->volume, 0, &lvol); - if(FAILED(hr)){ - LeaveCriticalSection(&device->mixlock); - WARN("GetChannelVolume failed: %08x\n", hr); - return hr; - } - - if(device->pwfx->nChannels > 1){ - hr = IAudioStreamVolume_GetChannelVolume(device->volume, 1, &rvol); - if(FAILED(hr)){ - LeaveCriticalSection(&device->mixlock); - WARN("GetChannelVolume failed: %08x\n", hr); - return hr; - } - }else - rvol = 1; - - device->volpan.dwTotalLeftAmpFactor = ((UINT16)(lvol * (DWORD)0xFFFF)); - device->volpan.dwTotalRightAmpFactor = ((UINT16)(rvol * (DWORD)0xFFFF)); - - DSOUND_AmpFactorToVolPan(&device->volpan); + if (!device->hwbuf) + { + waveOutGetVolume(device->hwo, &factors); + device->volpan.dwTotalLeftAmpFactor=ampfactors & 0xffff; + device->volpan.dwTotalRightAmpFactor=ampfactors >> 16; + DSOUND_AmpFactorToVolPan(&device->volpan); + } *pan = device->volpan.lPan; - - LeaveCriticalSection(&device->mixlock); - return DS_OK; } -static HRESULT WINAPI PrimaryBufferImpl_Unlock(IDirectSoundBuffer *iface, void *p1, DWORD x1, - void *p2, DWORD x2) -{ +static HRESULT WINAPI PrimaryBufferImpl_Unlock( + LPDIRECTSOUNDBUFFER iface,LPVOID p1,DWORD x1,LPVOID p2,DWORD x2 +) { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); DirectSoundDevice *device = This->device; TRACE("(%p,%p,%d,%p,%d)\n", iface, p1, x1, p2, x2); @@ -1091,22 +1051,34 @@ static HRESULT WINAPI PrimaryBufferImpl_Unlock(IDirectSoundBuffer *iface, void * return DSERR_PRIOLEVELNEEDED; } - if ((p1 && ((BYTE*)p1 < device->buffer || (BYTE*)p1 >= device->buffer + device->buflen)) || - (p2 && ((BYTE*)p2 < device->buffer || (BYTE*)p2 >= device->buffer + device->buflen))) - return DSERR_INVALIDPARAM; + if (!(device->drvdesc.dwFlags & DSDDESC_DONTNEEDPRIMARYLOCK) && device->hwbuf) { + HRESULT hres; + + if ((char *)p1 - (char *)device->buffer + x1 > device->buflen) + hres = DSERR_INVALIDPARAM; + else + hres = IDsDriverBuffer_Unlock(device->hwbuf, p1, x1, p2, x2); + + if (hres != DS_OK) { + WARN("IDsDriverBuffer_Unlock failed\n"); + return hres; + } + } return DS_OK; } -static HRESULT WINAPI PrimaryBufferImpl_Restore(IDirectSoundBuffer *iface) -{ +static HRESULT WINAPI PrimaryBufferImpl_Restore( + LPDIRECTSOUNDBUFFER iface +) { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); FIXME("(%p):stub\n",This); return DS_OK; } -static HRESULT WINAPI PrimaryBufferImpl_GetFrequency(IDirectSoundBuffer *iface, DWORD *freq) -{ +static HRESULT WINAPI PrimaryBufferImpl_GetFrequency( + LPDIRECTSOUNDBUFFER iface,LPDWORD freq +) { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); DirectSoundDevice *device = This->device; TRACE("(%p,%p)\n", iface, freq); @@ -1127,16 +1099,17 @@ static HRESULT WINAPI PrimaryBufferImpl_GetFrequency(IDirectSoundBuffer *iface, return DS_OK; } -static HRESULT WINAPI PrimaryBufferImpl_Initialize(IDirectSoundBuffer *iface, IDirectSound *dsound, - const DSBUFFERDESC *dbsd) -{ +static HRESULT WINAPI PrimaryBufferImpl_Initialize( + LPDIRECTSOUNDBUFFER iface,LPDIRECTSOUND dsound,LPCDSBUFFERDESC dbsd +) { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); WARN("(%p) already initialized\n", This); return DSERR_ALREADYINITIALIZED; } -static HRESULT WINAPI PrimaryBufferImpl_GetCaps(IDirectSoundBuffer *iface, DSBCAPS *caps) -{ +static HRESULT WINAPI PrimaryBufferImpl_GetCaps( + LPDIRECTSOUNDBUFFER iface,LPDSBCAPS caps +) { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); DirectSoundDevice *device = This->device; TRACE("(%p,%p)\n", iface, caps); @@ -1161,11 +1134,11 @@ static HRESULT WINAPI PrimaryBufferImpl_GetCaps(IDirectSoundBuffer *iface, DSBCA return DS_OK; } -static HRESULT WINAPI PrimaryBufferImpl_QueryInterface(IDirectSoundBuffer *iface, REFIID riid, - void **ppobj) -{ +static HRESULT WINAPI PrimaryBufferImpl_QueryInterface( + LPDIRECTSOUNDBUFFER iface,REFIID riid,LPVOID *ppobj +) { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); - + DirectSoundDevice *device = This->device; TRACE("(%p,%s,%p)\n", iface, debugstr_guid(riid), ppobj); if (ppobj == NULL) { @@ -1177,8 +1150,8 @@ static HRESULT WINAPI PrimaryBufferImpl_QueryInterface(IDirectSoundBuffer *iface if ( IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectSoundBuffer) ) { - IDirectSoundBuffer_AddRef(iface); - *ppobj = iface; + IDirectSoundBuffer_AddRef((LPDIRECTSOUNDBUFFER)This); + *ppobj = This; return S_OK; } @@ -1201,15 +1174,21 @@ static HRESULT WINAPI PrimaryBufferImpl_QueryInterface(IDirectSoundBuffer *iface } if ( IsEqualGUID( &IID_IDirectSound3DListener, riid ) ) { - *ppobj = &This->IDirectSound3DListener_iface; - IDirectSound3DListener_AddRef(&This->IDirectSound3DListener_iface); - return S_OK; + if (!device->listener) + IDirectSound3DListenerImpl_Create(device, &device->listener); + if (device->listener) { + *ppobj = device->listener; + IDirectSound3DListener_AddRef((LPDIRECTSOUND3DLISTENER)*ppobj); + return S_OK; + } + + WARN("IID_IDirectSound3DListener failed\n"); + return E_NOINTERFACE; } if ( IsEqualGUID( &IID_IKsPropertySet, riid ) ) { - *ppobj = &This->IKsPropertySet_iface; - IKsPropertySet_AddRef(&This->IKsPropertySet_iface); - return S_OK; + FIXME("app requested IKsPropertySet on primary buffer\n"); + return E_NOINTERFACE; } FIXME( "Unknown IID %s\n", debugstr_guid( riid ) ); @@ -1261,35 +1240,12 @@ HRESULT primarybuffer_create(DirectSoundDevice *device, IDirectSoundBufferImpl * return DSERR_OUTOFMEMORY; } - dsb->ref = 0; - dsb->ref3D = 0; - dsb->refiks = 0; - dsb->numIfaces = 0; + dsb->ref = 1; + dsb->numIfaces = 1; dsb->device = device; dsb->IDirectSoundBuffer8_iface.lpVtbl = (IDirectSoundBuffer8Vtbl *)&dspbvt; - dsb->IDirectSound3DListener_iface.lpVtbl = &ds3dlvt; - dsb->IKsPropertySet_iface.lpVtbl = &iksbvt; dsb->dsbd = *dsbd; - /* IDirectSound3DListener */ - device->ds3dl.dwSize = sizeof(DS3DLISTENER); - device->ds3dl.vPosition.x = 0.0; - device->ds3dl.vPosition.y = 0.0; - device->ds3dl.vPosition.z = 0.0; - device->ds3dl.vVelocity.x = 0.0; - device->ds3dl.vVelocity.y = 0.0; - device->ds3dl.vVelocity.z = 0.0; - device->ds3dl.vOrientFront.x = 0.0; - device->ds3dl.vOrientFront.y = 0.0; - device->ds3dl.vOrientFront.z = 1.0; - device->ds3dl.vOrientTop.x = 0.0; - device->ds3dl.vOrientTop.y = 1.0; - device->ds3dl.vOrientTop.z = 0.0; - device->ds3dl.flDistanceFactor = DS3D_DEFAULTDISTANCEFACTOR; - device->ds3dl.flRolloffFactor = DS3D_DEFAULTROLLOFFFACTOR; - device->ds3dl.flDopplerFactor = DS3D_DEFAULTDOPPLERFACTOR; - device->ds3dl_need_recalc = TRUE; - TRACE("Created primary buffer at %p\n", dsb); TRACE("(formattag=0x%04x,chans=%d,samplerate=%d," "bytespersec=%d,blockalign=%d,bitspersamp=%d,cbSize=%d)\n", @@ -1298,7 +1254,6 @@ HRESULT primarybuffer_create(DirectSoundDevice *device, IDirectSoundBufferImpl * device->pwfx->nBlockAlign, device->pwfx->wBitsPerSample, device->pwfx->cbSize); - IDirectSoundBuffer_AddRef(&dsb->IDirectSoundBuffer8_iface); *ppdsb = dsb; return S_OK; } diff --git a/dll/directx/wine/dsound/propset.c b/dll/directx/wine/dsound/propset.c index cb309d0b86e..658f04ac63b 100644 --- a/dll/directx/wine/dsound/propset.c +++ b/dll/directx/wine/dsound/propset.c @@ -21,8 +21,6 @@ #include "dsound_private.h" -static WCHAR wInterface[] = { 'I','n','t','e','r','f','a','c','e',0 }; - typedef struct IKsPrivatePropertySetImpl { IKsPropertySet IKsPropertySet_iface; @@ -40,7 +38,9 @@ static IKsPrivatePropertySetImpl *impl_from_IKsPropertySet(IKsPropertySet *iface /* IUnknown methods */ static HRESULT WINAPI IKsPrivatePropertySetImpl_QueryInterface( - IKsPropertySet *iface, REFIID riid, void **ppobj) + LPKSPROPERTYSET iface, + REFIID riid, + LPVOID *ppobj ) { IKsPrivatePropertySetImpl *This = impl_from_IKsPropertySet(iface); TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); @@ -48,7 +48,7 @@ static HRESULT WINAPI IKsPrivatePropertySetImpl_QueryInterface( if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IKsPropertySet)) { *ppobj = iface; - IKsPropertySet_AddRef(iface); + IUnknown_AddRef(iface); return S_OK; } *ppobj = NULL; @@ -76,61 +76,67 @@ static ULONG WINAPI IKsPrivatePropertySetImpl_Release(LPKSPROPERTYSET iface) return ref; } -struct search_data { - const WCHAR *tgt_name; - GUID *found_guid; -}; - -static BOOL CALLBACK search_callback(GUID *guid, const WCHAR *desc, - const WCHAR *module, void *user) -{ - struct search_data *search = user; - - if(!lstrcmpW(desc, search->tgt_name)){ - *search->found_guid = *guid; - return FALSE; - } - - return TRUE; -} - static HRESULT DSPROPERTY_WaveDeviceMappingW( LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned ) { - HRESULT hr; - PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA ppd = pPropData; - struct search_data search; - + HRESULT hr = DSERR_INVALIDPARAM; + PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA ppd; TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n", - pPropData,cbPropData,pcbReturned); + pPropData,cbPropData,pcbReturned); + + ppd = pPropData; if (!ppd) { - WARN("invalid parameter: pPropData\n"); - return DSERR_INVALIDPARAM; + WARN("invalid parameter: pPropData\n"); + return DSERR_INVALIDPARAM; } - search.tgt_name = ppd->DeviceName; - search.found_guid = &ppd->DeviceId; - - if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER) - hr = enumerate_mmdevices(eRender, DSOUND_renderer_guids, - search_callback, &search); - else if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE) - hr = enumerate_mmdevices(eCapture, DSOUND_capture_guids, - search_callback, &search); - else - return DSERR_INVALIDPARAM; - - if(hr != S_FALSE) - /* device was not found */ - return DSERR_INVALIDPARAM; + if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER) { + ULONG wod; + unsigned int wodn; + TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n"); + wodn = waveOutGetNumDevs(); + for (wod = 0; wod < wodn; wod++) { + WAVEOUTCAPSW capsW; + MMRESULT res; + res = waveOutGetDevCapsW(wod, &capsW, sizeof(capsW)); + if (res == MMSYSERR_NOERROR) { + if (lstrcmpW(capsW.szPname, ppd->DeviceName) == 0) { + ppd->DeviceId = DSOUND_renderer_guids[wod]; + hr = DS_OK; + TRACE("found %s for %s\n", debugstr_guid(&ppd->DeviceId), + debugstr_w(ppd->DeviceName)); + break; + } + } + } + } else if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE) { + ULONG wid; + unsigned int widn; + TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n"); + widn = waveInGetNumDevs(); + for (wid = 0; wid < widn; wid++) { + WAVEINCAPSW capsW; + MMRESULT res; + res = waveInGetDevCapsW(wid, &capsW, sizeof(capsW)); + if (res == MMSYSERR_NOERROR) { + if (lstrcmpW(capsW.szPname, ppd->DeviceName) == 0) { + ppd->DeviceId = DSOUND_capture_guids[wid]; + hr = DS_OK; + TRACE("found %s for %s\n", debugstr_guid(&ppd->DeviceId), + debugstr_w(ppd->DeviceName)); + break; + } + } + } + } if (pcbReturned) *pcbReturned = cbPropData; - return DS_OK; + return hr; } static HRESULT DSPROPERTY_WaveDeviceMappingA( @@ -174,12 +180,10 @@ static HRESULT DSPROPERTY_DescriptionW( PULONG pcbReturned ) { PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA ppd = pPropData; + HRESULT err; GUID dev_guid; - IMMDevice *mmdevice; - IPropertyStore *ps; - PROPVARIANT pv; - DWORD desclen; - HRESULT hr; + ULONG wod, wid, wodn, widn; + DSDRIVERDESC desc; TRACE("pPropData=%p,cbPropData=%d,pcbReturned=%p)\n", pPropData,cbPropData,pcbReturned); @@ -203,41 +207,63 @@ static HRESULT DSPROPERTY_DescriptionW( GetDeviceID(&ppd->DeviceId, &dev_guid); - hr = get_mmdevice(eRender, &dev_guid, &mmdevice); - if(FAILED(hr)){ - hr = get_mmdevice(eCapture, &dev_guid, &mmdevice); - if(FAILED(hr)) - return hr; + wodn = waveOutGetNumDevs(); + widn = waveInGetNumDevs(); + wid = wod = dev_guid.Data4[7]; + if (!memcmp(&dev_guid, &DSOUND_renderer_guids[0], sizeof(GUID)-1) + && wod < wodn) + { + ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; + ppd->WaveDeviceId = wod; + } + else if (!memcmp(&dev_guid, &DSOUND_capture_guids[0], sizeof(GUID)-1) + && wid < widn) + { + ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE; + ppd->WaveDeviceId = wid; + } + else + { + WARN("Device not found\n"); + return E_PROP_ID_UNSUPPORTED; } - hr = IMMDevice_OpenPropertyStore(mmdevice, STGM_READ, &ps); - if(FAILED(hr)){ - IMMDevice_Release(mmdevice); - WARN("OpenPropertyStore failed: %08x\n", hr); - return hr; + if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER) + err = waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,ds_hw_accel); + else + err = waveInMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,ds_hw_accel); + + if (err != MMSYSERR_NOERROR) + { + WARN("waveMessage(DRV_QUERYDSOUNDDESC) failed!\n"); + return E_PROP_ID_UNSUPPORTED; + } + else + { + /* FIXME: Still a memory leak.. */ + int desclen, modlen; + static WCHAR wInterface[] = { 'I','n','t','e','r','f','a','c','e',0 }; + + modlen = MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, NULL, 0 ); + desclen = MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, NULL, 0 ); + ppd->Module = HeapAlloc(GetProcessHeap(),0,modlen*sizeof(WCHAR)); + ppd->Description = HeapAlloc(GetProcessHeap(),0,desclen*sizeof(WCHAR)); + ppd->Interface = wInterface; + if (!ppd->Description || !ppd->Module) + { + WARN("Out of memory\n"); + HeapFree(GetProcessHeap(), 0, ppd->Description); + HeapFree(GetProcessHeap(), 0, ppd->Module); + ppd->Description = ppd->Module = NULL; + return E_OUTOFMEMORY; + } + + MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, ppd->Module, modlen ); + MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->Description, desclen ); } - hr = IPropertyStore_GetValue(ps, - (const PROPERTYKEY *)&DEVPKEY_Device_FriendlyName, &pv); - if(FAILED(hr)){ - IPropertyStore_Release(ps); - IMMDevice_Release(mmdevice); - WARN("GetValue(FriendlyName) failed: %08x\n", hr); - return hr; - } - - desclen = lstrlenW(pv.u.pwszVal) + 1; - /* FIXME: Still a memory leak.. */ - ppd->Description = HeapAlloc(GetProcessHeap(), 0, desclen * sizeof(WCHAR)); - memcpy(ppd->Description, pv.u.pwszVal, desclen * sizeof(WCHAR)); - ppd->Module = wine_vxd_drv; - ppd->Interface = wInterface; ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD; - PropVariantClear(&pv); - IPropertyStore_Release(ps); - IMMDevice_Release(mmdevice); - if (pcbReturned) { *pcbReturned = sizeof(*ppd); TRACE("*pcbReturned=%d\n", *pcbReturned); @@ -246,49 +272,15 @@ static HRESULT DSPROPERTY_DescriptionW( return S_OK; } -static -BOOL CALLBACK enum_callback(GUID *guid, const WCHAR *desc, const WCHAR *module, - void *user) -{ - PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA ppd = user; - DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA data; - DWORD len; - BOOL ret; - - TRACE("%s %s %s %p\n", wine_dbgstr_guid(guid), wine_dbgstr_w(desc), - wine_dbgstr_w(module), user); - - if(!guid) - return TRUE; - - data.DeviceId = *guid; - - len = lstrlenW(module) + 1; - data.Module = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - memcpy(data.Module, module, len * sizeof(WCHAR)); - - len = lstrlenW(desc) + 1; - data.Description = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - memcpy(data.Description, desc, len * sizeof(WCHAR)); - - data.Interface = wInterface; - - ret = ppd->Callback(&data, ppd->Context); - - HeapFree(GetProcessHeap(), 0, data.Module); - HeapFree(GetProcessHeap(), 0, data.Description); - - return ret; -} - static HRESULT DSPROPERTY_EnumerateW( LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned ) { PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA ppd = pPropData; - HRESULT hr; - + DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA data; + BOOL ret; + int widn, wodn, i; TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n", pPropData,cbPropData,pcbReturned); @@ -301,14 +293,45 @@ static HRESULT DSPROPERTY_EnumerateW( return E_PROP_ID_UNSUPPORTED; } - hr = enumerate_mmdevices(eRender, DSOUND_renderer_guids, - enum_callback, ppd); + wodn = waveOutGetNumDevs(); + widn = waveInGetNumDevs(); - if(hr == S_OK) - hr = enumerate_mmdevices(eCapture, DSOUND_capture_guids, - enum_callback, ppd); + data.DeviceId = DSOUND_renderer_guids[0]; + for (i = 0; i < wodn; ++i) + { + HRESULT hr; + data.DeviceId.Data4[7] = i; + hr = DSPROPERTY_DescriptionW(&data, sizeof(data), NULL); + if (FAILED(hr)) + { + ERR("DescriptionW failed!\n"); + return S_OK; + } + ret = ppd->Callback(&data, ppd->Context); + HeapFree(GetProcessHeap(), 0, data.Module); + HeapFree(GetProcessHeap(), 0, data.Description); + if (!ret) + return S_OK; + } - return SUCCEEDED(hr) ? DS_OK : hr; + data.DeviceId = DSOUND_capture_guids[0]; + for (i = 0; i < widn; ++i) + { + HRESULT hr; + data.DeviceId.Data4[7] = i; + hr = DSPROPERTY_DescriptionW(&data, sizeof(data), NULL); + if (FAILED(hr)) + { + ERR("DescriptionW failed!\n"); + return S_OK; + } + ret = ppd->Callback(&data, ppd->Context); + HeapFree(GetProcessHeap(), 0, data.Module); + HeapFree(GetProcessHeap(), 0, data.Description); + if (!ret) + return S_OK; + } + return S_OK; } static BOOL DSPROPERTY_descWtoA(const DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA *dataW, @@ -589,24 +612,23 @@ static const IKsPropertySetVtbl ikspvt = { IKsPrivatePropertySetImpl_QuerySupport }; -HRESULT IKsPrivatePropertySetImpl_Create(REFIID riid, void **ppv) +HRESULT IKsPrivatePropertySetImpl_Create( + REFIID riid, + IKsPropertySet **piks) { IKsPrivatePropertySetImpl *iks; - HRESULT hr; + TRACE("(%s, %p)\n", debugstr_guid(riid), piks); - TRACE("(%s, %p)\n", debugstr_guid(riid), ppv); - - iks = HeapAlloc(GetProcessHeap(), 0, sizeof(*iks)); - if (!iks) { - WARN("out of memory\n"); - return DSERR_OUTOFMEMORY; + if (!IsEqualIID(riid, &IID_IUnknown) && + !IsEqualIID(riid, &IID_IKsPropertySet)) { + *piks = 0; + return E_NOINTERFACE; } + iks = HeapAlloc(GetProcessHeap(),0,sizeof(*iks)); iks->ref = 1; iks->IKsPropertySet_iface.lpVtbl = &ikspvt; - hr = IKsPropertySet_QueryInterface(&iks->IKsPropertySet_iface, riid, ppv); - IKsPropertySet_Release(&iks->IKsPropertySet_iface); - - return hr; + *piks = &iks->IKsPropertySet_iface; + return S_OK; } diff --git a/dll/directx/wine/dsound/sound3d.c b/dll/directx/wine/dsound/sound3d.c index 48a3773b256..d5ea87f5598 100644 --- a/dll/directx/wine/dsound/sound3d.c +++ b/dll/directx/wine/dsound/sound3d.c @@ -147,6 +147,9 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb) D3DVALUE flAngle; D3DVECTOR vLeft; /* doppler shift related stuff */ +#if 0 + D3DVALUE flFreq, flBufferVel, flListenerVel; +#endif TRACE("(%p)\n",dsb); @@ -245,17 +248,13 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb) TRACE("panning: Angle = %f rad, lPan = %d\n", flAngle, dsb->volpan.lPan); /* FIXME: Doppler Effect disabled since i have no idea which frequency to change and how to do it */ -if(0) -{ - D3DVALUE flFreq, flBufferVel, flListenerVel; +#if 0 /* doppler shift*/ - if (!VectorMagnitude(&dsb->ds3db_ds3db.vVelocity) && !VectorMagnitude(&dsb->device->ds3dl.vVelocity)) + if ((VectorMagnitude(&ds3db_ds3db.vVelocity) == 0) && (VectorMagnitude(&dsb->device->ds3dl.vVelocity) == 0)) { TRACE("doppler: Buffer and Listener don't have velocities\n"); } - else if (!(dsb->ds3db_ds3db.vVelocity.x == dsb->device->ds3dl.vVelocity.x && - dsb->ds3db_ds3db.vVelocity.y == dsb->device->ds3dl.vVelocity.y && - dsb->ds3db_ds3db.vVelocity.z == dsb->device->ds3dl.vVelocity.z)) + else if (ds3db_ds3db.vVelocity != dsb->device->ds3dl.vVelocity) { /* calculate length of ds3db_ds3db.vVelocity component which causes Doppler Effect NOTE: if buffer moves TOWARDS the listener, it's velocity component is NEGATIVE @@ -268,13 +267,14 @@ if(0) /* formula taken from Gianicoli D.: Physics, 4th edition: */ /* FIXME: replace dsb->freq with appropriate frequency ! */ flFreq = dsb->freq * ((DEFAULT_VELOCITY + flListenerVel)/(DEFAULT_VELOCITY + flBufferVel)); - TRACE("doppler: Buffer velocity (component) = %f, Listener velocity (component) = %f => Doppler shift: %d Hz -> %f Hz\n", - flBufferVel, flListenerVel, dsb->freq, flFreq); + TRACE("doppler: Buffer velocity (component) = %lf, Listener velocity (component) = %lf => Doppler shift: %ld Hz -> %lf Hz\n", flBufferVel, flListenerVel, + dsb->freq, flFreq); /* FIXME: replace following line with correct frequency setting ! */ dsb->freq = flFreq; DSOUND_RecalcFormat(dsb); + DSOUND_MixToTemporary(dsb, 0, dsb->buflen); } -} +#endif /* time for remix */ DSOUND_RecalcVolPan(&dsb->volpan); @@ -287,7 +287,7 @@ static void DSOUND_Mix3DBuffer(IDirectSoundBufferImpl *dsb) DSOUND_Calc3DBuffer(dsb); } -static void DSOUND_ChangeListener(IDirectSoundBufferImpl *ds3dl) +static void DSOUND_ChangeListener(IDirectSound3DListenerImpl *ds3dl) { int i; TRACE("(%p)\n",ds3dl); @@ -304,54 +304,52 @@ static void DSOUND_ChangeListener(IDirectSoundBufferImpl *ds3dl) /******************************************************************************* * IDirectSound3DBuffer */ -static inline IDirectSoundBufferImpl *impl_from_IDirectSound3DBuffer(IDirectSound3DBuffer *iface) -{ - return CONTAINING_RECORD(iface, IDirectSoundBufferImpl, IDirectSound3DBuffer_iface); -} /* IUnknown methods */ -static HRESULT WINAPI IDirectSound3DBufferImpl_QueryInterface(IDirectSound3DBuffer *iface, - REFIID riid, void **ppobj) +static HRESULT WINAPI IDirectSound3DBufferImpl_QueryInterface( + LPDIRECTSOUND3DBUFFER iface, REFIID riid, LPVOID *ppobj) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; - TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppobj); - - return IDirectSoundBuffer8_QueryInterface(&This->IDirectSoundBuffer8_iface, riid, ppobj); + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); + return IDirectSoundBuffer_QueryInterface((LPDIRECTSOUNDBUFFER8)This->dsb, riid, ppobj); } -static ULONG WINAPI IDirectSound3DBufferImpl_AddRef(IDirectSound3DBuffer *iface) +static ULONG WINAPI IDirectSound3DBufferImpl_AddRef(LPDIRECTSOUND3DBUFFER iface) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); - ULONG ref = InterlockedIncrement(&This->ref3D); + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; + ULONG ref = InterlockedIncrement(&(This->ref)); TRACE("(%p) ref was %d\n", This, ref - 1); if(ref == 1) - InterlockedIncrement(&This->numIfaces); + InterlockedIncrement(&This->dsb->numIfaces); return ref; } -static ULONG WINAPI IDirectSound3DBufferImpl_Release(IDirectSound3DBuffer *iface) +static ULONG WINAPI IDirectSound3DBufferImpl_Release(LPDIRECTSOUND3DBUFFER iface) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); - ULONG ref = InterlockedDecrement(&This->ref3D); - + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; + ULONG ref = InterlockedDecrement(&(This->ref)); TRACE("(%p) ref was %d\n", This, ref + 1); - if (!ref && !InterlockedDecrement(&This->numIfaces)) - secondarybuffer_destroy(This); - + if (!ref) { + This->dsb->ds3db = NULL; + if (!InterlockedDecrement(&This->dsb->numIfaces)) + secondarybuffer_destroy(This->dsb); + HeapFree(GetProcessHeap(), 0, This); + TRACE("(%p) released\n", This); + } return ref; } /* IDirectSound3DBuffer methods */ -static HRESULT WINAPI IDirectSound3DBufferImpl_GetAllParameters(IDirectSound3DBuffer *iface, - DS3DBUFFER *lpDs3dBuffer) +static HRESULT WINAPI IDirectSound3DBufferImpl_GetAllParameters( + LPDIRECTSOUND3DBUFFER iface, + LPDS3DBUFFER lpDs3dBuffer) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); - + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; TRACE("(%p,%p)\n",This,lpDs3dBuffer); if (lpDs3dBuffer == NULL) { @@ -365,103 +363,109 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_GetAllParameters(IDirectSound3DBu } TRACE("returning: all parameters\n"); - *lpDs3dBuffer = This->ds3db_ds3db; + *lpDs3dBuffer = This->dsb->ds3db_ds3db; return DS_OK; } -static HRESULT WINAPI IDirectSound3DBufferImpl_GetConeAngles(IDirectSound3DBuffer *iface, - DWORD *lpdwInsideConeAngle, DWORD *lpdwOutsideConeAngle) +static HRESULT WINAPI IDirectSound3DBufferImpl_GetConeAngles( + LPDIRECTSOUND3DBUFFER iface, + LPDWORD lpdwInsideConeAngle, + LPDWORD lpdwOutsideConeAngle) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); - - TRACE("returning: Inside Cone Angle = %d degrees; Outside Cone Angle = %d degrees\n", - This->ds3db_ds3db.dwInsideConeAngle, This->ds3db_ds3db.dwOutsideConeAngle); - *lpdwInsideConeAngle = This->ds3db_ds3db.dwInsideConeAngle; - *lpdwOutsideConeAngle = This->ds3db_ds3db.dwOutsideConeAngle; - return DS_OK; + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; + TRACE("returning: Inside Cone Angle = %d degrees; Outside Cone Angle = %d degrees\n", + This->dsb->ds3db_ds3db.dwInsideConeAngle, This->dsb->ds3db_ds3db.dwOutsideConeAngle); + *lpdwInsideConeAngle = This->dsb->ds3db_ds3db.dwInsideConeAngle; + *lpdwOutsideConeAngle = This->dsb->ds3db_ds3db.dwOutsideConeAngle; + return DS_OK; } -static HRESULT WINAPI IDirectSound3DBufferImpl_GetConeOrientation(IDirectSound3DBuffer *iface, - D3DVECTOR *lpvConeOrientation) +static HRESULT WINAPI IDirectSound3DBufferImpl_GetConeOrientation( + LPDIRECTSOUND3DBUFFER iface, + LPD3DVECTOR lpvConeOrientation) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); - - TRACE("returning: Cone Orientation vector = (%f,%f,%f)\n", - This->ds3db_ds3db.vConeOrientation.x, - This->ds3db_ds3db.vConeOrientation.y, - This->ds3db_ds3db.vConeOrientation.z); - *lpvConeOrientation = This->ds3db_ds3db.vConeOrientation; - return DS_OK; + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; + TRACE("returning: Cone Orientation vector = (%f,%f,%f)\n", + This->dsb->ds3db_ds3db.vConeOrientation.x, + This->dsb->ds3db_ds3db.vConeOrientation.y, + This->dsb->ds3db_ds3db.vConeOrientation.z); + *lpvConeOrientation = This->dsb->ds3db_ds3db.vConeOrientation; + return DS_OK; } -static HRESULT WINAPI IDirectSound3DBufferImpl_GetConeOutsideVolume(IDirectSound3DBuffer *iface, - LONG *lplConeOutsideVolume) +static HRESULT WINAPI IDirectSound3DBufferImpl_GetConeOutsideVolume( + LPDIRECTSOUND3DBUFFER iface, + LPLONG lplConeOutsideVolume) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); - - TRACE("returning: Cone Outside Volume = %d\n", This->ds3db_ds3db.lConeOutsideVolume); - *lplConeOutsideVolume = This->ds3db_ds3db.lConeOutsideVolume; - return DS_OK; + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; + TRACE("returning: Cone Outside Volume = %d\n", This->dsb->ds3db_ds3db.lConeOutsideVolume); + *lplConeOutsideVolume = This->dsb->ds3db_ds3db.lConeOutsideVolume; + return DS_OK; } -static HRESULT WINAPI IDirectSound3DBufferImpl_GetMaxDistance(IDirectSound3DBuffer *iface, - D3DVALUE *lpfMaxDistance) +static HRESULT WINAPI IDirectSound3DBufferImpl_GetMaxDistance( + LPDIRECTSOUND3DBUFFER iface, + LPD3DVALUE lpfMaxDistance) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); - - TRACE("returning: Max Distance = %f\n", This->ds3db_ds3db.flMaxDistance); - *lpfMaxDistance = This->ds3db_ds3db.flMaxDistance; - return DS_OK; + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; + TRACE("returning: Max Distance = %f\n", This->dsb->ds3db_ds3db.flMaxDistance); + *lpfMaxDistance = This->dsb->ds3db_ds3db.flMaxDistance; + return DS_OK; } -static HRESULT WINAPI IDirectSound3DBufferImpl_GetMinDistance(IDirectSound3DBuffer *iface, - D3DVALUE *lpfMinDistance) +static HRESULT WINAPI IDirectSound3DBufferImpl_GetMinDistance( + LPDIRECTSOUND3DBUFFER iface, + LPD3DVALUE lpfMinDistance) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); - - TRACE("returning: Min Distance = %f\n", This->ds3db_ds3db.flMinDistance); - *lpfMinDistance = This->ds3db_ds3db.flMinDistance; - return DS_OK; + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; + TRACE("returning: Min Distance = %f\n", This->dsb->ds3db_ds3db.flMinDistance); + *lpfMinDistance = This->dsb->ds3db_ds3db.flMinDistance; + return DS_OK; } -static HRESULT WINAPI IDirectSound3DBufferImpl_GetMode(IDirectSound3DBuffer *iface, - DWORD *lpdwMode) +static HRESULT WINAPI IDirectSound3DBufferImpl_GetMode( + LPDIRECTSOUND3DBUFFER iface, + LPDWORD lpdwMode) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); - - TRACE("returning: Mode = %d\n", This->ds3db_ds3db.dwMode); - *lpdwMode = This->ds3db_ds3db.dwMode; - return DS_OK; + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; + TRACE("returning: Mode = %d\n", This->dsb->ds3db_ds3db.dwMode); + *lpdwMode = This->dsb->ds3db_ds3db.dwMode; + return DS_OK; } -static HRESULT WINAPI IDirectSound3DBufferImpl_GetPosition(IDirectSound3DBuffer *iface, - D3DVECTOR *lpvPosition) +static HRESULT WINAPI IDirectSound3DBufferImpl_GetPosition( + LPDIRECTSOUND3DBUFFER iface, + LPD3DVECTOR lpvPosition) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); - - TRACE("returning: Position vector = (%f,%f,%f)\n", This->ds3db_ds3db.vPosition.x, - This->ds3db_ds3db.vPosition.y, This->ds3db_ds3db.vPosition.z); - *lpvPosition = This->ds3db_ds3db.vPosition; - return DS_OK; + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; + TRACE("returning: Position vector = (%f,%f,%f)\n", + This->dsb->ds3db_ds3db.vPosition.x, + This->dsb->ds3db_ds3db.vPosition.y, + This->dsb->ds3db_ds3db.vPosition.z); + *lpvPosition = This->dsb->ds3db_ds3db.vPosition; + return DS_OK; } -static HRESULT WINAPI IDirectSound3DBufferImpl_GetVelocity(IDirectSound3DBuffer *iface, - D3DVECTOR *lpvVelocity) +static HRESULT WINAPI IDirectSound3DBufferImpl_GetVelocity( + LPDIRECTSOUND3DBUFFER iface, + LPD3DVECTOR lpvVelocity) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); - - TRACE("returning: Velocity vector = (%f,%f,%f)\n", This->ds3db_ds3db.vVelocity.x, - This->ds3db_ds3db.vVelocity.y, This->ds3db_ds3db.vVelocity.z); - *lpvVelocity = This->ds3db_ds3db.vVelocity; - return DS_OK; + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; + TRACE("returning: Velocity vector = (%f,%f,%f)\n", + This->dsb->ds3db_ds3db.vVelocity.x, + This->dsb->ds3db_ds3db.vVelocity.y, + This->dsb->ds3db_ds3db.vVelocity.z); + *lpvVelocity = This->dsb->ds3db_ds3db.vVelocity; + return DS_OK; } -static HRESULT WINAPI IDirectSound3DBufferImpl_SetAllParameters(IDirectSound3DBuffer *iface, - const DS3DBUFFER *lpcDs3dBuffer, DWORD dwApply) +static HRESULT WINAPI IDirectSound3DBufferImpl_SetAllParameters( + LPDIRECTSOUND3DBUFFER iface, + LPCDS3DBUFFER lpcDs3dBuffer, + DWORD dwApply) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; DWORD status = DSERR_INVALIDPARAM; - TRACE("(%p,%p,%x)\n",iface,lpcDs3dBuffer,dwApply); if (lpcDs3dBuffer == NULL) { @@ -475,152 +479,163 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_SetAllParameters(IDirectSound3DBu } TRACE("setting: all parameters; dwApply = %d\n", dwApply); - This->ds3db_ds3db = *lpcDs3dBuffer; + This->dsb->ds3db_ds3db = *lpcDs3dBuffer; if (dwApply == DS3D_IMMEDIATE) { - DSOUND_Mix3DBuffer(This); + DSOUND_Mix3DBuffer(This->dsb); } - This->ds3db_need_recalc = TRUE; + This->dsb->ds3db_need_recalc = TRUE; status = DS_OK; return status; } -static HRESULT WINAPI IDirectSound3DBufferImpl_SetConeAngles(IDirectSound3DBuffer *iface, - DWORD dwInsideConeAngle, DWORD dwOutsideConeAngle, DWORD dwApply) +static HRESULT WINAPI IDirectSound3DBufferImpl_SetConeAngles( + LPDIRECTSOUND3DBUFFER iface, + DWORD dwInsideConeAngle, + DWORD dwOutsideConeAngle, + DWORD dwApply) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); - - TRACE("setting: Inside Cone Angle = %d; Outside Cone Angle = %d; dwApply = %d\n", - dwInsideConeAngle, dwOutsideConeAngle, dwApply); - This->ds3db_ds3db.dwInsideConeAngle = dwInsideConeAngle; - This->ds3db_ds3db.dwOutsideConeAngle = dwOutsideConeAngle; - if (dwApply == DS3D_IMMEDIATE) - DSOUND_Mix3DBuffer(This); - This->ds3db_need_recalc = TRUE; - return DS_OK; + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; + TRACE("setting: Inside Cone Angle = %d; Outside Cone Angle = %d; dwApply = %d\n", + dwInsideConeAngle, dwOutsideConeAngle, dwApply); + This->dsb->ds3db_ds3db.dwInsideConeAngle = dwInsideConeAngle; + This->dsb->ds3db_ds3db.dwOutsideConeAngle = dwOutsideConeAngle; + if (dwApply == DS3D_IMMEDIATE) + { + DSOUND_Mix3DBuffer(This->dsb); + } + This->dsb->ds3db_need_recalc = TRUE; + return DS_OK; } -static HRESULT WINAPI IDirectSound3DBufferImpl_SetConeOrientation(IDirectSound3DBuffer *iface, - D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) +static HRESULT WINAPI IDirectSound3DBufferImpl_SetConeOrientation( + LPDIRECTSOUND3DBUFFER iface, + D3DVALUE x, D3DVALUE y, D3DVALUE z, + DWORD dwApply) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); - - TRACE("setting: Cone Orientation vector = (%f,%f,%f); dwApply = %d\n", x, y, z, dwApply); - This->ds3db_ds3db.vConeOrientation.x = x; - This->ds3db_ds3db.vConeOrientation.y = y; - This->ds3db_ds3db.vConeOrientation.z = z; - if (dwApply == DS3D_IMMEDIATE) - { - This->ds3db_need_recalc = FALSE; - DSOUND_Mix3DBuffer(This); - } - This->ds3db_need_recalc = TRUE; - return DS_OK; + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; + TRACE("setting: Cone Orientation vector = (%f,%f,%f); dwApply = %d\n", x, y, z, dwApply); + This->dsb->ds3db_ds3db.vConeOrientation.x = x; + This->dsb->ds3db_ds3db.vConeOrientation.y = y; + This->dsb->ds3db_ds3db.vConeOrientation.z = z; + if (dwApply == DS3D_IMMEDIATE) + { + This->dsb->ds3db_need_recalc = FALSE; + DSOUND_Mix3DBuffer(This->dsb); + } + This->dsb->ds3db_need_recalc = TRUE; + return DS_OK; } -static HRESULT WINAPI IDirectSound3DBufferImpl_SetConeOutsideVolume(IDirectSound3DBuffer *iface, - LONG lConeOutsideVolume, DWORD dwApply) +static HRESULT WINAPI IDirectSound3DBufferImpl_SetConeOutsideVolume( + LPDIRECTSOUND3DBUFFER iface, + LONG lConeOutsideVolume, + DWORD dwApply) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); - - TRACE("setting: ConeOutsideVolume = %d; dwApply = %d\n", lConeOutsideVolume, dwApply); - This->ds3db_ds3db.lConeOutsideVolume = lConeOutsideVolume; - if (dwApply == DS3D_IMMEDIATE) - { - This->ds3db_need_recalc = FALSE; - DSOUND_Mix3DBuffer(This); - } - This->ds3db_need_recalc = TRUE; - return DS_OK; + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; + TRACE("setting: ConeOutsideVolume = %d; dwApply = %d\n", lConeOutsideVolume, dwApply); + This->dsb->ds3db_ds3db.lConeOutsideVolume = lConeOutsideVolume; + if (dwApply == DS3D_IMMEDIATE) + { + This->dsb->ds3db_need_recalc = FALSE; + DSOUND_Mix3DBuffer(This->dsb); + } + This->dsb->ds3db_need_recalc = TRUE; + return DS_OK; } -static HRESULT WINAPI IDirectSound3DBufferImpl_SetMaxDistance(IDirectSound3DBuffer *iface, - D3DVALUE fMaxDistance, DWORD dwApply) +static HRESULT WINAPI IDirectSound3DBufferImpl_SetMaxDistance( + LPDIRECTSOUND3DBUFFER iface, + D3DVALUE fMaxDistance, + DWORD dwApply) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); - - TRACE("setting: MaxDistance = %f; dwApply = %d\n", fMaxDistance, dwApply); - This->ds3db_ds3db.flMaxDistance = fMaxDistance; - if (dwApply == DS3D_IMMEDIATE) - { - This->ds3db_need_recalc = FALSE; - DSOUND_Mix3DBuffer(This); - } - This->ds3db_need_recalc = TRUE; - return DS_OK; + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; + TRACE("setting: MaxDistance = %f; dwApply = %d\n", fMaxDistance, dwApply); + This->dsb->ds3db_ds3db.flMaxDistance = fMaxDistance; + if (dwApply == DS3D_IMMEDIATE) + { + This->dsb->ds3db_need_recalc = FALSE; + DSOUND_Mix3DBuffer(This->dsb); + } + This->dsb->ds3db_need_recalc = TRUE; + return DS_OK; } -static HRESULT WINAPI IDirectSound3DBufferImpl_SetMinDistance(IDirectSound3DBuffer *iface, - D3DVALUE fMinDistance, DWORD dwApply) +static HRESULT WINAPI IDirectSound3DBufferImpl_SetMinDistance( + LPDIRECTSOUND3DBUFFER iface, + D3DVALUE fMinDistance, + DWORD dwApply) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); - - TRACE("setting: MinDistance = %f; dwApply = %d\n", fMinDistance, dwApply); - This->ds3db_ds3db.flMinDistance = fMinDistance; - if (dwApply == DS3D_IMMEDIATE) - { - This->ds3db_need_recalc = FALSE; - DSOUND_Mix3DBuffer(This); - } - This->ds3db_need_recalc = TRUE; - return DS_OK; + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; + TRACE("setting: MinDistance = %f; dwApply = %d\n", fMinDistance, dwApply); + This->dsb->ds3db_ds3db.flMinDistance = fMinDistance; + if (dwApply == DS3D_IMMEDIATE) + { + This->dsb->ds3db_need_recalc = FALSE; + DSOUND_Mix3DBuffer(This->dsb); + } + This->dsb->ds3db_need_recalc = TRUE; + return DS_OK; } -static HRESULT WINAPI IDirectSound3DBufferImpl_SetMode(IDirectSound3DBuffer *iface, DWORD dwMode, - DWORD dwApply) +static HRESULT WINAPI IDirectSound3DBufferImpl_SetMode( + LPDIRECTSOUND3DBUFFER iface, + DWORD dwMode, + DWORD dwApply) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); - - TRACE("setting: Mode = %d; dwApply = %d\n", dwMode, dwApply); - This->ds3db_ds3db.dwMode = dwMode; - if (dwApply == DS3D_IMMEDIATE) - { - This->ds3db_need_recalc = FALSE; - DSOUND_Mix3DBuffer(This); - } - This->ds3db_need_recalc = TRUE; - return DS_OK; + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; + TRACE("setting: Mode = %d; dwApply = %d\n", dwMode, dwApply); + This->dsb->ds3db_ds3db.dwMode = dwMode; + if (dwApply == DS3D_IMMEDIATE) + { + This->dsb->ds3db_need_recalc = FALSE; + DSOUND_Mix3DBuffer(This->dsb); + } + This->dsb->ds3db_need_recalc = TRUE; + return DS_OK; } -static HRESULT WINAPI IDirectSound3DBufferImpl_SetPosition(IDirectSound3DBuffer *iface, D3DVALUE x, - D3DVALUE y, D3DVALUE z, DWORD dwApply) +static HRESULT WINAPI IDirectSound3DBufferImpl_SetPosition( + LPDIRECTSOUND3DBUFFER iface, + D3DVALUE x, D3DVALUE y, D3DVALUE z, + DWORD dwApply) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); - - TRACE("setting: Position vector = (%f,%f,%f); dwApply = %d\n", x, y, z, dwApply); - This->ds3db_ds3db.vPosition.x = x; - This->ds3db_ds3db.vPosition.y = y; - This->ds3db_ds3db.vPosition.z = z; - if (dwApply == DS3D_IMMEDIATE) - { - This->ds3db_need_recalc = FALSE; - DSOUND_Mix3DBuffer(This); - } - This->ds3db_need_recalc = TRUE; - return DS_OK; + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; + TRACE("setting: Position vector = (%f,%f,%f); dwApply = %d\n", x, y, z, dwApply); + This->dsb->ds3db_ds3db.vPosition.x = x; + This->dsb->ds3db_ds3db.vPosition.y = y; + This->dsb->ds3db_ds3db.vPosition.z = z; + if (dwApply == DS3D_IMMEDIATE) + { + This->dsb->ds3db_need_recalc = FALSE; + DSOUND_Mix3DBuffer(This->dsb); + } + This->dsb->ds3db_need_recalc = TRUE; + return DS_OK; } -static HRESULT WINAPI IDirectSound3DBufferImpl_SetVelocity(IDirectSound3DBuffer *iface, - D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) +static HRESULT WINAPI IDirectSound3DBufferImpl_SetVelocity( + LPDIRECTSOUND3DBUFFER iface, + D3DVALUE x, D3DVALUE y, D3DVALUE z, + DWORD dwApply) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); - - TRACE("setting: Velocity vector = (%f,%f,%f); dwApply = %d\n", x, y, z, dwApply); - This->ds3db_ds3db.vVelocity.x = x; - This->ds3db_ds3db.vVelocity.y = y; - This->ds3db_ds3db.vVelocity.z = z; - if (dwApply == DS3D_IMMEDIATE) - { - This->ds3db_need_recalc = FALSE; - DSOUND_Mix3DBuffer(This); - } - This->ds3db_need_recalc = TRUE; - return DS_OK; + IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; + TRACE("setting: Velocity vector = (%f,%f,%f); dwApply = %d\n", x, y, z, dwApply); + This->dsb->ds3db_ds3db.vVelocity.x = x; + This->dsb->ds3db_ds3db.vVelocity.y = y; + This->dsb->ds3db_ds3db.vVelocity.z = z; + if (dwApply == DS3D_IMMEDIATE) + { + This->dsb->ds3db_need_recalc = FALSE; + DSOUND_Mix3DBuffer(This->dsb); + } + This->dsb->ds3db_need_recalc = TRUE; + return DS_OK; } -const IDirectSound3DBufferVtbl ds3dbvt = +static const IDirectSound3DBufferVtbl ds3dbvt = { /* IUnknown methods */ IDirectSound3DBufferImpl_QueryInterface, @@ -647,60 +662,129 @@ const IDirectSound3DBufferVtbl ds3dbvt = IDirectSound3DBufferImpl_SetVelocity, }; +HRESULT IDirectSound3DBufferImpl_Create( + IDirectSoundBufferImpl *dsb, + IDirectSound3DBufferImpl **pds3db) +{ + IDirectSound3DBufferImpl *ds3db; + TRACE("(%p,%p)\n",dsb,pds3db); + + ds3db = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(*ds3db)); + + if (ds3db == NULL) { + WARN("out of memory\n"); + *pds3db = 0; + return DSERR_OUTOFMEMORY; + } + + ds3db->ref = 0; + ds3db->dsb = dsb; + ds3db->lpVtbl = &ds3dbvt; + + ds3db->dsb->ds3db_ds3db.dwSize = sizeof(DS3DBUFFER); + ds3db->dsb->ds3db_ds3db.vPosition.x = 0.0; + ds3db->dsb->ds3db_ds3db.vPosition.y = 0.0; + ds3db->dsb->ds3db_ds3db.vPosition.z = 0.0; + ds3db->dsb->ds3db_ds3db.vVelocity.x = 0.0; + ds3db->dsb->ds3db_ds3db.vVelocity.y = 0.0; + ds3db->dsb->ds3db_ds3db.vVelocity.z = 0.0; + ds3db->dsb->ds3db_ds3db.dwInsideConeAngle = DS3D_DEFAULTCONEANGLE; + ds3db->dsb->ds3db_ds3db.dwOutsideConeAngle = DS3D_DEFAULTCONEANGLE; + ds3db->dsb->ds3db_ds3db.vConeOrientation.x = 0.0; + ds3db->dsb->ds3db_ds3db.vConeOrientation.y = 0.0; + ds3db->dsb->ds3db_ds3db.vConeOrientation.z = 0.0; + ds3db->dsb->ds3db_ds3db.lConeOutsideVolume = DS3D_DEFAULTCONEOUTSIDEVOLUME; + ds3db->dsb->ds3db_ds3db.flMinDistance = DS3D_DEFAULTMINDISTANCE; + ds3db->dsb->ds3db_ds3db.flMaxDistance = DS3D_DEFAULTMAXDISTANCE; + ds3db->dsb->ds3db_ds3db.dwMode = DS3DMODE_NORMAL; + + ds3db->dsb->ds3db_need_recalc = TRUE; + + *pds3db = ds3db; + return S_OK; +} + +HRESULT IDirectSound3DBufferImpl_Destroy( + IDirectSound3DBufferImpl *pds3db) +{ + TRACE("(%p)\n",pds3db); + + while (IDirectSound3DBufferImpl_Release((LPDIRECTSOUND3DBUFFER)pds3db) > 0); + + return S_OK; +} /******************************************************************************* * IDirectSound3DListener */ -static inline IDirectSoundBufferImpl *impl_from_IDirectSound3DListener(IDirectSound3DListener *iface) -{ - return CONTAINING_RECORD(iface, IDirectSoundBufferImpl, IDirectSound3DListener_iface); -} - /* IUnknown methods */ -static HRESULT WINAPI IDirectSound3DListenerImpl_QueryInterface(IDirectSound3DListener *iface, - REFIID riid, void **ppobj) +static HRESULT WINAPI IDirectSound3DListenerImpl_QueryInterface( + LPDIRECTSOUND3DLISTENER iface, REFIID riid, LPVOID *ppobj) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DListener(iface); + IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface; - TRACE("(%p,%s,%p)\n", iface, debugstr_guid(riid), ppobj); + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); - return IDirectSoundBuffer_QueryInterface(&This->IDirectSoundBuffer8_iface, riid, ppobj); + if (ppobj == NULL) { + WARN("invalid parameter\n"); + return E_INVALIDARG; + } + + *ppobj = NULL; /* assume failure */ + + if ( IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IDirectSound3DListener ) ) { + IDirectSound3DListener_AddRef((LPDIRECTSOUND3DLISTENER)This); + *ppobj = This; + return S_OK; + } + + if ( IsEqualGUID(riid, &IID_IDirectSoundBuffer) ) { + *ppobj = &This->device->primary->IDirectSoundBuffer8_iface; + IDirectSoundBuffer8_AddRef(&This->device->primary->IDirectSoundBuffer8_iface); + return S_OK; + } + + FIXME( "Unknown IID %s\n", debugstr_guid( riid ) ); + return E_NOINTERFACE; } -static ULONG WINAPI IDirectSound3DListenerImpl_AddRef(IDirectSound3DListener *iface) +static ULONG WINAPI IDirectSound3DListenerImpl_AddRef(LPDIRECTSOUND3DLISTENER iface) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DListener(iface); - ULONG ref = InterlockedIncrement(&This->ref3D); + IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface; + ULONG ref = InterlockedIncrement(&(This->ref)); TRACE("(%p) ref was %d\n", This, ref - 1); if(ref == 1) - InterlockedIncrement(&This->numIfaces); + InterlockedIncrement(&This->device->primary->numIfaces); return ref; } -static ULONG WINAPI IDirectSound3DListenerImpl_Release(IDirectSound3DListener *iface) +static ULONG WINAPI IDirectSound3DListenerImpl_Release(LPDIRECTSOUND3DLISTENER iface) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DListener(iface); - ULONG ref; - - ref = capped_refcount_dec(&This->ref3D); - if(!ref) - capped_refcount_dec(&This->numIfaces); - - TRACE("(%p) ref is now %d\n", This, ref); + IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface; + ULONG ref = InterlockedDecrement(&(This->ref)); + TRACE("(%p) ref was %d\n", This, ref + 1); + if (!ref) { + This->device->listener = 0; + if (!InterlockedDecrement(&This->device->primary->numIfaces)) + primarybuffer_destroy(This->device->primary); + HeapFree(GetProcessHeap(), 0, This); + TRACE("(%p) released\n", This); + } return ref; } /* IDirectSound3DListener methods */ -static HRESULT WINAPI IDirectSound3DListenerImpl_GetAllParameter(IDirectSound3DListener *iface, - DS3DLISTENER *lpDS3DL) +static HRESULT WINAPI IDirectSound3DListenerImpl_GetAllParameter( + LPDIRECTSOUND3DLISTENER iface, + LPDS3DLISTENER lpDS3DL) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DListener(iface); - + IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface; TRACE("(%p,%p)\n",This,lpDS3DL); if (lpDS3DL == NULL) { @@ -718,31 +802,32 @@ static HRESULT WINAPI IDirectSound3DListenerImpl_GetAllParameter(IDirectSound3DL return DS_OK; } -static HRESULT WINAPI IDirectSound3DListenerImpl_GetDistanceFactor(IDirectSound3DListener *iface, - D3DVALUE *lpfDistanceFactor) +static HRESULT WINAPI IDirectSound3DListenerImpl_GetDistanceFactor( + LPDIRECTSOUND3DLISTENER iface, + LPD3DVALUE lpfDistanceFactor) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DListener(iface); - + IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface; TRACE("returning: Distance Factor = %f\n", This->device->ds3dl.flDistanceFactor); *lpfDistanceFactor = This->device->ds3dl.flDistanceFactor; return DS_OK; } -static HRESULT WINAPI IDirectSound3DListenerImpl_GetDopplerFactor(IDirectSound3DListener *iface, - D3DVALUE *lpfDopplerFactor) +static HRESULT WINAPI IDirectSound3DListenerImpl_GetDopplerFactor( + LPDIRECTSOUND3DLISTENER iface, + LPD3DVALUE lpfDopplerFactor) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DListener(iface); - + IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface; TRACE("returning: Doppler Factor = %f\n", This->device->ds3dl.flDopplerFactor); *lpfDopplerFactor = This->device->ds3dl.flDopplerFactor; return DS_OK; } -static HRESULT WINAPI IDirectSound3DListenerImpl_GetOrientation(IDirectSound3DListener *iface, - D3DVECTOR *lpvOrientFront, D3DVECTOR *lpvOrientTop) +static HRESULT WINAPI IDirectSound3DListenerImpl_GetOrientation( + LPDIRECTSOUND3DLISTENER iface, + LPD3DVECTOR lpvOrientFront, + LPD3DVECTOR lpvOrientTop) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DListener(iface); - + IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface; TRACE("returning: OrientFront vector = (%f,%f,%f); OrientTop vector = (%f,%f,%f)\n", This->device->ds3dl.vOrientFront.x, This->device->ds3dl.vOrientFront.y, This->device->ds3dl.vOrientFront.z, This->device->ds3dl.vOrientTop.x, This->device->ds3dl.vOrientTop.y, This->device->ds3dl.vOrientTop.z); @@ -751,41 +836,42 @@ static HRESULT WINAPI IDirectSound3DListenerImpl_GetOrientation(IDirectSound3DLi return DS_OK; } -static HRESULT WINAPI IDirectSound3DListenerImpl_GetPosition(IDirectSound3DListener *iface, - D3DVECTOR *lpvPosition) +static HRESULT WINAPI IDirectSound3DListenerImpl_GetPosition( + LPDIRECTSOUND3DLISTENER iface, + LPD3DVECTOR lpvPosition) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DListener(iface); - + IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface; TRACE("returning: Position vector = (%f,%f,%f)\n", This->device->ds3dl.vPosition.x, This->device->ds3dl.vPosition.y, This->device->ds3dl.vPosition.z); *lpvPosition = This->device->ds3dl.vPosition; return DS_OK; } -static HRESULT WINAPI IDirectSound3DListenerImpl_GetRolloffFactor(IDirectSound3DListener *iface, - D3DVALUE *lpfRolloffFactor) +static HRESULT WINAPI IDirectSound3DListenerImpl_GetRolloffFactor( + LPDIRECTSOUND3DLISTENER iface, + LPD3DVALUE lpfRolloffFactor) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DListener(iface); - + IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface; TRACE("returning: RolloffFactor = %f\n", This->device->ds3dl.flRolloffFactor); *lpfRolloffFactor = This->device->ds3dl.flRolloffFactor; return DS_OK; } -static HRESULT WINAPI IDirectSound3DListenerImpl_GetVelocity(IDirectSound3DListener *iface, - D3DVECTOR *lpvVelocity) +static HRESULT WINAPI IDirectSound3DListenerImpl_GetVelocity( + LPDIRECTSOUND3DLISTENER iface, + LPD3DVECTOR lpvVelocity) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DListener(iface); - + IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface; TRACE("returning: Velocity vector = (%f,%f,%f)\n", This->device->ds3dl.vVelocity.x, This->device->ds3dl.vVelocity.y, This->device->ds3dl.vVelocity.z); *lpvVelocity = This->device->ds3dl.vVelocity; return DS_OK; } -static HRESULT WINAPI IDirectSound3DListenerImpl_SetAllParameters(IDirectSound3DListener *iface, - const DS3DLISTENER *lpcDS3DL, DWORD dwApply) +static HRESULT WINAPI IDirectSound3DListenerImpl_SetAllParameters( + LPDIRECTSOUND3DLISTENER iface, + LPCDS3DLISTENER lpcDS3DL, + DWORD dwApply) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DListener(iface); - + IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface; TRACE("setting: all parameters; dwApply = %d\n", dwApply); This->device->ds3dl = *lpcDS3DL; if (dwApply == DS3D_IMMEDIATE) @@ -797,11 +883,12 @@ static HRESULT WINAPI IDirectSound3DListenerImpl_SetAllParameters(IDirectSound3D return DS_OK; } -static HRESULT WINAPI IDirectSound3DListenerImpl_SetDistanceFactor(IDirectSound3DListener *iface, - D3DVALUE fDistanceFactor, DWORD dwApply) +static HRESULT WINAPI IDirectSound3DListenerImpl_SetDistanceFactor( + LPDIRECTSOUND3DLISTENER iface, + D3DVALUE fDistanceFactor, + DWORD dwApply) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DListener(iface); - + IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface; TRACE("setting: Distance Factor = %f; dwApply = %d\n", fDistanceFactor, dwApply); This->device->ds3dl.flDistanceFactor = fDistanceFactor; if (dwApply == DS3D_IMMEDIATE) @@ -813,11 +900,12 @@ static HRESULT WINAPI IDirectSound3DListenerImpl_SetDistanceFactor(IDirectSound3 return DS_OK; } -static HRESULT WINAPI IDirectSound3DListenerImpl_SetDopplerFactor(IDirectSound3DListener *iface, - D3DVALUE fDopplerFactor, DWORD dwApply) +static HRESULT WINAPI IDirectSound3DListenerImpl_SetDopplerFactor( + LPDIRECTSOUND3DLISTENER iface, + D3DVALUE fDopplerFactor, + DWORD dwApply) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DListener(iface); - + IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface; TRACE("setting: Doppler Factor = %f; dwApply = %d\n", fDopplerFactor, dwApply); This->device->ds3dl.flDopplerFactor = fDopplerFactor; if (dwApply == DS3D_IMMEDIATE) @@ -829,12 +917,13 @@ static HRESULT WINAPI IDirectSound3DListenerImpl_SetDopplerFactor(IDirectSound3D return DS_OK; } -static HRESULT WINAPI IDirectSound3DListenerImpl_SetOrientation(IDirectSound3DListener *iface, - D3DVALUE xFront, D3DVALUE yFront, D3DVALUE zFront, D3DVALUE xTop, D3DVALUE yTop, - D3DVALUE zTop, DWORD dwApply) +static HRESULT WINAPI IDirectSound3DListenerImpl_SetOrientation( + LPDIRECTSOUND3DLISTENER iface, + D3DVALUE xFront, D3DVALUE yFront, D3DVALUE zFront, + D3DVALUE xTop, D3DVALUE yTop, D3DVALUE zTop, + DWORD dwApply) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DListener(iface); - + IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface; TRACE("setting: Front vector = (%f,%f,%f); Top vector = (%f,%f,%f); dwApply = %d\n", xFront, yFront, zFront, xTop, yTop, zTop, dwApply); This->device->ds3dl.vOrientFront.x = xFront; @@ -852,11 +941,12 @@ static HRESULT WINAPI IDirectSound3DListenerImpl_SetOrientation(IDirectSound3DLi return DS_OK; } -static HRESULT WINAPI IDirectSound3DListenerImpl_SetPosition(IDirectSound3DListener *iface, - D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) +static HRESULT WINAPI IDirectSound3DListenerImpl_SetPosition( + LPDIRECTSOUND3DLISTENER iface, + D3DVALUE x, D3DVALUE y, D3DVALUE z, + DWORD dwApply) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DListener(iface); - + IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface; TRACE("setting: Position vector = (%f,%f,%f); dwApply = %d\n", x, y, z, dwApply); This->device->ds3dl.vPosition.x = x; This->device->ds3dl.vPosition.y = y; @@ -870,11 +960,12 @@ static HRESULT WINAPI IDirectSound3DListenerImpl_SetPosition(IDirectSound3DListe return DS_OK; } -static HRESULT WINAPI IDirectSound3DListenerImpl_SetRolloffFactor(IDirectSound3DListener *iface, - D3DVALUE fRolloffFactor, DWORD dwApply) +static HRESULT WINAPI IDirectSound3DListenerImpl_SetRolloffFactor( + LPDIRECTSOUND3DLISTENER iface, + D3DVALUE fRolloffFactor, + DWORD dwApply) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DListener(iface); - + IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface; TRACE("setting: Rolloff Factor = %f; dwApply = %d\n", fRolloffFactor, dwApply); This->device->ds3dl.flRolloffFactor = fRolloffFactor; if (dwApply == DS3D_IMMEDIATE) @@ -886,11 +977,12 @@ static HRESULT WINAPI IDirectSound3DListenerImpl_SetRolloffFactor(IDirectSound3D return DS_OK; } -static HRESULT WINAPI IDirectSound3DListenerImpl_SetVelocity(IDirectSound3DListener *iface, - D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) +static HRESULT WINAPI IDirectSound3DListenerImpl_SetVelocity( + LPDIRECTSOUND3DLISTENER iface, + D3DVALUE x, D3DVALUE y, D3DVALUE z, + DWORD dwApply) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DListener(iface); - + IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface; TRACE("setting: Velocity vector = (%f,%f,%f); dwApply = %d\n", x, y, z, dwApply); This->device->ds3dl.vVelocity.x = x; This->device->ds3dl.vVelocity.y = y; @@ -904,16 +996,16 @@ static HRESULT WINAPI IDirectSound3DListenerImpl_SetVelocity(IDirectSound3DListe return DS_OK; } -static HRESULT WINAPI IDirectSound3DListenerImpl_CommitDeferredSettings(IDirectSound3DListener *iface) +static HRESULT WINAPI IDirectSound3DListenerImpl_CommitDeferredSettings( + LPDIRECTSOUND3DLISTENER iface) { - IDirectSoundBufferImpl *This = impl_from_IDirectSound3DListener(iface); - + IDirectSound3DListenerImpl *This = (IDirectSound3DListenerImpl *)iface; TRACE("\n"); DSOUND_ChangeListener(This); return DS_OK; } -const IDirectSound3DListenerVtbl ds3dlvt = +static const IDirectSound3DListenerVtbl ds3dlvt = { /* IUnknown methods */ IDirectSound3DListenerImpl_QueryInterface, @@ -936,3 +1028,46 @@ const IDirectSound3DListenerVtbl ds3dlvt = IDirectSound3DListenerImpl_SetVelocity, IDirectSound3DListenerImpl_CommitDeferredSettings, }; + +HRESULT IDirectSound3DListenerImpl_Create( + DirectSoundDevice * device, + IDirectSound3DListenerImpl ** ppdsl) +{ + IDirectSound3DListenerImpl *pdsl; + TRACE("(%p,%p)\n",device,ppdsl); + + pdsl = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(*pdsl)); + + if (pdsl == NULL) { + WARN("out of memory\n"); + *ppdsl = 0; + return DSERR_OUTOFMEMORY; + } + + pdsl->ref = 0; + pdsl->lpVtbl = &ds3dlvt; + + pdsl->device = device; + + pdsl->device->ds3dl.dwSize = sizeof(DS3DLISTENER); + pdsl->device->ds3dl.vPosition.x = 0.0; + pdsl->device->ds3dl.vPosition.y = 0.0; + pdsl->device->ds3dl.vPosition.z = 0.0; + pdsl->device->ds3dl.vVelocity.x = 0.0; + pdsl->device->ds3dl.vVelocity.y = 0.0; + pdsl->device->ds3dl.vVelocity.z = 0.0; + pdsl->device->ds3dl.vOrientFront.x = 0.0; + pdsl->device->ds3dl.vOrientFront.y = 0.0; + pdsl->device->ds3dl.vOrientFront.z = 1.0; + pdsl->device->ds3dl.vOrientTop.x = 0.0; + pdsl->device->ds3dl.vOrientTop.y = 1.0; + pdsl->device->ds3dl.vOrientTop.z = 0.0; + pdsl->device->ds3dl.flDistanceFactor = DS3D_DEFAULTDISTANCEFACTOR; + pdsl->device->ds3dl.flRolloffFactor = DS3D_DEFAULTROLLOFFFACTOR; + pdsl->device->ds3dl.flDopplerFactor = DS3D_DEFAULTDOPPLERFACTOR; + + pdsl->device->ds3dl_need_recalc = TRUE; + + *ppdsl = pdsl; + return S_OK; +} diff --git a/dll/win32/CMakeLists.txt b/dll/win32/CMakeLists.txt index fc01a8db9f7..867faf6267f 100644 --- a/dll/win32/CMakeLists.txt +++ b/dll/win32/CMakeLists.txt @@ -84,6 +84,7 @@ add_subdirectory(mcicda) add_subdirectory(mciqtz32) add_subdirectory(mciseq) add_subdirectory(mciwave) +add_subdirectory(mgmtapi) add_subdirectory(mlang) add_subdirectory(mmdevapi) add_subdirectory(mmdrv) diff --git a/dll/win32/localui/lang/ui_Da.rc b/dll/win32/localui/lang/ui_Da.rc index b30c9c7e43e..f4c14c8b6f3 100644 --- a/dll/win32/localui/lang/ui_Da.rc +++ b/dll/win32/localui/lang/ui_Da.rc @@ -16,12 +16,21 @@ * 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 "localui.h" LANGUAGE LANG_DANISH, SUBLANG_DEFAULT +STRINGTABLE +{ + IDS_LOCALPORT "Lokal port" + IDS_INVALIDNAME "'%s' er ikke et gyldigt port navn" + IDS_PORTEXISTS "Porten %s findes allerede" + IDS_NOTHINGTOCONFIG "Denne port har ingen indstillinger" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Opret en lokal port" @@ -29,8 +38,8 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Skriv navnet på den nye port:", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "Annuller", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "OK", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "Annuller", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -45,12 +54,3 @@ BEGIN DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "Annuller", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Lokal port" - IDS_INVALIDNAME "'%s' er ikke et gyldigt port navn" - IDS_PORTEXISTS "Porten %s findes allerede" - IDS_NOTHINGTOCONFIG "Denne port har ingen indstillinger" -} diff --git a/dll/win32/localui/lang/ui_De.rc b/dll/win32/localui/lang/ui_De.rc index cee6d7b61d0..53e87f65eda 100644 --- a/dll/win32/localui/lang/ui_De.rc +++ b/dll/win32/localui/lang/ui_De.rc @@ -16,6 +16,7 @@ * 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 "localui.h" @@ -24,6 +25,14 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL +STRINGTABLE +{ + IDS_LOCALPORT "Lokaler Anschluss" + IDS_INVALIDNAME "'%s' ist kein gĂ¼ltiger Anschlussname" + IDS_PORTEXISTS "Der Anschluss %s existiert bereits" + IDS_NOTHINGTOCONFIG "Dieser Anschluss besitzt keine zu konfigurierenden Optionen" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Lokalen Anschluss hinzufĂ¼gen" @@ -47,12 +56,3 @@ BEGIN DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "Abbrechen", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Lokaler Anschluss" - IDS_INVALIDNAME "'%s' ist kein gĂ¼ltiger Anschlussname" - IDS_PORTEXISTS "Der Anschluss %s existiert bereits" - IDS_NOTHINGTOCONFIG "Dieser Anschluss besitzt keine zu konfigurierenden Optionen" -} diff --git a/dll/win32/localui/lang/ui_En.rc b/dll/win32/localui/lang/ui_En.rc index 8a78fc80e70..e7112434d3f 100644 --- a/dll/win32/localui/lang/ui_En.rc +++ b/dll/win32/localui/lang/ui_En.rc @@ -16,12 +16,21 @@ * 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 "localui.h" LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT +STRINGTABLE +{ + IDS_LOCALPORT "Local Port" + IDS_INVALIDNAME "'%s' is not a valid port name" + IDS_PORTEXISTS "Port %s already exists" + IDS_NOTHINGTOCONFIG "This port has no options to configure" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Add a Local Port" @@ -29,8 +38,8 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Enter the port name to add:", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "Cancel", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "OK", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "Cancel", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -45,12 +54,3 @@ BEGIN DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "Cancel", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Local Port" - IDS_INVALIDNAME "'%s' is not a valid port name" - IDS_PORTEXISTS "Port %s already exists" - IDS_NOTHINGTOCONFIG "This port has no options to configure" -} diff --git a/dll/win32/localui/lang/ui_Es.rc b/dll/win32/localui/lang/ui_Es.rc index 2ca3f9cd124..e66e7a8b565 100644 --- a/dll/win32/localui/lang/ui_Es.rc +++ b/dll/win32/localui/lang/ui_Es.rc @@ -16,6 +16,7 @@ * 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 "localui.h" @@ -24,6 +25,14 @@ LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL +STRINGTABLE +{ + IDS_LOCALPORT "Puerto local" + IDS_INVALIDNAME "'%s' no es un nombre de puerto vĂ¡lido" + IDS_PORTEXISTS "El puerto %s ya existe" + IDS_NOTHINGTOCONFIG "Este puerto no tiene opciones para configurar" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Agregar un puerto local" @@ -31,8 +40,8 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Ingrese el nombre del puerto a agregar:", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "Aceptar", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "Cancelar", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "Aceptar", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "Cancelar", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -47,12 +56,3 @@ BEGIN DEFPUSHBUTTON "Aceptar", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "Cancelar", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Puerto local" - IDS_INVALIDNAME "'%s' no es un nombre de puerto vĂ¡lido" - IDS_PORTEXISTS "El puerto %s ya existe" - IDS_NOTHINGTOCONFIG "Este puerto no tiene opciones para configurar" -} diff --git a/dll/win32/localui/lang/ui_Fr.rc b/dll/win32/localui/lang/ui_Fr.rc index 575c688acd3..c4b1ab9d651 100644 --- a/dll/win32/localui/lang/ui_Fr.rc +++ b/dll/win32/localui/lang/ui_Fr.rc @@ -16,6 +16,7 @@ * 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 "localui.h" @@ -24,6 +25,14 @@ LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL +STRINGTABLE +{ + IDS_LOCALPORT "Port local" + IDS_INVALIDNAME "« %s » n'est pas un nom de port valide" + IDS_PORTEXISTS "Le port %s existe dĂ©jĂ " + IDS_NOTHINGTOCONFIG "Ce port n'a pas d'options de configuration" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Ajouter un port local" @@ -31,8 +40,8 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Saisisser le nom du port Ă  ajouter :", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "Annuler", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "OK", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "Annuler", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -47,12 +56,3 @@ BEGIN DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "Annuler", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Port local" - IDS_INVALIDNAME "« %s » n'est pas un nom de port valide" - IDS_PORTEXISTS "Le port %s existe dĂ©jĂ " - IDS_NOTHINGTOCONFIG "Ce port n'a pas d'options de configuration" -} diff --git a/dll/win32/localui/lang/ui_He.rc b/dll/win32/localui/lang/ui_He.rc index 2c0e5a7d432..4c572c0a628 100644 --- a/dll/win32/localui/lang/ui_He.rc +++ b/dll/win32/localui/lang/ui_He.rc @@ -18,12 +18,21 @@ * 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 "localui.h" LANGUAGE LANG_HEBREW, SUBLANG_DEFAULT +STRINGTABLE +{ + IDS_LOCALPORT "יצי××” ×קו×ית" + IDS_INVALIDNAME "'%s' ×ינו ×©× ×™×¦×™××” חוקי" + IDS_PORTEXISTS "יצי××” %s כבר ×§×™×™×ת" + IDS_NOTHINGTOCONFIG "ליצי××” הזו ×ין ×פשרויות להגדיר" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "הוסף יצי××” ×קו×ית" @@ -31,8 +40,8 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "הזן ×ת ×©× ×”×™×¦×™××” כדי להוסיפה:", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "×ישור", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "ביטול", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "×ישור", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "ביטול", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -47,12 +56,3 @@ BEGIN DEFPUSHBUTTON "×ישור", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "ביטול", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "יצי××” ×קו×ית" - IDS_INVALIDNAME "'%s' ×ינו ×©× ×™×¦×™××” חוקי" - IDS_PORTEXISTS "יצי××” %s כבר ×§×™×™×ת" - IDS_NOTHINGTOCONFIG "ליצי××” הזו ×ין ×פשרויות להגדיר" -} diff --git a/dll/win32/localui/lang/ui_Hu.rc b/dll/win32/localui/lang/ui_Hu.rc index f012cac7672..ffb9bf0dc37 100644 --- a/dll/win32/localui/lang/ui_Hu.rc +++ b/dll/win32/localui/lang/ui_Hu.rc @@ -16,6 +16,7 @@ * 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 "localui.h" @@ -25,6 +26,14 @@ LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT +STRINGTABLE +{ + IDS_LOCALPORT "Helyi port" + IDS_INVALIDNAME "A(z) '%s' nem egy Ă©rvĂ©nyes portnĂ©v" + IDS_PORTEXISTS "A port: %s mĂ¡r lĂ©tezik" + IDS_NOTHINGTOCONFIG "Ennek a portnak nincsenek beĂ¡llĂ­thatĂ³ tulajdonsĂ¡gai" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Helyi port hozzĂ¡adĂ¡sa" @@ -32,8 +41,8 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Adja meg a &hozzĂ¡adni kĂ­vĂ¡nt port nevĂ©t:", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "MĂ©gse", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "OK", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "MĂ©gse", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -48,12 +57,3 @@ BEGIN DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "MĂ©gse", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Helyi port" - IDS_INVALIDNAME "A(z) '%s' nem egy Ă©rvĂ©nyes portnĂ©v" - IDS_PORTEXISTS "A port: %s mĂ¡r lĂ©tezik" - IDS_NOTHINGTOCONFIG "Ennek a portnak nincsenek beĂ¡llĂ­thatĂ³ tulajdonsĂ¡gai" -} diff --git a/dll/win32/localui/lang/ui_It.rc b/dll/win32/localui/lang/ui_It.rc index 916b5f16d74..cfc38f26027 100644 --- a/dll/win32/localui/lang/ui_It.rc +++ b/dll/win32/localui/lang/ui_It.rc @@ -17,6 +17,7 @@ * 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 "localui.h" @@ -26,6 +27,14 @@ LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL +STRINGTABLE +{ + IDS_LOCALPORT "Porta locale" + IDS_INVALIDNAME "'%s' non è un nome di porta valido" + IDS_PORTEXISTS "La porta %s giĂ  esiste" + IDS_NOTHINGTOCONFIG "Questa porta non ha opzioni da configurare" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Aggiungi una porta locale" @@ -33,8 +42,8 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Inserisci il nome della porta da aggiungere:", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "Annulla", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "OK", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "Annulla", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -49,12 +58,3 @@ BEGIN DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "Annulla", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Porta locale" - IDS_INVALIDNAME "'%s' non è un nome di porta valido" - IDS_PORTEXISTS "La porta %s giĂ  esiste" - IDS_NOTHINGTOCONFIG "Questa porta non ha opzioni da configurare" -} diff --git a/dll/win32/localui/lang/ui_Ja.rc b/dll/win32/localui/lang/ui_Ja.rc index ef151c3d282..bf4d3db33a8 100644 --- a/dll/win32/localui/lang/ui_Ja.rc +++ b/dll/win32/localui/lang/ui_Ja.rc @@ -16,6 +16,7 @@ * 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 "localui.h" @@ -25,6 +26,14 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT +STRINGTABLE +{ + IDS_LOCALPORT "ăƒ­ăƒ¼ă‚«ăƒ« ăƒăƒ¼ăƒˆ" + IDS_INVALIDNAME "'%s' ă¯ăƒăƒ¼ăƒˆåă¨ă—ă¦æ­£ă—ăă‚ă‚ă¾ă›ă‚“" + IDS_PORTEXISTS "ăƒăƒ¼ăƒˆ %s ă¯ă™ă§ă«å­˜åœ¨ă—ă¾ă™" + IDS_NOTHINGTOCONFIG "ă“ă®ăƒăƒ¼ăƒˆă«ă¯è¨­å®é …ç›®ăŒă‚ă‚ă¾ă›ă‚“" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "ăƒ­ăƒ¼ă‚«ăƒ« ăƒăƒ¼ăƒˆă®è¿½å " @@ -32,8 +41,8 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "追å ă™ă‚‹ăƒăƒ¼ăƒˆă®åå‰(&E):", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "ă‚­ăƒ£ăƒ³ă‚»ăƒ«", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "OK", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "ă‚­ăƒ£ăƒ³ă‚»ăƒ«", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -48,12 +57,3 @@ BEGIN DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "ă‚­ăƒ£ăƒ³ă‚»ăƒ«", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "ăƒ­ăƒ¼ă‚«ăƒ« ăƒăƒ¼ăƒˆ" - IDS_INVALIDNAME "'%s' ă¯ăƒăƒ¼ăƒˆåă¨ă—ă¦æ­£ă—ăă‚ă‚ă¾ă›ă‚“" - IDS_PORTEXISTS "ăƒăƒ¼ăƒˆ %s ă¯ă™ă§ă«å­˜åœ¨ă—ă¾ă™" - IDS_NOTHINGTOCONFIG "ă“ă®ăƒăƒ¼ăƒˆă«ă¯è¨­å®é …ç›®ăŒă‚ă‚ă¾ă›ă‚“" -} diff --git a/dll/win32/localui/lang/ui_Ko.rc b/dll/win32/localui/lang/ui_Ko.rc index 718dca9f03c..6b10aa9cbae 100644 --- a/dll/win32/localui/lang/ui_Ko.rc +++ b/dll/win32/localui/lang/ui_Ko.rc @@ -17,12 +17,21 @@ * 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 "localui.h" LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT +STRINGTABLE +{ + IDS_LOCALPORT "Áö¿ª Æ÷Æ®" + IDS_INVALIDNAME "'%s'´Â ¿Ă¹Ù¸¥ Æ÷Æ® À̀¸§À̀ ¾Æ´Ơ´Ï´Ù" + IDS_PORTEXISTS "Æ÷Æ® %s´Â À̀¹̀ Á¸ÀçÇƠ´Ï´Ù" + IDS_NOTHINGTOCONFIG "À̀ Æ÷Æ®´Â ¼³Á¤Ç̉ ¿É¼ÇÀ̀ ¾ø½À´Ï´Ù" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Áö¿ª Æ÷Æ® ´ơÇϱâ" @@ -30,8 +39,8 @@ FONT 9, "MS Shell Dlg" BEGIN LTEXT "´ơÇ̉ Æ÷Æ® À̀¸§ ÀÔ·Â(&E):", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "È®ÀÎ", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "Ăë¼̉", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "È®ÀÎ", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "Ăë¼̉", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -46,12 +55,3 @@ BEGIN DEFPUSHBUTTON "È®ÀÎ", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "Ăë¼̉", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Áö¿ª Æ÷Æ®" - IDS_INVALIDNAME "'%s'´Â ¿Ă¹Ù¸¥ Æ÷Æ® À̀¸§À̀ ¾Æ´Ơ´Ï´Ù" - IDS_PORTEXISTS "Æ÷Æ® %s´Â À̀¹̀ Á¸ÀçÇƠ´Ï´Ù" - IDS_NOTHINGTOCONFIG "À̀ Æ÷Æ®´Â ¼³Á¤Ç̉ ¿É¼ÇÀ̀ ¾ø½À´Ï´Ù" -} diff --git a/dll/win32/localui/lang/ui_Lt.rc b/dll/win32/localui/lang/ui_Lt.rc index 43854283587..f9ed5bbaa37 100644 --- a/dll/win32/localui/lang/ui_Lt.rc +++ b/dll/win32/localui/lang/ui_Lt.rc @@ -16,6 +16,7 @@ * 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 "localui.h" @@ -25,6 +26,14 @@ LANGUAGE LANG_LITHUANIAN, SUBLANG_NEUTRAL +STRINGTABLE +{ + IDS_LOCALPORT "Vietinis prievadas" + IDS_INVALIDNAME "â€%s“ yra netinkamas prievado vardas" + IDS_PORTEXISTS "Prievadas %s jau egzistuoja" + IDS_NOTHINGTOCONFIG "Å is prievadas neturi parinkÄių konfigÅ«ravimui" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "PridÄ—ti vietinį prievadÄ…" @@ -32,8 +41,8 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Ä®veskite pridedamo prievado vardÄ…:", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "Gerai", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "Atsisakyti", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "Gerai", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "Atsisakyti", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -48,12 +57,3 @@ BEGIN DEFPUSHBUTTON "Gerai", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "Atsisakyti", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Vietinis prievadas" - IDS_INVALIDNAME "â€%s“ yra netinkamas prievado vardas" - IDS_PORTEXISTS "Prievadas %s jau egzistuoja" - IDS_NOTHINGTOCONFIG "Å is prievadas neturi parinkÄių konfigÅ«ravimui" -} diff --git a/dll/win32/localui/lang/ui_Nl.rc b/dll/win32/localui/lang/ui_Nl.rc index 7f10a815ba5..d337429d75c 100644 --- a/dll/win32/localui/lang/ui_Nl.rc +++ b/dll/win32/localui/lang/ui_Nl.rc @@ -16,12 +16,21 @@ * 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 "localui.h" LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL +STRINGTABLE +{ + IDS_LOCALPORT "Lokale Poort" + IDS_INVALIDNAME "'%s' is geen valide poort naam" + IDS_PORTEXISTS "Poort %s bestaat reeds" + IDS_NOTHINGTOCONFIG "Deze poort heeft geen opties om in te stellen" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Voeg een Lokale Poort toe" @@ -29,8 +38,8 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Voer de toe te voegen poort naam in:", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "Annuleren", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "OK", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "Annuleren", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -45,12 +54,3 @@ BEGIN DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "Annuleren", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Lokale Poort" - IDS_INVALIDNAME "'%s' is geen valide poort naam" - IDS_PORTEXISTS "Poort %s bestaat reeds" - IDS_NOTHINGTOCONFIG "Deze poort heeft geen opties om in te stellen" -} diff --git a/dll/win32/localui/lang/ui_No.rc b/dll/win32/localui/lang/ui_No.rc index 997b08ad91a..609104da9e1 100644 --- a/dll/win32/localui/lang/ui_No.rc +++ b/dll/win32/localui/lang/ui_No.rc @@ -16,12 +16,21 @@ * 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 "localui.h" LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL +STRINGTABLE +{ + IDS_LOCALPORT "Lokal port" + IDS_INVALIDNAME "«%s» er ikke et gyldig portnavn" + IDS_PORTEXISTS "Porten %s finnes allerede" + IDS_NOTHINGTOCONFIG "Denne porten har ingen innstillinger" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Legg til en lokal port" @@ -29,8 +38,8 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Skriv inn navn&et på den nye porten:", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "Avbryt", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "OK", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "Avbryt", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -45,12 +54,3 @@ BEGIN DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "Avbryt", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Lokal port" - IDS_INVALIDNAME "«%s» er ikke et gyldig portnavn" - IDS_PORTEXISTS "Porten %s finnes allerede" - IDS_NOTHINGTOCONFIG "Denne porten har ingen innstillinger" -} diff --git a/dll/win32/localui/lang/ui_Pl.rc b/dll/win32/localui/lang/ui_Pl.rc index 90966d76df4..5945af36d09 100644 --- a/dll/win32/localui/lang/ui_Pl.rc +++ b/dll/win32/localui/lang/ui_Pl.rc @@ -17,12 +17,21 @@ * 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 "localui.h" LANGUAGE LANG_POLISH, SUBLANG_DEFAULT +STRINGTABLE +{ + IDS_LOCALPORT "Port lokalny" + IDS_INVALIDNAME "'%s' nie jest poprawn¹ nazw¹ portu" + IDS_PORTEXISTS "Port %s ju¿ istnieje" + IDS_NOTHINGTOCONFIG "Ten port nie ma opcji do skonfigurowania" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Dodaj port lokalny" @@ -30,8 +39,8 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Nazwa nowego portu:", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "&OK", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "&Anuluj", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "&OK", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "&Anuluj", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -46,12 +55,3 @@ BEGIN DEFPUSHBUTTON "&OK", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "&Anuluj", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Port lokalny" - IDS_INVALIDNAME "'%s' nie jest poprawn¹ nazw¹ portu" - IDS_PORTEXISTS "Port %s ju¿ istnieje" - IDS_NOTHINGTOCONFIG "Ten port nie ma opcji do skonfigurowania" -} diff --git a/dll/win32/localui/lang/ui_Pt.rc b/dll/win32/localui/lang/ui_Pt.rc index b0997abebcb..82a41fc58c9 100644 --- a/dll/win32/localui/lang/ui_Pt.rc +++ b/dll/win32/localui/lang/ui_Pt.rc @@ -16,12 +16,21 @@ * 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 "localui.h" LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL +STRINGTABLE +{ + IDS_LOCALPORT "Porta Local" + IDS_INVALIDNAME "'%s' năo é um nome de porta válido" + IDS_PORTEXISTS "Porta %s já existe" + IDS_NOTHINGTOCONFIG "Esta porta năo possui opçơes de configuraçăo" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Adicionar uma porta local" @@ -29,8 +38,8 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Introduza o nome da porta a adicionar:", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "Cancelar", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "OK", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "Cancelar", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -45,12 +54,3 @@ BEGIN DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "Cancelar", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Porta Local" - IDS_INVALIDNAME "'%s' năo é um nome de porta válido" - IDS_PORTEXISTS "Porta %s já existe" - IDS_NOTHINGTOCONFIG "Esta porta năo possui opçơes de configuraçăo" -} diff --git a/dll/win32/localui/lang/ui_Ro.rc b/dll/win32/localui/lang/ui_Ro.rc index ea7e7a10b1e..d89c963337a 100644 --- a/dll/win32/localui/lang/ui_Ro.rc +++ b/dll/win32/localui/lang/ui_Ro.rc @@ -16,23 +16,32 @@ * 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 "localui.h" +#pragma code_page(65001) + LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL -#pragma code_page(65001) +STRINGTABLE +{ + IDS_LOCALPORT "Port local" + IDS_INVALIDNAME "â€%s†nu este un nume valid de port" + IDS_PORTEXISTS "Portul %s existsă deja" + IDS_NOTHINGTOCONFIG "Acest port nu are opÈ›iuni de configurat" +} ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Adaugare port local" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "N&umele portului adăugat:", -1, 7, 13, 194, 13, WS_VISIBLE - EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "Con&firmă", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "A&nulează", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + LTEXT "N&umele portului adăugat:", -1, 7, 13, 194, 13, WS_VISIBLE + EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL + DEFPUSHBUTTON "Con&firmă", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "A&nulează", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -41,18 +50,9 @@ STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPW CAPTION "Configurare port LPT" FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "Temporizare (secunde)", LPTCONFIG_GROUP, 6, 6, 150, 35, BS_GROUPBOX - LTEXT "&ReĂ®ncearcă transmisia:", -1, 14, 22, 90, 13, WS_VISIBLE - EDITTEXT LPTCONFIG_EDIT, 112, 20, 32, 13, WS_VISIBLE | ES_NUMBER - DEFPUSHBUTTON "Con&firmă", IDOK, 164, 10, 50, 14, WS_VISIBLE - PUSHBUTTON "A&nulează", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE + GROUPBOX "Temporizare (secunde)", LPTCONFIG_GROUP, 6, 6, 150, 35, BS_GROUPBOX + LTEXT "&ReĂ®ncearcă transmisia:", -1, 14, 22, 90, 13, WS_VISIBLE + EDITTEXT LPTCONFIG_EDIT, 112, 20, 32, 13, WS_VISIBLE | ES_NUMBER + DEFPUSHBUTTON "Con&firmă", IDOK, 164, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "A&nulează", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Port local" - IDS_INVALIDNAME "â€%s†nu este un nume valid de port" - IDS_PORTEXISTS "Portul %s existsă deja" - IDS_NOTHINGTOCONFIG "Acest port nu are opÈ›iuni de configurat" -} diff --git a/dll/win32/localui/lang/ui_Ru.rc b/dll/win32/localui/lang/ui_Ru.rc index 5c8243efc07..c9ef0fd9bc9 100644 --- a/dll/win32/localui/lang/ui_Ru.rc +++ b/dll/win32/localui/lang/ui_Ru.rc @@ -16,6 +16,7 @@ * 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 "localui.h" @@ -25,6 +26,14 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT +STRINGTABLE +{ + IDS_LOCALPORT "Đ›Đ¾ĐºĐ°Đ»ÑŒĐ½Ñ‹Đ¹ Đ¿Đ¾Ñ€Ñ‚" + IDS_INVALIDNAME "ĐĐµĐ¿Ñ€Đ°Đ²Đ¸Đ»ÑŒĐ½Đ¾Đµ Đ½Đ°Đ·Đ²Đ°Đ½Đ¸Đµ Đ¿Đ¾Ñ€Ñ‚Đ° '%s'" + IDS_PORTEXISTS "ĐŸĐ¾Ñ€Ñ‚ '%s' ÑƒĐ¶Đµ ÑÑƒÑ‰ĐµÑÑ‚Đ²ÑƒĐµÑ‚" + IDS_NOTHINGTOCONFIG "Đ­Ñ‚Đ¾Ñ‚ Đ¿Đ¾Ñ€Ñ‚ Đ½Đµ Đ¸Đ¼ĐµĐµÑ‚ Đ½Đ°ÑÑ‚Ñ€Đ¾ĐµĐº" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Đ”Đ¾Đ±Đ°Đ²Đ¸Ñ‚ÑŒ Đ»Đ¾ĐºĐ°Đ»ÑŒĐ½Ñ‹Đ¹ Đ¿Đ¾Ñ€Ñ‚" @@ -32,8 +41,8 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Đ’Đ²ĐµĐ´Đ¸Ñ‚Đµ &Đ½Đ°Đ·Đ²Đ°Đ½Đ¸Đµ Đ»Đ¾ĐºĐ°Đ»ÑŒĐ½Đ¾Đ³Đ¾ Đ¿Đ¾Ñ€Ñ‚Đ°:", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "ĐÑ‚Đ¼ĐµĐ½Đ¸Ñ‚ÑŒ", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "OK", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "ĐÑ‚Đ¼ĐµĐ½Đ¸Ñ‚ÑŒ", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -48,12 +57,3 @@ BEGIN DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "ĐÑ‚Đ¼ĐµĐ½Đ°", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Đ›Đ¾ĐºĐ°Đ»ÑŒĐ½Ñ‹Đ¹ Đ¿Đ¾Ñ€Ñ‚" - IDS_INVALIDNAME "ĐĐµĐ¿Ñ€Đ°Đ²Đ¸Đ»ÑŒĐ½Đ¾Đµ Đ½Đ°Đ·Đ²Đ°Đ½Đ¸Đµ Đ¿Đ¾Ñ€Ñ‚Đ° '%s'" - IDS_PORTEXISTS "ĐŸĐ¾Ñ€Ñ‚ '%s' ÑƒĐ¶Đµ ÑÑƒÑ‰ĐµÑÑ‚Đ²ÑƒĐµÑ‚" - IDS_NOTHINGTOCONFIG "Đ­Ñ‚Đ¾Ñ‚ Đ¿Đ¾Ñ€Ñ‚ Đ½Đµ Đ¸Đ¼ĐµĐµÑ‚ Đ½Đ°ÑÑ‚Ñ€Đ¾ĐµĐº" -} diff --git a/dll/win32/localui/lang/ui_Si.rc b/dll/win32/localui/lang/ui_Si.rc index cb6b6740ad6..4f8538f4fc8 100644 --- a/dll/win32/localui/lang/ui_Si.rc +++ b/dll/win32/localui/lang/ui_Si.rc @@ -16,6 +16,7 @@ * 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 "localui.h" @@ -24,6 +25,14 @@ LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT +STRINGTABLE +{ + IDS_LOCALPORT "Lokalna vrata" + IDS_INVALIDNAME "'%s' ni veljavno ime vrat" + IDS_PORTEXISTS "Vrata z imenom %s že obstajajo" + IDS_NOTHINGTOCONFIG "Ta vrata nimajo možnosti nastavitve" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Dodaj lokalna vrata" @@ -31,8 +40,8 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Ime vrat:", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "V redu", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "PrekliÄi", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "V redu", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "PrekliÄi", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -47,12 +56,3 @@ BEGIN DEFPUSHBUTTON "V redu", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "PrekliÄi", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Lokalna vrata" - IDS_INVALIDNAME "'%s' ni veljavno ime vrat" - IDS_PORTEXISTS "Vrata z imenom %s že obstajajo" - IDS_NOTHINGTOCONFIG "Ta vrata nimajo možnosti nastavitve" -} diff --git a/dll/win32/localui/lang/ui_Sq.rc b/dll/win32/localui/lang/ui_Sq.rc index e27079849c3..e44695ffb70 100644 --- a/dll/win32/localui/lang/ui_Sq.rc +++ b/dll/win32/localui/lang/ui_Sq.rc @@ -17,12 +17,21 @@ * 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 "localui.h" LANGUAGE LANG_ALBANIAN, SUBLANG_NEUTRAL +STRINGTABLE +{ + IDS_LOCALPORT "Porti Vendor" + IDS_INVALIDNAME "'%s' nuk Ă«shtĂ« emer e vlefshem porti" + IDS_PORTEXISTS "Porti %s ekziston" + IDS_NOTHINGTOCONFIG "Ky port ska opsione pĂ«r tĂ« konfiguruar" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Shto njĂ« Port Vendor" @@ -30,8 +39,8 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Fut emrin e Portit pĂ«r tĂ« shtuar:", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "Anulo", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "OK", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "Anulo", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -46,12 +55,3 @@ BEGIN DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "Anulo", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Porti Vendor" - IDS_INVALIDNAME "'%s' nuk Ă«shtĂ« emer e vlefshem porti" - IDS_PORTEXISTS "Porti %s ekziston" - IDS_NOTHINGTOCONFIG "Ky port ska opsione pĂ«r tĂ« konfiguruar" -} diff --git a/dll/win32/localui/lang/ui_Sv.rc b/dll/win32/localui/lang/ui_Sv.rc index a62d009a033..872ed759716 100644 --- a/dll/win32/localui/lang/ui_Sv.rc +++ b/dll/win32/localui/lang/ui_Sv.rc @@ -16,12 +16,21 @@ * 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 "localui.h" LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL +STRINGTABLE +{ + IDS_LOCALPORT "Lokal port" + IDS_INVALIDNAME "'%s' är inte ett giltigt portnamn" + IDS_PORTEXISTS "Porten %s finns redan" + IDS_NOTHINGTOCONFIG "Denna port har inga alternativ att konfigurera" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Lägg till en lokal port" @@ -29,8 +38,8 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Ange portnamnet att lägga till:", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "Avbryt", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "OK", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "Avbryt", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -45,12 +54,3 @@ BEGIN DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "Avbryt", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Lokal port" - IDS_INVALIDNAME "'%s' är inte ett giltigt portnamn" - IDS_PORTEXISTS "Porten %s finns redan" - IDS_NOTHINGTOCONFIG "Denna port har inga alternativ att konfigurera" -} diff --git a/dll/win32/localui/lang/ui_Tr.rc b/dll/win32/localui/lang/ui_Tr.rc index 23acf4feafb..f8286fb4a08 100644 --- a/dll/win32/localui/lang/ui_Tr.rc +++ b/dll/win32/localui/lang/ui_Tr.rc @@ -16,12 +16,21 @@ * 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 "localui.h" LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT +STRINGTABLE +{ + IDS_LOCALPORT "Yerli GiriÅŸ" + IDS_INVALIDNAME """%s"", geçerli bir giriÅŸ adı deÄŸil." + IDS_PORTEXISTS "%s giriÅŸi önceden var." + IDS_NOTHINGTOCONFIG "Bu giriÅŸin yapılandırmak için seçeneÄŸi yok." +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Bir Yerli GiriÅŸ Ekle" @@ -29,8 +38,8 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Eklemek için giriÅŸ adını giriniz:", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "Tamam", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "İptal", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "Tamam", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "İptal", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -45,12 +54,3 @@ BEGIN DEFPUSHBUTTON "Tamam", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "İptal", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Yerli GiriÅŸ" - IDS_INVALIDNAME """%s"", geçerli bir giriÅŸ adı deÄŸil." - IDS_PORTEXISTS "%s giriÅŸi önceden var." - IDS_NOTHINGTOCONFIG "Bu giriÅŸin yapılandırmak için seçeneÄŸi yok." -} diff --git a/dll/win32/localui/lang/ui_Uk.rc b/dll/win32/localui/lang/ui_Uk.rc index 3386eaf0c8d..0cd2726385e 100644 --- a/dll/win32/localui/lang/ui_Uk.rc +++ b/dll/win32/localui/lang/ui_Uk.rc @@ -16,6 +16,7 @@ * 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 "localui.h" @@ -25,6 +26,14 @@ LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT +STRINGTABLE +{ + IDS_LOCALPORT "Đ›Đ¾ĐºĐ°Đ»ÑŒĐ½Đ¸Đ¹ Đ¿Đ¾Ñ€Ñ‚" + IDS_INVALIDNAME "'%s' Đ½Đµ Đ´Ñ–Đ¹ÑĐ½Đ° Đ½Đ°Đ·Đ²Đ° Đ¿Đ¾Ñ€Ñ‚Ñƒ" + IDS_PORTEXISTS "ĐŸĐ¾Ñ€Ñ‚ '%s' Đ²Đ¶Đµ Ñ–ÑĐ½ÑƒÑ”" + IDS_NOTHINGTOCONFIG "Đ¦ĐµĐ¹ Đ¿Đ¾Ñ€Ñ‚ Đ½Đµ Đ¼Đ°Ñ” Đ½Đ°Đ»Đ°ÑˆÑ‚ÑƒĐ²Đ°Đ½ÑŒ" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Đ”Đ¾Đ´Đ°Ñ‚Đ¸ Đ»Đ¾ĐºĐ°Đ»ÑŒĐ½Đ¸Đ¹ Đ¿Đ¾Ñ€Ñ‚" @@ -32,8 +41,8 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Đ’Đ²ĐµĐ´Ñ–Ñ‚ÑŒ &Đ½Đ°Đ·Đ²Ñƒ Đ»Đ¾ĐºĐ°Đ»ÑŒĐ½Đ¾Đ³Đ¾ Đ¿Đ¾Ñ€Ñ‚Đ°:", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "Đ¡ĐºĐ°ÑÑƒĐ²Đ°Ñ‚Đ¸", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "OK", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "Đ¡ĐºĐ°ÑÑƒĐ²Đ°Ñ‚Đ¸", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -48,12 +57,3 @@ BEGIN DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "Đ¡ĐºĐ°ÑÑƒĐ²Đ°Ñ‚Đ¸", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "Đ›Đ¾ĐºĐ°Đ»ÑŒĐ½Đ¸Đ¹ Đ¿Đ¾Ñ€Ñ‚" - IDS_INVALIDNAME "'%s' Đ½Đµ Đ´Ñ–Đ¹ÑĐ½Đ° Đ½Đ°Đ·Đ²Đ° Đ¿Đ¾Ñ€Ñ‚Ñƒ" - IDS_PORTEXISTS "ĐŸĐ¾Ñ€Ñ‚ '%s' Đ²Đ¶Đµ Ñ–ÑĐ½ÑƒÑ”" - IDS_NOTHINGTOCONFIG "Đ¦ĐµĐ¹ Đ¿Đ¾Ñ€Ñ‚ Đ½Đµ Đ¼Đ°Ñ” Đ½Đ°Đ»Đ°ÑˆÑ‚ÑƒĐ²Đ°Đ½ÑŒ" -} diff --git a/dll/win32/localui/lang/ui_Zh.rc b/dll/win32/localui/lang/ui_Zh.rc index 7fb12b83da6..a4d854a897b 100644 --- a/dll/win32/localui/lang/ui_Zh.rc +++ b/dll/win32/localui/lang/ui_Zh.rc @@ -16,6 +16,7 @@ * 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 "localui.h" @@ -25,6 +26,14 @@ LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED +STRINGTABLE +{ + IDS_LOCALPORT "本地端å£" + IDS_INVALIDNAME "'%s' 䏿˜¯æœ‰æ•ˆç„端å£åç§°" + IDS_PORTEXISTS "ç«¯å£ %s å·²ç»å­˜åœ¨" + IDS_NOTHINGTOCONFIG "è¿™ä¸ªç«¯å£æ²¡æœ‰å¯è®¾ç½®é€‰é¡¹" +} + ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "æ·»å æœ¬åœ°ç«¯å£" @@ -32,8 +41,8 @@ FONT 9, "MS Shell Dlg" BEGIN LTEXT "æ·»å æœ¬åœ°ç«¯å£åç§°(&E):", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "ç¡®å®", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "å–æ¶ˆ", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "ç¡®å®", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "å–æ¶ˆ", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -49,17 +58,16 @@ BEGIN PUSHBUTTON "å–æ¶ˆ", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL STRINGTABLE { IDS_LOCALPORT "本地端å£" - IDS_INVALIDNAME "'%s' 䏿˜¯æœ‰æ•ˆç„端å£åç§°" - IDS_PORTEXISTS "ç«¯å£ %s å·²ç»å­˜åœ¨" - IDS_NOTHINGTOCONFIG "è¿™ä¸ªç«¯å£æ²¡æœ‰å¯è®¾ç½®é€‰é¡¹" + IDS_INVALIDNAME "'%s' 䏿˜¯æœ‰æ•ˆç„端å£å稱" + IDS_PORTEXISTS "ç«¯å£ %s 已經存在" + IDS_NOTHINGTOCONFIG "é€™å€‹ç«¯å£æ²’有å¯è¨­å®é¸é …" } -LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL - ADDPORT_DIALOG DIALOG 6, 18, 245, 47 STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "æ·»å æœ¬åœ°ç«¯å£" @@ -67,8 +75,8 @@ FONT 9, "MS Shell Dlg" BEGIN LTEXT "æ·»å æœ¬åœ°ç«¯å£å稱(&E):", -1, 7, 13, 194, 13, WS_VISIBLE EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL - DEFPUSHBUTTON "確å®", IDOK, 199, 10, 40, 14, WS_VISIBLE - PUSHBUTTON "å–æ¶ˆ", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE + DEFPUSHBUTTON "確å®", IDOK, 188, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "å–æ¶ˆ", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE END @@ -83,12 +91,3 @@ BEGIN DEFPUSHBUTTON "確å®", IDOK, 164, 10, 50, 14, WS_VISIBLE PUSHBUTTON "å–æ¶ˆ", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE END - - -STRINGTABLE -{ - IDS_LOCALPORT "本地端å£" - IDS_INVALIDNAME "'%s' 䏿˜¯æœ‰æ•ˆç„端å£å稱" - IDS_PORTEXISTS "ç«¯å£ %s 已經存在" - IDS_NOTHINGTOCONFIG "é€™å€‹ç«¯å£æ²’有å¯è¨­å®é¸é …" -} diff --git a/dll/win32/lsasrv/authport.c b/dll/win32/lsasrv/authport.c index 89598dc1bf4..d6b848283d1 100644 --- a/dll/win32/lsasrv/authport.c +++ b/dll/win32/lsasrv/authport.c @@ -237,6 +237,11 @@ AuthPortThreadRoutine(PVOID Param) ReplyMsg = &RequestMsg; break; + case LSASS_REQUEST_GET_LOGON_SESSION_DATA: + RequestMsg.Status = LsapGetLogonSessionData(&RequestMsg); + ReplyMsg = &RequestMsg; + break; + default: RequestMsg.Status = STATUS_INVALID_SYSTEM_SERVICE; ReplyMsg = &RequestMsg; diff --git a/dll/win32/lsasrv/lsasrv.h b/dll/win32/lsasrv/lsasrv.h index f6016a5c0b1..d27bc44d0d8 100644 --- a/dll/win32/lsasrv/lsasrv.h +++ b/dll/win32/lsasrv/lsasrv.h @@ -407,6 +407,9 @@ LsapSetLogonSessionData(IN PLUID LogonId); NTSTATUS LsapEnumLogonSessions(IN OUT PLSA_API_MSG RequestMsg); +NTSTATUS +LsapGetLogonSessionData(IN OUT PLSA_API_MSG RequestMsg); + /* utils.c */ INT LsapLoadString(HINSTANCE hInstance, diff --git a/dll/win32/lsasrv/session.c b/dll/win32/lsasrv/session.c index 25bc1a073af..8f967426cd8 100644 --- a/dll/win32/lsasrv/session.c +++ b/dll/win32/lsasrv/session.c @@ -12,6 +12,16 @@ typedef struct _LSAP_LOGON_SESSION { LIST_ENTRY Entry; LUID LogonId; + ULONG LogonType; + ULONG Session; + LARGE_INTEGER LogonTime; + PSID Sid; + UNICODE_STRING UserName; + UNICODE_STRING LogonDomain; + UNICODE_STRING AuthenticationPackage; + UNICODE_STRING LogonServer; + UNICODE_STRING DnsDomainName; + UNICODE_STRING Upn; } LSAP_LOGON_SESSION, *PLSAP_LOGON_SESSION; @@ -58,7 +68,7 @@ LsapSetLogonSessionData(IN PLUID LogonId) { PLSAP_LOGON_SESSION Session; - TRACE("()\n"); + TRACE("LsapSetLogonSessionData()\n"); Session = LsapGetLogonSession(LogonId); if (Session == NULL) @@ -92,7 +102,7 @@ LsapCreateLogonSession(IN PLUID LogonId) RtlCopyLuid(&Session->LogonId, LogonId); /* Insert the new session into the session list */ - InsertTailList(&SessionListHead, &Session->Entry); + InsertHeadList(&SessionListHead, &Session->Entry); SessionCount++; return STATUS_SUCCESS; @@ -116,6 +126,28 @@ LsapDeleteLogonSession(IN PLUID LogonId) RemoveEntryList(&Session->Entry); SessionCount--; + /* Free the session data */ + if (Session->Sid != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, Session->Sid); + + if (Session->UserName.Buffer != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, Session->UserName.Buffer); + + if (Session->LogonDomain.Buffer != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, Session->LogonDomain.Buffer); + + if (Session->AuthenticationPackage.Buffer != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, Session->AuthenticationPackage.Buffer); + + if (Session->LogonServer.Buffer != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, Session->LogonServer.Buffer); + + if (Session->DnsDomainName.Buffer != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, Session->DnsDomainName.Buffer); + + if (Session->Upn.Buffer != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, Session->Upn.Buffer); + /* Free the session entry */ RtlFreeHeap(RtlGetProcessHeap(), 0, Session); @@ -135,7 +167,7 @@ LsapEnumLogonSessions(IN OUT PLSA_API_MSG RequestMsg) PVOID ClientBaseAddress = NULL; NTSTATUS Status; - TRACE("LsapEnumLogonSessions()\n"); + TRACE("LsapEnumLogonSessions(%p)\n", RequestMsg); Length = SessionCount * sizeof(LUID); SessionList = RtlAllocateHeap(RtlGetProcessHeap(), @@ -166,7 +198,7 @@ LsapEnumLogonSessions(IN OUT PLSA_API_MSG RequestMsg) NULL); Status = NtOpenProcess(&ProcessHandle, - PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION | PROCESS_DUP_HANDLE, + PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION, &ObjectAttributes, &RequestMsg->h.ClientId); if (!NT_SUCCESS(Status)) @@ -175,6 +207,8 @@ LsapEnumLogonSessions(IN OUT PLSA_API_MSG RequestMsg) goto done; } + TRACE("Length: %lu\n", Length); + MemSize = Length; Status = NtAllocateVirtualMemory(ProcessHandle, &ClientBaseAddress, @@ -188,6 +222,9 @@ LsapEnumLogonSessions(IN OUT PLSA_API_MSG RequestMsg) goto done; } + TRACE("MemSize: %lu\n", MemSize); + TRACE("ClientBaseAddress: %p\n", ClientBaseAddress); + Status = NtWriteVirtualMemory(ProcessHandle, ClientBaseAddress, SessionList, @@ -212,4 +249,110 @@ done: return Status; } + +NTSTATUS +LsapGetLogonSessionData(IN OUT PLSA_API_MSG RequestMsg) +{ + OBJECT_ATTRIBUTES ObjectAttributes; + HANDLE ProcessHandle = NULL; + PLSAP_LOGON_SESSION Session; + PSECURITY_LOGON_SESSION_DATA LocalSessionData; + PVOID ClientBaseAddress = NULL; + ULONG Length, MemSize; + LPWSTR Ptr; + NTSTATUS Status; + + TRACE("LsapGetLogonSessionData(%p)\n", RequestMsg); + + TRACE("LogonId: %lx\n", RequestMsg->GetLogonSessionData.Request.LogonId.LowPart); + Session = LsapGetLogonSession(&RequestMsg->GetLogonSessionData.Request.LogonId); + if (Session == NULL) + return STATUS_NO_SUCH_LOGON_SESSION; + + Length = sizeof(SECURITY_LOGON_SESSION_DATA); +/* + Session->UserName.MaximumLength + + Session->LogonDomain.MaximumLength + + Session->AuthenticationPackage.MaximumLength + + Session->LogonServer.MaximumLength + + Session->DnsDomainName.MaximumLength + + Session->Upn.MaximumLength; + + if (Session->Sid != NULL) + RtlLengthSid(Session->Sid); +*/ + + TRACE("Length: %lu\n", Length); + + LocalSessionData = RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + Length); + if (LocalSessionData == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + Ptr = (LPWSTR)((ULONG_PTR)LocalSessionData + sizeof(SECURITY_LOGON_SESSION_DATA)); + TRACE("LocalSessionData: %p Ptr: %p\n", LocalSessionData, Ptr); + + LocalSessionData->Size = sizeof(SECURITY_LOGON_SESSION_DATA); + + RtlCopyLuid(&LocalSessionData->LogonId, + &RequestMsg->GetLogonSessionData.Request.LogonId); + + InitializeObjectAttributes(&ObjectAttributes, + NULL, + 0, + NULL, + NULL); + + Status = NtOpenProcess(&ProcessHandle, + PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION, + &ObjectAttributes, + &RequestMsg->h.ClientId); + if (!NT_SUCCESS(Status)) + { + TRACE("NtOpenProcess() failed (Status %lx)\n", Status); + goto done; + } + + //TRACE("MemSize: %lu\n", MemSize); + + MemSize = Length; + Status = NtAllocateVirtualMemory(ProcessHandle, + &ClientBaseAddress, + 0, + &MemSize, + MEM_COMMIT, + PAGE_READWRITE); + if (!NT_SUCCESS(Status)) + { + TRACE("NtAllocateVirtualMemory() failed (Status %lx)\n", Status); + goto done; + } + + TRACE("MemSize: %lu\n", MemSize); + TRACE("ClientBaseAddress: %p\n", ClientBaseAddress); + + Status = NtWriteVirtualMemory(ProcessHandle, + ClientBaseAddress, + LocalSessionData, + Length, + NULL); + if (!NT_SUCCESS(Status)) + { + TRACE("NtWriteVirtualMemory() failed (Status %lx)\n", Status); + goto done; + } + + RequestMsg->GetLogonSessionData.Reply.SessionDataBuffer = ClientBaseAddress; + +done: + if (ProcessHandle != NULL) + NtClose(ProcessHandle); + + if (LocalSessionData != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, LocalSessionData); + + return Status; +} + /* EOF */ diff --git a/dll/win32/mgmtapi/CMakeLists.txt b/dll/win32/mgmtapi/CMakeLists.txt new file mode 100644 index 00000000000..a7a5472893a --- /dev/null +++ b/dll/win32/mgmtapi/CMakeLists.txt @@ -0,0 +1,16 @@ + +add_definitions(-D__WINESRC__) +include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) + +spec2def(mgmtapi.dll mgmtapi.spec) + +list(APPEND SOURCE + mgmtapi.c + ${CMAKE_CURRENT_BINARY_DIR}/mgmtapi_stubs.c + ${CMAKE_CURRENT_BINARY_DIR}/mgmtapi.def) + +add_library(mgmtapi SHARED ${SOURCE}) +set_module_type(mgmtapi win32dll) +target_link_libraries(mgmtapi wine) +add_importlibs(mgmtapi msvcrt kernel32 ntdll) +add_cd_file(TARGET mgmtapi DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mgmtapi/mgmtapi.c b/dll/win32/mgmtapi/mgmtapi.c new file mode 100644 index 00000000000..05ba2d9e840 --- /dev/null +++ b/dll/win32/mgmtapi/mgmtapi.c @@ -0,0 +1,40 @@ +/* + * Copyright 2012 Stefan Leichter + * + * 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 +#include +#include + +#include + +WINE_DEFAULT_DEBUG_CHANNEL(mgmtapi); + +BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) +{ + TRACE("%p, %u, %p\n", hinst, reason, reserved); + + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls( hinst ); + break; + } + return TRUE; +} diff --git a/dll/win32/mgmtapi/mgmtapi.spec b/dll/win32/mgmtapi/mgmtapi.spec new file mode 100644 index 00000000000..a052d73516d --- /dev/null +++ b/dll/win32/mgmtapi/mgmtapi.spec @@ -0,0 +1,9 @@ +@ stub SnmpMgrClose +@ stub SnmpMgrCtl +@ stub SnmpMgrGetTrap +@ stub SnmpMgrGetTrapEx +@ stub SnmpMgrOidToStr +@ stub SnmpMgrOpen +@ stub SnmpMgrRequest +@ stub SnmpMgrStrToOid +@ stub SnmpMgrTrapListen diff --git a/dll/win32/mmdevapi/devenum.c b/dll/win32/mmdevapi/devenum.c index 7aa5a009aeb..a4c77764f6f 100644 --- a/dll/win32/mmdevapi/devenum.c +++ b/dll/win32/mmdevapi/devenum.c @@ -1048,8 +1048,8 @@ static void notify_clients(EDataFlow flow, ERole role, const WCHAR *id) notify_clients(flow, eMultimedia, id); } -static int notify_if_changed(EDataFlow flow, ERole role, HKEY key, - const WCHAR *val_name, WCHAR *old_val, IMMDevice *def_dev) +static BOOL notify_if_changed(EDataFlow flow, ERole role, HKEY key, + const WCHAR *val_name, WCHAR *old_val, IMMDevice *def_dev) { WCHAR new_val[64], *id; DWORD size; @@ -1064,7 +1064,7 @@ static int notify_if_changed(EDataFlow flow, ERole role, HKEY key, hr = IMMDevice_GetId(def_dev, &id); if(FAILED(hr)){ ERR("GetId failed: %08x\n", hr); - return 0; + return FALSE; } }else id = NULL; @@ -1073,23 +1073,23 @@ static int notify_if_changed(EDataFlow flow, ERole role, HKEY key, old_val[0] = 0; CoTaskMemFree(id); - return 1; + return TRUE; } /* system default -> system default, noop */ - return 0; + return FALSE; } if(!lstrcmpW(old_val, new_val)){ /* set by user -> same value */ - return 0; + return FALSE; } if(new_val[0] != 0){ /* set by user -> different value */ notify_clients(flow, role, new_val); memcpy(old_val, new_val, sizeof(new_val)); - return 1; + return TRUE; } /* set by user -> system default */ @@ -1097,7 +1097,7 @@ static int notify_if_changed(EDataFlow flow, ERole role, HKEY key, hr = IMMDevice_GetId(def_dev, &id); if(FAILED(hr)){ ERR("GetId failed: %08x\n", hr); - return 0; + return FALSE; } }else id = NULL; @@ -1106,7 +1106,7 @@ static int notify_if_changed(EDataFlow flow, ERole role, HKEY key, old_val[0] = 0; CoTaskMemFree(id); - return 1; + return TRUE; } static DWORD WINAPI notif_thread_proc(void *user) @@ -1325,10 +1325,10 @@ static HRESULT WINAPI MMDevPropStore_GetCount(IPropertyStore *iface, DWORD *npro *nprops = 0; do { DWORD len = sizeof(buffer)/sizeof(*buffer); - if (RegEnumKeyExW(propkey, i, buffer, &len, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) + if (RegEnumValueW(propkey, i, buffer, &len, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) break; i++; - } while (0); + } while (1); RegCloseKey(propkey); TRACE("Returning %i\n", i); *nprops = i; @@ -1351,16 +1351,16 @@ static HRESULT WINAPI MMDevPropStore_GetAt(IPropertyStore *iface, DWORD prop, PR if (FAILED(hr)) return hr; - if (RegEnumKeyExW(propkey, prop, buffer, &len, NULL, NULL, NULL, NULL) != ERROR_SUCCESS - || len <= 40) + if (RegEnumValueW(propkey, prop, buffer, &len, NULL, NULL, NULL, NULL) != ERROR_SUCCESS + || len <= 39) { WARN("GetAt %u failed\n", prop); return E_INVALIDARG; } RegCloseKey(propkey); - buffer[39] = 0; + buffer[38] = 0; CLSIDFromString(buffer, &key->fmtid); - key->pid = atoiW(&buffer[40]); + key->pid = atoiW(&buffer[39]); return S_OK; } diff --git a/dll/win32/mmdevapi/mmdevapi_classes.idl b/dll/win32/mmdevapi/mmdevapi_classes.idl index a93dd3f5f72..e364fce62e3 100644 --- a/dll/win32/mmdevapi/mmdevapi_classes.idl +++ b/dll/win32/mmdevapi/mmdevapi_classes.idl @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep register + [ helpstring("MMDeviceEnumerator class"), threading(both), diff --git a/dll/win32/mpr/lang/mpr_Bg.rc b/dll/win32/mpr/lang/mpr_Bg.rc index 72debde3314..5ef0429c693 100644 --- a/dll/win32/mpr/lang/mpr_Bg.rc +++ b/dll/win32/mpr/lang/mpr_Bg.rc @@ -25,22 +25,22 @@ STRINGTABLE IDS_ENTIRENETWORK "Öÿëạ̀à ́đåæà" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Âúâåäạ̊å ́đåæîâà ïàđîëà" FONT 8, "MS Shell Dlg" { - LTEXT "Âúâåäạ̊å âàøạ̊î ïị̂đåáẹ̀åëñêî è́å è ïàđîëà:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Ïđîêñè", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "Ïị̂đåáẹ̀åë", -1, 40, 66, 50, 10 - LTEXT "Ïàđîëà", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD - CHECKBOX "&Save this password (Insecure)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Ị̂́åíè", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + LTEXT "Âúâåäạ̊å âàøạ̊î ïị̂đåáẹ̀åëñêî è́å è ïàđîëà:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Ïđîêñè", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "Ïị̂đåáẹ̀åë", -1, 6, 66, 60, 10 + LTEXT "Ïàđîëà", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + CHECKBOX "&Save this password (insecure)", IDC_SAVEPASSWORD, + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Ị̂́åíè", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_Cs.rc b/dll/win32/mpr/lang/mpr_Cs.rc index 801fedc4c6a..f567b540a43 100644 --- a/dll/win32/mpr/lang/mpr_Cs.rc +++ b/dll/win32/mpr/lang/mpr_Cs.rc @@ -28,22 +28,22 @@ STRINGTABLE IDS_ENTIRENETWORK "Celá sí" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Zadání síového hesla" FONT 8, "MS Shell Dlg" { - LTEXT "Prosím zadejte své uivatelské jméno a heslo:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Proxy", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "Uivatel", -1, 40, 66, 50, 10 - LTEXT "Heslo", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "Prosím zadejte své uivatelské jméno a heslo:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Proxy", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "Uivatel", -1, 6, 66, 60, 10 + LTEXT "Heslo", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "&Uloit toto heslo (Není bezpeèné) ?", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Zruit", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Zruit", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_Da.rc b/dll/win32/mpr/lang/mpr_Da.rc index 64f67a603ab..fe559c4f811 100644 --- a/dll/win32/mpr/lang/mpr_Da.rc +++ b/dll/win32/mpr/lang/mpr_Da.rc @@ -25,22 +25,22 @@ STRINGTABLE IDS_ENTIRENETWORK "Hele netværket" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Skriv netværkskodeord" FONT 8, "MS Shell Dlg" { - LTEXT "Skriv dit brugernavn og kodeord:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Proxy", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "Brugernavn", -1, 40, 66, 50, 10 - LTEXT "Kodeord", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "Skriv dit brugernavn og kodeord:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Proxy", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "Brugernavn", -1, 6, 66, 60, 10 + LTEXT "Kodeord", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "Gem dette ko&deord (usikkert)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Annuller", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Annuller", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_De.rc b/dll/win32/mpr/lang/mpr_De.rc index 7fa736ced58..67b735f8d18 100644 --- a/dll/win32/mpr/lang/mpr_De.rc +++ b/dll/win32/mpr/lang/mpr_De.rc @@ -27,22 +27,22 @@ STRINGTABLE IDS_ENTIRENETWORK "Gesamtes Netzwerk" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Netzwerkkennung eingeben" FONT 8, "MS Shell Dlg" { - LTEXT "Bitte geben Sie Benutzernamen und Kennwort ein:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Proxy", -1, 40, 26, 50, 10 -/* LTEXT "Bereich", -1, 40, 46, 50, 10 */ - LTEXT "Benutzername", -1, 40, 66, 50, 10 - LTEXT "Kennwort", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "Bitte geben Sie Benutzernamen und Kennwort ein:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Proxy", -1, 6, 26, 60, 10 +/* LTEXT "Bereich", -1, 6, 46, 60, 10 */ + LTEXT "Benutzername", -1, 6, 66, 60, 10 + LTEXT "Kennwort", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "Dieses Kennwort speichern (unsicher)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Abbrechen", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Abbrechen", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_En.rc b/dll/win32/mpr/lang/mpr_En.rc index 360698f67cc..77de8436a55 100644 --- a/dll/win32/mpr/lang/mpr_En.rc +++ b/dll/win32/mpr/lang/mpr_En.rc @@ -25,22 +25,22 @@ STRINGTABLE IDS_ENTIRENETWORK "Entire Network" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Enter Network Password" FONT 8, "MS Shell Dlg" { - LTEXT "Please enter your username and password:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Proxy", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "User", -1, 40, 66, 50, 10 - LTEXT "Password", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD - CHECKBOX "&Save this password (Insecure)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Cancel", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + LTEXT "Please enter your username and password:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Proxy", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "User", -1, 6, 66, 60, 10 + LTEXT "Password", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + CHECKBOX "&Save this password (insecure)", IDC_SAVEPASSWORD, + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Cancel", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_Es.rc b/dll/win32/mpr/lang/mpr_Es.rc index 3e261b30645..13f3859eefa 100644 --- a/dll/win32/mpr/lang/mpr_Es.rc +++ b/dll/win32/mpr/lang/mpr_Es.rc @@ -25,22 +25,22 @@ STRINGTABLE IDS_ENTIRENETWORK "Toda la red" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Introduzca contraseña de red" FONT 8, "MS Shell Dlg" { - LTEXT "Por favor, introduzca su nombre de usuario y contraseña:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Proxy", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "Usuario", -1, 40, 66, 50, 10 - LTEXT "Contraseña", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "Por favor, introduzca su nombre de usuario y contraseña:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Proxy", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "Usuario", -1, 6, 66, 60, 10 + LTEXT "Contraseña", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "&Guardar esta contraseña (Inseguro)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Aceptar", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Cancelar", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "Aceptar", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Cancelar", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_Fr.rc b/dll/win32/mpr/lang/mpr_Fr.rc index 1427bbd5f89..085cf594c24 100644 --- a/dll/win32/mpr/lang/mpr_Fr.rc +++ b/dll/win32/mpr/lang/mpr_Fr.rc @@ -29,22 +29,22 @@ STRINGTABLE IDS_ENTIRENETWORK "Le rĂ©seau entier" } -IDD_PROXYDLG DIALOG 36, 24, 210, 146 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Entrez le mot de passe rĂ©seau" FONT 8, "MS Shell Dlg" { - LTEXT "Veuillez saisir votre nom d'utilisateur et votre mot de passe :", IDC_EXPLAIN, 10, 6, 150, 17 - LTEXT "Proxy", -1, 10, 31, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "Utilisateur", -1, 10, 68, 45, 10 - LTEXT "Mot de passe", -1, 10, 88, 45, 10 - LTEXT "", IDC_PROXY, 56, 32, 144, 14, 0 - LTEXT "", IDC_REALM, 56, 46, 144, 14, 0 - EDITTEXT IDC_USERNAME, 56, 66, 144, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 56, 86, 144, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "Veuillez saisir votre nom d'utilisateur et votre mot de passe :", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Proxy", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "Utilisateur", -1, 6, 66, 60, 10 + LTEXT "Mot de passe", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "&Enregistrer ce mot de passe (risquĂ©)", IDC_SAVEPASSWORD, - 56, 106, 144, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "OK", IDOK, 68, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Annuler", IDCANCEL, 128, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Annuler", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_He.rc b/dll/win32/mpr/lang/mpr_He.rc index aec9ef2f95a..c211ecbf25b 100644 --- a/dll/win32/mpr/lang/mpr_He.rc +++ b/dll/win32/mpr/lang/mpr_He.rc @@ -27,22 +27,22 @@ STRINGTABLE IDS_ENTIRENETWORK "הרשת כולה" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "הזן סיס×ת רשת" FONT 8, "MS Shell Dlg" { - LTEXT "× × ×”×›× ×¡ ×ת ×©× ×”×תש×ש והסיס××” של×:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "שרת ××ª×•×•× (Proxy)", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "×©× ×שת×ש", -1, 40, 66, 50, 10 - LTEXT "סיס××”", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "× × ×”×›× ×¡ ×ת ×©× ×”×תש×ש והסיס××” של×:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "שרת ××ª×•×•× (Proxy)", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "×©× ×שת×ש", -1, 6, 66, 60, 10 + LTEXT "סיס××”", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "זכור ×ת הסיס××” (×œ× ×‘×˜×•×—)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "×ישור", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "ביטול", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "×ישור", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "ביטול", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_Hu.rc b/dll/win32/mpr/lang/mpr_Hu.rc index 46fbf7f8de3..2741481bc0b 100644 --- a/dll/win32/mpr/lang/mpr_Hu.rc +++ b/dll/win32/mpr/lang/mpr_Hu.rc @@ -25,22 +25,22 @@ STRINGTABLE IDS_ENTIRENETWORK "Teljes hálózat" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Hálózati jelszó megadása" FONT 8, "MS Shell Dlg" { - LTEXT "Kérem adja meg a felhasználónevét és jelszavát:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Proxy", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "Felhasználónév", -1, 40, 66, 50, 10 - LTEXT "Jelszó", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "Kérem adja meg a felhasználónevét és jelszavát:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Proxy", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "Felhasználónév", -1, 6, 66, 60, 10 + LTEXT "Jelszó", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "&Jelszó mentése (nem biztonságos)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Mégse", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Mégse", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_It.rc b/dll/win32/mpr/lang/mpr_It.rc index 5c046cbb8f3..0eaec258a5b 100644 --- a/dll/win32/mpr/lang/mpr_It.rc +++ b/dll/win32/mpr/lang/mpr_It.rc @@ -26,22 +26,22 @@ STRINGTABLE IDS_ENTIRENETWORK "Tutta la rete" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Inserisci la Password di Rete" FONT 8, "MS Shell Dlg" { -LTEXT "Inserire nome utente e password:", IDC_EXPLAIN, 40, 6, 150, 15 -LTEXT "Proxy", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ -LTEXT "Utente", -1, 40, 66, 50, 10 -LTEXT "Password", -1, 40, 86, 50, 10 -LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 -LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 -EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP -EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD -CHECKBOX "&Memorizza la password ( RISCHIOSO! )", IDC_SAVEPASSWORD, -80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP -PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON -PUSHBUTTON "Annulla", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + LTEXT "Inserire nome utente e password:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Proxy", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "Utente", -1, 6, 66, 60, 10 + LTEXT "Password", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + CHECKBOX "&Memorizza la password ( RISCHIOSO! )", IDC_SAVEPASSWORD, + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Annulla", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_Ja.rc b/dll/win32/mpr/lang/mpr_Ja.rc index 03158e2b21a..b9b0210100b 100644 --- a/dll/win32/mpr/lang/mpr_Ja.rc +++ b/dll/win32/mpr/lang/mpr_Ja.rc @@ -28,22 +28,22 @@ STRINGTABLE IDS_ENTIRENETWORK "ăƒăƒƒăƒˆăƒ¯ăƒ¼ă‚¯å…¨ä½“" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "ăƒăƒƒăƒˆăƒ¯ăƒ¼ă‚¯ç”¨ăƒ‘ă‚¹ăƒ¯ăƒ¼ăƒ‰ă‚’å…¥å›" FONT 8, "MS Shell Dlg" { - LTEXT "ăƒ¦ăƒ¼ă‚¶ăƒ¼åă¨ăƒ‘ă‚¹ăƒ¯ăƒ¼ăƒ‰ă‚’å…¥å›ă—ă¦ăă ă•ă„:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "ăƒ—ăƒ­ă‚­ă‚·", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "ăƒ¦ăƒ¼ă‚¶ăƒ¼å", -1, 40, 66, 50, 10 - LTEXT "ăƒ‘ă‚¹ăƒ¯ăƒ¼ăƒ‰", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "ăƒ¦ăƒ¼ă‚¶ăƒ¼åă¨ăƒ‘ă‚¹ăƒ¯ăƒ¼ăƒ‰ă‚’å…¥å›ă—ă¦ăă ă•ă„:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "ăƒ—ăƒ­ă‚­ă‚·", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "ăƒ¦ăƒ¼ă‚¶ăƒ¼å", -1, 6, 66, 60, 10 + LTEXT "ăƒ‘ă‚¹ăƒ¯ăƒ¼ăƒ‰", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "ăƒ‘ă‚¹ăƒ¯ăƒ¼ăƒ‰ă‚’ä¿å­˜ă™ă‚‹(&S)(ă‚»ă‚­ăƒ¥ă‚¢ă§ă¯ă‚ă‚ă¾ă›ă‚“)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "ă‚­ăƒ£ăƒ³ă‚»ăƒ«", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "ă‚­ăƒ£ăƒ³ă‚»ăƒ«", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_Ko.rc b/dll/win32/mpr/lang/mpr_Ko.rc index 26425d66ae6..074623d0608 100644 --- a/dll/win32/mpr/lang/mpr_Ko.rc +++ b/dll/win32/mpr/lang/mpr_Ko.rc @@ -26,22 +26,22 @@ STRINGTABLE IDS_ENTIRENETWORK "ÀüĂ¼ ³×Æ®¿öÅ©" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "³×Æ®¿öÅ© ¾ÏÈ£ ÀÔ·Â" FONT 9, "MS Shell Dlg" { - LTEXT "´ç½ÅÀÇ »ç¿ëÀÚÀ̀¸§°ú ¾ÏÈ£¸¦ ÀÔ·ÂÇÏ½Ă¿À:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "ÇÁ·Ï½Ă", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "»ç¿ëÀÚ", -1, 40, 66, 50, 10 - LTEXT "¾ÏÈ£", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "´ç½ÅÀÇ »ç¿ëÀÚÀ̀¸§°ú ¾ÏÈ£¸¦ ÀÔ·ÂÇÏ½Ă¿À:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "ÇÁ·Ï½Ă", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "»ç¿ëÀÚ", -1, 6, 66, 60, 10 + LTEXT "¾ÏÈ£", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "¾ÏÈ£ ÀúÀå(&S) (º¸¾È¿¡ ÁÖÀÇ)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "È®ÀÎ", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Ăë¼̉", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "È®ÀÎ", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Ăë¼̉", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_Lt.rc b/dll/win32/mpr/lang/mpr_Lt.rc index 2a6727cfbfb..17420787c2d 100644 --- a/dll/win32/mpr/lang/mpr_Lt.rc +++ b/dll/win32/mpr/lang/mpr_Lt.rc @@ -28,22 +28,22 @@ STRINGTABLE IDS_ENTIRENETWORK "Visas tinklas" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Ä®veskite tinklo slaptažodį" FONT 8, "MS Shell Dlg" { - LTEXT "Ä®veskite savo naudotojo vardÄ… ir slaptažodį:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Ä®galiot. serv.", -1, 40, 26, 50, 10 -/* LTEXT "Sritis", -1, 40, 46, 50, 10 */ - LTEXT "Naudotojas", -1, 40, 66, 50, 10 - LTEXT "Slaptažodis", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "Ä®veskite savo naudotojo vardÄ… ir slaptažodį:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Ä®galiot. serv.", -1, 6, 26, 60, 10 +/* LTEXT "Sritis", -1, 6, 46, 60, 10 */ + LTEXT "Naudotojas", -1, 6, 66, 60, 10 + LTEXT "Slaptažodis", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "Ä®&raÅ¡yti šį slaptažodį (nesaugu)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Gerai", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Atsisakyti", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "Gerai", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Atsisakyti", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_Nl.rc b/dll/win32/mpr/lang/mpr_Nl.rc index 0f218ab99a1..71955223afe 100644 --- a/dll/win32/mpr/lang/mpr_Nl.rc +++ b/dll/win32/mpr/lang/mpr_Nl.rc @@ -26,22 +26,22 @@ STRINGTABLE IDS_ENTIRENETWORK "Gehele netwerk" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Voer het Netwerk Wachtwoord in" FONT 8, "MS Shell Dlg" { - LTEXT "Voer a.u.b uw gebruikersnaam en wachtwoord in:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Proxy", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "Gebruiker", -1, 40, 66, 50, 10 - LTEXT "Wachtwoord", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "Voer a.u.b uw gebruikersnaam en wachtwoord in:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Proxy", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "Gebruiker", -1, 6, 66, 60, 10 + LTEXT "Wachtwoord", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "&Sla dit wachtwoord op (Onveilig)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Annuleren", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Annuleren", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_No.rc b/dll/win32/mpr/lang/mpr_No.rc index af5758e7f90..5b142906314 100644 --- a/dll/win32/mpr/lang/mpr_No.rc +++ b/dll/win32/mpr/lang/mpr_No.rc @@ -25,22 +25,22 @@ STRINGTABLE IDS_ENTIRENETWORK "Hele nettverket" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Skriv inn nettverkspassord" FONT 8, "MS Shell Dlg" { - LTEXT "Skriv inn brukernavnet og passordet ditt:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Mellomtjener", -1, 40, 26, 50, 10 -/* LTEXT "Område", -1, 40, 46, 50, 10 */ - LTEXT "Bruker", -1, 40, 66, 50, 10 - LTEXT "Passord", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "Skriv inn brukernavnet og passordet ditt:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Mellomtjener", -1, 6, 26, 60, 10 +/* LTEXT "Område", -1, 6, 46, 60, 10 */ + LTEXT "Bruker", -1, 6, 66, 60, 10 + LTEXT "Passord", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "Lagre dette pa&ssordet (usikkert)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Avbryt", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Avbryt", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_Pl.rc b/dll/win32/mpr/lang/mpr_Pl.rc index 13c4dacfa1c..e7db5596baf 100644 --- a/dll/win32/mpr/lang/mpr_Pl.rc +++ b/dll/win32/mpr/lang/mpr_Pl.rc @@ -26,22 +26,22 @@ STRINGTABLE IDS_ENTIRENETWORK "Ca³a sieæ" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Wpisz has³o sieci" FONT 8, "MS Shell Dlg" { - LTEXT "Proszê wprowadziæ nazwê u¿ytkownika i has³o:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Proxy", -1, 40, 26, 50, 10 -/* LTEXT "Obszar", -1, 40, 46, 50, 10 */ - LTEXT "U¿ytkownik", -1, 40, 66, 50, 10 - LTEXT "Has³o", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "Proszê wprowadziæ nazwê u¿ytkownika i has³o:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Proxy", -1, 6, 26, 60, 10 +/* LTEXT "Obszar", -1, 6, 46, 60, 10 */ + LTEXT "U¿ytkownik", -1, 6, 66, 60, 10 + LTEXT "Has³o", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "&Zapisz to has³o (niebezpieczne)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Anuluj", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Anuluj", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_Pt.rc b/dll/win32/mpr/lang/mpr_Pt.rc index df7e70552f1..8738739cd63 100644 --- a/dll/win32/mpr/lang/mpr_Pt.rc +++ b/dll/win32/mpr/lang/mpr_Pt.rc @@ -31,44 +31,44 @@ STRINGTABLE LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Entre a senha da rede" FONT 8, "MS Shell Dlg" { - LTEXT "Por favor, entre como o nome de usuĂ¡rio e a senha:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Proxy", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "UsuĂ¡rio", -1, 40, 66, 50, 10 - LTEXT "Senha", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "Por favor, entre como o nome de usuĂ¡rio e a senha:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Proxy", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "UsuĂ¡rio", -1, 6, 66, 60, 10 + LTEXT "Senha", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "&Salvar esta senha (Inseguro)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Cancelar", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Cancelar", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Indique a senha da rede" FONT 8, "MS Shell Dlg" { - LTEXT "Por favor, indique o nome de utilizador e a senha:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Proxy", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "Utilizador", -1, 40, 66, 50, 10 - LTEXT "Senha", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "Por favor, indique o nome de utilizador e a senha:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Proxy", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "Utilizador", -1, 6, 66, 60, 10 + LTEXT "Senha", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "&Gravar esta senha (Inseguro)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Cancelar", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Cancelar", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_Ro.rc b/dll/win32/mpr/lang/mpr_Ro.rc index 02d39de0981..27ceb0aee8b 100644 --- a/dll/win32/mpr/lang/mpr_Ro.rc +++ b/dll/win32/mpr/lang/mpr_Ro.rc @@ -27,21 +27,22 @@ STRINGTABLE IDS_ENTIRENETWORK "Toată reÈ›eaua" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Introducere parolă de reÈ›ea" FONT 8, "MS Shell Dlg" { - LTEXT "IntroduceÈ›i numele de utilizator È™i parola:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Mandatar", -1, 40, 26, 50, 10 - LTEXT "Utilizator", -1, 40, 66, 50, 10 - LTEXT "Parolă", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD - CHECKBOX "&Păstrează această parolă (nerecomandat)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Con&firmă", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "A&nulează", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + LTEXT "IntroduceÈ›i numele de utilizator È™i parola:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Mandatar", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "Utilizator", -1, 6, 66, 60, 10 + LTEXT "Parolă", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + CHECKBOX "&Păstrează această parolă (nerecomandat)", IDC_SAVEPASSWORD, + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "Con&firmă", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "A&nulează", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_Ru.rc b/dll/win32/mpr/lang/mpr_Ru.rc index 94f78b5bc32..34d76fe0bcf 100644 --- a/dll/win32/mpr/lang/mpr_Ru.rc +++ b/dll/win32/mpr/lang/mpr_Ru.rc @@ -28,22 +28,22 @@ STRINGTABLE IDS_ENTIRENETWORK "Đ’ÑÑ ÑĐµÑ‚ÑŒ" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Đ’Đ²ĐµĐ´Đ¸Ñ‚Đµ ÑĐµÑ‚ĐµĐ²Đ¾Đ¹ Đ¿Đ°Ñ€Đ¾Đ»ÑŒ" FONT 8, "MS Shell Dlg" { - LTEXT "Đ’Đ²ĐµĐ´Đ¸Ñ‚Đµ Đ²Đ°ÑˆĐ¸ Đ¸Đ¼Ñ Đ¸ Đ¿Đ°Ñ€Đ¾Đ»ÑŒ Đ¿Đ¾Đ»ÑŒĐ·Đ¾Đ²Đ°Ñ‚ĐµĐ»Ñ:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "ĐŸÑ€Đ¾ĐºÑи", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "Đ˜Đ¼Ñ", -1, 40, 66, 50, 10 - LTEXT "ĐŸĐ°Ñ€Đ¾Đ»ÑŒ", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "Đ’Đ²ĐµĐ´Đ¸Ñ‚Đµ Đ²Đ°ÑˆĐ¸ Đ¸Đ¼Ñ Đ¸ Đ¿Đ°Ñ€Đ¾Đ»ÑŒ Đ¿Đ¾Đ»ÑŒĐ·Đ¾Đ²Đ°Ñ‚ĐµĐ»Ñ:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "ĐŸÑ€Đ¾ĐºÑи", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "Đ˜Đ¼Ñ", -1, 6, 66, 60, 10 + LTEXT "ĐŸĐ°Ñ€Đ¾Đ»ÑŒ", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "&Đ¡Đ¾Ñ…Ñ€Đ°Đ½Đ¸Ñ‚ÑŒ ÑÑ‚Đ¾Ñ‚ Đ¿Đ°Ñ€Đ¾Đ»ÑŒ (Đ½ĐµĐ±ĐµĐ·Đ¾Đ¿Đ°ÑĐ½Đ¾!)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "ĐÑ‚Đ¼ĐµĐ½Đ°", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "ĐÑ‚Đ¼ĐµĐ½Đ°", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_Si.rc b/dll/win32/mpr/lang/mpr_Si.rc index cbbf4110d77..f22b76d1129 100644 --- a/dll/win32/mpr/lang/mpr_Si.rc +++ b/dll/win32/mpr/lang/mpr_Si.rc @@ -27,22 +27,22 @@ STRINGTABLE IDS_ENTIRENETWORK "Celotno omrežje" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Vnesite omrežno geslo" FONT 8, "MS Shell Dlg" { - LTEXT "Vnesite uporabniÅ¡ko ime in geslo:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Proksi", -1, 40, 26, 50, 10 -/* LTEXT "Kraljestvo", -1, 40, 46, 50, 10 */ - LTEXT "UporabniÅ¡ko ime", -1, 40, 66, 50, 10 - LTEXT "Geslo", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "Vnesite uporabniÅ¡ko ime in geslo:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Proksi", -1, 6, 26, 60, 10 +/* LTEXT "Kraljestvo", -1, 6, 46, 60, 10 */ + LTEXT "UporabniÅ¡ko ime", -1, 6, 66, 60, 10 + LTEXT "Geslo", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "&Shrani geslo (nezaÅ¡Äiteno)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "V redu", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "PrekliÄi", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "V redu", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "PrekliÄi", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_Sq.rc b/dll/win32/mpr/lang/mpr_Sq.rc index 42704a2c36e..253ba4e5270 100644 --- a/dll/win32/mpr/lang/mpr_Sq.rc +++ b/dll/win32/mpr/lang/mpr_Sq.rc @@ -25,22 +25,22 @@ STRINGTABLE IDS_ENTIRENETWORK "GjithĂ« Rrjeti" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "FjalĂ«kalimi i GjithĂ« Rrjetit" FONT 8, "MS Shell Dlg" { - LTEXT "Ju lutem shkruani emrin e pĂ«rdoruesit dhe fjalĂ«kalimin:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Proxi", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "PĂ«rdoruesi", -1, 40, 66, 50, 10 - LTEXT "FjalĂ«kalimi", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "Ju lutem shkruani emrin e pĂ«rdoruesit dhe fjalĂ«kalimin:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Proxi", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "PĂ«rdoruesi", -1, 6, 66, 60, 10 + LTEXT "FjalĂ«kalimi", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "&Ruaj kĂ«tĂ« fjalĂ«kalim (i pasigurt)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Anulo", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Anulo", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_Sv.rc b/dll/win32/mpr/lang/mpr_Sv.rc index 1f962cbf1e5..dbf23f1f789 100644 --- a/dll/win32/mpr/lang/mpr_Sv.rc +++ b/dll/win32/mpr/lang/mpr_Sv.rc @@ -25,22 +25,22 @@ STRINGTABLE IDS_ENTIRENETWORK "Hela nätverket" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Ange nätverkslösenord" FONT 8, "MS Shell Dlg" { - LTEXT "Ange ditt användarnamn och lösenord:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Proxy", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "Användare", -1, 40, 66, 50, 10 - LTEXT "Lösenord", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "Ange ditt användarnamn och lösenord:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Proxy", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "Användare", -1, 6, 66, 60, 10 + LTEXT "Lösenord", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "&Spara detta lösenord (osäkert)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Avbryt", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Avbryt", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_Tr.rc b/dll/win32/mpr/lang/mpr_Tr.rc index c4b26751dc6..9bfc624e039 100644 --- a/dll/win32/mpr/lang/mpr_Tr.rc +++ b/dll/win32/mpr/lang/mpr_Tr.rc @@ -25,22 +25,22 @@ STRINGTABLE IDS_ENTIRENETWORK "TĂ¼m AÄŸ" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "AÄŸ Åifresini Gir" FONT 8, "MS Shell Dlg" { - LTEXT "LĂ¼tfen kullanıcı adınızı ve ÅŸifrenizi giriniz:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Vekil", -1, 40, 26, 50, 10 -/* LTEXT "EriÅŸim Alanı", -1, 40, 46, 50, 10 */ - LTEXT "Kullanıcı", -1, 40, 66, 50, 10 - LTEXT "Åifre", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "LĂ¼tfen kullanıcı adınızı ve ÅŸifrenizi giriniz:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "Vekil", -1, 6, 26, 60, 10 +/* LTEXT "EriÅŸim Alanı", -1, 6, 46, 60, 10 */ + LTEXT "Kullanıcı", -1, 6, 66, 60, 10 + LTEXT "Åifre", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "&Bu Åifreyi Sakla (GĂ¼vensiz)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Tamam", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "İptal", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "Tamam", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "İptal", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_Uk.rc b/dll/win32/mpr/lang/mpr_Uk.rc index 68d3ae7a6a2..b6ebea462e7 100644 --- a/dll/win32/mpr/lang/mpr_Uk.rc +++ b/dll/win32/mpr/lang/mpr_Uk.rc @@ -29,22 +29,22 @@ STRINGTABLE IDS_ENTIRENETWORK "Đ’ÑÑ ĐœĐµÑ€ĐµĐ¶Đ°" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Đ’Đ²ĐµĐ´Ñ–Ñ‚ÑŒ ĐœĐµÑ€ĐµĐ¶Đ½Đ¸Đ¹ ĐŸĐ°Ñ€Đ¾Đ»ÑŒ" FONT 8, "MS Shell Dlg" { - LTEXT "Đ‘ÑƒĐ´ÑŒ лаÑĐºĐ°, Đ²Đ²ĐµĐ´Ñ–Ñ‚ÑŒ Đ’Đ°ÑˆÑ– Ñ–Đ¼'Ñ Ñ‚Đ° Đ¿Đ°Ñ€Đ¾Đ»ÑŒ:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "ĐŸÑ€Đ¾ĐºÑÑ–", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "ĐĐ¾Ñ€Đ¸ÑÑ‚ÑƒĐ²Đ°Ñ‡", -1, 40, 66, 50, 10 - LTEXT "ĐŸĐ°Ñ€Đ¾Đ»ÑŒ", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "Đ‘ÑƒĐ´ÑŒ лаÑĐºĐ°, Đ²Đ²ĐµĐ´Ñ–Ñ‚ÑŒ Đ’Đ°ÑˆÑ– Ñ–Đ¼'Ñ Ñ‚Đ° Đ¿Đ°Ñ€Đ¾Đ»ÑŒ:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "ĐŸÑ€Đ¾ĐºÑÑ–", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "ĐĐ¾Ñ€Đ¸ÑÑ‚ÑƒĐ²Đ°Ñ‡", -1, 6, 66, 60, 10 + LTEXT "ĐŸĐ°Ñ€Đ¾Đ»ÑŒ", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "&Đ—Đ±ĐµÑ€ĐµĐ³Ñ‚Đ¸ Ñ†ĐµĐ¹ Đ¿Đ°Ñ€Đ¾Đ»ÑŒ (Đ½ĐµĐ±ĐµĐ·Đ¿ĐµÑ‡Đ½Đ¾)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Đ¡ĐºĐ°ÑÑƒĐ²Đ°Ñ‚Đ¸", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Đ¡ĐºĐ°ÑÑƒĐ²Đ°Ñ‚Đ¸", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/lang/mpr_Zh.rc b/dll/win32/mpr/lang/mpr_Zh.rc index f88046420b8..9de1f666cd4 100644 --- a/dll/win32/mpr/lang/mpr_Zh.rc +++ b/dll/win32/mpr/lang/mpr_Zh.rc @@ -28,24 +28,24 @@ STRINGTABLE IDS_ENTIRENETWORK "整个网络" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "输入网络密ç " FONT 9, "MS Shell Dlg" { - LTEXT "请输入用户å和密ç :", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "代ç†", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "用户å", -1, 40, 66, 50, 10 - LTEXT "密ç ", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "请输入用户å和密ç :", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "代ç†", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "用户å", -1, 6, 66, 60, 10 + LTEXT "密ç ", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "ä¿å­˜å¯†ç (ä¸å®‰å…¨)(&S)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "ç¡®å®", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "å–æ¶ˆ", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "ç¡®å®", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "å–æ¶ˆ", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL @@ -55,22 +55,22 @@ STRINGTABLE IDS_ENTIRENETWORK "整個網路" } -IDD_PROXYDLG DIALOG 36, 24, 250, 154 +IDD_PROXYDLG DIALOG 36, 24, 228, 145 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "輸入網路密碼" FONT 9, "MS Shell Dlg" { - LTEXT "請輸入用戶å和密碼:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "代ç†", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "用戶å", -1, 40, 66, 50, 10 - LTEXT "密碼", -1, 40, 86, 50, 10 - LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "", IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + LTEXT "請輸入用戶å和密碼:", IDC_EXPLAIN, 6, 6, 150, 18 + LTEXT "代ç†", -1, 6, 26, 60, 10 +/* LTEXT "Realm", -1, 6, 46, 60, 10 */ + LTEXT "用戶å", -1, 6, 66, 60, 10 + LTEXT "密碼", -1, 6, 86, 60, 10 + LTEXT "", IDC_PROXY, 70, 26, 150, 14, 0 + LTEXT "", IDC_REALM, 70, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 70, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 70, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD CHECKBOX "儲存密碼(ä¸å®‰å…¨)(&S)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "確å®", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "å–æ¶ˆ", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + 70, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON "確å®", IDOK, 114, 126, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "å–æ¶ˆ", IDCANCEL, 170, 126, 50, 14, WS_GROUP | WS_TABSTOP } diff --git a/dll/win32/mpr/wnet.c b/dll/win32/mpr/wnet.c index 712c87a35a9..c9fecde03c2 100644 --- a/dll/win32/mpr/wnet.c +++ b/dll/win32/mpr/wnet.c @@ -1753,6 +1753,7 @@ static DWORD get_drive_connection( WCHAR letter, LPWSTR remote, LPDWORD size ) struct mountmgr_unix_drive *data = (struct mountmgr_unix_drive *)buffer; HANDLE mgr; DWORD ret = WN_NOT_CONNECTED; + DWORD bytes_returned; if ((mgr = CreateFileW( MOUNTMGR_DOS_DEVICE_NAME, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, @@ -1764,7 +1765,7 @@ static DWORD get_drive_connection( WCHAR letter, LPWSTR remote, LPDWORD size ) memset( data, 0, sizeof(*data) ); data->letter = letter; if (DeviceIoControl( mgr, IOCTL_MOUNTMGR_QUERY_UNIX_DRIVE, data, sizeof(*data), - data, sizeof(buffer), NULL, NULL )) + data, sizeof(buffer), &bytes_returned, NULL )) { char *p, *mount_point = buffer + data->mount_point_offset; DWORD len; diff --git a/dll/win32/secur32/lsalpc.c b/dll/win32/secur32/lsalpc.c index 31104f65d02..ab7a7e168e1 100644 --- a/dll/win32/secur32/lsalpc.c +++ b/dll/win32/secur32/lsalpc.c @@ -108,9 +108,11 @@ LsapOpenLsaPort(VOID) */ NTSTATUS NTAPI -LsaEnumerateLogonSessions(PULONG LogonSessionCount, - PLUID *LogonSessionList) +LsaEnumerateLogonSessions( + PULONG LogonSessionCount, + PLUID *LogonSessionList) { +#if 1 LSA_API_MSG ApiMessage; NTSTATUS Status; @@ -144,6 +146,10 @@ LsaEnumerateLogonSessions(PULONG LogonSessionCount, *LogonSessionList = ApiMessage.EnumLogonSessions.Reply.LogonSessionBuffer; return Status; +#else + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +#endif } @@ -152,11 +158,59 @@ LsaEnumerateLogonSessions(PULONG LogonSessionCount, */ NTSTATUS NTAPI -LsaGetLogonSessionData(PLUID LogonId, - PSECURITY_LOGON_SESSION_DATA *ppLogonSessionData) +LsaGetLogonSessionData( + PLUID LogonId, + PSECURITY_LOGON_SESSION_DATA *ppLogonSessionData) { +#if 1 + LSA_API_MSG ApiMessage; + PSECURITY_LOGON_SESSION_DATA SessionData; + NTSTATUS Status; + + TRACE("LsaGetLogonSessionData(%p %p)\n", LogonId, ppLogonSessionData); + + Status = LsapOpenLsaPort(); + if (!NT_SUCCESS(Status)) + return Status; + + ApiMessage.ApiNumber = LSASS_REQUEST_GET_LOGON_SESSION_DATA; + ApiMessage.h.u1.s1.DataLength = LSA_PORT_DATA_SIZE(ApiMessage.GetLogonSessionData); + ApiMessage.h.u1.s1.TotalLength = LSA_PORT_MESSAGE_SIZE; + ApiMessage.h.u2.ZeroInit = 0; + + RtlCopyLuid(&ApiMessage.GetLogonSessionData.Request.LogonId, + LogonId); + + Status = NtRequestWaitReplyPort(LsaPortHandle, + (PPORT_MESSAGE)&ApiMessage, + (PPORT_MESSAGE)&ApiMessage); + if (!NT_SUCCESS(Status)) + { + ERR("NtRequestWaitReplyPort() failed (Status 0x%08lx)\n", Status); + return Status; + } + + if (!NT_SUCCESS(ApiMessage.Status)) + { + ERR("NtRequestWaitReplyPort() failed (ApiMessage.Status 0x%08lx)\n", ApiMessage.Status); + return ApiMessage.Status; + } + + SessionData = ApiMessage.GetLogonSessionData.Reply.SessionDataBuffer; + + if (SessionData->UserName.Buffer != NULL) + SessionData->UserName.Buffer = (LPWSTR)((ULONG_PTR)&SessionData->UserName.Buffer + (ULONG_PTR)SessionData->UserName.Buffer); + + if (SessionData->Sid != NULL) + SessionData->Sid = (LPWSTR)((ULONG_PTR)&SessionData->Sid + (ULONG_PTR)SessionData->Sid); + + *ppLogonSessionData = SessionData; + + return Status; +#else UNIMPLEMENTED; return STATUS_NOT_IMPLEMENTED; +#endif } diff --git a/include/dxsdk/d3drmwin.h b/include/dxsdk/d3drmwin.h deleted file mode 100644 index d6de2dd3509..00000000000 --- a/include/dxsdk/d3drmwin.h +++ /dev/null @@ -1,28 +0,0 @@ - -#ifndef __D3DRMWIN_H__ -#define __D3DRMWIN_H__ - -#ifndef WIN32 -#define WIN32 -#endif - -#include "d3drm.h" -#include "ddraw.h" -#include "d3d.h" - -#undef INTERFACE -#define INTERFACE IDirect3DRMWinDevice - -DECLARE_INTERFACE_(IDirect3DRMWinDevice, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - STDMETHOD(HandlePaint) (THIS_ HDC hdc) PURE; - STDMETHOD(HandleActivate) (THIS_ WORD wparam) PURE; -}; - -DEFINE_GUID(IID_IDirect3DRMWinDevice, 0xC5016CC0, 0xD273, 0x11CE, 0xAC, 0x48, 0x0, 0x0, 0xC0, 0x38, 0x25, 0xA1); -WIN_TYPES(IDirect3DRMWinDevice, DIRECT3DRMWINDEVICE); - -#endif - diff --git a/include/dxsdk/dsdriver.h b/include/dxsdk/dsdriver.h new file mode 100644 index 00000000000..bb7f4c60316 --- /dev/null +++ b/include/dxsdk/dsdriver.h @@ -0,0 +1,366 @@ +/* + * DirectSound driver + * (DirectX 5 version) + * + * Copyright (C) 2000 Ove Kaaven + * + * 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 + */ + +#ifndef __WINE_DSDRIVER_H +#define __WINE_DSDRIVER_H + +#ifdef __cplusplus +extern "C" { +#endif + +/***************************************************************************** + * Predeclare the interfaces + */ +DEFINE_GUID(IID_IDsDriver, 0x8C4233C0l, 0xB4CC, 0x11CE, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00); +typedef struct IDsDriver *PIDSDRIVER; + +DEFINE_GUID(IID_IDsDriverBuffer, 0x8C4233C1l, 0xB4CC, 0x11CE, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00); +typedef struct IDsDriverBuffer *PIDSDRIVERBUFFER; + +DEFINE_GUID(IID_IDsDriverPropertySet, 0x0F6F2E8E0, 0xD842, 0x11D0, 0x8F, 0x75, 0x00, 0xC0, 0x4F, 0xC2, 0x8A, 0xCA); +typedef struct IDsDriverPropertySet *PIDSDRIVERPROPERTYSET; + +DEFINE_GUID(IID_IDsDriverNotify, 0x00363EF44, 0x3B57, 0x11D3, 0xAC, 0x79, 0x00, 0x10, 0x5A, 0x01, 0x7f, 0xe1); +typedef struct IDsDriverNotify *PIDSDRIVERNOTIFY; + +DEFINE_GUID(IID_IDsCaptureDriver, 0x03DD10C47, 0x74FB, 0x11D3, 0x90, 0x49, 0xCB, 0xB4, 0xB3, 0x2E, 0xAA, 0x08); +typedef struct IDsCaptureDriver *PIDSCDRIVER; + +DEFINE_GUID(IID_IDsCaptureDriverBuffer, 0x03DD10C48, 0x74FB, 0x11D3, 0x90, 0x49, 0xCB, 0xB4, 0xB3, 0x2E, 0xAA, 0x08); +typedef struct IDsCaptureDriverBuffer *PIDSCDRIVERBUFFER; + +#define DSDDESC_DOMMSYSTEMOPEN 0x00000001 +#define DSDDESC_DOMMSYSTEMSETFORMAT 0x00000002 +#define DSDDESC_USESYSTEMMEMORY 0x00000004 +#define DSDDESC_DONTNEEDPRIMARYLOCK 0x00000008 +#define DSDDESC_DONTNEEDSECONDARYLOCK 0x00000010 +#define DSDDESC_DONTNEEDWRITELEAD 0x00000020 + +#define DSDHEAP_NOHEAP 0 +#define DSDHEAP_CREATEHEAP 1 +#define DSDHEAP_USEDIRECTDRAWHEAP 2 +#define DSDHEAP_PRIVATEHEAP 3 + +typedef struct _DSDRIVERDESC +{ + DWORD dwFlags; + CHAR szDesc[256]; + CHAR szDrvname[256]; + DWORD dnDevNode; + WORD wVxdId; + WORD wReserved; + ULONG ulDeviceNum; + DWORD dwHeapType; + LPVOID pvDirectDrawHeap; + DWORD dwMemStartAddress; + DWORD dwMemEndAddress; + DWORD dwMemAllocExtra; + LPVOID pvReserved1; + LPVOID pvReserved2; +} DSDRIVERDESC,*PDSDRIVERDESC; + +typedef struct _DSDRIVERCAPS +{ + DWORD dwFlags; + DWORD dwMinSecondarySampleRate; + DWORD dwMaxSecondarySampleRate; + DWORD dwPrimaryBuffers; + DWORD dwMaxHwMixingAllBuffers; + DWORD dwMaxHwMixingStaticBuffers; + DWORD dwMaxHwMixingStreamingBuffers; + DWORD dwFreeHwMixingAllBuffers; + DWORD dwFreeHwMixingStaticBuffers; + DWORD dwFreeHwMixingStreamingBuffers; + DWORD dwMaxHw3DAllBuffers; + DWORD dwMaxHw3DStaticBuffers; + DWORD dwMaxHw3DStreamingBuffers; + DWORD dwFreeHw3DAllBuffers; + DWORD dwFreeHw3DStaticBuffers; + DWORD dwFreeHw3DStreamingBuffers; + DWORD dwTotalHwMemBytes; + DWORD dwFreeHwMemBytes; + DWORD dwMaxContigFreeHwMemBytes; +} DSDRIVERCAPS,*PDSDRIVERCAPS; + +typedef struct _DSVOLUMEPAN +{ + DWORD dwTotalLeftAmpFactor; + DWORD dwTotalRightAmpFactor; + LONG lVolume; + DWORD dwVolAmpFactor; + LONG lPan; + DWORD dwPanLeftAmpFactor; + DWORD dwPanRightAmpFactor; +} DSVOLUMEPAN,*PDSVOLUMEPAN; + +typedef union _DSPROPERTY +{ + struct { + GUID Set; + ULONG Id; + ULONG Flags; + ULONG InstanceId; + } DUMMYSTRUCTNAME; + ULONGLONG Alignment; +} DSPROPERTY,*PDSPROPERTY; + +typedef struct _DSCDRIVERCAPS +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwFormats; + DWORD dwChannels; +} DSCDRIVERCAPS,*PDSCDRIVERCAPS; + +/***************************************************************************** + * IDsDriver interface + */ +#define INTERFACE IDsDriver +DECLARE_INTERFACE_(IDsDriver,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDsDriver methods ***/ + STDMETHOD(GetDriverDesc)(THIS_ PDSDRIVERDESC pDsDriverDesc) PURE; + STDMETHOD(Open)(THIS) PURE; + STDMETHOD(Close)(THIS) PURE; + STDMETHOD(GetCaps)(THIS_ PDSDRIVERCAPS pDsDrvCaps) PURE; + STDMETHOD(CreateSoundBuffer)(THIS_ LPWAVEFORMATEX pwfx,DWORD dwFlags,DWORD dwCardAddress,LPDWORD pdwcbBufferSize,LPBYTE *ppbBuffer,LPVOID *ppvObj) PURE; + STDMETHOD(DuplicateSoundBuffer)(THIS_ PIDSDRIVERBUFFER pIDsDriverBuffer,LPVOID *ppvObj) PURE; +}; +#undef INTERFACE + +#if !defined (__cplusplus) || defined(CINTERFACE) + /*** IUnknown methods ***/ +#define IDsDriver_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDsDriver_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDsDriver_Release(p) (p)->lpVtbl->Release(p) + /*** IDsDriver methods ***/ +#define IDsDriver_GetDriverDesc(p,a) (p)->lpVtbl->GetDriverDesc(p,a) +#define IDsDriver_Open(p) (p)->lpVtbl->Open(p) +#define IDsDriver_Close(p) (p)->lpVtbl->Close(p) +#define IDsDriver_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDsDriver_CreateSoundBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c,d,e,f) +#define IDsDriver_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b) +#endif + +/***************************************************************************** + * IDsDriverBuffer interface + */ +#define INTERFACE IDsDriverBuffer +DECLARE_INTERFACE_(IDsDriverBuffer,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDsDriverBuffer methods ***/ + STDMETHOD(Lock)(THIS_ LPVOID *ppvAudio1,LPDWORD pdwLen1,LPVOID *pdwAudio2,LPDWORD pdwLen2,DWORD dwWritePosition,DWORD dwWriteLen,DWORD dwFlags) PURE; + STDMETHOD(Unlock)(THIS_ LPVOID pvAudio1,DWORD dwLen1,LPVOID pvAudio2,DWORD dwLen2) PURE; + STDMETHOD(SetFormat)(THIS_ LPWAVEFORMATEX pwfxToSet) PURE; + STDMETHOD(SetFrequency)(THIS_ DWORD dwFrequency) PURE; + STDMETHOD(SetVolumePan)(THIS_ PDSVOLUMEPAN pDsVolumePan) PURE; + STDMETHOD(SetPosition)(THIS_ DWORD dwNewPosition) PURE; + STDMETHOD(GetPosition)(THIS_ LPDWORD lpdwCurrentPlayCursor,LPDWORD lpdwCurrentWriteCursor) PURE; + STDMETHOD(Play)(THIS_ DWORD dwReserved1,DWORD dwReserved2,DWORD dwFlags) PURE; + STDMETHOD(Stop)(THIS) PURE; +}; +#undef INTERFACE + +#if !defined (__cplusplus) || defined(CINTERFACE) + /*** IUnknown methods ***/ +#define IDsDriverBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDsDriverBuffer_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDsDriverBuffer_Release(p) (p)->lpVtbl->Release(p) + /*** IDsDriverBuffer methods ***/ +#define IDsDriverBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g) +#define IDsDriverBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d) +#define IDsDriverBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a) +#define IDsDriverBuffer_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a) +#define IDsDriverBuffer_SetVolumePan(p,a) (p)->lpVtbl->SetVolumePan(p,a) +#define IDsDriverBuffer_SetPosition(p,a) (p)->lpVtbl->SetPosition(p,a) +#define IDsDriverBuffer_GetPosition(p,a,b) (p)->lpVtbl->GetPosition(p,a,b) +#define IDsDriverBuffer_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c) +#define IDsDriverBuffer_Stop(p) (p)->lpVtbl->Stop(p) +#endif + +/***************************************************************************** + * IDsDriverPropertySet interface + */ +#define INTERFACE IDsDriverPropertySet +DECLARE_INTERFACE_(IDsDriverPropertySet,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDsDriverPropertySet methods ***/ + STDMETHOD(Get)(THIS_ PDSPROPERTY pDsProperty,LPVOID pPropertyParams,ULONG cbPropertyParams,LPVOID pPropertyData,ULONG cbPropertyData,PULONG pcbReturnedData) PURE; + STDMETHOD(Set)(THIS_ PDSPROPERTY pDsProperty,LPVOID pPropertyParams,ULONG cbPropertyParams,LPVOID pPropertyData,ULONG cbPropertyData) PURE; + STDMETHOD(QuerySupport)(THIS_ REFGUID PropertySetId,ULONG PropertyId,PULONG pSupport) PURE; +}; +#undef INTERFACE + +#if !defined (__cplusplus) || defined(CINTERFACE) + /*** IUnknown methods ***/ +#define IDsDriverPropertySet_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDsDriverPropertySet_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDsDriverPropertySet_Release(p) (p)->lpVtbl->Release(p) + /*** IDsDriverPropertySet methods ***/ +#define IDsDriverPropertySet_Get(p,a,b,c,d,e,f) (p)->lpVtbl->Get(p,a,b,c,d,e,f) +#define IDsDriverPropertySet_Set(p,a,b,c,d,e) (p)->lpVtbl->Set(p,a,b,c,d,e) +#define IDsDriverPropertySet_QuerySupport(p,a,b,c) (p)->lpVtbl->QuerySupport(p,a,b,c) +#endif + +/* Defined property sets */ +DEFINE_GUID(DSPROPSETID_DirectSound3DListener, 0x6D047B40, 0x7AF9, 0x11D0, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0); +typedef enum +{ + DSPROPERTY_DIRECTSOUND3DLISTENER_ALL, + DSPROPERTY_DIRECTSOUND3DLISTENER_POSITION, + DSPROPERTY_DIRECTSOUND3DLISTENER_VELOCITY, + DSPROPERTY_DIRECTSOUND3DLISTENER_ORIENTATION, + DSPROPERTY_DIRECTSOUND3DLISTENER_DISTANCEFACTOR, + DSPROPERTY_DIRECTSOUND3DLISTENER_ROLLOFFFACTOR, + DSPROPERTY_DIRECTSOUND3DLISTENER_DOPPLERFACTOR, + DSPROPERTY_DIRECTSOUND3DLISTENER_BATCH, + DSPROPERTY_DIRECTSOUND3DLISTENER_ALLOCATION +} DSPROPERTY_DIRECTSOUND3DLISTENER; + +DEFINE_GUID(DSPROPSETID_DirectSound3DBuffer, 0x6D047B41, 0x7AF9, 0x11D0, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0); +typedef enum +{ + DSPROPERTY_DIRECTSOUND3DBUFFER_ALL, + DSPROPERTY_DIRECTSOUND3DBUFFER_POSITION, + DSPROPERTY_DIRECTSOUND3DBUFFER_VELOCITY, + DSPROPERTY_DIRECTSOUND3DBUFFER_CONEANGLES, + DSPROPERTY_DIRECTSOUND3DBUFFER_CONEORIENTATION, + DSPROPERTY_DIRECTSOUND3DBUFFER_CONEOUTSIDEVOLUME, + DSPROPERTY_DIRECTSOUND3DBUFFER_MINDISTANCE, + DSPROPERTY_DIRECTSOUND3DBUFFER_MAXDISTANCE, + DSPROPERTY_DIRECTSOUND3DBUFFER_MODE +} DSPROPERTY_DIRECTSOUND3DBUFFER; + +DEFINE_GUID(DSPROPSETID_DirectSoundSpeakerConfig, 0x6D047B42, 0x7AF9, 0x11D0, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0); +typedef enum +{ + DSPROPERTY_DIRECTSOUNDSPEAKERCONFIG_SPEAKERCONFIG +} DSPROPERTY_DIRECTSOUNDSPEAKERCONFIG; + +/***************************************************************************** + * IDsDriverNotify interface + */ +#define INTERFACE IDsDriverNotify +DECLARE_INTERFACE_(IDsDriverNotify,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDsDriverNotify methods ***/ + STDMETHOD(SetNotificationPositions)(THIS_ DWORD dwPositionNotifies,LPCDSBPOSITIONNOTIFY pcPositionNotifies) PURE; +}; +#undef INTERFACE + +#if !defined (__cplusplus) || defined(CINTERFACE) + /*** IUnknown methods ***/ +#define IDsDriverNotify_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDsDriverNotify_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDsDriverNotify_Release(p) (p)->lpVtbl->Release(p) + /*** IDsDriverNotify methods ***/ +#define IDsDriverNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b) +#endif + +/***************************************************************************** + * IDsCaptureDriver interface + */ +#define INTERFACE IDsCaptureDriver +DECLARE_INTERFACE_(IDsCaptureDriver,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDsCaptureDriver methods ***/ + STDMETHOD(GetDriverDesc)(THIS_ PDSDRIVERDESC pDsDriverDesc) PURE; + STDMETHOD(Open)(THIS) PURE; + STDMETHOD(Close)(THIS) PURE; + STDMETHOD(GetCaps)(THIS_ PDSCDRIVERCAPS pDsDrvCaps) PURE; + STDMETHOD(CreateCaptureBuffer)(THIS_ LPWAVEFORMATEX pwfx,DWORD dwFlags,DWORD dwCardAddress,LPDWORD pdwcbBufferSize,LPBYTE *ppbBuffer,LPVOID *ppvObj) PURE; +}; +#undef INTERFACE + +#if !defined (__cplusplus) || defined(CINTERFACE) + /*** IUnknown methods ***/ +#define IDsCaptureDriver_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDsCaptureDriver_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDsCaptureDriver_Release(p) (p)->lpVtbl->Release(p) + /*** IDsCaptureDriver methods ***/ +#define IDsCaptureDriver_GetDriverDesc(p,a) (p)->lpVtbl->GetDriverDesc(p,a) +#define IDsCaptureDriver_Open(p) (p)->lpVtbl->Open(p) +#define IDsCaptureDriver_Close(p) (p)->lpVtbl->Close(p) +#define IDsCaptureDriver_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDsCaptureDriver_CreateCaptureBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c,d,e,f) +#endif + +/***************************************************************************** + * IDsCaptureDriverBuffer interface + */ +#define INTERFACE IDsCaptureDriverBuffer +DECLARE_INTERFACE_(IDsCaptureDriverBuffer,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDsCaptureDriverBuffer methods ***/ + STDMETHOD(Lock)(THIS_ LPVOID *ppvAudio1,LPDWORD pdwLen1,LPVOID *ppvAudio2,LPDWORD pdwLen2,DWORD dwWritePosition,DWORD dwWriteLen,DWORD dwFlags) PURE; + STDMETHOD(Unlock)(THIS_ LPVOID pvAudio1,DWORD dwLen1,LPVOID pvAudio2,DWORD dwLen2) PURE; + STDMETHOD(SetFormat)(THIS_ LPWAVEFORMATEX pwfxToSet) PURE; + STDMETHOD(GetPosition)(THIS_ LPDWORD lpdwCurrentPlayCursor,LPDWORD lpdwCurrentWriteCursor) PURE; + STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE; + STDMETHOD(Start)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(Stop)(THIS) PURE; +}; +#undef INTERFACE + +#if !defined (__cplusplus) || defined(CINTERFACE) + /*** IUnknown methods ***/ +#define IDsCaptureDriverBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDsCaptureDriverBuffer_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDsCaptureDriverBuffer_Release(p) (p)->lpVtbl->Release(p) + /*** IDsCaptureDriverBuffer methods ***/ +#define IDsCaptureDriverBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g) +#define IDsCaptureDriverBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d) +#define IDsCaptureDriverBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a) +#define IDsCaptureDriverBuffer_GetPosition(p,a,b) (p)->lpVtbl->GetPosition(p,a,b) +#define IDsCaptureDriverBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a) +#define IDsCaptureDriverBuffer_Start(p,a) (p)->lpVtbl->Start(p,a) +#define IDsCaptureDriverBuffer_Stop(p) (p)->lpVtbl->Stop(p) +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __WINE_DSDRIVER_H */ diff --git a/include/dxsdk/dxfile.h b/include/dxsdk/dxfile.h index 9eab71a1f4a..bfa6f0eac4f 100644 --- a/include/dxsdk/dxfile.h +++ b/include/dxsdk/dxfile.h @@ -260,7 +260,10 @@ DEFINE_GUID(TID_DXFILEHeader, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x /* DirectX File errors */ #define _FACDD 0x876 + +#ifndef MAKE_DDHRESULT #define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) +#endif #define DXFILE_OK 0 diff --git a/include/ndk/cmtypes.h b/include/ndk/cmtypes.h index bb208837970..44133ade125 100644 --- a/include/ndk/cmtypes.h +++ b/include/ndk/cmtypes.h @@ -296,6 +296,7 @@ typedef struct _KEY_FULL_INFORMATION typedef struct _KEY_NAME_INFORMATION { + ULONG NameLength; WCHAR Name[1]; } KEY_NAME_INFORMATION, *PKEY_NAME_INFORMATION; diff --git a/include/psdk/d3drm.h b/include/psdk/d3drm.h index 316890074a0..07e39c19327 100644 --- a/include/psdk/d3drm.h +++ b/include/psdk/d3drm.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2005 Peter Berg Larsen + * Copyright (C) 2010 Christian Costa * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,8 +21,14 @@ #define __D3DRM_H__ #include -/* #include */ +typedef struct IDirect3DRM *LPDIRECT3DRM, **LPLPDIRECT3DRM; + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* Direct3DRM Object CLSID */ DEFINE_GUID(CLSID_CDirect3DRM, 0x4516ec41, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); @@ -31,4 +38,487 @@ DEFINE_GUID(IID_IDirect3DRM, 0x2bc49361, 0x8327, 0x11cf, 0xac, 0x DEFINE_GUID(IID_IDirect3DRM2, 0x4516ecc8, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); DEFINE_GUID(IID_IDirect3DRM3, 0x4516ec83, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); +typedef struct IDirect3DRM2 *LPDIRECT3DRM2, **LPLPDIRECT3DRM2; +typedef struct IDirect3DRM3 *LPDIRECT3DRM3, **LPLPDIRECT3DRM3; + +HRESULT WINAPI Direct3DRMCreate(struct IDirect3DRM **d3drm); + +/***************************************************************************** + * IDirect3DRMObject interface + */ +#ifdef WINE_NO_UNICODE_MACROS +#undef GetClassName +#endif +#define INTERFACE IDirect3DRM +DECLARE_INTERFACE_(IDirect3DRM,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRM methods ***/ + STDMETHOD(CreateObject)(THIS_ REFCLSID clsid, IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(CreateFrame)(THIS_ IDirect3DRMFrame *parent, IDirect3DRMFrame **frame) PURE; + STDMETHOD(CreateMesh)(THIS_ IDirect3DRMMesh **mesh) PURE; + STDMETHOD(CreateMeshBuilder)(THIS_ IDirect3DRMMeshBuilder **mesh_builder) PURE; + STDMETHOD(CreateFace)(THIS_ IDirect3DRMFace **face) PURE; + STDMETHOD(CreateAnimation)(THIS_ IDirect3DRMAnimation **animation) PURE; + STDMETHOD(CreateAnimationSet)(THIS_ IDirect3DRMAnimationSet **set) PURE; + STDMETHOD(CreateTexture)(THIS_ D3DRMIMAGE *image, IDirect3DRMTexture **texture) PURE; + STDMETHOD(CreateLight)(THIS_ D3DRMLIGHTTYPE type, D3DCOLOR color, IDirect3DRMLight **light) PURE; + STDMETHOD(CreateLightRGB)(THIS_ D3DRMLIGHTTYPE type, D3DVALUE r, D3DVALUE g, D3DVALUE b, + IDirect3DRMLight **light) PURE; + STDMETHOD(CreateMaterial)(THIS_ D3DVALUE power, IDirect3DRMMaterial **material) PURE; + STDMETHOD(CreateDevice)(THIS_ DWORD width, DWORD height, IDirect3DRMDevice **device) PURE; + STDMETHOD(CreateDeviceFromSurface)(THIS_ GUID *guid, IDirectDraw *ddraw, + IDirectDrawSurface *surface, IDirect3DRMDevice **device) PURE; + STDMETHOD(CreateDeviceFromD3D)(THIS_ IDirect3D *d3d, IDirect3DDevice *d3d_device, + IDirect3DRMDevice **device) PURE; + STDMETHOD(CreateDeviceFromClipper)(THIS_ IDirectDrawClipper *clipper, GUID *guid, + int width, int height, IDirect3DRMDevice **device) PURE; + STDMETHOD(CreateTextureFromSurface)(THIS_ IDirectDrawSurface *surface, + IDirect3DRMTexture **texture) PURE; + STDMETHOD(CreateShadow)(THIS_ IDirect3DRMVisual *visual, IDirect3DRMLight *light, + D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, + IDirect3DRMVisual **shadow) PURE; + STDMETHOD(CreateViewport)(THIS_ IDirect3DRMDevice *device, IDirect3DRMFrame *camera, + DWORD x, DWORD y, DWORD width, DWORD height, IDirect3DRMViewport **viewport) PURE; + STDMETHOD(CreateWrap)(THIS_ D3DRMWRAPTYPE type, IDirect3DRMFrame *reference, D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, + D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov, + D3DVALUE su, D3DVALUE sv, IDirect3DRMWrap **wrap) PURE; + STDMETHOD(CreateUserVisual)(THIS_ D3DRMUSERVISUALCALLBACK cb, void *ctx, IDirect3DRMUserVisual **visual) PURE; + STDMETHOD(LoadTexture)(THIS_ const char *filename, IDirect3DRMTexture **texture) PURE; + STDMETHOD(LoadTextureFromResource)(THIS_ HRSRC resource, IDirect3DRMTexture **texture) PURE; + STDMETHOD(SetSearchPath)(THIS_ const char *path) PURE; + STDMETHOD(AddSearchPath)(THIS_ const char *path) PURE; + STDMETHOD(GetSearchPath)(THIS_ DWORD *size, char *path) PURE; + STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE; + STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE; + STDMETHOD(GetDevices)(THIS_ IDirect3DRMDeviceArray **array) PURE; + STDMETHOD(GetNamedObject)(THIS_ const char *name, IDirect3DRMObject **object) PURE; + STDMETHOD(EnumerateObjects)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(Load)(THIS_ void *source, void *object_id, IID **iids, DWORD iid_count, D3DRMLOADOPTIONS flags, + D3DRMLOADCALLBACK load_cb, void *load_ctx, D3DRMLOADTEXTURECALLBACK load_tex_cb, void *load_tex_ctx, + IDirect3DRMFrame *parent_frame) PURE; + STDMETHOD(Tick)(THIS_ D3DVALUE) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRM_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRM_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRM_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRM methods ***/ +#define IDirect3DRM_CreateObject(p,a,b,c,d) (p)->lpVtbl->CreateObject(p,a,b,d) +#define IDirect3DRM_CreateFrame(p,a,b) (p)->lpVtbl->CreateFrame(p,a,b) +#define IDirect3DRM_CreateMesh(p,a) (p)->lpVtbl->CreateMesh(p,a) +#define IDirect3DRM_CreateMeshBuilder(p,a) (p)->lpVtbl->CreateMeshBuilder(p,a) +#define IDirect3DRM_CreateFace(p,a) (p)->lpVtbl->CreateFace(p,a) +#define IDirect3DRM_CreateAnimation(p,a) (p)->lpVtbl->CreateAnimation(p,a) +#define IDirect3DRM_CreateAnimationSet(p,a) (p)->lpVtbl->CreateAnimationSet(p,a) +#define IDirect3DRM_CreateTexture(p,a,b) (p)->lpVtbl->CreateTexture(p,a,b) +#define IDirect3DRM_CreateLight(p,a,b,c) (p)->lpVtbl->CreateLight(p,a,b,c) +#define IDirect3DRM_CreateLightRGB(p,a,b,c,d,e) (p)->lpVtbl->CreateLightRGB(p,a,b,c,d,e) +#define IDirect3DRM_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b) +#define IDirect3DRM_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) +#define IDirect3DRM_CreateDeviceFromSurface(p,a,b,c,d) (p)->lpVtbl->CreateDeviceFromSurface(p,a,b,c,d) +#define IDirect3DRM_CreateDeviceFromD3D(p,a,b,c) (p)->lpVtbl->CreateDeviceFromD3D(p,a,b,c) +#define IDirect3DRM_CreateDeviceFromClipper(p,a,b,c,d,e) (p)->lpVtbl->CreateDeviceFromClipper(p,a,b,c,d,e) +#define IDirect3DRM_CreateTextureFromSurface(p,a,b) (p)->lpVtbl->CreateTextureFromSurface(p,a,b) +#define IDirect3DRM_CreateShadow(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateShadow(p,a,b,c,d,e,f,g,h,i) +#define IDirect3DRM_CreateViewport(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateViewport(p,a,b,c,d,e,f,g) +#define IDirect3DRM_CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) (p)->lpVtbl->CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) +#define IDirect3DRM_CreateUserVisual(p,a,b,c) (p)->lpVtbl->CreateUserVisual(p,a,b,c) +#define IDirect3DRM_LoadTexture(p,a,b) (p)->lpVtbl->LoadTexture(p,a,b) +#define IDirect3DRM_LoadTextureFromResource(p,a,b) (p)->lpVtbl->LoadTextureFromResource(p,a,b) +#define IDirect3DRM_SetSearchPath(p,a) (p)->lpVtbl->SetSearchPath(p,a) +#define IDirect3DRM_AddSearchPath(p,a) (p)->lpVtbl->AddSearchPath(p,a) +#define IDirect3DRM_GetSearchPath(p,a,b) (p)->lpVtbl->GetSearchPath(p,a,b) +#define IDirect3DRM_SetDefaultTextureColors(p,a) (p)->lpVtbl->SetDefaultTextureColors(p,a) +#define IDirect3DRM_SetDefaultTextureShades(p,a) (p)->lpVtbl->SetDefaultTextureShades(p,a) +#define IDirect3DRM_GetDevices(p,a) (p)->lpVtbl->GetDevices(p,a) +#define IDirect3DRM_GetNamedObject(p,a,b) (p)->lpVtbl->GetNamedObject(p,a,b) +#define IDirect3DRM_EnumerateObjects(p,a,b) (p)->lpVtbl->EnumerateObjects(p,a,b) +#define IDirect3DRM_Load(p,a,b,c,d,e,f,g,h,i,j) (p)->lpVtbl->Load(p,a,b,c,d,e,f,g,h,i,j) +#define IDirect3DRM_Tick(p,a) (p)->lpVtbl->Tick(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DRM_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRM_AddRef(p) (p)->AddRef() +#define IDirect3DRM_Release(p) (p)->Release() +/*** IDirect3DRM methods ***/ +#define IDirect3DRM_CreateObject(p,a,b,c,d) (p)->CreateObject(a,b,d) +#define IDirect3DRM_CreateFrame(p,a,b) (p)->CreateFrame(a,b) +#define IDirect3DRM_CreateMesh(p,a) (p)->CreateMesh(a) +#define IDirect3DRM_CreateMeshBuilder(p,a) (p)->CreateMeshBuilder(a) +#define IDirect3DRM_CreateFace(p,a) (p)->CreateFace(a) +#define IDirect3DRM_CreateAnimation(p,a) (p)->CreateAnimation(a) +#define IDirect3DRM_CreateAnimationSet(p,a) (p)->CreateAnimationSet(a) +#define IDirect3DRM_CreateTexture(p,a,b) (p)->CreateTexture(a,b) +#define IDirect3DRM_CreateLight(p,a,b,c) (p)->CreateLight(a,b,c) +#define IDirect3DRM_CreateLightRGB(p,a,b,c,d,e) (p)->CreateLightRGB(a,b,c,d,e) +#define IDirect3DRM_CreateMaterial(p,a,b) (p)->CreateMaterial(a,b) +#define IDirect3DRM_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) +#define IDirect3DRM_CreateDeviceFromSurface(p,a,b,c,d) (p)->CreateDeviceFromSurface(a,b,c,d) +#define IDirect3DRM_CreateDeviceFromD3D(p,a,b,c) (p)->CreateDeviceFromD3D(a,b,c) +#define IDirect3DRM_CreateDeviceFromClipper(p,a,b,c,d,e) (p)->CreateDeviceFromClipper(a,b,c,d,e) +#define IDirect3DRM_CreateTextureFromSurface(p,a,b) (p)->CreateTextureFromSurface(a,b) +#define IDirect3DRM_CreateShadow(p,a,b,c,d,e,f,g,h,i) (p)->CreateShadow(a,b,c,d,e,f,g,h,i) +#define IDirect3DRM_CreateViewport(p,a,b,c,d,e,f,g) (p)->CreateViewport(a,b,c,d,e,f,g) +#define IDirect3DRM_CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) (p)->CreateWrap(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) +#define IDirect3DRM_CreateUserVisual(p,a,b,c) (p)->CreateUserVisual(a,b,c) +#define IDirect3DRM_LoadTexture(p,a,b) (p)->LoadTexture(a,b) +#define IDirect3DRM_LoadTextureFromResource(p,a,b) (p)->LoadTextureFromResource(a,b) +#define IDirect3DRM_SetSearchPath(p,a) (p)->SetSearchPath(a) +#define IDirect3DRM_AddSearchPath(p,a) (p)->AddSearchPath(a) +#define IDirect3DRM_GetSearchPath(p,a,b) (p)->GetSearchPath(a,b) +#define IDirect3DRM_SetDefaultTextureColors(p,a) (p)->SetDefaultTextureColors(a) +#define IDirect3DRM_SetDefaultTextureShades(p,a) (p)->SetDefaultTextureShades(a) +#define IDirect3DRM_GetDevices(p,a) (p)->GetDevices(a) +#define IDirect3DRM_GetNamedObject(p,a,b) (p)->GetNamedObject(a,b) +#define IDirect3DRM_EnumerateObjects(p,a,b) (p)->EnumerateObjects(a,b) +#define IDirect3DRM_Load(p,a,b,c,d,e,f,g,h,i,j) (p)->Load(a,b,c,d,e,f,g,h,i,j) +#define IDirect3DRM_Tick(p,a) (p)->Tick(a) +#endif + +/***************************************************************************** + * IDirect3DRM2 interface + */ +#ifdef WINE_NO_UNICODE_MACROS +#undef GetClassName +#endif +#define INTERFACE IDirect3DRM2 +DECLARE_INTERFACE_(IDirect3DRM2,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRM2 methods ***/ + STDMETHOD(CreateObject)(THIS_ REFCLSID clsid, IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(CreateFrame)(THIS_ IDirect3DRMFrame *parent, IDirect3DRMFrame2 **frame) PURE; + STDMETHOD(CreateMesh)(THIS_ IDirect3DRMMesh **mesh) PURE; + STDMETHOD(CreateMeshBuilder)(THIS_ IDirect3DRMMeshBuilder2 **mesh_builder) PURE; + STDMETHOD(CreateFace)(THIS_ IDirect3DRMFace **face) PURE; + STDMETHOD(CreateAnimation)(THIS_ IDirect3DRMAnimation **animation) PURE; + STDMETHOD(CreateAnimationSet)(THIS_ IDirect3DRMAnimationSet **set) PURE; + STDMETHOD(CreateTexture)(THIS_ D3DRMIMAGE *image, IDirect3DRMTexture2 **texture) PURE; + STDMETHOD(CreateLight)(THIS_ D3DRMLIGHTTYPE type, D3DCOLOR color, IDirect3DRMLight **light) PURE; + STDMETHOD(CreateLightRGB)(THIS_ D3DRMLIGHTTYPE type, D3DVALUE r, D3DVALUE g, D3DVALUE b, + IDirect3DRMLight **light) PURE; + STDMETHOD(CreateMaterial)(THIS_ D3DVALUE power, IDirect3DRMMaterial **material) PURE; + STDMETHOD(CreateDevice)(THIS_ DWORD width, DWORD height, IDirect3DRMDevice2 **device) PURE; + STDMETHOD(CreateDeviceFromSurface)(THIS_ GUID *guid, IDirectDraw *ddraw, + IDirectDrawSurface *surface, IDirect3DRMDevice2 **device) PURE; + STDMETHOD(CreateDeviceFromD3D)(THIS_ IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device, + IDirect3DRMDevice2 **device) PURE; + STDMETHOD(CreateDeviceFromClipper)(THIS_ IDirectDrawClipper *clipper, GUID *guid, + int width, int height, IDirect3DRMDevice2 **device) PURE; + STDMETHOD(CreateTextureFromSurface)(THIS_ IDirectDrawSurface *surface, + IDirect3DRMTexture2 **texture) PURE; + STDMETHOD(CreateShadow)(THIS_ IDirect3DRMVisual *visual, IDirect3DRMLight *light, + D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, + IDirect3DRMVisual **shadow) PURE; + STDMETHOD(CreateViewport)(THIS_ IDirect3DRMDevice *device, IDirect3DRMFrame *camera, + DWORD x, DWORD y, DWORD width, DWORD height, IDirect3DRMViewport **viewport) PURE; + STDMETHOD(CreateWrap)(THIS_ D3DRMWRAPTYPE type, IDirect3DRMFrame *reference, D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, + D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov, + D3DVALUE su, D3DVALUE sv, IDirect3DRMWrap **wrap) PURE; + STDMETHOD(CreateUserVisual)(THIS_ D3DRMUSERVISUALCALLBACK cb, void *ctx, IDirect3DRMUserVisual **visual) PURE; + STDMETHOD(LoadTexture)(THIS_ const char *filename, IDirect3DRMTexture2 **texture) PURE; + STDMETHOD(LoadTextureFromResource)(THIS_ HMODULE module, const char *resource_name, + const char *resource_type, IDirect3DRMTexture2 **texture) PURE; + STDMETHOD(SetSearchPath)(THIS_ const char *path) PURE; + STDMETHOD(AddSearchPath)(THIS_ const char *path) PURE; + STDMETHOD(GetSearchPath)(THIS_ DWORD *size, char *path) PURE; + STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE; + STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE; + STDMETHOD(GetDevices)(THIS_ IDirect3DRMDeviceArray **array) PURE; + STDMETHOD(GetNamedObject)(THIS_ const char *name, IDirect3DRMObject **object) PURE; + STDMETHOD(EnumerateObjects)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(Load)(THIS_ void *source, void *object_id, IID **iids, DWORD iid_count, D3DRMLOADOPTIONS flags, + D3DRMLOADCALLBACK load_cb, void *load_ctx, D3DRMLOADTEXTURECALLBACK load_tex_cb, void *load_tex_ctx, + IDirect3DRMFrame *parent_frame) PURE; + STDMETHOD(Tick)(THIS_ D3DVALUE) PURE; + STDMETHOD(CreateProgressiveMesh)(THIS_ IDirect3DRMProgressiveMesh **mesh) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRM2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRM2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRM2_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRM2 methods ***/ +#define IDirect3DRM2_CreateObject(p,a,b,c,d) (p)->lpVtbl->CreateObject(p,a,b,d) +#define IDirect3DRM2_CreateFrame(p,a,b) (p)->lpVtbl->CreateFrame(p,a,b) +#define IDirect3DRM2_CreateMesh(p,a) (p)->lpVtbl->CreateMesh(p,a) +#define IDirect3DRM2_CreateMeshBuilder(p,a) (p)->lpVtbl->CreateMeshBuilder(p,a) +#define IDirect3DRM2_CreateFace(p,a) (p)->lpVtbl->CreateFace(p,a) +#define IDirect3DRM2_CreateAnimation(p,a) (p)->lpVtbl->CreateAnimation(p,a) +#define IDirect3DRM2_CreateAnimationSet(p,a) (p)->lpVtbl->CreateAnimationSet(p,a) +#define IDirect3DRM2_CreateTexture(p,a,b) (p)->lpVtbl->CreateTexture(p,a,b) +#define IDirect3DRM2_CreateLight(p,a,b,c) (p)->lpVtbl->CreateLight(p,a,b,c) +#define IDirect3DRM2_CreateLightRGB(p,a,b,c,d,e) (p)->lpVtbl->CreateLightRGB(p,a,b,c,d,e) +#define IDirect3DRM2_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b) +#define IDirect3DRM2_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) +#define IDirect3DRM2_CreateDeviceFromSurface(p,a,b,c,d) (p)->lpVtbl->CreateDeviceFromSurface(p,a,b,c,d) +#define IDirect3DRM2_CreateDeviceFromD3D(p,a,b,c) (p)->lpVtbl->CreateDeviceFromD3D(p,a,b,c) +#define IDirect3DRM2_CreateDeviceFromClipper(p,a,b,c,d,e) (p)->lpVtbl->CreateDeviceFromClipper(p,a,b,c,d,e) +#define IDirect3DRM2_CreateTextureFromSurface(p,a,b) (p)->lpVtbl->CreateTextureFromSurface(p,a,b) +#define IDirect3DRM2_CreateShadow(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateShadow(p,a,b,c,d,e,f,g,h,i) +#define IDirect3DRM2_CreateViewport(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateViewport(p,a,b,c,d,e,f,g) +#define IDirect3DRM2_CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) (p)->lpVtbl->CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) +#define IDirect3DRM2_CreateUserVisual(p,a,b,c) (p)->lpVtbl->CreateUserVisual(p,a,b,c) +#define IDirect3DRM2_LoadTexture(p,a,b) (p)->lpVtbl->LoadTexture(p,a,b) +#define IDirect3DRM2_LoadTextureFromResource(p,a,b,c,d) (p)->lpVtbl->LoadTextureFromResource(p,a,b,c,d) +#define IDirect3DRM2_SetSearchPath(p,a) (p)->lpVtbl->SetSearchPath(p,a) +#define IDirect3DRM2_AddSearchPath(p,a) (p)->lpVtbl->AddSearchPath(p,a) +#define IDirect3DRM2_GetSearchPath(p,a,b) (p)->lpVtbl->GetSearchPath(p,a,b) +#define IDirect3DRM2_SetDefaultTextureColors(p,a) (p)->lpVtbl->SetDefaultTextureColors(p,a) +#define IDirect3DRM2_SetDefaultTextureShades(p,a) (p)->lpVtbl->SetDefaultTextureShades(p,a) +#define IDirect3DRM2_GetDevices(p,a) (p)->lpVtbl->GetDevices(p,a) +#define IDirect3DRM2_GetNamedObject(p,a,b) (p)->lpVtbl->GetNamedObject(p,a,b) +#define IDirect3DRM2_EnumerateObjects(p,a,b) (p)->lpVtbl->EnumerateObjects(p,a,b) +#define IDirect3DRM2_Load(p,a,b,c,d,e,f,g,h,i,j) (p)->lpVtbl->Load(p,a,b,c,d,e,f,g,h,i,j) +#define IDirect3DRM2_Tick(p,a) (p)->lpVtbl->Tick(p,a) +#define IDirect3DRM2_CreateProgressiveMesh(p,a) (p)->lpVtbl->CreateProgressiveMesh(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DRM2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRM2_AddRef(p) (p)->AddRef() +#define IDirect3DRM2_Release(p) (p)->Release() +/*** IDirect3DRM2 methods ***/ +#define IDirect3DRM2_CreateObject(p,a,b,c,d) (p)->CreateObject(a,b,d) +#define IDirect3DRM2_CreateFrame(p,a,b) (p)->CreateFrame(a,b) +#define IDirect3DRM2_CreateMesh(p,a) (p)->CreateMesh(a) +#define IDirect3DRM2_CreateMeshBuilder(p,a) (p)->CreateMeshBuilder(a) +#define IDirect3DRM2_CreateFace(p,a) (p)->CreateFace(a) +#define IDirect3DRM2_CreateAnimation(p,a) (p)->CreateAnimation(a) +#define IDirect3DRM2_CreateAnimationSet(p,a) (p)->CreateAnimationSet(a) +#define IDirect3DRM2_CreateTexture(p,a,b) (p)->CreateTexture(a,b) +#define IDirect3DRM2_CreateLight(p,a,b,c) (p)->CreateLight(a,b,c) +#define IDirect3DRM2_CreateLightRGB(p,a,b,c,d,e) (p)->CreateLightRGB(a,b,c,d,e) +#define IDirect3DRM2_CreateMaterial(p,a,b) (p)->CreateMaterial(a,b) +#define IDirect3DRM2_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) +#define IDirect3DRM2_CreateDeviceFromSurface(p,a,b,c,d) (p)->CreateDeviceFromSurface(a,b,c,d) +#define IDirect3DRM2_CreateDeviceFromD3D(p,a,b,c) (p)->CreateDeviceFromD3D(a,b,c) +#define IDirect3DRM2_CreateDeviceFromClipper(p,a,b,c,d,e) (p)->CreateDeviceFromClipper(a,b,c,d,e) +#define IDirect3DRM2_CreateTextureFromSurface(p,a,b) (p)->CreateTextureFromSurface(a,b) +#define IDirect3DRM2_CreateShadow(p,a,b,c,d,e,f,g,h,i) (p)->CreateShadow(a,b,c,d,e,f,g,h,i) +#define IDirect3DRM2_CreateViewport(p,a,b,c,d,e,f,g) (p)->CreateViewport(a,b,c,d,e,f,g) +#define IDirect3DRM2_CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) (p)->CreateWrap(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) +#define IDirect3DRM2_CreateUserVisual(p,a,b,c) (p)->CreateUserVisual(a,b,c) +#define IDirect3DRM2_LoadTexture(p,a,b) (p)->LoadTexture(a,b) +#define IDirect3DRM2_LoadTextureFromResource(p,a,b,c,d) (p)->LoadTextureFromResource(a,b,c,d) +#define IDirect3DRM2_SetSearchPath(p,a) (p)->SetSearchPath(a) +#define IDirect3DRM2_AddSearchPath(p,a) (p)->AddSearchPath(a) +#define IDirect3DRM2_GetSearchPath(p,a,b) (p)->GetSearchPath(a,b) +#define IDirect3DRM2_SetDefaultTextureColors(p,a) (p)->SetDefaultTextureColors(a) +#define IDirect3DRM2_SetDefaultTextureShades(p,a) (p)->SetDefaultTextureShades(a) +#define IDirect3DRM2_GetDevices(p,a) (p)->GetDevices(a) +#define IDirect3DRM2_GetNamedObject(p,a,b) (p)->GetNamedObject(a,b) +#define IDirect3DRM2_EnumerateObjects(p,a,b) (p)->EnumerateObjects(a,b) +#define IDirect3DRM2_Load(p,a,b,c,d,e,f,g,h,i,j) (p)->Load(a,b,c,d,e,f,g,h,i,j) +#define IDirect3DRM2_Tick(p,a) (p)->Tick(a) +#define IDirect3DRM2_CreateProgressiveMesh(p,a) (p)->CreateProgressiveMesh(p,a) +#endif + +/***************************************************************************** + * IDirect3DRM3 interface + */ +#ifdef WINE_NO_UNICODE_MACROS +#undef GetClassName +#endif +#define INTERFACE IDirect3DRM3 +DECLARE_INTERFACE_(IDirect3DRM3,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRM2 methods ***/ + STDMETHOD(CreateObject)(THIS_ REFCLSID clsid, IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(CreateFrame)(THIS_ IDirect3DRMFrame3 *parent, IDirect3DRMFrame3 **frame) PURE; + STDMETHOD(CreateMesh)(THIS_ IDirect3DRMMesh **mesh) PURE; + STDMETHOD(CreateMeshBuilder)(THIS_ IDirect3DRMMeshBuilder3 **mesh_builder) PURE; + STDMETHOD(CreateFace)(THIS_ IDirect3DRMFace2 **face) PURE; + STDMETHOD(CreateAnimation)(THIS_ IDirect3DRMAnimation2 **animation) PURE; + STDMETHOD(CreateAnimationSet)(THIS_ IDirect3DRMAnimationSet2 **set) PURE; + STDMETHOD(CreateTexture)(THIS_ D3DRMIMAGE *image, IDirect3DRMTexture3 **texture) PURE; + STDMETHOD(CreateLight)(THIS_ D3DRMLIGHTTYPE type, D3DCOLOR color, IDirect3DRMLight **light) PURE; + STDMETHOD(CreateLightRGB)(THIS_ D3DRMLIGHTTYPE type, D3DVALUE r, D3DVALUE g, D3DVALUE b, + IDirect3DRMLight **light) PURE; + STDMETHOD(CreateMaterial)(THIS_ D3DVALUE, IDirect3DRMMaterial2 **material) PURE; + STDMETHOD(CreateDevice)(THIS_ DWORD width, DWORD height, IDirect3DRMDevice3 **device) PURE; + STDMETHOD(CreateDeviceFromSurface)(THIS_ GUID *guid, IDirectDraw *ddraw, + IDirectDrawSurface *surface, IDirect3DRMDevice3 **device) PURE; + STDMETHOD(CreateDeviceFromD3D)(THIS_ IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device, + IDirect3DRMDevice3 **device) PURE; + STDMETHOD(CreateDeviceFromClipper)(THIS_ IDirectDrawClipper *clipper, GUID *guid, + int width, int height, IDirect3DRMDevice3 **device) PURE; + STDMETHOD(CreateTextureFromSurface)(THIS_ IDirectDrawSurface *surface, + IDirect3DRMTexture3 **texture) PURE; + STDMETHOD(CreateShadow)(THIS_ IUnknown *object, IDirect3DRMLight *light, D3DVALUE px, D3DVALUE py, D3DVALUE pz, + D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, IDirect3DRMShadow2 **shadow) PURE; + STDMETHOD(CreateViewport)(THIS_ IDirect3DRMDevice3 *device, IDirect3DRMFrame3 *camera, + DWORD x, DWORD y, DWORD width, DWORD height, IDirect3DRMViewport2 **viewport) PURE; + STDMETHOD(CreateWrap)(THIS_ D3DRMWRAPTYPE type, IDirect3DRMFrame3 *reference, + D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, + D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov, D3DVALUE su, D3DVALUE sv, + IDirect3DRMWrap **wrap) PURE; + STDMETHOD(CreateUserVisual)(THIS_ D3DRMUSERVISUALCALLBACK cb, void *ctx, IDirect3DRMUserVisual **visual) PURE; + STDMETHOD(LoadTexture)(THIS_ const char *filename, IDirect3DRMTexture3 **texture) PURE; + STDMETHOD(LoadTextureFromResource)(THIS_ HMODULE module, const char *resource_name, + const char *resource_type, IDirect3DRMTexture3 **texture) PURE; + STDMETHOD(SetSearchPath)(THIS_ const char *path) PURE; + STDMETHOD(AddSearchPath)(THIS_ const char *path) PURE; + STDMETHOD(GetSearchPath)(THIS_ DWORD *size, char *path) PURE; + STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE; + STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE; + STDMETHOD(GetDevices)(THIS_ IDirect3DRMDeviceArray **array) PURE; + STDMETHOD(GetNamedObject)(THIS_ const char *name, IDirect3DRMObject **object) PURE; + STDMETHOD(EnumerateObjects)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(Load)(THIS_ void *source, void *object_id, IID **iids, DWORD iid_count, D3DRMLOADOPTIONS flags, + D3DRMLOADCALLBACK load_cb, void *load_ctx, D3DRMLOADTEXTURECALLBACK load_tex_cb, void *load_tex_ctx, + IDirect3DRMFrame3 *parent_frame) PURE; + STDMETHOD(Tick)(THIS_ D3DVALUE) PURE; + STDMETHOD(CreateProgressiveMesh)(THIS_ IDirect3DRMProgressiveMesh **mesh) PURE; + STDMETHOD(RegisterClient)(THIS_ REFGUID guid, DWORD *id) PURE; + STDMETHOD(UnregisterClient)(THIS_ REFGUID rguid) PURE; + STDMETHOD(CreateClippedVisual)(THIS_ IDirect3DRMVisual *visual, IDirect3DRMClippedVisual **clipped_visual) PURE; + STDMETHOD(SetOptions)(THIS_ DWORD) PURE; + STDMETHOD(GetOptions)(THIS_ DWORD *flags) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRM3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRM3_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRM3_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRM3 methods ***/ +#define IDirect3DRM3_CreateObject(p,a,b,c,d) (p)->lpVtbl->CreateObject(p,a,b,d) +#define IDirect3DRM3_CreateFrame(p,a,b) (p)->lpVtbl->CreateFrame(p,a,b) +#define IDirect3DRM3_CreateMesh(p,a) (p)->lpVtbl->CreateMesh(p,a) +#define IDirect3DRM3_CreateMeshBuilder(p,a) (p)->lpVtbl->CreateMeshBuilder(p,a) +#define IDirect3DRM3_CreateFace(p,a) (p)->lpVtbl->CreateFace(p,a) +#define IDirect3DRM3_CreateAnimation(p,a) (p)->lpVtbl->CreateAnimation(p,a) +#define IDirect3DRM3_CreateAnimationSet(p,a) (p)->lpVtbl->CreateAnimationSet(p,a) +#define IDirect3DRM3_CreateTexture(p,a,b) (p)->lpVtbl->CreateTexture(p,a,b) +#define IDirect3DRM3_CreateLight(p,a,b,c) (p)->lpVtbl->CreateLight(p,a,b,c) +#define IDirect3DRM3_CreateLightRGB(p,a,b,c,d,e) (p)->lpVtbl->CreateLightRGB(p,a,b,c,d,e) +#define IDirect3DRM3_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b) +#define IDirect3DRM3_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) +#define IDirect3DRM3_CreateDeviceFromSurface(p,a,b,c,d) (p)->lpVtbl->CreateDeviceFromSurface(p,a,b,c,d) +#define IDirect3DRM3_CreateDeviceFromD3D(p,a,b,c) (p)->lpVtbl->CreateDeviceFromD3D(p,a,b,c) +#define IDirect3DRM3_CreateDeviceFromClipper(p,a,b,c,d,e) (p)->lpVtbl->CreateDeviceFromClipper(p,a,b,c,d,e) +#define IDirect3DRM3_CreateTextureFromSurface(p,a,b) (p)->lpVtbl->CreateTextureFromSurface(p,a,b) +#define IDirect3DRM3_CreateShadow(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateShadow(p,a,b,c,d,e,f,g,h,i) +#define IDirect3DRM3_CreateViewport(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateViewport(p,a,b,c,d,e,f,g) +#define IDirect3DRM3_CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) (p)->lpVtbl->CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) +#define IDirect3DRM3_CreateUserVisual(p,a,b,c) (p)->lpVtbl->CreateUserVisual(p,a,b,c) +#define IDirect3DRM3_LoadTexture(p,a,b) (p)->lpVtbl->LoadTexture(p,a,b) +#define IDirect3DRM3_LoadTextureFromResource(p,a,b,c,d) (p)->lpVtbl->LoadTextureFromResource(p,a,b,c,d) +#define IDirect3DRM3_SetSearchPath(p,a) (p)->lpVtbl->SetSearchPath(p,a) +#define IDirect3DRM3_AddSearchPath(p,a) (p)->lpVtbl->AddSearchPath(p,a) +#define IDirect3DRM3_GetSearchPath(p,a,b) (p)->lpVtbl->GetSearchPath(p,a,b) +#define IDirect3DRM3_SetDefaultTextureColors(p,a) (p)->lpVtbl->SetDefaultTextureColors(p,a) +#define IDirect3DRM3_SetDefaultTextureShades(p,a) (p)->lpVtbl->SetDefaultTextureShades(p,a) +#define IDirect3DRM3_GetDevices(p,a) (p)->lpVtbl->GetDevices(p,a) +#define IDirect3DRM3_GetNamedObject(p,a,b) (p)->lpVtbl->GetNamedObject(p,a,b) +#define IDirect3DRM3_EnumerateObjects(p,a,b) (p)->lpVtbl->EnumerateObjects(p,a,b) +#define IDirect3DRM3_Load(p,a,b,c,d,e,f,g,h,i,j) (p)->lpVtbl->Load(p,a,b,c,d,e,f,g,h,i,j) +#define IDirect3DRM3_Tick(p,a) (p)->lpVtbl->Tick(p,a) +#define IDirect3DRM3_CreateProgressiveMesh(p,a) (p)->lpVtbl->CreateProgressiveMesh(p,a) +#define IDirect3DRM3_RegisterClient(p,a,b) (p)->lpVtbl->RegisterClient(p,a,b) +#define IDirect3DRM3_UnregisterClient(p,a) (p)->lpVtbl->UnregisterClient(p,a) +#define IDirect3DRM3_CreateClippedVisual(p,ab) (p)->lpVtbl->CreateClippedVisual(p,a,b) +#define IDirect3DRM3_SetOptions(p,a) (p)->lpVtbl->SetOptions(p,a) +#define IDirect3DRM3_GetOptions(p,a) (p)->lpVtbl->GetOptions(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DRM3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRM3_AddRef(p) (p)->AddRef() +#define IDirect3DRM3_Release(p) (p)->Release() +/*** IDirect3DRM3 methods ***/ +#define IDirect3DRM3_CreateObject(p,a,b,c,d) (p)->CreateObject(a,b,d) +#define IDirect3DRM3_CreateFrame(p,a,b) (p)->CreateFrame(a,b) +#define IDirect3DRM3_CreateMesh(p,a) (p)->CreateMesh(a) +#define IDirect3DRM3_CreateMeshBuilder(p,a) (p)->CreateMeshBuilder(a) +#define IDirect3DRM3_CreateFace(p,a) (p)->CreateFace(a) +#define IDirect3DRM3_CreateAnimation(p,a) (p)->CreateAnimation(a) +#define IDirect3DRM3_CreateAnimationSet(p,a) (p)->CreateAnimationSet(a) +#define IDirect3DRM3_CreateTexture(p,a,b) (p)->CreateTexture(a,b) +#define IDirect3DRM3_CreateLight(p,a,b,c) (p)->CreateLight(a,b,c) +#define IDirect3DRM3_CreateLightRGB(p,a,b,c,d,e) (p)->CreateLightRGB(a,b,c,d,e) +#define IDirect3DRM3_CreateMaterial(p,a,b) (p)->CreateMaterial(a,b) +#define IDirect3DRM3_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) +#define IDirect3DRM3_CreateDeviceFromSurface(p,a,b,c,d) (p)->CreateDeviceFromSurface(a,b,c,d) +#define IDirect3DRM3_CreateDeviceFromD3D(p,a,b,c) (p)->CreateDeviceFromD3D(a,b,c) +#define IDirect3DRM3_CreateDeviceFromClipper(p,a,b,c,d,e) (p)->CreateDeviceFromClipper(a,b,c,d,e) +#define IDirect3DRM3_CreateTextureFromSurface(p,a,b) (p)->CreateTextureFromSurface(a,b) +#define IDirect3DRM3_CreateShadow(p,a,b,c,d,e,f,g,h,i) (p)->CreateShadow(a,b,c,d,e,f,g,h,i) +#define IDirect3DRM3_CreateViewport(p,a,b,c,d,e,f,g) (p)->CreateViewport(a,b,c,d,e,f,g) +#define IDirect3DRM3_CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) (p)->CreateWrap(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) +#define IDirect3DRM3_CreateUserVisual(p,a,b,c) (p)->CreateUserVisual(a,b,c) +#define IDirect3DRM3_LoadTexture(p,a,b) (p)->LoadTexture(a,b) +#define IDirect3DRM3_LoadTextureFromResource(p,a,b,c,d) (p)->LoadTextureFromResource(a,b,c,d) +#define IDirect3DRM3_SetSearchPath(p,a) (p)->SetSearchPath(a) +#define IDirect3DRM3_AddSearchPath(p,a) (p)->AddSearchPath(a) +#define IDirect3DRM3_GetSearchPath(p,a,b) (p)->GetSearchPath(a,b) +#define IDirect3DRM3_SetDefaultTextureColors(p,a) (p)->SetDefaultTextureColors(a) +#define IDirect3DRM3_SetDefaultTextureShades(p,a) (p)->SetDefaultTextureShades(a) +#define IDirect3DRM3_GetDevices(p,a) (p)->GetDevices(a) +#define IDirect3DRM3_GetNamedObject(p,a,b) (p)->GetNamedObject(a,b) +#define IDirect3DRM3_EnumerateObjects(p,a,b) (p)->EnumerateObjects(a,b) +#define IDirect3DRM3_Load(p,a,b,c,d,e,f,g,h,i,j) (p)->Load(a,b,c,d,e,f,g,h,i,j) +#define IDirect3DRM3_Tick(p,a) (p)->Tick(a) +#define IDirect3DRM3_CreateProgressiveMesh(p,a) (p)->CreateProgressiveMesh(p,a) +#define IDirect3DRM3_RegisterClient(p,a,b) (p)->RegisterClient(p,a,b) +#define IDirect3DRM3_UnregisterClient(p,a) (p)->UnregisterClient(p,a) +#define IDirect3DRM3_CreateClippedVisual(p,ab) (p)->CreateClippedVisual(p,a,b) +#define IDirect3DRM3_SetOptions(p,a) (p)->SetOptions(p,a) +#define IDirect3DRM3_GetOptions(p,a) (p)->GetOptions(p,a) +#endif + +#define D3DRM_OK DD_OK +#define D3DRMERR_BADOBJECT MAKE_DDHRESULT(781) +#define D3DRMERR_BADTYPE MAKE_DDHRESULT(782) +#define D3DRMERR_BADALLOC MAKE_DDHRESULT(783) +#define D3DRMERR_FACEUSED MAKE_DDHRESULT(784) +#define D3DRMERR_NOTFOUND MAKE_DDHRESULT(785) +#define D3DRMERR_NOTDONEYET MAKE_DDHRESULT(786) +#define D3DRMERR_FILENOTFOUND MAKE_DDHRESULT(787) +#define D3DRMERR_BADFILE MAKE_DDHRESULT(788) +#define D3DRMERR_BADDEVICE MAKE_DDHRESULT(789) +#define D3DRMERR_BADVALUE MAKE_DDHRESULT(790) +#define D3DRMERR_BADMAJORVERSION MAKE_DDHRESULT(791) +#define D3DRMERR_BADMINORVERSION MAKE_DDHRESULT(792) +#define D3DRMERR_UNABLETOEXECUTE MAKE_DDHRESULT(793) +#define D3DRMERR_LIBRARYNOTFOUND MAKE_DDHRESULT(794) +#define D3DRMERR_INVALIDLIBRARY MAKE_DDHRESULT(795) +#define D3DRMERR_PENDING MAKE_DDHRESULT(796) +#define D3DRMERR_NOTENOUGHDATA MAKE_DDHRESULT(797) +#define D3DRMERR_REQUESTTOOLARGE MAKE_DDHRESULT(798) +#define D3DRMERR_REQUESTTOOSMALL MAKE_DDHRESULT(799) +#define D3DRMERR_CONNECTIONLOST MAKE_DDHRESULT(800) +#define D3DRMERR_LOADABORTED MAKE_DDHRESULT(801) +#define D3DRMERR_NOINTERNET MAKE_DDHRESULT(802) +#define D3DRMERR_BADCACHEFILE MAKE_DDHRESULT(803) +#define D3DRMERR_BOXNOTSET MAKE_DDHRESULT(804) +#define D3DRMERR_BADPMDATA MAKE_DDHRESULT(805) +#define D3DRMERR_CLIENTNOTREGISTERED MAKE_DDHRESULT(806) +#define D3DRMERR_NOTCREATEDFROMDDS MAKE_DDHRESULT(807) +#define D3DRMERR_NOSUCHKEY MAKE_DDHRESULT(808) +#define D3DRMERR_INCOMPATABLEKEY MAKE_DDHRESULT(809) +#define D3DRMERR_ELEMENTINUSE MAKE_DDHRESULT(810) +#define D3DRMERR_TEXTUREFORMATNOTFOUND MAKE_DDHRESULT(811) +#define D3DRMERR_NOTAGGREGATED MAKE_DDHRESULT(812) + +#ifdef __cplusplus +} +#endif + #endif /* __D3DRM_H__ */ diff --git a/include/psdk/d3drmdef.h b/include/psdk/d3drmdef.h index 6f769f4af3f..e62e40f5c23 100644 --- a/include/psdk/d3drmdef.h +++ b/include/psdk/d3drmdef.h @@ -1,6 +1,7 @@ /* - * Copyright 2007 Vijay Kiran Kamuju + * Copyright 2007,2010 Vijay Kiran Kamuju * Copyright 2007 David ADAM + * Copyright 2010 Christian Costa * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,32 +28,429 @@ extern "C" { #endif -typedef D3DVALUE D3DRMMATRIX4D[4][4]; -typedef struct _D3DRMQUATERNION +typedef struct _D3DRMVECTOR4D { + D3DVALUE x; + D3DVALUE y; + D3DVALUE z; + D3DVALUE w; +} D3DRMVECTOR4D, *LPD3DRMVECTOR4D; + +typedef D3DVALUE D3DRMMATRIX4D[4][4]; + +typedef struct _D3DRMQUATERNION { D3DVALUE s; D3DVECTOR v; } D3DRMQUATERNION, *LPD3DRMQUATERNION; -void WINAPI D3DRMMatrixFromQuaternion(D3DRMMATRIX4D, LPD3DRMQUATERNION); +typedef struct _D3DRMRAY { + D3DVECTOR dvDir; + D3DVECTOR dvPos; +} D3DRMRAY, *LPD3DRMRAY; -LPD3DRMQUATERNION WINAPI D3DRMQuaternionFromRotation(LPD3DRMQUATERNION ,LPD3DVECTOR,D3DVALUE); -LPD3DRMQUATERNION WINAPI D3DRMQuaternionMultiply(LPD3DRMQUATERNION, LPD3DRMQUATERNION, LPD3DRMQUATERNION); -LPD3DRMQUATERNION WINAPI D3DRMQuaternionSlerp(LPD3DRMQUATERNION, LPD3DRMQUATERNION, LPD3DRMQUATERNION, D3DVALUE); +typedef struct _D3DRMBOX { + D3DVECTOR min; + D3DVECTOR max; +} D3DRMBOX, *LPD3DRMBOX; -LPD3DVECTOR WINAPI D3DRMVectorAdd(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR); -LPD3DVECTOR WINAPI D3DRMVectorCrossProduct(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR); -D3DVALUE WINAPI D3DRMVectorDotProduct(LPD3DVECTOR, LPD3DVECTOR); -LPD3DVECTOR WINAPI D3DRMVectorNormalize(LPD3DVECTOR); +typedef void (*D3DRMWRAPCALLBACK)(D3DVECTOR *vec, int *u, int *v, D3DVECTOR *a, D3DVECTOR *b, void *ctx); + +typedef enum _D3DRMLIGHTTYPE { + D3DRMLIGHT_AMBIENT, + D3DRMLIGHT_POINT, + D3DRMLIGHT_SPOT, + D3DRMLIGHT_DIRECTIONAL, + D3DRMLIGHT_PARALLELPOINT +} D3DRMLIGHTTYPE, *LPD3DRMLIGHTTYPE; + +typedef enum _D3DRMSHADEMODE { + D3DRMSHADE_FLAT = 0, + D3DRMSHADE_GOURAUD = 1, + D3DRMSHADE_PHONG = 2, + D3DRMSHADE_MASK = 7, + D3DRMSHADE_MAX = 8 +} D3DRMSHADEMODE, *LPD3DRMSHADEMODE; + +typedef enum _D3DRMLIGHTMODE { + D3DRMLIGHT_OFF = 0 * D3DRMSHADE_MAX, + D3DRMLIGHT_ON = 1 * D3DRMSHADE_MAX, + D3DRMLIGHT_MASK = 7 * D3DRMSHADE_MAX, + D3DRMLIGHT_MAX = 8 * D3DRMSHADE_MAX +} D3DRMLIGHTMODE, *LPD3DRMLIGHTMODE; + +typedef enum _D3DRMFILLMODE { + D3DRMFILL_POINTS = 0 * D3DRMLIGHT_MAX, + D3DRMFILL_WIREFRAME = 1 * D3DRMLIGHT_MAX, + D3DRMFILL_SOLID = 2 * D3DRMLIGHT_MAX, + D3DRMFILL_MASK = 7 * D3DRMLIGHT_MAX, + D3DRMFILL_MAX = 8 * D3DRMLIGHT_MAX +} D3DRMFILLMODE, *LPD3DRMFILLMODE; + +typedef DWORD D3DRMRENDERQUALITY, *LPD3DRMRENDERQUALITY; + +#define D3DRMRENDER_WIREFRAME (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_WIREFRAME) +#define D3DRMRENDER_UNLITFLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_SOLID) +#define D3DRMRENDER_FLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_ON+D3DRMFILL_SOLID) +#define D3DRMRENDER_GOURAUD (D3DRMSHADE_GOURAUD+D3DRMLIGHT_ON+D3DRMFILL_SOLID) +#define D3DRMRENDER_PHONG (D3DRMSHADE_PHONG+D3DRMLIGHT_ON+D3DRMFILL_SOLID + +#define D3DRMRENDERMODE_BLENDEDTRANSPARENCY 1 +#define D3DRMRENDERMODE_SORTEDTRANSPARENCY 2 +#define D3DRMRENDERMODE_LIGHTINMODELSPACE 8 +#define D3DRMRENDERMODE_VIEWDEPENDENTSPECULAR 16 +#define D3DRMRENDERMODE_DISABLESORTEDALPHAZWRITE 32 + +typedef enum _D3DRMTEXTUREQUALITY { + D3DRMTEXTURE_NEAREST, + D3DRMTEXTURE_LINEAR, + D3DRMTEXTURE_MIPNEAREST, + D3DRMTEXTURE_MIPLINEAR, + D3DRMTEXTURE_LINEARMIPNEAREST, + D3DRMTEXTURE_LINEARMIPLINEAR +} D3DRMTEXTUREQUALITY, *LPD3DRMTEXTUREQUALITY; + +#define D3DRMTEXTURE_FORCERESIDENT 0x00000001 +#define D3DRMTEXTURE_STATIC 0x00000002 +#define D3DRMTEXTURE_DOWNSAMPLEPOINT 0x00000004 +#define D3DRMTEXTURE_DOWNSAMPLEBILINEAR 0x00000008 +#define D3DRMTEXTURE_DOWNSAMPLEREDUCEDEPTH 0x00000010 +#define D3DRMTEXTURE_DOWNSAMPLENONE 0x00000020 +#define D3DRMTEXTURE_CHANGEDPIXELS 0x00000040 +#define D3DRMTEXTURE_CHANGEDPALETTE 0x00000080 +#define D3DRMTEXTURE_INVALIDATEONLY 0x00000100 + +#define D3DRMSHADOW_TRUEALPHA 0x00000001 + +typedef enum _D3DRMCOMBINETYPE { + D3DRMCOMBINE_REPLACE, + D3DRMCOMBINE_BEFORE, + D3DRMCOMBINE_AFTER +} D3DRMCOMBINETYPE, *LPD3DRMCOMBINETYPE; + +typedef D3DCOLORMODEL D3DRMCOLORMODEL, *LPD3DRMCOLORMODEL; + +typedef enum _D3DRMPALETTEFLAGS +{ + D3DRMPALETTE_FREE, + D3DRMPALETTE_READONLY, + D3DRMPALETTE_RESERVED +} D3DRMPALETTEFLAGS, *LPD3DRMPALETTEFLAGS; + +typedef struct _D3DRMPALETTEENTRY { + unsigned char red; + unsigned char green; + unsigned char blue; + unsigned char flags; +} D3DRMPALETTEENTRY, *LPD3DRMPALETTEENTRY; + +typedef struct _D3DRMIMAGE { + int width; + int height; + int aspectx; + int aspecty; + int depth; + int rgb; + int bytes_per_line; + void* buffer1; + void* buffer2; + ULONG red_mask; + ULONG green_mask; + ULONG blue_mask; + ULONG alpha_mask; + int palette_size; + D3DRMPALETTEENTRY* palette; +} D3DRMIMAGE, *LPD3DRMIMAGE; + +typedef enum _D3DRMWRAPTYPE { + D3DRMWRAP_FLAT, + D3DRMWRAP_CYLINDER, + D3DRMWRAP_SPHERE, + D3DRMWRAP_CHROME, + D3DRMWRAP_SHEET, + D3DRMWRAP_BOX +} D3DRMWRAPTYPE, *LPD3DRMWRAPTYPE; + +#define D3DRMWIREFRAME_CULL 1 +#define D3DRMWIREFRAME_HIDDENLINE 2 + +typedef enum _D3DRMPROJECTIONTYPE +{ + D3DRMPROJECT_PERSPECTIVE, + D3DRMPROJECT_ORTHOGRAPHIC, + D3DRMPROJECT_RIGHTHANDPERSPECTIVE, + D3DRMPROJECT_RIGHTHANDORTHOGRAPHIC +} D3DRMPROJECTIONTYPE, *LPD3DRMPROJECTIONTYPE; + +#define D3DRMOPTIONS_LEFTHANDED 0x00000001 +#define D3DRMOPTIONS_RIGHTHANDED 0x00000002 + +typedef enum _D3DRMXOFFORMAT { + D3DRMXOF_BINARY, + D3DRMXOF_COMPRESSED, + D3DRMXOF_TEXT +} D3DRMXOFFORMAT, *LPD3DRMXOFFORMAT; + +typedef DWORD D3DRMSAVEOPTIONS; +#define D3DRMXOFSAVE_NORMALS 1 +#define D3DRMXOFSAVE_TEXTURECOORDINATES 2 +#define D3DRMXOFSAVE_MATERIALS 4 +#define D3DRMXOFSAVE_TEXTURENAMES 8 +#define D3DRMXOFSAVE_ALL 15 +#define D3DRMXOFSAVE_TEMPLATES 16 +#define D3DRMXOFSAVE_TEXTURETOPOLOGY 32 + +typedef enum _D3DRMCOLORSOURCE { + D3DRMCOLOR_FROMFACE, + D3DRMCOLOR_FROMVERTEX +} D3DRMCOLORSOURCE, *LPD3DRMCOLORSOURCE; + +typedef enum _D3DRMFRAMECONSTRAINT { + D3DRMCONSTRAIN_Z, + D3DRMCONSTRAIN_Y, + D3DRMCONSTRAIN_X +} D3DRMFRAMECONSTRAINT, *LPD3DRMFRAMECONSTRAINT; + +typedef enum _D3DRMMATERIALMODE { + D3DRMMATERIAL_FROMMESH, + D3DRMMATERIAL_FROMPARENT, + D3DRMMATERIAL_FROMFRAME +} D3DRMMATERIALMODE, *LPD3DRMMATERIALMODE; + +typedef enum _D3DRMFOGMODE { + D3DRMFOG_LINEAR, + D3DRMFOG_EXPONENTIAL, + D3DRMFOG_EXPONENTIALSQUARED +} D3DRMFOGMODE, *LPD3DRMFOGMODE; + +typedef enum _D3DRMZBUFFERMODE { + D3DRMZBUFFER_FROMPARENT, + D3DRMZBUFFER_ENABLE, + D3DRMZBUFFER_DISABLE +} D3DRMZBUFFERMODE, *LPD3DRMZBUFFERMODE; + +typedef enum _D3DRMSORTMODE { + D3DRMSORT_FROMPARENT, + D3DRMSORT_NONE, + D3DRMSORT_FRONTTOBACK, + D3DRMSORT_BACKTOFRONT +} D3DRMSORTMODE, *LPD3DRMSORTMODE; + +typedef struct _D3DRMMATERIALOVERRIDE { + DWORD dwSize; + DWORD dwFlags; + D3DCOLORVALUE dcDiffuse; + D3DCOLORVALUE dcAmbient; + D3DCOLORVALUE dcEmissive; + D3DCOLORVALUE dcSpecular; + D3DVALUE dvPower; + IUnknown *lpD3DRMTex; +} D3DRMMATERIALOVERRIDE, *LPD3DRMMATERIALOVERRIDE; + +#define D3DRMMATERIALOVERRIDE_DIFFUSE_ALPHAONLY 0x00000001 +#define D3DRMMATERIALOVERRIDE_DIFFUSE_RGBONLY 0x00000002 +#define D3DRMMATERIALOVERRIDE_DIFFUSE 0x00000003 +#define D3DRMMATERIALOVERRIDE_AMBIENT 0x00000004 +#define D3DRMMATERIALOVERRIDE_EMISSIVE 0x00000008 +#define D3DRMMATERIALOVERRIDE_SPECULAR 0x00000010 +#define D3DRMMATERIALOVERRIDE_POWER 0x00000020 +#define D3DRMMATERIALOVERRIDE_TEXTURE 0x00000040 +#define D3DRMMATERIALOVERRIDE_DIFFUSE_ALPHAMULTIPLY 0x00000080 +#define D3DRMMATERIALOVERRIDE_ALL 0x000000FF + +#define D3DRMFPTF_ALPHA 0x00000001 +#define D3DRMFPTF_NOALPHA 0x00000002 +#define D3DRMFPTF_PALETTIZED 0x00000004 +#define D3DRMFPTF_NOTPALETTIZED 0x00000008 + +#define D3DRMSTATECHANGE_UPDATEONLY 0x000000001 +#define D3DRMSTATECHANGE_VOLATILE 0x000000002 +#define D3DRMSTATECHANGE_NONVOLATILE 0x000000004 +#define D3DRMSTATECHANGE_RENDER 0x000000020 +#define D3DRMSTATECHANGE_LIGHT 0x000000040 + +#define D3DRMDEVICE_NOZBUFFER 0x00000001 + +#define D3DRMCALLBACK_PREORDER 0 +#define D3DRMCALLBACK_POSTORDER 1 + +#define D3DRMRAYPICK_ONLYBOUNDINGBOXES 0x01 +#define D3DRMRAYPICK_IGNOREFURTHERPRIMITIVES 0x02 +#define D3DRMRAYPICK_INTERPOLATEUV 0x04 +#define D3DRMRAYPICK_INTERPOLATECOLOR 0x08 +#define D3DRMRAYPICK_INTERPOLATENORMAL 0x10 + +#define D3DRMADDFACES_VERTICESONLY 1 + +#define D3DRMGENERATENORMALS_PRECOMPACT 1 +#define D3DRMGENERATENORMALS_USECREASEANGLE 2 + +#define D3DRMMESHBUILDER_DIRECTPARENT 1 +#define D3DRMMESHBUILDER_ROOTMESH 2 + +#define D3DRMMESHBUILDER_RENDERENABLE 0x00000001 +#define D3DRMMESHBUILDER_PICKENABLE 0x00000002 + +#define D3DRMADDMESHBUILDER_DONTCOPYAPPDATA 1 +#define D3DRMADDMESHBUILDER_FLATTENSUBMESHES 2 +#define D3DRMADDMESHBUILDER_NOSUBMESHES 4 + +#define D3DRMMESHBUILDERAGE_GEOMETRY 0x00000001 +#define D3DRMMESHBUILDERAGE_MATERIALS 0x00000002 +#define D3DRMMESHBUILDERAGE_TEXTURES 0x00000004 + +#define D3DRMFVF_TYPE 0x00000001 +#define D3DRMFVF_NORMAL 0x00000002 +#define D3DRMFVF_COLOR 0x00000004 +#define D3DRMFVF_TEXTURECOORDS 0x00000008 + +#define D3DRMVERTEX_STRIP 0x00000001 +#define D3DRMVERTEX_FAN 0x00000002 +#define D3DRMVERTEX_LIST 0x00000004 + +#define D3DRMCLEAR_TARGET 0x00000001 +#define D3DRMCLEAR_ZBUFFER 0x00000002 +#define D3DRMCLEAR_DIRTYRECTS 0x00000004 +#define D3DRMCLEAR_ALL (D3DRMCLEAR_TARGET | D3DRMCLEAR_ZBUFFER | D3DRMCLEAR_DIRTYRECTS) + +#define D3DRMFOGMETHOD_VERTEX 0x00000001 +#define D3DRMFOGMETHOD_TABLE 0x00000002 +#define D3DRMFOGMETHOD_ANY 0x00000004 + +#define D3DRMFRAME_RENDERENABLE 0x00000001 +#define D3DRMFRAME_PICKENABLE 0x00000002 + +typedef DWORD D3DRMANIMATIONOPTIONS; +#define D3DRMANIMATION_OPEN 0x00000001 +#define D3DRMANIMATION_CLOSED 0x00000002 +#define D3DRMANIMATION_LINEARPOSITION 0x00000004 +#define D3DRMANIMATION_SPLINEPOSITION 0x00000008 +#define D3DRMANIMATION_SCALEANDROTATION 0x00000010 +#define D3DRMANIMATION_POSITION 0x00000020 + +typedef DWORD D3DRMINTERPOLATIONOPTIONS; +#define D3DRMINTERPOLATION_OPEN 0x0001 +#define D3DRMINTERPOLATION_CLOSED 0x0002 +#define D3DRMINTERPOLATION_NEAREST 0x0100 +#define D3DRMINTERPOLATION_LINEAR 0x0004 +#define D3DRMINTERPOLATION_SPLINE 0x0008 +#define D3DRMINTERPOLATION_VERTEXCOLOR 0x0040 +#define D3DRMINTERPOLATION_SLERPNORMALS 0x0080 + +typedef DWORD D3DRMLOADOPTIONS; + +#define D3DRMLOAD_FROMFILE 0x000L +#define D3DRMLOAD_FROMRESOURCE 0x001L +#define D3DRMLOAD_FROMMEMORY 0x002L +#define D3DRMLOAD_FROMSTREAM 0x004L +#define D3DRMLOAD_FROMURL 0x008L + +#define D3DRMLOAD_BYNAME 0x010L +#define D3DRMLOAD_BYPOSITION 0x020L +#define D3DRMLOAD_BYGUID 0x040L +#define D3DRMLOAD_FIRST 0x080L + +#define D3DRMLOAD_INSTANCEBYREFERENCE 0x100L +#define D3DRMLOAD_INSTANCEBYCOPYING 0x200L + +#define D3DRMLOAD_ASYNCHRONOUS 0x400L + +typedef struct _D3DRMLOADRESOURCE +{ + HMODULE hModule; + const char *lpName; + const char *lpType; +} D3DRMLOADRESOURCE, *LPD3DRMLOADRESOURCE; + +typedef struct _D3DRMLOADMEMORY +{ + void *lpMemory; + DWORD dSize; +} D3DRMLOADMEMORY, *LPD3DRMLOADMEMORY; + +#define D3DRMPMESHSTATUS_VALID 0x01 +#define D3DRMPMESHSTATUS_INTERRUPTED 0x02 +#define D3DRMPMESHSTATUS_BASEMESHCOMPLETE 0x04 +#define D3DRMPMESHSTATUS_COMPLETE 0x08 +#define D3DRMPMESHSTATUS_RENDERABLE 0x10 + +#define D3DRMPMESHEVENT_BASEMESH 0x01 +#define D3DRMPMESHEVENT_COMPLETE 0x02 + +typedef struct _D3DRMPMESHLOADSTATUS { + DWORD dwSize; + DWORD dwPMeshSize; + DWORD dwBaseMeshSize; + DWORD dwBytesLoaded; + DWORD dwVerticesLoaded; + DWORD dwFacesLoaded; + HRESULT dwLoadResult; + DWORD dwFlags; +} D3DRMPMESHLOADSTATUS, *LPD3DRMPMESHLOADSTATUS; + +typedef enum _D3DRMUSERVISUALREASON { + D3DRMUSERVISUAL_CANSEE, + D3DRMUSERVISUAL_RENDER +} D3DRMUSERVISUALREASON, *LPD3DRMUSERVISUALREASON; + +typedef struct _D3DRMANIMATIONKEY +{ + DWORD dwSize; + DWORD dwKeyType; + D3DVALUE dvTime; + DWORD dwID; +#if !defined(__cplusplus) || !defined(D3D_OVERLOADS) + union + { + D3DRMQUATERNION dqRotateKey; + D3DVECTOR dvScaleKey; + D3DVECTOR dvPositionKey; + } DUMMYUNIONNAME; +#else + D3DVALUE dvK[4]; +#endif +} D3DRMANIMATIONKEY; +typedef D3DRMANIMATIONKEY *LPD3DRMANIMATIONKEY; + +#define D3DRMANIMATION_ROTATEKEY 0x01 +#define D3DRMANIMATION_SCALEKEY 0x02 +#define D3DRMANIMATION_POSITIONKEY 0x03 + +typedef DWORD D3DRMMAPPING, D3DRMMAPPINGFLAG, *LPD3DRMMAPPING; +static const D3DRMMAPPINGFLAG D3DRMMAP_WRAPU = 1; +static const D3DRMMAPPINGFLAG D3DRMMAP_WRAPV = 2; +static const D3DRMMAPPINGFLAG D3DRMMAP_PERSPCORRECT = 4; + +typedef struct _D3DRMVERTEX { + D3DVECTOR position; + D3DVECTOR normal; + D3DVALUE tu; + D3DVALUE tv; + D3DCOLOR color; +} D3DRMVERTEX, *LPD3DRMVERTEX; + +typedef LONG D3DRMGROUPINDEX; +static const D3DRMGROUPINDEX D3DRMGROUP_ALLGROUPS = -1; + +void WINAPI D3DRMMatrixFromQuaternion(D3DRMMATRIX4D m, D3DRMQUATERNION *q); + +D3DRMQUATERNION * WINAPI D3DRMQuaternionFromRotation(D3DRMQUATERNION *x, D3DVECTOR *axis, D3DVALUE theta); +D3DRMQUATERNION * WINAPI D3DRMQuaternionMultiply(D3DRMQUATERNION *ret, D3DRMQUATERNION *x, D3DRMQUATERNION *y); +D3DRMQUATERNION * WINAPI D3DRMQuaternionSlerp(D3DRMQUATERNION *ret, + D3DRMQUATERNION *x, D3DRMQUATERNION *y, D3DVALUE alpha); + +D3DVECTOR * WINAPI D3DRMVectorAdd(D3DVECTOR *ret, D3DVECTOR *x, D3DVECTOR *y); +D3DVECTOR * WINAPI D3DRMVectorCrossProduct(D3DVECTOR *ret, D3DVECTOR *x, D3DVECTOR *y); +D3DVALUE WINAPI D3DRMVectorDotProduct(D3DVECTOR *x, D3DVECTOR *y); +D3DVECTOR * WINAPI D3DRMVectorNormalize(D3DVECTOR *x); #define D3DRMVectorNormalise D3DRMVectorNormalize -D3DVALUE WINAPI D3DRMVectorModulus(LPD3DVECTOR); -LPD3DVECTOR WINAPI D3DRMVectorRandom(LPD3DVECTOR); -LPD3DVECTOR WINAPI D3DRMVectorRotate(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR, D3DVALUE); -LPD3DVECTOR WINAPI D3DRMVectorReflect(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR); -LPD3DVECTOR WINAPI D3DRMVectorScale(LPD3DVECTOR, LPD3DVECTOR, D3DVALUE); -LPD3DVECTOR WINAPI D3DRMVectorSubtract(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR); +D3DVALUE WINAPI D3DRMVectorModulus(D3DVECTOR *x); +D3DVECTOR * WINAPI D3DRMVectorRandom(D3DVECTOR *ret); +D3DVECTOR * WINAPI D3DRMVectorRotate(D3DVECTOR *ret, D3DVECTOR *x, D3DVECTOR *axis, D3DVALUE theta); +D3DVECTOR * WINAPI D3DRMVectorReflect(D3DVECTOR *ret, D3DVECTOR *ray, D3DVECTOR *normal); +D3DVECTOR * WINAPI D3DRMVectorScale(D3DVECTOR *ret, D3DVECTOR *x, D3DVALUE scale); +D3DVECTOR * WINAPI D3DRMVectorSubtract(D3DVECTOR *ret, D3DVECTOR *x, D3DVECTOR *y); D3DCOLOR WINAPI D3DRMCreateColorRGB(D3DVALUE, D3DVALUE, D3DVALUE); D3DCOLOR WINAPI D3DRMCreateColorRGBA(D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE); diff --git a/include/psdk/d3drmobj.h b/include/psdk/d3drmobj.h new file mode 100644 index 00000000000..f0ab369fa57 --- /dev/null +++ b/include/psdk/d3drmobj.h @@ -0,0 +1,4702 @@ +/* + * Copyright (C) 2008 Vijay Kiran Kamuju + * Copyright (C) 2010 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 + */ + +#ifndef __D3DRMOBJ_H__ +#define __D3DRMOBJ_H__ + +#include +#define VIRTUAL +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Direct3DRM object CLSIDs */ + +DEFINE_GUID(CLSID_CDirect3DRMDevice, 0x4fa3568e, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMViewport, 0x4fa3568f, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMFrame, 0x4fa35690, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMMesh, 0x4fa35691, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMMeshBuilder, 0x4fa35692, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMFace, 0x4fa35693, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMLight, 0x4fa35694, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMTexture, 0x4fa35695, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMWrap, 0x4fa35696, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMMaterial, 0x4fa35697, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMAnimation, 0x4fa35698, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMAnimationSet, 0x4fa35699, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMUserVisual, 0x4fa3569a, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMShadow, 0x4fa3569b, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMViewportInterpolator, 0xde9eaa1, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(CLSID_CDirect3DRMFrameInterpolator, 0xde9eaa2, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(CLSID_CDirect3DRMMeshInterpolator, 0xde9eaa3, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(CLSID_CDirect3DRMLightInterpolator, 0xde9eaa6, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(CLSID_CDirect3DRMMaterialInterpolator, 0xde9eaa7, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(CLSID_CDirect3DRMTextureInterpolator, 0xde9eaa8, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(CLSID_CDirect3DRMProgressiveMesh, 0x4516ec40, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(CLSID_CDirect3DRMClippedVisual, 0x5434e72d, 0x6d66, 0x11d1, 0xbb, 0xb, 0x0, 0x0, 0xf8, 0x75, 0x86, 0x5a); + +/* Direct3DRM object interface GUIDs */ + +DEFINE_GUID(IID_IDirect3DRMObject, 0xeb16cb00, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMObject2, 0x4516ec7c, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(IID_IDirect3DRMDevice, 0xe9e19280, 0x6e05, 0x11cf, 0xac, 0x4a, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMDevice2, 0x4516ec78, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(IID_IDirect3DRMDevice3, 0x549f498b, 0xbfeb, 0x11d1, 0x8e, 0xd8, 0x00, 0xa0, 0xc9, 0x67, 0xa4, 0x82); +DEFINE_GUID(IID_IDirect3DRMViewport, 0xeb16cb02, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMViewport2, 0x4a1b1be6, 0xbfed, 0x11d1, 0x8e, 0xd8, 0x00, 0xa0, 0xc9, 0x67, 0xa4, 0x82); +DEFINE_GUID(IID_IDirect3DRMFrame, 0xeb16cb03, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMFrame2, 0xc3dfbd60, 0x3988, 0x11d0, 0x9e, 0xc2, 0x00, 0x00, 0xc0, 0x29, 0x1a, 0xc3); +DEFINE_GUID(IID_IDirect3DRMFrame3, 0xff6b7f70, 0xa40e, 0x11d1, 0x91, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0x8e, 0x66); +DEFINE_GUID(IID_IDirect3DRMVisual, 0xeb16cb04, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMMesh, 0xa3a80d01, 0x6e12, 0x11cf, 0xac, 0x4a, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMMeshBuilder, 0xa3a80d02, 0x6e12, 0x11cf, 0xac, 0x4a, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMMeshBuilder2, 0x4516ec77, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(IID_IDirect3DRMMeshBuilder3, 0x4516ec82, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(IID_IDirect3DRMFace, 0xeb16cb07, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMFace2, 0x4516ec81, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(IID_IDirect3DRMLight, 0xeb16cb08, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMTexture, 0xeb16cb09, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMTexture2, 0x120f30c0, 0x1629, 0x11d0, 0x94, 0x1c, 0x00, 0x80, 0xc8, 0x0c, 0xfa, 0x7b); +DEFINE_GUID(IID_IDirect3DRMTexture3, 0xff6b7f73, 0xa40e, 0x11d1, 0x91, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0x8e, 0x66); +DEFINE_GUID(IID_IDirect3DRMWrap, 0xeb16cb0a, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMMaterial, 0xeb16cb0b, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMMaterial2, 0xff6b7f75, 0xa40e, 0x11d1, 0x91, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0x8e, 0x66); +DEFINE_GUID(IID_IDirect3DRMAnimation, 0xeb16cb0d, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMAnimation2, 0xff6b7f77, 0xa40e, 0x11d1, 0x91, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0x8e, 0x66); +DEFINE_GUID(IID_IDirect3DRMAnimationSet, 0xeb16cb0e, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMAnimationSet2, 0xff6b7f79, 0xa40e, 0x11d1, 0x91, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0x8e, 0x66); +DEFINE_GUID(IID_IDirect3DRMObjectArray, 0x242f6bc2, 0x3849, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(IID_IDirect3DRMDeviceArray, 0xeb16cb10, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMViewportArray, 0xeb16cb11, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMFrameArray, 0xeb16cb12, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMVisualArray, 0xeb16cb13, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMLightArray, 0xeb16cb14, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMPickedArray, 0xeb16cb16, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMFaceArray, 0xeb16cb17, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMAnimationArray, 0xd5f1cae0, 0x4bd7, 0x11d1, 0xb9, 0x74, 0x00, 0x60, 0x08, 0x3e, 0x45, 0xf3); +DEFINE_GUID(IID_IDirect3DRMUserVisual, 0x59163de0, 0x6d43, 0x11cf, 0xac, 0x4a, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMShadow, 0xaf359780, 0x6ba3, 0x11cf, 0xac, 0x4a, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMShadow2, 0x86b44e25, 0x9c82, 0x11d1, 0xbb, 0x0b, 0x00, 0xa0, 0xc9, 0x81, 0xa0, 0xa6); +DEFINE_GUID(IID_IDirect3DRMInterpolator, 0x242f6bc1, 0x3849, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(IID_IDirect3DRMProgressiveMesh, 0x4516ec79, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(IID_IDirect3DRMPicked2Array, 0x4516ec7b, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(IID_IDirect3DRMClippedVisual, 0x5434e733, 0x6d66, 0x11d1, 0xbb, 0x0b, 0x00, 0x00, 0xf8, 0x75, 0x86, 0x5a); + +/***************************************************************************** + * Predeclare the interfaces + */ + +typedef struct IDirect3DRMObject *LPDIRECT3DRMOBJECT, **LPLPDIRECT3DRMOBJECT; +typedef struct IDirect3DRMObject2 *LPDIRECT3DRMOBJECT2, **LPLPDIRECT3DRMOBJECT2; +typedef struct IDirect3DRMDevice *LPDIRECT3DRMDEVICE, **LPLPDIRECT3DRMDEVICE; +typedef struct IDirect3DRMDevice2 *LPDIRECT3DRMDEVICE2, **LPLPDIRECT3DRMDEVICE2; +typedef struct IDirect3DRMDevice3 *LPDIRECT3DRMDEVICE3, **LPLPDIRECT3DRMDEVICE3; +typedef struct IDirect3DRMViewport *LPDIRECT3DRMVIEWPORT, **LPLPDIRECT3DRMVIEWPORT; +typedef struct IDirect3DRMViewport2 *LPDIRECT3DRMVIEWPORT2, **LPLPDIRECT3DRMVIEWPORT2; +typedef struct IDirect3DRMFrame *LPDIRECT3DRMFRAME, **LPLPDIRECT3DRMFRAME; +typedef struct IDirect3DRMFrame2 *LPDIRECT3DRMFRAME2, **LPLPDIRECT3DRMFRAME2; +typedef struct IDirect3DRMFrame3 *LPDIRECT3DRMFRAME3, **LPLPDIRECT3DRMFRAME3; +typedef struct IDirect3DRMVisual *LPDIRECT3DRMVISUAL, **LPLPDIRECT3DRMVISUAL; +typedef struct IDirect3DRMMesh *LPDIRECT3DRMMESH, **LPLPDIRECT3DRMMESH; +typedef struct IDirect3DRMMeshBuilder *LPDIRECT3DRMMESHBUILDER, **LPLPDIRECT3DRMMESHBUILDER; +typedef struct IDirect3DRMMeshBuilder2 *LPDIRECT3DRMMESHBUILDER2, **LPLPDIRECT3DRMMESHBUILDER2; +typedef struct IDirect3DRMMeshBuilder3 *LPDIRECT3DRMMESHBUILDER3, **LPLPDIRECT3DRMMESHBUILDER3; +typedef struct IDirect3DRMFace *LPDIRECT3DRMFACE, **LPLPDIRECT3DRMFACE; +typedef struct IDirect3DRMFace2 *LPDIRECT3DRMFACE2, **LPLPDIRECT3DRMFACE2; +typedef struct IDirect3DRMLight *LPDIRECT3DRMLIGHT, **LPLPDIRECT3DRMLIGHT; +typedef struct IDirect3DRMTexture *LPDIRECT3DRMTEXTURE, **LPLPDIRECT3DRMTEXTURE; +typedef struct IDirect3DRMTexture2 *LPDIRECT3DRMTEXTURE2, **LPLPDIRECT3DRMTEXTURE2; +typedef struct IDirect3DRMTexture3 *LPDIRECT3DRMTEXTURE3, **LPLPDIRECT3DRMTEXTURE3; +typedef struct IDirect3DRMWrap *LPDIRECT3DRMWRAP, **LPLPDIRECT3DRMWRAP; +typedef struct IDirect3DRMMaterial *LPDIRECT3DRMMATERIAL, **LPLPDIRECT3DRMMATERIAL; +typedef struct IDirect3DRMMaterial2 *LPDIRECT3DRMMATERIAL2, **LPLPDIRECT3DRMMATERIAL2; +typedef struct IDirect3DRMAnimation *LPDIRECT3DRMANIMATION, **LPLPDIRECT3DRMANIMATION; +typedef struct IDirect3DRMAnimation2 *LPDIRECT3DRMANIMATION2, **LPLPDIRECT3DRMANIMATION2; +typedef struct IDirect3DRMAnimationSet *LPDIRECT3DRMANIMATIONSET, **LPLPDIRECT3DRMANIMATIONSET; +typedef struct IDirect3DRMAnimationSet2 *LPDIRECT3DRMANIMATIONSET2, **LPLPDIRECT3DRMANIMATIONSET2; +typedef struct IDirect3DRMUserVisual *LPDIRECT3DRMUSERVISUAL, **LPLPDIRECT3DRMUSERVISUAL; +typedef struct IDirect3DRMShadow *LPDIRECT3DRMSHADOW, **LPLPDIRECT3DRMSHADOW; +typedef struct IDirect3DRMShadow2 *LPDIRECT3DRMSHADOW2, **LPLPDIRECT3DRMSHADOW2; +typedef struct IDirect3DRMArray *LPDIRECT3DRMARRAY, **LPLPDIRECT3DRMARRAY; +typedef struct IDirect3DRMObjectArray *LPDIRECT3DRMOBJECTARRAY, **LPLPDIRECT3DRMOBJECTARRAY; +typedef struct IDirect3DRMDeviceArray *LPDIRECT3DRMDEVICEARRAY, **LPLPDIRECT3DRMDEVICEARRAY; +typedef struct IDirect3DRMFaceArray *LPDIRECT3DRMFACEARRAY, **LPLPDIRECT3DRMFACEARRAY; +typedef struct IDirect3DRMViewportArray *LPDIRECT3DRMVIEWPORTARRAY, **LPLPDIRECT3DRMVIEWPORTARRAY; +typedef struct IDirect3DRMFrameArray *LPDIRECT3DRMFRAMEARRAY, **LPLPDIRECT3DRMFRAMEARRAY; +typedef struct IDirect3DRMAnimationArray *LPDIRECT3DRMANIMATIONARRAY, **LPLPDIRECT3DRMANIMATIONARRAY; +typedef struct IDirect3DRMVisualArray *LPDIRECT3DRMVISUALARRAY, **LPLPDIRECT3DRMVISUALARRAY; +typedef struct IDirect3DRMPickedArray *LPDIRECT3DRMPICKEDARRAY, **LPLPDIRECT3DRMPICKEDARRAY; +typedef struct IDirect3DRMPicked2Array *LPDIRECT3DRMPICKED2ARRAY, **LPLPDIRECT3DRMPICKED2ARRAY; +typedef struct IDirect3DRMLightArray *LPDIRECT3DRMLIGHTARRAY, **LPLPDIRECT3DRMLIGHTARRAY; +typedef struct IDirect3DRMProgressiveMesh *LPDIRECT3DRMPROGRESSIVEMESH, **LPLPDIRECT3DRMPROGRESSIVEMESH; +typedef struct IDirect3DRMClippedVisual *LPDIRECT3DRMCLIPPEDVISUAL, **LPLPDIRECT3DRMCLIPPEDVISUAL; + +/* ******************************************************************** + Types and structures + ******************************************************************** */ + +typedef void (__cdecl *D3DRMOBJECTCALLBACK)(struct IDirect3DRMObject *obj, void *arg); +typedef void (__cdecl *D3DRMFRAMEMOVECALLBACK)(struct IDirect3DRMFrame *frame, void *ctx, D3DVALUE delta); +typedef void (__cdecl *D3DRMFRAME3MOVECALLBACK)(struct IDirect3DRMFrame3 *frame, void *ctx, D3DVALUE delta); +typedef void (__cdecl *D3DRMUPDATECALLBACK)(struct IDirect3DRMDevice *device, void *ctx, int count, D3DRECT *rects); +typedef void (__cdecl *D3DRMDEVICE3UPDATECALLBACK)(struct IDirect3DRMDevice3 *device, void *ctx, + int count, D3DRECT *rects); +typedef int (__cdecl *D3DRMUSERVISUALCALLBACK)(struct IDirect3DRMUserVisual *visual, void *ctx, + D3DRMUSERVISUALREASON reason, struct IDirect3DRMDevice *device, struct IDirect3DRMViewport *viewport); +typedef HRESULT (__cdecl *D3DRMLOADTEXTURECALLBACK)(char *tex_name, void *arg, struct IDirect3DRMTexture **texture); +typedef HRESULT (__cdecl *D3DRMLOADTEXTURE3CALLBACK)(char *tex_name, void *arg, struct IDirect3DRMTexture3 **texture); +typedef void (__cdecl *D3DRMLOADCALLBACK)(struct IDirect3DRMObject *object, REFIID objectguid, void *arg); +typedef HRESULT (__cdecl *D3DRMDOWNSAMPLECALLBACK)(struct IDirect3DRMTexture3 *texture, void *ctx, + IDirectDrawSurface *src_surface, IDirectDrawSurface *dst_surface); +typedef HRESULT (__cdecl *D3DRMVALIDATIONCALLBACK)(struct IDirect3DRMTexture3 *texture, void *ctx, + DWORD flags, DWORD rect_count, RECT *rects); + +typedef struct _D3DRMPICKDESC +{ + ULONG ulFaceIdx; + LONG lGroupIdx; + D3DVECTOR vPosition; +} D3DRMPICKDESC, *LPD3DRMPICKDESC; + +typedef struct _D3DRMPICKDESC2 +{ + ULONG ulFaceIdx; + LONG lGroupIdx; + D3DVECTOR vPosition; + D3DVALUE tu; + D3DVALUE tv; + D3DVECTOR dvNormal; + D3DCOLOR dcColor; +} D3DRMPICKDESC2, *LPD3DRMPICKDESC2; + +/***************************************************************************** + * IDirect3DRMObject interface + */ +#ifdef WINE_NO_UNICODE_MACROS +#undef GetClassName +#endif +#define INTERFACE IDirect3DRMObject +DECLARE_INTERFACE_(IDirect3DRMObject,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMObject_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMObject_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMObject_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMObject_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMObject_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMObject_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMObject_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMObject_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMObject_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMObject_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMObject_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMObject_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMObject_AddRef(p) (p)->AddRef() +#define IDirect3DRMObject_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMObject_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMObject_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMObject_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMObject_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMObject_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMObject_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMObject_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMObject_GetClassName(p,a,b) (p)->GetClassName(a,b) +#endif + +/***************************************************************************** + * IDirect3DRMObject2 interface + */ +#ifdef WINE_NO_UNICODE_MACROS +#undef GetClassName +#endif +#define INTERFACE IDirect3DRMObject2 +DECLARE_INTERFACE_(IDirect3DRMObject2,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject2 methods ***/ + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(GetClientData)(THIS_ DWORD id, void **data) PURE; + STDMETHOD(GetDirect3DRM)(THIS_ struct IDirect3DRM **d3drm) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(SetClientData)(THIS_ DWORD id, void *data, DWORD flags) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetAge)(THIS_ DWORD flags, DWORD *age) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMObject2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMObject2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMObject2_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject2 methods ***/ +#define IDirect3DRMObject2_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMObject2_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMObject2_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMObject2_GetClientData(p,a,b) (p)->lpVtbl->SetClientData(p,a,b) +#define IDirect3DRMObject2_GetDirect3DRM(p,a) (p)->lpVtbl->GetDirect3DRM(p,a) +#define IDirect3DRMObject2_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMObject2_SetClientData(p,a,b,c) (p)->lpVtbl->SetClientData(p,a,b,c) +#define IDirect3DRMObject2_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMObject2_GetAge(p,a,b) (p)->lpVtbl->GetAge(p,a,b) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMObject2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMObject2_AddRef(p) (p)->AddRef() +#define IDirect3DRMObject2_Release(p) (p)->Release() +/*** IDirect3DRMObject2 methods ***/ +#define IDirect3DRMObject2_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMObject2_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMObject2_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMObject2_GetClientData(p,a,b) (p)->SetClientData(a,b) +#define IDirect3DRMObject2_GetDirect3DRM(p,a) (p)->GetDirect3DRM(a) +#define IDirect3DRMObject2_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMObject2_SetClientData(p,a,b,c) (p)->SetClientData(a,b,c) +#define IDirect3DRMObject2_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMObject2_GetAge(p,a,b) (p)->GetAge(a,b) +#endif + +/***************************************************************************** + * IDirect3DRMVisual interface + */ +#define INTERFACE IDirect3DRMVisual +DECLARE_INTERFACE_(IDirect3DRMVisual,IDirect3DRMObject) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMVisual_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMVisual_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMVisual_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMVisual_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMVisual_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMVisual_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMVisual_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMVisual_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMVisual_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMVisual_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMVisual_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMVisual_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMVisual_AddRef(p) (p)->AddRef() +#define IDirect3DRMVisual_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMVisual_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMVisual_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMVisual_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMVisual_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMVisual_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMVisual_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMVisual_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMVisual_GetClassName(p,a,b) (p)->GetClassName(a,b) +#endif + +/***************************************************************************** + * IDirect3DRMDevice interface + */ +#ifdef WINE_NO_UNICODE_MACROS +#undef GetClassName +#endif +#define INTERFACE IDirect3DRMDevice +DECLARE_INTERFACE_(IDirect3DRMDevice,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMDevice methods ***/ + STDMETHOD(Init)(THIS_ ULONG width, ULONG height) PURE; + STDMETHOD(InitFromD3D)(THIS_ IDirect3D *d3d, IDirect3DDevice *d3d_device) PURE; + STDMETHOD(InitFromClipper)(THIS_ IDirectDrawClipper *clipper, GUID *guid, int width, int height) PURE; + STDMETHOD(Update)(THIS) PURE; + STDMETHOD(AddUpdateCallback)(THIS_ D3DRMUPDATECALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteUpdateCallback)(THIS_ D3DRMUPDATECALLBACK cb, void *ctx) PURE; + STDMETHOD(SetBufferCount)(THIS_ DWORD) PURE; + STDMETHOD_(DWORD, GetBufferCount)(THIS) PURE; + STDMETHOD(SetDither)(THIS_ BOOL) PURE; + STDMETHOD(SetShades)(THIS_ DWORD) PURE; + STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; + STDMETHOD(SetTextureQuality)(THIS_ D3DRMTEXTUREQUALITY) PURE; + STDMETHOD(GetViewports)(THIS_ struct IDirect3DRMViewportArray **array) PURE; + STDMETHOD_(BOOL, GetDither)(THIS) PURE; + STDMETHOD_(DWORD, GetShades)(THIS) PURE; + STDMETHOD_(DWORD, GetHeight)(THIS) PURE; + STDMETHOD_(DWORD, GetWidth)(THIS) PURE; + STDMETHOD_(DWORD, GetTrianglesDrawn)(THIS) PURE; + STDMETHOD_(DWORD, GetWireframeOptions)(THIS) PURE; + STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; + STDMETHOD_(D3DCOLORMODEL, GetColorModel)(THIS) PURE; + STDMETHOD_(D3DRMTEXTUREQUALITY, GetTextureQuality)(THIS) PURE; + STDMETHOD(GetDirect3DDevice)(THIS_ IDirect3DDevice **d3d_device) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMDevice_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMDevice_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMDevice_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMDevice_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMDevice_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMDevice_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMDevice_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMDevice_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMDevice_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMDevice_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMDevice methods ***/ +#define IDirect3DRMDevice_Init(p,a,b) (p)->lpVtbl->Init(p,a,b) +#define IDirect3DRMDevice_InitFromD3D(p,a,b) (p)->lpVtbl->InitFromD3D(p,a,b) +#define IDirect3DRMDevice_InitFromClipper(p,a,b,c,d) (p)->lpVtbl->InitFromClipper(p,a,b,c,d) +#define IDirect3DRMDevice_Update(p) (p)->lpVtbl->Update(p) +#define IDirect3DRMDevice_AddUpdateCallback(p,a,b) (p)->lpVtbl->AddUpdateCallback(p,a,b) +#define IDirect3DRMDevice_DeleteUpdateCallback(p,a,b) (p)->lpVtbl->DeleteUpdateCallback(p,a,b) +#define IDirect3DRMDevice_SetBufferCount(p,a) (p)->lpVtbl->SetBufferCount(p,a) +#define IDirect3DRMDevice_GetBufferCount(p) (p)->lpVtbl->GetBufferCount(p) +#define IDirect3DRMDevice_SetDither(p,a) (p)->lpVtbl->SetDither(p,a) +#define IDirect3DRMDevice_SetShades(p,a) (p)->lpVtbl->SetShades(p,a) +#define IDirect3DRMDevice_SetQuality(p,a) (p)->lpVtbl->SetQuality(p,a) +#define IDirect3DRMDevice_SetTextureQuality(p,a) (p)->lpVtbl->SetTextureQuality(p,a) +#define IDirect3DRMDevice_GetViewports(p,a) (p)->lpVtbl->GetViewports(p,a) +#define IDirect3DRMDevice_GetDither(p) (p)->lpVtbl->GetDither(p) +#define IDirect3DRMDevice_GetShades(p) (p)->lpVtbl->GetShades(p) +#define IDirect3DRMDevice_GetHeight(p) (p)->lpVtbl->GetHeight(p) +#define IDirect3DRMDevice_GetWidth(p) (p)->lpVtbl->GetWidth(p) +#define IDirect3DRMDevice_GetTrianglesDrawn(p) (p)->lpVtbl->GetTrianglesDrawn(p) +#define IDirect3DRMDevice_GetWireframeOptions(p) (p)->lpVtbl->GetWireframeOptions(p) +#define IDirect3DRMDevice_GetQuality(p) (p)->lpVtbl->GetQuality(p) +#define IDirect3DRMDevice_GetColorModel(p) (p)->lpVtbl->GetColorModel(p) +#define IDirect3DRMDevice_GetTextureQuality(p) (p)->lpVtbl->GetTextureQuality(p) +#define IDirect3DRMDevice_GetDirect3DDevice(p,a) (p)->lpVtbl->GetDirect3DDevice(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMDevice_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMDevice_AddRef(p) (p)->AddRef() +#define IDirect3DRMDevice_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMDevice_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMDevice_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMDevice_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMDevice_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMDevice_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMDevice_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMDevice_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMDevice_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMDevice methods ***/ +#define IDirect3DRMDevice_Init(p,a,b) (p)->Init(a,b) +#define IDirect3DRMDevice_InitFromD3D(p,a,b) (p)->InitFromD3D(a,b) +#define IDirect3DRMDevice_InitFromClipper(p,a,b,c,d) (p)->InitFromClipper(a,b,c,d) +#define IDirect3DRMDevice_Update(p) (p)->Update() +#define IDirect3DRMDevice_AddUpdateCallback(p,a,b) (p)->AddUpdateCallback(a,b) +#define IDirect3DRMDevice_DeleteUpdateCallback(p,a,b) (p)->DeleteUpdateCallback(a,b) +#define IDirect3DRMDevice_SetBufferCount(p,a) (p)->SetBufferCount(a) +#define IDirect3DRMDevice_GetBufferCount(p) (p)->GetBufferCount() +#define IDirect3DRMDevice_SetDither(p,a) (p)->SetDither(a) +#define IDirect3DRMDevice_SetShades(p,a) (p)->SetShades(a) +#define IDirect3DRMDevice_SetQuality(p,a) (p)->SetQuality(a) +#define IDirect3DRMDevice_SetTextureQuality(p,a) (p)->SetTextureQuality(a) +#define IDirect3DRMDevice_GetViewports(p,a) (p)->GetViewports(a) +#define IDirect3DRMDevice_GetDither(p) (p)->GetDither() +#define IDirect3DRMDevice_GetShades(p) (p)->GetShades() +#define IDirect3DRMDevice_GetHeight(p) (p)->GetHeight() +#define IDirect3DRMDevice_GetWidth(p) (p)->GetWidth() +#define IDirect3DRMDevice_GetTrianglesDrawn(p) (p)->GetTrianglesDrawn() +#define IDirect3DRMDevice_GetWireframeOptions(p) (p)->GetWireframeOptions() +#define IDirect3DRMDevice_GetQuality(p) (p)->GetQuality() +#define IDirect3DRMDevice_GetColorModel(p) (p)->GetColorModel() +#define IDirect3DRMDevice_GetTextureQuality(p) (p)->GetTextureQuality() +#define IDirect3DRMDevice_GetDirect3DDevice(p,a) (p)->GetDirect3DDevice(a) +#endif + +/***************************************************************************** + * IDirect3DRMDevice2 interface + */ +#ifdef WINE_NO_UNICODE_MACROS +#undef GetClassName +#endif +#define INTERFACE IDirect3DRMDevice2 +DECLARE_INTERFACE_(IDirect3DRMDevice2,IDirect3DRMDevice) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMDevice methods ***/ + STDMETHOD(Init)(THIS_ ULONG width, ULONG height) PURE; + STDMETHOD(InitFromD3D)(THIS_ IDirect3D *d3d, IDirect3DDevice *d3d_device) PURE; + STDMETHOD(InitFromClipper)(THIS_ IDirectDrawClipper *clipper, GUID *guid, int width, int height) PURE; + STDMETHOD(Update)(THIS) PURE; + STDMETHOD(AddUpdateCallback)(THIS_ D3DRMUPDATECALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteUpdateCallback)(THIS_ D3DRMUPDATECALLBACK cb, void *ctx) PURE; + STDMETHOD(SetBufferCount)(THIS_ DWORD) PURE; + STDMETHOD_(DWORD, GetBufferCount)(THIS) PURE; + STDMETHOD(SetDither)(THIS_ BOOL) PURE; + STDMETHOD(SetShades)(THIS_ DWORD) PURE; + STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; + STDMETHOD(SetTextureQuality)(THIS_ D3DRMTEXTUREQUALITY) PURE; + STDMETHOD(GetViewports)(THIS_ struct IDirect3DRMViewportArray **array) PURE; + STDMETHOD_(BOOL, GetDither)(THIS) PURE; + STDMETHOD_(DWORD, GetShades)(THIS) PURE; + STDMETHOD_(DWORD, GetHeight)(THIS) PURE; + STDMETHOD_(DWORD, GetWidth)(THIS) PURE; + STDMETHOD_(DWORD, GetTrianglesDrawn)(THIS) PURE; + STDMETHOD_(DWORD, GetWireframeOptions)(THIS) PURE; + STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; + STDMETHOD_(D3DCOLORMODEL, GetColorModel)(THIS) PURE; + STDMETHOD_(D3DRMTEXTUREQUALITY, GetTextureQuality)(THIS) PURE; + STDMETHOD(GetDirect3DDevice)(THIS_ IDirect3DDevice **d3d_device) PURE; + /*** IDirect3DRMDevice2 methods ***/ + STDMETHOD(InitFromD3D2)(THIS_ IDirect3D2 *d3d, IDirect3DDevice2 *device) PURE; + STDMETHOD(InitFromSurface)(THIS_ GUID *guid, IDirectDraw *ddraw, IDirectDrawSurface *surface) PURE; + STDMETHOD(SetRenderMode)(THIS_ DWORD flags) PURE; + STDMETHOD_(DWORD, GetRenderMode)(THIS) PURE; + STDMETHOD(GetDirect3DDevice2)(THIS_ IDirect3DDevice2 **device) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMDevice2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMDevice2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMDevice2_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMDevice2_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMDevice2_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMDevice2_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMDevice2_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMDevice2_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMDevice2_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMDevice2_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMDevice2_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMDevice methods ***/ +#define IDirect3DRMDevice2_Init(p,a,b) (p)->lpVtbl->Init(p,a,b) +#define IDirect3DRMDevice2_InitFromD3D(p,a,b) (p)->lpVtbl->InitFromD3D(p,a,b) +#define IDirect3DRMDevice2_InitFromClipper(p,a,b,c,d) (p)->lpVtbl->InitFromClipper(p,a,b,c,d) +#define IDirect3DRMDevice2_Update(p) (p)->lpVtbl->Update(p) +#define IDirect3DRMDevice2_AddUpdateCallback(p,a,b) (p)->lpVtbl->AddUpdateCallback(p,a,b) +#define IDirect3DRMDevice2_DeleteUpdateCallback(p,a,b) (p)->lpVtbl->DeleteUpdateCallback(p,a,b) +#define IDirect3DRMDevice2_SetBufferCount(p,a) (p)->lpVtbl->SetBufferCount(p,a) +#define IDirect3DRMDevice2_GetBufferCount(p) (p)->lpVtbl->GetBufferCount(p) +#define IDirect3DRMDevice2_SetDither(p,a) (p)->lpVtbl->SetDither(p,a) +#define IDirect3DRMDevice2_SetShades(p,a) (p)->lpVtbl->SetShades(p,a) +#define IDirect3DRMDevice2_SetQuality(p,a) (p)->lpVtbl->SetQuality(p,a) +#define IDirect3DRMDevice2_SetTextureQuality(p,a) (p)->lpVtbl->SetTextureQuality(p,a) +#define IDirect3DRMDevice2_GetViewports(p,a) (p)->lpVtbl->GetViewports(p,a) +#define IDirect3DRMDevice2_GetDither(p) (p)->lpVtbl->GetDither(p) +#define IDirect3DRMDevice2_GetShades(p) (p)->lpVtbl->GetShades(p) +#define IDirect3DRMDevice2_GetHeight(p) (p)->lpVtbl->GetHeight(p) +#define IDirect3DRMDevice2_GetWidth(p) (p)->lpVtbl->GetWidth(p) +#define IDirect3DRMDevice2_GetTrianglesDrawn(p) (p)->lpVtbl->GetTrianglesDrawn(p) +#define IDirect3DRMDevice2_GetWireframeOptions(p) (p)->lpVtbl->GetWireframeOptions(p) +#define IDirect3DRMDevice2_GetQuality(p) (p)->lpVtbl->GetQuality(p) +#define IDirect3DRMDevice2_GetColorModel(p) (p)->lpVtbl->GetColorModel(p) +#define IDirect3DRMDevice2_GetTextureQuality(p) (p)->lpVtbl->GetTextureQuality(p) +#define IDirect3DRMDevice2_GetDirect3DDevice(p,a) (p)->lpVtbl->GetDirect3DDevice(p,a) +/*** IDirect3DRMDevice2 methods ***/ +#define IDirect3DRMDevice2_InitFromD3D2(p,a,b) (p)->lpVtbl->InitFromD3D2(p,a,b) +#define IDirect3DRMDevice2_InitFromSurface(p,a,b,c) (p)->lpVtbl->InitFromSurface(p,a,b,c) +#define IDirect3DRMDevice2_SetRenderMode(p,a) (p)->lpVtbl->SetRenderMode(p,a) +#define IDirect3DRMDevice2_GetRenderMode(p) (p)->lpVtbl->GetRenderMode(p) +#define IDirect3DRMDevice2_GetDirect3DDevice2(p,a) (p)->lpVtbl->GetDirect3DDevice2(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMDevice2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMDevice2_AddRef(p) (p)->AddRef() +#define IDirect3DRMDevice2_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMDevice2_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMDevice2_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMDevice2_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMDevice2_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMDevice2_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMDevice2_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMDevice2_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMDevice2_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMDevice methods ***/ +#define IDirect3DRMDevice2_Init(p,a,b) (p)->Init(a,b) +#define IDirect3DRMDevice2_InitFromD3D(p,a,b) (p)->InitFromD3D(a,b) +#define IDirect3DRMDevice2_InitFromClipper(p,a,b,c,d) (p)->InitFromClipper(a,b,c,d) +#define IDirect3DRMDevice2_Update(p) (p)->Update() +#define IDirect3DRMDevice2_AddUpdateCallback(p,a,b) (p)->AddUpdateCallback(a,b) +#define IDirect3DRMDevice2_DeleteUpdateCallback(p,a,b) (p)->DeleteUpdateCallback(a,b) +#define IDirect3DRMDevice2_SetBufferCount(p,a) (p)->SetBufferCount(a) +#define IDirect3DRMDevice2_GetBufferCount(p) (p)->GetBufferCount() +#define IDirect3DRMDevice2_SetDither(p,a) (p)->SetDither(a) +#define IDirect3DRMDevice2_SetShades(p,a) (p)->SetShades(a) +#define IDirect3DRMDevice2_SetQuality(p,a) (p)->SetQuality(a) +#define IDirect3DRMDevice2_SetTextureQuality(p,a) (p)->SetTextureQuality(a) +#define IDirect3DRMDevice2_GetViewports(p,a) (p)->GetViewports(a) +#define IDirect3DRMDevice2_GetDither(p) (p)->GetDither() +#define IDirect3DRMDevice2_GetShades(p) (p)->GetShades() +#define IDirect3DRMDevice2_GetHeight(p) (p)->GetHeight() +#define IDirect3DRMDevice2_GetWidth(p) (p)->GetWidth() +#define IDirect3DRMDevice2_GetTrianglesDrawn(p) (p)->GetTrianglesDrawn() +#define IDirect3DRMDevice2_GetWireframeOptions(p) (p)->GetWireframeOptions() +#define IDirect3DRMDevice2_GetQuality(p) (p)->GetQuality() +#define IDirect3DRMDevice2_GetColorModel(p) (p)->GetColorModel() +#define IDirect3DRMDevice2_GetTextureQuality(p) (p)->GetTextureQuality() +#define IDirect3DRMDevice2_GetDirect3DDevice(p,a) (p)->GetDirect3DDevice(a) +/*** IDirect3DRMDevice2 methods ***/ +#define IDirect3DRMDevice2_InitFromD3D2(p,a,b) (p)->InitFromD3D2(a,b) +#define IDirect3DRMDevice2_InitFromSurface(p,a,b,c) (p)->InitFromSurface(a,b,c) +#define IDirect3DRMDevice2_SetRenderMode(p,a) (p)->SetRenderMode(a) +#define IDirect3DRMDevice2_GetRenderMode(p) (p)->GetRenderMode() +#define IDirect3DRMDevice2_GetDirect3DDevice2(p,a) (p)->GetDirect3DDevice2(a) +#endif + +/***************************************************************************** + * IDirect3DRMDevice3 interface + */ +#ifdef WINE_NO_UNICODE_MACROS +#undef GetClassName +#endif +#define INTERFACE IDirect3DRMDevice3 +DECLARE_INTERFACE_(IDirect3DRMDevice3,IDirect3DRMObject) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMDevice methods ***/ + STDMETHOD(Init)(THIS_ ULONG width, ULONG height) PURE; + STDMETHOD(InitFromD3D)(THIS_ IDirect3D *d3d, IDirect3DDevice *d3d_device) PURE; + STDMETHOD(InitFromClipper)(THIS_ IDirectDrawClipper *clipper, GUID *guid, int width, int height) PURE; + STDMETHOD(Update)(THIS) PURE; + STDMETHOD(AddUpdateCallback)(THIS_ D3DRMUPDATECALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteUpdateCallback)(THIS_ D3DRMUPDATECALLBACK cb, void *ctx) PURE; + STDMETHOD(SetBufferCount)(THIS_ DWORD) PURE; + STDMETHOD_(DWORD, GetBufferCount)(THIS) PURE; + STDMETHOD(SetDither)(THIS_ BOOL) PURE; + STDMETHOD(SetShades)(THIS_ DWORD) PURE; + STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; + STDMETHOD(SetTextureQuality)(THIS_ D3DRMTEXTUREQUALITY) PURE; + STDMETHOD(GetViewports)(THIS_ struct IDirect3DRMViewportArray **array) PURE; + STDMETHOD_(BOOL, GetDither)(THIS) PURE; + STDMETHOD_(DWORD, GetShades)(THIS) PURE; + STDMETHOD_(DWORD, GetHeight)(THIS) PURE; + STDMETHOD_(DWORD, GetWidth)(THIS) PURE; + STDMETHOD_(DWORD, GetTrianglesDrawn)(THIS) PURE; + STDMETHOD_(DWORD, GetWireframeOptions)(THIS) PURE; + STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; + STDMETHOD_(D3DCOLORMODEL, GetColorModel)(THIS) PURE; + STDMETHOD_(D3DRMTEXTUREQUALITY, GetTextureQuality)(THIS) PURE; + STDMETHOD(GetDirect3DDevice)(THIS_ IDirect3DDevice **d3d_device) PURE; + /*** IDirect3DRMDevice2 methods ***/ + STDMETHOD(InitFromD3D2)(THIS_ IDirect3D2 *d3d, IDirect3DDevice2 *device) PURE; + STDMETHOD(InitFromSurface)(THIS_ GUID *guid, IDirectDraw *ddraw, IDirectDrawSurface *surface) PURE; + STDMETHOD(SetRenderMode)(THIS_ DWORD flags) PURE; + STDMETHOD_(DWORD, GetRenderMode)(THIS) PURE; + STDMETHOD(GetDirect3DDevice2)(THIS_ IDirect3DDevice2 **device) PURE; + /*** IDirect3DRMDevice3 methods ***/ + STDMETHOD(FindPreferredTextureFormat)(THIS_ DWORD BitDepths, DWORD flags, DDPIXELFORMAT *format) PURE; + STDMETHOD(RenderStateChange)(THIS_ D3DRENDERSTATETYPE drsType, DWORD val, DWORD flags) PURE; + STDMETHOD(LightStateChange)(THIS_ D3DLIGHTSTATETYPE drsType, DWORD val, DWORD flags) PURE; + STDMETHOD(GetStateChangeOptions)(THIS_ DWORD state_class, DWORD state_idx, DWORD *flags) PURE; + STDMETHOD(SetStateChangeOptions)(THIS_ DWORD StateClass, DWORD StateNum, DWORD flags) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMDevice3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMDevice3_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMDevice3_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMDevice3_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMDevice3_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMDevice3_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMDevice3_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMDevice3_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMDevice3_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMDevice3_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMDevice3_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMDevice methods ***/ +#define IDirect3DRMDevice3_Init(p,a,b) (p)->lpVtbl->Init(p,a,b) +#define IDirect3DRMDevice3_InitFromD3D(p,a,b) (p)->lpVtbl->InitFromD3D(p,a,b) +#define IDirect3DRMDevice3_InitFromClipper(p,a,b,c,d) (p)->lpVtbl->InitFromClipper(p,a,b,c,d) +#define IDirect3DRMDevice3_Update(p) (p)->lpVtbl->Update(p) +#define IDirect3DRMDevice3_AddUpdateCallback(p,a,b) (p)->lpVtbl->AddUpdateCallback(p,a,b) +#define IDirect3DRMDevice3_DeleteUpdateCallback(p,a,b) (p)->lpVtbl->DeleteUpdateCallback(p,a,b) +#define IDirect3DRMDevice3_SetBufferCount(p,a) (p)->lpVtbl->SetBufferCount(p,a) +#define IDirect3DRMDevice3_GetBufferCount(p) (p)->lpVtbl->GetBufferCount(p) +#define IDirect3DRMDevice3_SetDither(p,a) (p)->lpVtbl->SetDither(p,a) +#define IDirect3DRMDevice3_SetShades(p,a) (p)->lpVtbl->SetShades(p,a) +#define IDirect3DRMDevice3_SetQuality(p,a) (p)->lpVtbl->SetQuality(p,a) +#define IDirect3DRMDevice3_SetTextureQuality(p,a) (p)->lpVtbl->SetTextureQuality(p,a) +#define IDirect3DRMDevice3_GetViewports(p,a) (p)->lpVtbl->GetViewports(p,a) +#define IDirect3DRMDevice3_GetDither(p) (p)->lpVtbl->GetDither(p) +#define IDirect3DRMDevice3_GetShades(p) (p)->lpVtbl->GetShades(p) +#define IDirect3DRMDevice3_GetHeight(p) (p)->lpVtbl->GetHeight(p) +#define IDirect3DRMDevice3_GetWidth(p) (p)->lpVtbl->GetWidth(p) +#define IDirect3DRMDevice3_GetTrianglesDrawn(p) (p)->lpVtbl->GetTrianglesDrawn(p) +#define IDirect3DRMDevice3_GetWireframeOptions(p) (p)->lpVtbl->GetWireframeOptions(p) +#define IDirect3DRMDevice3_GetQuality(p) (p)->lpVtbl->GetQuality(p) +#define IDirect3DRMDevice3_GetColorModel(p) (p)->lpVtbl->GetColorModel(p) +#define IDirect3DRMDevice3_GetTextureQuality(p) (p)->lpVtbl->GetTextureQuality(p) +#define IDirect3DRMDevice3_GetDirect3DDevice(p,a) (p)->lpVtbl->GetDirect3DDevice(p,a) +/*** IDirect3DRMDevice2 methods ***/ +#define IDirect3DRMDevice3_InitFromD3D2(p,a,b) (p)->lpVtbl->InitFromD3D2(p,a,b) +#define IDirect3DRMDevice3_InitFromSurface(p,a,b,c) (p)->lpVtbl->InitFromSurface(p,a,b,c) +#define IDirect3DRMDevice3_SetRenderMode(p,a) (p)->lpVtbl->SetRenderMode(p,a) +#define IDirect3DRMDevice3_GetRenderMode(p) (p)->lpVtbl->GetRenderMode(p) +#define IDirect3DRMDevice3_GetDirect3DDevice2(p,a) (p)->lpVtbl->GetDirect3DDevice2(p,a) +/*** IDirect3DRMDevice3 methods ***/ +#define IDirect3DRMDevice3_FindPreferredTextureFormat(p,a,b,c) (p)->lpVtbl->FindPreferredTextureFormat(p,a,b,c) +#define IDirect3DRMDevice3_RenderStateChange(p,a,b,c) (p)->lpVtbl->RenderStateChange(p,a,b,c) +#define IDirect3DRMDevice3_LightStateChange(p,a,b,c) (p)->lpVtbl->LightStateChange(p,a,b,c) +#define IDirect3DRMDevice3_GetStateChangeOptions(p,a,b,c) (p)->lpVtbl->GetStateChangeOptions(p,a,b,c) +#define IDirect3DRMDevice3_SetStateChangeOptions(p,a,b,c) (p)->lpVtbl->SetStateChangeOptions(p,a,b,c) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMDevice3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMDevice3_AddRef(p) (p)->AddRef() +#define IDirect3DRMDevice3_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMDevice3_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMDevice3_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMDevice3_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMDevice3_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMDevice3_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMDevice3_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMDevice3_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMDevice3_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMDevice methods ***/ +#define IDirect3DRMDevice3_Init(p,a,b) (p)->Init(a,b) +#define IDirect3DRMDevice3_InitFromD3D(p,a,b) (p)->InitFromD3D(a,b) +#define IDirect3DRMDevice3_InitFromClipper(p,a,b,c,d) (p)->InitFromClipper(a,b,c,d) +#define IDirect3DRMDevice3_Update(p) (p)->Update() +#define IDirect3DRMDevice3_AddUpdateCallback(p,a,b) (p)->AddUpdateCallback(a,b) +#define IDirect3DRMDevice3_DeleteUpdateCallback(p,a,b) (p)->DeleteUpdateCallback(a,b) +#define IDirect3DRMDevice3_SetBufferCount(p,a) (p)->SetBufferCount(a) +#define IDirect3DRMDevice3_GetBufferCount(p) (p)->GetBufferCount() +#define IDirect3DRMDevice3_SetDither(p,a) (p)->SetDither(a) +#define IDirect3DRMDevice3_SetShades(p,a) (p)->SetShades(a) +#define IDirect3DRMDevice3_SetQuality(p,a) (p)->SetQuality(a) +#define IDirect3DRMDevice3_SetTextureQuality(p,a) (p)->SetTextureQuality(a) +#define IDirect3DRMDevice3_GetViewports(p,a) (p)->GetViewports(a) +#define IDirect3DRMDevice3_GetDither(p) (p)->GetDither() +#define IDirect3DRMDevice3_GetShades(p) (p)->GetShades() +#define IDirect3DRMDevice3_GetHeight(p) (p)->GetHeight() +#define IDirect3DRMDevice3_GetWidth(p) (p)->GetWidth() +#define IDirect3DRMDevice3_GetTrianglesDrawn(p) (p)->GetTrianglesDrawn() +#define IDirect3DRMDevice3_GetWireframeOptions(p) (p)->GetWireframeOptions() +#define IDirect3DRMDevice3_GetQuality(p) (p)->GetQuality() +#define IDirect3DRMDevice3_GetColorModel(p) (p)->GetColorModel() +#define IDirect3DRMDevice3_GetTextureQuality(p) (p)->GetTextureQuality() +#define IDirect3DRMDevice3_GetDirect3DDevice(p,a) (p)->GetDirect3DDevice(a) +/*** IDirect3DRMDevice2 methods ***/ +#define IDirect3DRMDevice3_InitFromD3D2(p,a,b) (p)->InitFromD3D2(a,b) +#define IDirect3DRMDevice3_InitFromSurface(p,a,b,c) (p)->InitFromSurface(a,b,c) +#define IDirect3DRMDevice3_SetRenderMode(p,a) (p)->SetRenderMode(a) +#define IDirect3DRMDevice3_GetRenderMode(p) (p)->GetRenderMode() +#define IDirect3DRMDevice3_GetDirect3DDevice2(p,a) (p)->GetDirect3DDevice2(a) +/*** IDirect3DRMDevice3 methods ***/ +#define IDirect3DRMDevice3_FindPreferredTextureFormat(p,a,b,c) (p)->FindPreferredTextureFormat(a,b,c) +#define IDirect3DRMDevice3_RenderStateChange(p,a,b,c) (p)->RenderStateChange(a,b,c) +#define IDirect3DRMDevice3_LightStateChange(p,a,b,c) (p)->LightStateChange(a,b,c) +#define IDirect3DRMDevice3_GetStateChangeOptions(p,a,b,c) (p)->GetStateChangeOptions(a,b,c) +#define IDirect3DRMDevice3_SetStateChangeOptions(p,a,b,c) (p)->SetStateChangeOptions(a,b,c) +#endif + +/***************************************************************************** + * IDirect3DRMViewport interface + */ +#define INTERFACE IDirect3DRMViewport +DECLARE_INTERFACE_(IDirect3DRMViewport,IDirect3DRMObject) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMViewport methods ***/ + STDMETHOD(Init) (THIS_ IDirect3DRMDevice *device, struct IDirect3DRMFrame *camera, + DWORD x, DWORD y, DWORD width, DWORD height) PURE; + STDMETHOD(Clear)(THIS) PURE; + STDMETHOD(Render)(THIS_ struct IDirect3DRMFrame *frame) PURE; + STDMETHOD(SetFront)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetBack)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetField)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetUniformScaling)(THIS_ BOOL) PURE; + STDMETHOD(SetCamera)(THIS_ struct IDirect3DRMFrame *camera) PURE; + STDMETHOD(SetProjection)(THIS_ D3DRMPROJECTIONTYPE) PURE; + STDMETHOD(Transform)(THIS_ D3DRMVECTOR4D *d, D3DVECTOR *s) PURE; + STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DRMVECTOR4D *s) PURE; + STDMETHOD(Configure)(THIS_ LONG x, LONG y, DWORD width, DWORD height) PURE; + STDMETHOD(ForceUpdate)(THIS_ DWORD x1, DWORD y1, DWORD x2, DWORD y2) PURE; + STDMETHOD(SetPlane)(THIS_ D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top) PURE; + STDMETHOD(GetCamera)(THIS_ struct IDirect3DRMFrame **camera) PURE; + STDMETHOD(GetDevice)(THIS_ IDirect3DRMDevice **device) PURE; + STDMETHOD(GetPlane)(THIS_ D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top) PURE; + STDMETHOD(Pick)(THIS_ LONG x, LONG y, struct IDirect3DRMPickedArray **visuals) PURE; + STDMETHOD_(BOOL, GetUniformScaling)(THIS) PURE; + STDMETHOD_(LONG, GetX)(THIS) PURE; + STDMETHOD_(LONG, GetY)(THIS) PURE; + STDMETHOD_(DWORD, GetWidth)(THIS) PURE; + STDMETHOD_(DWORD, GetHeight)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetField)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetBack)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetFront)(THIS) PURE; + STDMETHOD_(D3DRMPROJECTIONTYPE, GetProjection)(THIS) PURE; + STDMETHOD(GetDirect3DViewport)(THIS_ IDirect3DViewport **viewport) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMViewport_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMViewport_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMViewport_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMViewport_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMViewport_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMViewport_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMViewport_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMViewport_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMViewport_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMViewport_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMViewport_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMViewport methods ***/ +#define IDirect3DRMViewport_Init(p,a,b,c,d) (p)->lpVtbl->Init(p,a,b,c,d) +#define IDirect3DRMViewport_Clear(p) (p)->lpVtbl->Clear(p) +#define IDirect3DRMViewport_Render(p,a) (p)->lpVtbl->Render(p,a) +#define IDirect3DRMViewport_SetFront(p,a) (p)->lpVtbl->SetFront(p,a) +#define IDirect3DRMViewport_SetBack(p,a) (p)->lpVtbl->SetBack(p,a) +#define IDirect3DRMViewport_SetField(p,a) (p)->lpVtbl->SetField(p,a) +#define IDirect3DRMViewport_SetUniformScaling(p,a) (p)->lpVtbl->SetUniformScaling(p,a) +#define IDirect3DRMViewport_SetCamera(p,a) (p)->lpVtbl->SetCamera(p,a) +#define IDirect3DRMViewport_SetProjection(p,a) (p)->lpVtbl->SetProjection(p,a) +#define IDirect3DRMViewport_Transform(p,a,b) (p)->lpVtbl->Transform(p,a,b) +#define IDirect3DRMViewport_InverseTransform(p,a,b) (p)->lpVtbl->InverseTransform(p,a,b) +#define IDirect3DRMViewport_Configure(p,a,b,c,d) (p)->lpVtbl->Configure(p,a,b,c,d) +#define IDirect3DRMViewport_ForceUpdate(p,a,b,c,d) (p)->lpVtbl->ForceUpdate(p,a,b,c,d) +#define IDirect3DRMViewport_SetPlane(p,a,b,c,d) (p)->lpVtbl->SetPlane(p,a,b,c,d) +#define IDirect3DRMViewport_GetCamera(p,a) (p)->lpVtbl->GetCamera(p,a) +#define IDirect3DRMViewport_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DRMViewport_GetPlane(p,a,b,c,d) (p)->lpVtbl->GetPlane(p,a,b,c,d) +#define IDirect3DRMViewport_Pick(p,a,b,c) (p)->lpVtbl->Pick(p,a,b,c) +#define IDirect3DRMViewport_GetUniformScaling(p) (p)->lpVtbl->GetUniformScaling(p) +#define IDirect3DRMViewport_GetX(p) (p)->lpVtbl->GetX(p) +#define IDirect3DRMViewport_GetY(p) (p)->lpVtbl->GetY(p) +#define IDirect3DRMViewport_GetWidth(p) (p)->lpVtbl->GetWidth(p) +#define IDirect3DRMViewport_GetHeight(p) (p)->lpVtbl->GetHeight(p) +#define IDirect3DRMViewport_GetField(p) (p)->lpVtbl->GetField(p) +#define IDirect3DRMViewport_GetBack(p) (p)->lpVtbl->GetBack(p) +#define IDirect3DRMViewport_GetFront(p) (p)->lpVtbl->GetFront(p) +#define IDirect3DRMViewport_GetProjection(p) (p)->lpVtbl->GetProjection(p) +#define IDirect3DRMViewport_GetDirect3DViewport(p,a) (p)->lpVtbl->GetDirect3DViewport(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMViewport_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMViewport_AddRef(p) (p)->AddRef() +#define IDirect3DRMViewport_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMViewport_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMViewport_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMViewport_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMViewport_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMViewport_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMViewport_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMViewport_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMViewport_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMViewport methods ***/ +#define IDirect3DRMViewport_Init(p,a,b,c,d) (p)->Init(a,b,c,d) +#define IDirect3DRMViewport_Clear(p) (p)->Clear() +#define IDirect3DRMViewport_Render(p,a) (p)->Render(a) +#define IDirect3DRMViewport_SetFront(p,a) (p)->SetFront(a) +#define IDirect3DRMViewport_SetBack(p,a) (p)->SetBack(a) +#define IDirect3DRMViewport_SetField(p,a) (p)->SetField(a) +#define IDirect3DRMViewport_SetUniformScaling(p,a) (p)->SetUniformScaling(a) +#define IDirect3DRMViewport_SetCamera(p,a) (p)->SetCamera(a) +#define IDirect3DRMViewport_SetProjection(p,a) (p)->SetProjection(a) +#define IDirect3DRMViewport_Transform(p,a,b) (p)->Transform(a,b) +#define IDirect3DRMViewport_InverseTransform(p,a,b) (p)->InverseTransform(a,b) +#define IDirect3DRMViewport_Configure(p,a,b,c,d) (p)->Configure(a,b,c,d) +#define IDirect3DRMViewport_ForceUpdate(p,a,b,c,d) (p)->ForceUpdate(a,b,c,d) +#define IDirect3DRMViewport_SetPlane(p,a,b,c,d) (p)->SetPlane(a,b,c,d) +#define IDirect3DRMViewport_GetCamera(p,a) (p)->GetCamera(a) +#define IDirect3DRMViewport_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DRMViewport_GetPlane(p,a,b,c,d) (p)->GetPlane(a,b,c,d) +#define IDirect3DRMViewport_Pick(p,a,b,c) (p)->Pick(a,b,c) +#define IDirect3DRMViewport_GetUniformScaling(p) (p)->GetUniformScaling() +#define IDirect3DRMViewport_GetX(p) (p)->GetX() +#define IDirect3DRMViewport_GetY(p) (p)->GetY() +#define IDirect3DRMViewport_GetWidth(p) (p)->GetWidth() +#define IDirect3DRMViewport_GetHeight(p) (p)->GetHeight() +#define IDirect3DRMViewport_GetField(p) (p)->GetField() +#define IDirect3DRMViewport_GetBack(p) (p)->GetBack() +#define IDirect3DRMViewport_GetFront(p) (p)->GetFront() +#define IDirect3DRMViewport_GetProjection(p) (p)->GetProjection() +#define IDirect3DRMViewport_GetDirect3DViewport(p,a) (p)->GetDirect3DViewport(a) +#endif + +/***************************************************************************** + * IDirect3DRMViewport2 interface + */ +#define INTERFACE IDirect3DRMViewport2 +DECLARE_INTERFACE_(IDirect3DRMViewport2,IDirect3DRMObject) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMViewport2 methods ***/ + STDMETHOD(Init) (THIS_ IDirect3DRMDevice3 *device, struct IDirect3DRMFrame3 *camera, + DWORD x, DWORD y, DWORD width, DWORD height) PURE; + STDMETHOD(Clear)(THIS_ DWORD flags) PURE; + STDMETHOD(Render)(THIS_ struct IDirect3DRMFrame3 *frame) PURE; + STDMETHOD(SetFront)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetBack)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetField)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetUniformScaling)(THIS_ BOOL) PURE; + STDMETHOD(SetCamera)(THIS_ struct IDirect3DRMFrame3 *camera) PURE; + STDMETHOD(SetProjection)(THIS_ D3DRMPROJECTIONTYPE) PURE; + STDMETHOD(Transform)(THIS_ D3DRMVECTOR4D *d, D3DVECTOR *s) PURE; + STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DRMVECTOR4D *s) PURE; + STDMETHOD(Configure)(THIS_ LONG x, LONG y, DWORD width, DWORD height) PURE; + STDMETHOD(ForceUpdate)(THIS_ DWORD x1, DWORD y1, DWORD x2, DWORD y2) PURE; + STDMETHOD(SetPlane)(THIS_ D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top) PURE; + STDMETHOD(GetCamera)(THIS_ struct IDirect3DRMFrame3 **camera) PURE; + STDMETHOD(GetDevice)(THIS_ IDirect3DRMDevice3 **device) PURE; + STDMETHOD(GetPlane)(THIS_ D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top) PURE; + STDMETHOD(Pick)(THIS_ LONG x, LONG y, struct IDirect3DRMPickedArray **visuals) PURE; + STDMETHOD_(BOOL, GetUniformScaling)(THIS) PURE; + STDMETHOD_(LONG, GetX)(THIS) PURE; + STDMETHOD_(LONG, GetY)(THIS) PURE; + STDMETHOD_(DWORD, GetWidth)(THIS) PURE; + STDMETHOD_(DWORD, GetHeight)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetField)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetBack)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetFront)(THIS) PURE; + STDMETHOD_(D3DRMPROJECTIONTYPE, GetProjection)(THIS) PURE; + STDMETHOD(GetDirect3DViewport)(THIS_ IDirect3DViewport **viewport) PURE; + STDMETHOD(TransformVectors)(THIS_ DWORD vector_count, D3DRMVECTOR4D *dst_vectors, + D3DVECTOR *src_vectors) PURE; + STDMETHOD(InverseTransformVectors)(THIS_ DWORD vector_count, D3DVECTOR *dst_vectors, + D3DRMVECTOR4D *src_vectors) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMViewport2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMViewport2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMViewport2_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMViewport_2Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMViewport2_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMViewport2_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMViewport2_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMViewport2_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMViewport2_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMViewport2_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMViewport2_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMViewport2 methods ***/ +#define IDirect3DRMViewport2_Init(p,a,b,c,d,e,f) (p)->lpVtbl->Init(p,a,b,c,d,e,f) +#define IDirect3DRMViewport2_Clear(p,a) (p)->lpVtbl->Clear(p,a) +#define IDirect3DRMViewport2_Render(p,a) (p)->lpVtbl->Render(p,a) +#define IDirect3DRMViewport2_SetFront(p,a) (p)->lpVtbl->SetFront(p,a) +#define IDirect3DRMViewport2_SetBack(p,a) (p)->lpVtbl->SetBack(p,a) +#define IDirect3DRMViewport2_SetField(p,a) (p)->lpVtbl->SetField(p,a) +#define IDirect3DRMViewport2_SetUniformScaling(p,a) (p)->lpVtbl->SetUniformScaling(p,a) +#define IDirect3DRMViewport2_SetCamera(p,a) (p)->lpVtbl->SetCamera(p,a) +#define IDirect3DRMViewport2_SetProjection(p,a) (p)->lpVtbl->SetProjection(p,a) +#define IDirect3DRMViewport2_Transform(p,a,b) (p)->lpVtbl->Transform(p,a,b) +#define IDirect3DRMViewport2_InverseTransform(p,a,b) (p)->lpVtbl->InverseTransform(p,a,b) +#define IDirect3DRMViewport2_Configure(p,a,b,c,d) (p)->lpVtbl->Configure(p,a,b,c,d) +#define IDirect3DRMViewport2_ForceUpdate(p,a,b,c,d) (p)->lpVtbl->ForceUpdate(p,a,b,c,d) +#define IDirect3DRMViewport2_SetPlane(p,a,b,c,d) (p)->lpVtbl->SetPlane(p,a,b,c,d) +#define IDirect3DRMViewport2_GetCamera(p,a) (p)->lpVtbl->GetCamera(p,a) +#define IDirect3DRMViewport2_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DRMViewport2_GetPlane(p,a,b,c,d) (p)->lpVtbl->GetPlane(p,a,b,c,d) +#define IDirect3DRMViewport2_Pick(p,a,b,c) (p)->lpVtbl->Pick(p,a,b,c) +#define IDirect3DRMViewport2_GetUniformScaling(p) (p)->lpVtbl->GetUniformScaling(p) +#define IDirect3DRMViewport2_GetX(p) (p)->lpVtbl->GetX(p) +#define IDirect3DRMViewport2_GetY(p) (p)->lpVtbl->GetY(p) +#define IDirect3DRMViewport2_GetWidth(p) (p)->lpVtbl->GetWidth(p) +#define IDirect3DRMViewport2_GetHeight(p) (p)->lpVtbl->GetHeight(p) +#define IDirect3DRMViewport2_GetField(p) (p)->lpVtbl->GetField(p) +#define IDirect3DRMViewport2_GetBack(p) (p)->lpVtbl->GetBack(p) +#define IDirect3DRMViewport2_GetFront(p) (p)->lpVtbl->GetFront(p) +#define IDirect3DRMViewport2_GetProjection(p) (p)->lpVtbl->GetProjection(p) +#define IDirect3DRMViewport2_GetDirect3DViewport(p,a) (p)->lpVtbl->GetDirect3DViewport(p,a) +#define IDirect3DRMViewport2_TransformVectors(p,a,b,c) (p)->lpVtbl->TransformVectors(p,a,b,c) +#define IDirect3DRMViewport2_InverseTransformVectors(p,a,b,c) (p)->lpVtbl->InverseTransformVectors(p,a,b,c) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMViewport2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMViewport2_AddRef(p) (p)->AddRef() +#define IDirect3DRMViewport2_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMViewport2_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMViewport2_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMViewport2_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMViewport2_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMViewport2_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMViewport2_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMViewport2_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMViewport2_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMViewport2 methods ***/ +#define IDirect3DRMViewport2_Init(p,a,b,c,d) (p)->Init(a,b,c,d) +#define IDirect3DRMViewport2_Clear(p) (p)->Clear() +#define IDirect3DRMViewport2_Render(p,a) (p)->Render(a) +#define IDirect3DRMViewport2_SetFront(p,a) (p)->SetFront(a) +#define IDirect3DRMViewport2_SetBack(p,a) (p)->SetBack(a) +#define IDirect3DRMViewport2_SetField(p,a) (p)->SetField(a) +#define IDirect3DRMViewport2_SetUniformScaling(p,a) (p)->SetUniformScaling(a) +#define IDirect3DRMViewport2_SetCamera(p,a) (p)->SetCamera(a) +#define IDirect3DRMViewport2_SetProjection(p,a) (p)->SetProjection(a) +#define IDirect3DRMViewport2_Transform(p,a,b) (p)->Transform(a,b) +#define IDirect3DRMViewport2_InverseTransform(p,a,b) (p)->InverseTransform(a,b) +#define IDirect3DRMViewport2_Configure(p,a,b,c,d) (p)->Configure(a,b,c,d) +#define IDirect3DRMViewport2_ForceUpdate(p,a,b,c,d) (p)->ForceUpdate(a,b,c,d) +#define IDirect3DRMViewport2_SetPlane(p,a,b,c,d) (p)->SetPlane(a,b,c,d) +#define IDirect3DRMViewport2_GetCamera(p,a) (p)->GetCamera(a) +#define IDirect3DRMViewport2_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DRMViewport2_GetPlane(p,a,b,c,d) (p)->GetPlane(a,b,c,d) +#define IDirect3DRMViewport2_Pick(p,a,b,c) (p)->Pick(a,b,c) +#define IDirect3DRMViewport2_GetUniformScaling(p) (p)->GetUniformScaling() +#define IDirect3DRMViewport2_GetX(p) (p)->GetX() +#define IDirect3DRMViewport2_GetY(p) (p)->GetY() +#define IDirect3DRMViewport2_GetWidth(p) (p)->GetWidth() +#define IDirect3DRMViewport2_GetHeight(p) (p)->GetHeight() +#define IDirect3DRMViewport2_GetField(p) (p)->GetField() +#define IDirect3DRMViewport2_GetBack(p) (p)->GetBack() +#define IDirect3DRMViewport2_GetFront(p) (p)->GetFront() +#define IDirect3DRMViewport2_GetProjection(p) (p)->GetProjection() +#define IDirect3DRMViewport2_GetDirect3DViewport(p,a) (p)->GetDirect3DViewport(a) +#define IDirect3DRMViewport2_TransformVectors(p,a,b,c) (p)->TransformVectors(a,b,c) +#define IDirect3DRMViewport2_InverseTransformVectors(p,a,b,c) (p)->InverseTransformVectors(a,b,c) +#endif + +/***************************************************************************** + * IDirect3DRMFrame interface + */ +#define INTERFACE IDirect3DRMFrame +DECLARE_INTERFACE_(IDirect3DRMFrame,IDirect3DRMVisual) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMFrame methods ***/ + STDMETHOD(AddChild)(THIS_ IDirect3DRMFrame *child) PURE; + STDMETHOD(AddLight)(THIS_ struct IDirect3DRMLight *light) PURE; + STDMETHOD(AddMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK cb, void *ctx) PURE; + STDMETHOD(AddTransform)(THIS_ D3DRMCOMBINETYPE, D3DRMMATRIX4D) PURE; + STDMETHOD(AddTranslation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(AddScale)(THIS_ D3DRMCOMBINETYPE, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; + STDMETHOD(AddRotation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; + STDMETHOD(AddVisual)(THIS_ IDirect3DRMVisual *visual) PURE; + STDMETHOD(GetChildren)(THIS_ struct IDirect3DRMFrameArray **children) PURE; + STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; + STDMETHOD(GetLights)(THIS_ struct IDirect3DRMLightArray **lights) PURE; + STDMETHOD_(D3DRMMATERIALMODE, GetMaterialMode)(THIS) PURE; + STDMETHOD(GetParent)(THIS_ IDirect3DRMFrame **parent) PURE; + STDMETHOD(GetPosition)(THIS_ IDirect3DRMFrame *reference, D3DVECTOR *return_position) PURE; + STDMETHOD(GetRotation)(THIS_ IDirect3DRMFrame *reference, D3DVECTOR *axis, D3DVALUE *return_theta) PURE; + STDMETHOD(GetScene)(THIS_ IDirect3DRMFrame **scene) PURE; + STDMETHOD_(D3DRMSORTMODE, GetSortMode)(THIS) PURE; + STDMETHOD(GetTexture)(THIS_ struct IDirect3DRMTexture **texture) PURE; + STDMETHOD(GetTransform)(THIS_ D3DRMMATRIX4D return_matrix) PURE; + STDMETHOD(GetVelocity)(THIS_ IDirect3DRMFrame *reference, D3DVECTOR *return_velocity, BOOL with_rotation) PURE; + STDMETHOD(GetOrientation)(THIS_ IDirect3DRMFrame *reference, D3DVECTOR *dir, D3DVECTOR *up) PURE; + STDMETHOD(GetVisuals)(THIS_ struct IDirect3DRMVisualArray **visuals) PURE; + STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE; + STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; + STDMETHOD(Load)(THIS_ void *filename, void *name, D3DRMLOADOPTIONS flags, + D3DRMLOADTEXTURECALLBACK cb, void *ctx)PURE; + STDMETHOD(LookAt)(THIS_ IDirect3DRMFrame *target, IDirect3DRMFrame *reference, + D3DRMFRAMECONSTRAINT constraint) PURE; + STDMETHOD(Move)(THIS_ D3DVALUE delta) PURE; + STDMETHOD(DeleteChild)(THIS_ IDirect3DRMFrame *child) PURE; + STDMETHOD(DeleteLight)(THIS_ struct IDirect3DRMLight *light) PURE; + STDMETHOD(DeleteMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteVisual)(THIS_ IDirect3DRMVisual *visual) PURE; + STDMETHOD_(D3DCOLOR, GetSceneBackground)(THIS) PURE; + STDMETHOD(GetSceneBackgroundDepth)(THIS_ IDirectDrawSurface **surface) PURE; + STDMETHOD_(D3DCOLOR, GetSceneFogColor)(THIS) PURE; + STDMETHOD_(BOOL, GetSceneFogEnable)(THIS) PURE; + STDMETHOD_(D3DRMFOGMODE, GetSceneFogMode)(THIS) PURE; + STDMETHOD(GetSceneFogParams)(THIS_ D3DVALUE *return_start, D3DVALUE *return_end, D3DVALUE *return_density) PURE; + STDMETHOD(SetSceneBackground)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetSceneBackgroundRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetSceneBackgroundDepth)(THIS_ IDirectDrawSurface *surface) PURE; + STDMETHOD(SetSceneBackgroundImage)(THIS_ struct IDirect3DRMTexture *texture) PURE; + STDMETHOD(SetSceneFogEnable)(THIS_ BOOL) PURE; + STDMETHOD(SetSceneFogColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetSceneFogMode)(THIS_ D3DRMFOGMODE) PURE; + STDMETHOD(SetSceneFogParams)(THIS_ D3DVALUE start, D3DVALUE end, D3DVALUE density) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD_(D3DRMZBUFFERMODE, GetZbufferMode)(THIS) PURE; + STDMETHOD(SetMaterialMode)(THIS_ D3DRMMATERIALMODE) PURE; + STDMETHOD(SetOrientation)(THIS_ IDirect3DRMFrame *reference, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, + D3DVALUE ux, D3DVALUE uy, D3DVALUE uz) PURE; + STDMETHOD(SetPosition)(THIS_ IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetRotation)(THIS_ IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; + STDMETHOD(SetSortMode)(THIS_ D3DRMSORTMODE) PURE; + STDMETHOD(SetTexture)(THIS_ struct IDirect3DRMTexture *texture) PURE; + STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; + STDMETHOD(SetVelocity)(THIS_ IDirect3DRMFrame *reference, + D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation) PURE; + STDMETHOD(SetZbufferMode)(THIS_ D3DRMZBUFFERMODE) PURE; + STDMETHOD(Transform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMFrame_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMFrame_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMFrame_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMFrame_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMFrame_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMFrame_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMFrame_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMFrame_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMFrame_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMFrame_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMFrame_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMFrame methods ***/ +#define IDirect3DRMFrame_AddChild(p,a) (p)->lpVtbl->AddChild(p,a) +#define IDirect3DRMFrame_AddLight(p,a) (p)->lpVtbl->AddLight(p,a) +#define IDirect3DRMFrame_AddMoveCallback(p,a,b) (p)->lpVtbl->AddMoveCallback(p,a,b) +#define IDirect3DRMFrame_AddTransform(p,a,b) (p)->lpVtbl->AddTransform(p,a,b) +#define IDirect3DRMFrame_AddTranslation(p,a,b,c,d) (p)->lpVtbl->AddTranslation(p,a,b,c,d) +#define IDirect3DRMFrame_AddScale(p,a,b,c,d) (p)->lpVtbl->AddScale(p,a,b,c,d) +#define IDirect3DRMFrame_AddRotation(p,a,b,c,d,e) (p)->lpVtbl->AddRotation(p,a,b,c,d,e) +#define IDirect3DRMFrame_AddVisual(p,a) (p)->lpVtbl->AddVisual(p,a) +#define IDirect3DRMFrame_GetChildren(p,a) (p)->lpVtbl->GetChildren(p,a) +#define IDirect3DRMFrame_GetColor(p) (p)->lpVtbl->GetColor(p) +#define IDirect3DRMFrame_GetLights(p,a) (p)->lpVtbl->GetLights(p,a) +#define IDirect3DRMFrame_GetMaterialMode(p) (p)->lpVtbl->GetMaterialMode(p) +#define IDirect3DRMFrame_GetParent(p,a) (p)->lpVtbl->GetParent(p,a) +#define IDirect3DRMFrame_GetPosition(p,a,b) (p)->lpVtbl->GetPosition(p,a,b) +#define IDirect3DRMFrame_GetRotation(p,a,b,c) (p)->lpVtbl->GetRotation(p,a,b,c) +#define IDirect3DRMFrame_GetScene(p,a) (p)->lpVtbl->GetScene(p,a) +#define IDirect3DRMFrame_GetSortMode(p) (p)->lpVtbl->GetSortMode(p) +#define IDirect3DRMFrame_GetTexture(p,a) (p)->lpVtbl->GetTexture(p,a) +#define IDirect3DRMFrame_GetTransform(p,a) (p)->lpVtbl->GetTransform(p,a) +#define IDirect3DRMFrame_GetVelocity(p,a,b,c) (p)->lpVtbl->GetVelocity(p,a,b,c) +#define IDirect3DRMFrame_GetOrientation(p,a,b,c) (p)->lpVtbl->GetOrientation(p,a,b,c) +#define IDirect3DRMFrame_GetVisuals(p,a) (p)->lpVtbl->GetVisuals(p,a) +#define IDirect3DRMFrame_GetTextureTopology(p,a,b) (p)->lpVtbl->GetTextureTopology(p,a,b) +#define IDirect3DRMFrame_InverseTransform(p,a,b) (p)->lpVtbl->InverseTransform(p,a,b) +#define IDirect3DRMFrame_Load(p,a,b,c,d,e) (p)->lpVtbl->Load(p,a,b,c,d,e) +#define IDirect3DRMFrame_LookAt(p,a,b,c) (p)->lpVtbl->LookAt(p,a,b,c) +#define IDirect3DRMFrame_Move(p,a) (p)->lpVtbl->Move(p,a) +#define IDirect3DRMFrame_DeleteChild(p,a) (p)->lpVtbl->DeleteChild(p,a) +#define IDirect3DRMFrame_DeleteLight(p,a) (p)->lpVtbl->DeleteLight(p,a) +#define IDirect3DRMFrame_DeleteMoveCallback(p,a,b) (p)->lpVtbl->DeleteMoveCallback(p,a,b) +#define IDirect3DRMFrame_DeleteVisual(p,a) (p)->lpVtbl->DeleteVisual(p,a) +#define IDirect3DRMFrame_GetSceneBackground(p) (p)->lpVtbl->GetSceneBackground(p) +#define IDirect3DRMFrame_GetSceneBackgroundDepth(p,a) (p)->lpVtbl->GetSceneBackgroundDepth(p,a) +#define IDirect3DRMFrame_GetSceneFogColor(p) (p)->lpVtbl->GetSceneFogColor(p) +#define IDirect3DRMFrame_GetSceneFogEnable(p) (p)->lpVtbl->GetSceneFogEnable(p) +#define IDirect3DRMFrame_GetSceneFogMode(p) (p)->lpVtbl->GetSceneFogMode(p) +#define IDirect3DRMFrame_GetSceneFogParams(p,a,b,c) (p)->lpVtbl->GetSceneFogParams(p,a,b,c) +#define IDirect3DRMFrame_SetSceneBackground(p,a) (p)->lpVtbl->SetSceneBackground(p,a) +#define IDirect3DRMFrame_SetSceneBackgroundRGB(p,a,b,c) (p)->lpVtbl->SetSceneBackgroundRGB(p,a,b,c) +#define IDirect3DRMFrame_SetSceneBackgroundDepth(p,a) (p)->lpVtbl->SetSceneBackgroundDepth(p,a) +#define IDirect3DRMFrame_SetSceneBackgroundImage(p,a) (p)->lpVtbl->SetSceneBackgroundImage(p,a) +#define IDirect3DRMFrame_SetSceneFogEnable(p,a) (p)->lpVtbl->SetSceneFogEnable(p,a) +#define IDirect3DRMFrame_SetSceneFogColor(p,a) (p)->lpVtbl->SetSceneFogColor(p,a) +#define IDirect3DRMFrame_SetSceneFogMode(p,a) (p)->lpVtbl->SetSceneFogMode(p,a) +#define IDirect3DRMFrame_SetSceneFogParams(p,a,b,c) (p)->lpVtbl->SetSceneFogParams(p,a,b,c) +#define IDirect3DRMFrame_SetColor(p,a) (p)->lpVtbl->SetColor(p,a) +#define IDirect3DRMFrame_SetColorRGB(p,a,b,c) (p)->lpVtbl->SetColorRGB(p,a,b,c) +#define IDirect3DRMFrame_GetZbufferMode(p) (p)->lpVtbl->GetZbufferMode(p) +#define IDirect3DRMFrame_SetMaterialMode(p,a) (p)->lpVtbl->SetMaterialMode(p,a) +#define IDirect3DRMFrame_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g) +#define IDirect3DRMFrame_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d) +#define IDirect3DRMFrame_SetRotation(p,a,b,c,d,e) (p)->lpVtbl->SetRotation(p,a,b,c,d,e) +#define IDirect3DRMFrame_SetSortMode(p,a) (p)->lpVtbl->SetSortMode(p,a) +#define IDirect3DRMFrame_SetTexture(p,a) (p)->lpVtbl->SetTexture(p,a) +#define IDirect3DRMFrame_SetTextureTopology(p,a,b) (p)->lpVtbl->SetTextureTopology(p,a,b) +#define IDirect3DRMFrame_SetVelocity(p,a,b,c,d,e) (p)->lpVtbl->SetVelocity(p,a,b,c,d,e) +#define IDirect3DRMFrame_SetZbufferMode(p,a) (p)->lpVtbl->SetZbufferMode(p,a) +#define IDirect3DRMFrame_Transform(p,a,b) (p)->lpVtbl->Transform(p,a,b) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMFrame_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMFrame_AddRef(p) (p)->AddRef() +#define IDirect3DRMFrame_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMFrame_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMFrame_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMFrame_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMFrame_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMFrame_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMFrame_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMFrame_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMFrame_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMFrame methods ***/ +#define IDirect3DRMFrame_AddChild(p,a) (p)->AddChild(a) +#define IDirect3DRMFrame_AddLight(p,a) (p)->AddLight(a) +#define IDirect3DRMFrame_AddMoveCallback(p,a,b) (p)->AddMoveCallback(a,b) +#define IDirect3DRMFrame_AddTransform(p,a,b) (p)->AddTransform(a,b) +#define IDirect3DRMFrame_AddTranslation(p,a,b,c,d) (p)->AddTranslation(a,b,c,d) +#define IDirect3DRMFrame_AddScale(p,a,b,c,d) (p)->AddScale(a,b,c,d) +#define IDirect3DRMFrame_AddRotation(p,a,b,c,d,e) (p)->AddRotation(a,b,c,d,e) +#define IDirect3DRMFrame_AddVisual(p,a) (p)->AddVisual(a) +#define IDirect3DRMFrame_GetChildren(p,a) (p)->GetChildren(a) +#define IDirect3DRMFrame_GetColor(p) (p)->GetColor() +#define IDirect3DRMFrame_GetLights(p,a) (p)->GetLights(a) +#define IDirect3DRMFrame_GetMaterialMode(p) (p)->GetMaterialMode() +#define IDirect3DRMFrame_GetParent(p,a) (p)->GetParent(a) +#define IDirect3DRMFrame_GetPosition(p,a,b) (p)->GetPosition(a,b) +#define IDirect3DRMFrame_GetRotation(p,a,b,c) (p)->GetRotation(a,b,c) +#define IDirect3DRMFrame_GetScene(p,a) (p)->GetScene(a) +#define IDirect3DRMFrame_GetSortMode(p) (p)->GetSortMode() +#define IDirect3DRMFrame_GetTexture(p,a) (p)->GetTexture(a) +#define IDirect3DRMFrame_GetTransform(p,a) (p)->GetTransform(a) +#define IDirect3DRMFrame_GetVelocity(p,a,b,c) (p)->GetVelocity(a,b,c) +#define IDirect3DRMFrame_GetOrientation(p,a,b,c) (p)->GetOrientation(a,b,c) +#define IDirect3DRMFrame_GetVisuals(p,a) (p)->GetVisuals(a) +#define IDirect3DRMFrame_GetTextureTopology(p,a,b) (p)->GetTextureTopology(a,b) +#define IDirect3DRMFrame_InverseTransform(p,a,b) (p)->InverseTransform(a,b) +#define IDirect3DRMFrame_Load(p,a,b,c,d,e) (p)->Load(a,b,c,d,e) +#define IDirect3DRMFrame_LookAt(p,a,b,c) (p)->LookAt(a,b,c) +#define IDirect3DRMFrame_Move(p,a) (p)->Move(a) +#define IDirect3DRMFrame_DeleteChild(p,a) (p)->DeleteChild(a) +#define IDirect3DRMFrame_DeleteLight(p,a) (p)->DeleteLight(a) +#define IDirect3DRMFrame_DeleteMoveCallback(p,a,b) (p)->DeleteMoveCallback(a,b) +#define IDirect3DRMFrame_DeleteVisual(p,a) (p)->DeleteVisual(a) +#define IDirect3DRMFrame_GetSceneBackground(p) (p)->GetSceneBackground() +#define IDirect3DRMFrame_GetSceneBackgroundDepth(p,a) (p)->GetSceneBackgroundDepth(a) +#define IDirect3DRMFrame_GetSceneFogColor(p) (p)->GetSceneFogColor() +#define IDirect3DRMFrame_GetSceneFogEnable(p) (p)->GetSceneFogEnable() +#define IDirect3DRMFrame_GetSceneFogMode(p) (p)->GetSceneFogMode() +#define IDirect3DRMFrame_GetSceneFogParams(p,a,b,c) (p)->GetSceneFogParams(a,b,c) +#define IDirect3DRMFrame_SetSceneBackground(p,a) (p)->SetSceneBackground(a) +#define IDirect3DRMFrame_SetSceneBackgroundRGB(p,a,b,c) (p)->SetSceneBackgroundRGB(a,b,c) +#define IDirect3DRMFrame_SetSceneBackgroundDepth(p,a) (p)->SetSceneBackgroundDepth(a) +#define IDirect3DRMFrame_SetSceneBackgroundImage(p,a) (p)->SetSceneBackgroundImage(a) +#define IDirect3DRMFrame_SetSceneFogEnable(p,a) (p)->SetSceneFogEnable(a) +#define IDirect3DRMFrame_SetSceneFogColor(p,a) (p)->SetSceneFogColor(a) +#define IDirect3DRMFrame_SetSceneFogMode(p,a) (p)->SetSceneFogMode(a) +#define IDirect3DRMFrame_SetSceneFogParams(p,a,b,c) (p)->SetSceneFogParams(a,b,c) +#define IDirect3DRMFrame_SetColor(p,a) (p)->SetColor(a) +#define IDirect3DRMFrame_SetColorRGB(p,a,b,c) (p)->SetColorRGB(a,b,c) +#define IDirect3DRMFrame_GetZbufferMode(p) (p)->GetZbufferMode() +#define IDirect3DRMFrame_SetMaterialMode(p,a) (p)->SetMaterialMode(a) +#define IDirect3DRMFrame_SetOrientation(p,a,b,c,d,e,f,g) (p)->SetOrientation(a,b,c,d,e,f,g) +#define IDirect3DRMFrame_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d) +#define IDirect3DRMFrame_SetRotation(p,a,b,c,d,e) (p)->SetRotation(a,b,c,d,e) +#define IDirect3DRMFrame_SetSortMode(p,a) (p)->SetSortMode(a) +#define IDirect3DRMFrame_SetTexture(p,a) (p)->SetTexture(a) +#define IDirect3DRMFrame_SetTextureTopology(p,a,b) (p)->SetTextureTopology(a,b) +#define IDirect3DRMFrame_SetVelocity(p,a,b,c,d,e) (p)->SetVelocity(a,b,c,d,e) +#define IDirect3DRMFrame_SetZbufferMode(p,a) (p)->SetZbufferMode(a) +#define IDirect3DRMFrame_Transform(p,a,b) (p)->Transform(a,b) +#endif + +/***************************************************************************** + * IDirect3DRMFrame2 interface + */ +#define INTERFACE IDirect3DRMFrame2 +DECLARE_INTERFACE_(IDirect3DRMFrame2,IDirect3DRMFrame) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMFrame methods ***/ + STDMETHOD(AddChild)(THIS_ IDirect3DRMFrame *child) PURE; + STDMETHOD(AddLight)(THIS_ struct IDirect3DRMLight *light) PURE; + STDMETHOD(AddMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK cb, void *ctx) PURE; + STDMETHOD(AddTransform)(THIS_ D3DRMCOMBINETYPE, D3DRMMATRIX4D) PURE; + STDMETHOD(AddTranslation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(AddScale)(THIS_ D3DRMCOMBINETYPE, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; + STDMETHOD(AddRotation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; + STDMETHOD(AddVisual)(THIS_ IDirect3DRMVisual *visual) PURE; + STDMETHOD(GetChildren)(THIS_ struct IDirect3DRMFrameArray **children) PURE; + STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; + STDMETHOD(GetLights)(THIS_ struct IDirect3DRMLightArray **lights) PURE; + STDMETHOD_(D3DRMMATERIALMODE, GetMaterialMode)(THIS) PURE; + STDMETHOD(GetParent)(THIS_ IDirect3DRMFrame **parent) PURE; + STDMETHOD(GetPosition)(THIS_ IDirect3DRMFrame *reference, D3DVECTOR *return_position) PURE; + STDMETHOD(GetRotation)(THIS_ IDirect3DRMFrame *reference, D3DVECTOR *axis, D3DVALUE *return_theta) PURE; + STDMETHOD(GetScene)(THIS_ IDirect3DRMFrame **scene) PURE; + STDMETHOD_(D3DRMSORTMODE, GetSortMode)(THIS) PURE; + STDMETHOD(GetTexture)(THIS_ struct IDirect3DRMTexture **texture) PURE; + STDMETHOD(GetTransform)(THIS_ D3DRMMATRIX4D return_matrix) PURE; + STDMETHOD(GetVelocity)(THIS_ IDirect3DRMFrame *reference, D3DVECTOR *return_velocity, BOOL with_rotation) PURE; + STDMETHOD(GetOrientation)(THIS_ IDirect3DRMFrame *reference, D3DVECTOR *dir, D3DVECTOR *up) PURE; + STDMETHOD(GetVisuals)(THIS_ struct IDirect3DRMVisualArray **visuals) PURE; + STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE; + STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; + STDMETHOD(Load)(THIS_ void *filename, void *name, D3DRMLOADOPTIONS flags, + D3DRMLOADTEXTURECALLBACK cb, void *ctx)PURE; + STDMETHOD(LookAt)(THIS_ IDirect3DRMFrame *target, IDirect3DRMFrame *reference, + D3DRMFRAMECONSTRAINT constraint) PURE; + STDMETHOD(Move)(THIS_ D3DVALUE delta) PURE; + STDMETHOD(DeleteChild)(THIS_ IDirect3DRMFrame *child) PURE; + STDMETHOD(DeleteLight)(THIS_ struct IDirect3DRMLight *light) PURE; + STDMETHOD(DeleteMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteVisual)(THIS_ IDirect3DRMVisual *visual) PURE; + STDMETHOD_(D3DCOLOR, GetSceneBackground)(THIS) PURE; + STDMETHOD(GetSceneBackgroundDepth)(THIS_ IDirectDrawSurface **surface) PURE; + STDMETHOD_(D3DCOLOR, GetSceneFogColor)(THIS) PURE; + STDMETHOD_(BOOL, GetSceneFogEnable)(THIS) PURE; + STDMETHOD_(D3DRMFOGMODE, GetSceneFogMode)(THIS) PURE; + STDMETHOD(GetSceneFogParams)(THIS_ D3DVALUE *return_start, D3DVALUE *return_end, D3DVALUE *return_density) PURE; + STDMETHOD(SetSceneBackground)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetSceneBackgroundRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetSceneBackgroundDepth)(THIS_ IDirectDrawSurface *surface) PURE; + STDMETHOD(SetSceneBackgroundImage)(THIS_ struct IDirect3DRMTexture *texture) PURE; + STDMETHOD(SetSceneFogEnable)(THIS_ BOOL) PURE; + STDMETHOD(SetSceneFogColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetSceneFogMode)(THIS_ D3DRMFOGMODE) PURE; + STDMETHOD(SetSceneFogParams)(THIS_ D3DVALUE start, D3DVALUE end, D3DVALUE density) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD_(D3DRMZBUFFERMODE, GetZbufferMode)(THIS) PURE; + STDMETHOD(SetMaterialMode)(THIS_ D3DRMMATERIALMODE) PURE; + STDMETHOD(SetOrientation)(THIS_ IDirect3DRMFrame *reference, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, + D3DVALUE ux, D3DVALUE uy, D3DVALUE uz) PURE; + STDMETHOD(SetPosition)(THIS_ IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetRotation)(THIS_ IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; + STDMETHOD(SetSortMode)(THIS_ D3DRMSORTMODE) PURE; + STDMETHOD(SetTexture)(THIS_ struct IDirect3DRMTexture *texture) PURE; + STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; + STDMETHOD(SetVelocity)(THIS_ IDirect3DRMFrame *reference, + D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation) PURE; + STDMETHOD(SetZbufferMode)(THIS_ D3DRMZBUFFERMODE) PURE; + STDMETHOD(Transform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; + /*** IDirect3DRMFrame2 methods ***/ + STDMETHOD(AddMoveCallback2)(THIS_ D3DRMFRAMEMOVECALLBACK cb, void *ctx, DWORD flags) PURE; + STDMETHOD(GetBox)(THIS_ D3DRMBOX *box) PURE; + STDMETHOD_(BOOL, GetBoxEnable)(THIS) PURE; + STDMETHOD(GetAxes)(THIS_ D3DVECTOR *dir, D3DVECTOR *up); + STDMETHOD(GetMaterial)(THIS_ struct IDirect3DRMMaterial **material) PURE; + STDMETHOD_(BOOL, GetInheritAxes)(THIS); + STDMETHOD(GetHierarchyBox)(THIS_ D3DRMBOX *box) PURE; + STDMETHOD(SetBox)(THIS_ D3DRMBOX *box) PURE; + STDMETHOD(SetBoxEnable)(THIS_ BOOL) PURE; + STDMETHOD(SetAxes)(THIS_ D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz); + STDMETHOD(SetInheritAxes)(THIS_ BOOL inherit_from_parent); + STDMETHOD(SetMaterial)(THIS_ struct IDirect3DRMMaterial *material) PURE; + STDMETHOD(SetQuaternion)(THIS_ IDirect3DRMFrame *reference, D3DRMQUATERNION *q) PURE; + STDMETHOD(RayPick)(THIS_ IDirect3DRMFrame *reference, D3DRMRAY *ray, DWORD flags, + struct IDirect3DRMPicked2Array **return_visuals) PURE; + STDMETHOD(Save)(THIS_ const char *filename, D3DRMXOFFORMAT format, D3DRMSAVEOPTIONS flags); +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMFrame2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMFrame2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMFrame2_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMFrame2_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMFrame2_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMFrame2_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMFrame2_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMFrame2_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMFrame2_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMFrame2_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMFrame2_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMFrame methods ***/ +#define IDirect3DRMFrame2_AddChild(p,a) (p)->lpVtbl->AddChild(p,a) +#define IDirect3DRMFrame2_AddLight(p,a) (p)->lpVtbl->AddLight(p,a) +#define IDirect3DRMFrame2_AddMoveCallback(p,a,b) (p)->lpVtbl->AddMoveCallback(p,a,b) +#define IDirect3DRMFrame2_AddTransform(p,a,b) (p)->lpVtbl->AddTransform(p,a,b) +#define IDirect3DRMFrame2_AddTranslation(p,a,b,c,d) (p)->lpVtbl->AddTranslation(p,a,b,c,d) +#define IDirect3DRMFrame2_AddScale(p,a,b,c,d) (p)->lpVtbl->AddScale(p,a,b,c,d) +#define IDirect3DRMFrame2_AddRotation(p,a,b,c,d,e) (p)->lpVtbl->AddRotation(p,a,b,c,d,e) +#define IDirect3DRMFrame2_AddVisual(p,a) (p)->lpVtbl->AddVisual(p,a) +#define IDirect3DRMFrame2_GetChildren(p,a) (p)->lpVtbl->GetChildren(p,a) +#define IDirect3DRMFrame2_GetColor(p) (p)->lpVtbl->GetColor(p) +#define IDirect3DRMFrame2_GetLights(p,a) (p)->lpVtbl->GetLights(p,a) +#define IDirect3DRMFrame2_GetMaterialMode(p) (p)->lpVtbl->GetMaterialMode(p) +#define IDirect3DRMFrame2_GetParent(p,a) (p)->lpVtbl->GetParent(p,a) +#define IDirect3DRMFrame2_GetPosition(p,a,b) (p)->lpVtbl->GetPosition(p,a,b) +#define IDirect3DRMFrame2_GetRotation(p,a,b,c) (p)->lpVtbl->GetRotation(p,a,b,c) +#define IDirect3DRMFrame2_GetScene(p,a) (p)->lpVtbl->GetScene(p,a) +#define IDirect3DRMFrame2_GetSortMode(p) (p)->lpVtbl->GetSortMode(p) +#define IDirect3DRMFrame2_GetTexture(p,a) (p)->lpVtbl->GetTexture(p,a) +#define IDirect3DRMFrame2_GetTransform(p,a) (p)->lpVtbl->GetTransform(p,a) +#define IDirect3DRMFrame2_GetVelocity(p,a,b,c) (p)->lpVtbl->GetVelocity(p,a,b,c) +#define IDirect3DRMFrame2_GetOrientation(p,a,b,c) (p)->lpVtbl->GetOrientation(p,a,b,c) +#define IDirect3DRMFrame2_GetVisuals(p,a) (p)->lpVtbl->GetVisuals(p,a) +#define IDirect3DRMFrame2_GetTextureTopology(p,a,b) (p)->lpVtbl->GetTextureTopology(p,a,b) +#define IDirect3DRMFrame2_InverseTransform(p,a,b) (p)->lpVtbl->InverseTransform(p,a,b) +#define IDirect3DRMFrame2_Load(p,a,b,c,d,e) (p)->lpVtbl->Load(p,a,b,c,d,e) +#define IDirect3DRMFrame2_LookAt(p,a,b,c) (p)->lpVtbl->LookAt(p,a,b,c) +#define IDirect3DRMFrame2_Move(p,a) (p)->lpVtbl->Move(p,a) +#define IDirect3DRMFrame2_DeleteChild(p,a) (p)->lpVtbl->DeleteChild(p,a) +#define IDirect3DRMFrame2_DeleteLight(p,a) (p)->lpVtbl->DeleteLight(p,a) +#define IDirect3DRMFrame2_DeleteMoveCallback(p,a,b) (p)->lpVtbl->DeleteMoveCallback(p,a,b) +#define IDirect3DRMFrame2_DeleteVisual(p,a) (p)->lpVtbl->DeleteVisual(p,a) +#define IDirect3DRMFrame2_GetSceneBackground(p) (p)->lpVtbl->GetSceneBackground(p) +#define IDirect3DRMFrame2_GetSceneBackgroundDepth(p,a) (p)->lpVtbl->GetSceneBackgroundDepth(p,a) +#define IDirect3DRMFrame2_GetSceneFogColor(p) (p)->lpVtbl->GetSceneFogColor(p) +#define IDirect3DRMFrame2_GetSceneFogEnable(p) (p)->lpVtbl->GetSceneFogEnable(p) +#define IDirect3DRMFrame2_GetSceneFogMode(p) (p)->lpVtbl->GetSceneFogMode(p) +#define IDirect3DRMFrame2_GetSceneFogParams(p,a,b,c) (p)->lpVtbl->GetSceneFogParams(p,a,b,c) +#define IDirect3DRMFrame2_SetSceneBackground(p,a) (p)->lpVtbl->SetSceneBackground(p,a) +#define IDirect3DRMFrame2_SetSceneBackgroundRGB(p,a,b,c) (p)->lpVtbl->SetSceneBackgroundRGB(p,a,b,c) +#define IDirect3DRMFrame2_SetSceneBackgroundDepth(p,a) (p)->lpVtbl->SetSceneBackgroundDepth(p,a) +#define IDirect3DRMFrame2_SetSceneBackgroundImage(p,a) (p)->lpVtbl->SetSceneBackgroundImage(p,a) +#define IDirect3DRMFrame2_SetSceneFogEnable(p,a) (p)->lpVtbl->SetSceneFogEnable(p,a) +#define IDirect3DRMFrame2_SetSceneFogColor(p,a) (p)->lpVtbl->SetSceneFogColor(p,a) +#define IDirect3DRMFrame2_SetSceneFogMode(p,a) (p)->lpVtbl->SetSceneFogMode(p,a) +#define IDirect3DRMFrame2_SetSceneFogParams(p,a,b,c) (p)->lpVtbl->SetSceneFogParams(p,a,b,c) +#define IDirect3DRMFrame2_SetColor(p,a) (p)->lpVtbl->SetColor(p,a) +#define IDirect3DRMFrame2_SetColorRGB(p,a,b,c) (p)->lpVtbl->SetColorRGB(p,a,b,c) +#define IDirect3DRMFrame2_GetZbufferMode(p) (p)->lpVtbl->GetZbufferMode(p) +#define IDirect3DRMFrame2_SetMaterialMode(p,a) (p)->lpVtbl->SetMaterialMode(p,a) +#define IDirect3DRMFrame2_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g) +#define IDirect3DRMFrame2_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d) +#define IDirect3DRMFrame2_SetRotation(p,a,b,c,d,e) (p)->lpVtbl->SetRotation(p,a,b,c,d,e) +#define IDirect3DRMFrame2_SetSortMode(p,a) (p)->lpVtbl->SetSortMode(p,a) +#define IDirect3DRMFrame2_SetTexture(p,a) (p)->lpVtbl->SetTexture(p,a) +#define IDirect3DRMFrame2_SetTextureTopology(p,a,b) (p)->lpVtbl->SetTextureTopology(p,a,b) +#define IDirect3DRMFrame2_SetVelocity(p,a,b,c,d,e) (p)->lpVtbl->SetVelocity(p,a,b,c,d,e) +#define IDirect3DRMFrame2_SetZbufferMode(p,a) (p)->lpVtbl->SetZbufferMode(p,a) +#define IDirect3DRMFrame2_Transform(p,a,b) (p)->lpVtbl->Transform(p,a,b) +/*** IDirect3DRMFrame2 methods ***/ +#define IDirect3DRMFrame2_AddMoveCallback2(p,a,b,c) (p)->lpVtbl->AddMoveCallback2(p,a,b,c) +#define IDirect3DRMFrame2_GetBox(p,a) (p)->lpVtbl->GetBox(p,a) +#define IDirect3DRMFrame2_GetBoxEnable(p) (p)->lpVtbl->GetBoxEnable(p) +#define IDirect3DRMFrame2_GetAxes(p,a,b) (p)->lpVtbl->GetAxes(p,a,b) +#define IDirect3DRMFrame2_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) +#define IDirect3DRMFrame2_GetInheritAxes(p,a,b) (p)->lpVtbl->GetInheritAxes(p,a,b) +#define IDirect3DRMFrame2_GetHierarchyBox(p,a) (p)->lpVtbl->GetHierarchyBox(p,a) +#define IDirect3DRMFrame2_SetBox(p,a) (p)->lpVtbl->SetBox(p,a) +#define IDirect3DRMFrame2_SetBoxEnable(p,a) (p)->lpVtbl->SetBoxEnable(p,a) +#define IDirect3DRMFrame2_SetAxes(p,a,b,c,d,e,f) (p)->lpVtbl->SetAxes(p,a,b,c,d,e,f) +#define IDirect3DRMFrame2_SetInheritAxes(p,a) (p)->lpVtbl->SetInheritAxes(p,a) +#define IDirect3DRMFrame2_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) +#define IDirect3DRMFrame2_SetQuaternion(p,a,b) (p)->lpVtbl->SetQuaternion(p,a,b) +#define IDirect3DRMFrame2_RayPick(p,a,b,c,d) (p)->lpVtbl->RayPick(p,a,b,c,d) +#define IDirect3DRMFrame2_Save(p,a,b,c) (p)->lpVtbl->Save(p,a,b,c) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMFrame2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMFrame2_AddRef(p) (p)->AddRef() +#define IDirect3DRMFrame2_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMFrame2_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMFrame2_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMFrame2_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMFrame2_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMFrame2_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMFrame2_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMFrame2_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMFrame2_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMFrame methods ***/ +#define IDirect3DRMFrame2_AddChild(p,a) (p)->AddChild(a) +#define IDirect3DRMFrame2_AddLight(p,a) (p)->AddLight(a) +#define IDirect3DRMFrame2_AddMoveCallback(p,a,b) (p)->AddMoveCallback(a,b) +#define IDirect3DRMFrame2_AddTransform(p,a,b) (p)->AddTransform(a,b) +#define IDirect3DRMFrame2_AddTranslation(p,a,b,c,d) (p)->AddTranslation(a,b,c,d) +#define IDirect3DRMFrame2_AddScale(p,a,b,c,d) (p)->AddScale(a,b,c,d) +#define IDirect3DRMFrame2_AddRotation(p,a,b,c,d,e) (p)->AddRotation(a,b,c,d,e) +#define IDirect3DRMFrame2_AddVisual(p,a) (p)->AddVisual(a) +#define IDirect3DRMFrame2_GetChildren(p,a) (p)->GetChildren(a) +#define IDirect3DRMFrame2_GetColor(p) (p)->GetColor() +#define IDirect3DRMFrame2_GetLights(p,a) (p)->GetLights(a) +#define IDirect3DRMFrame2_GetMaterialMode(p) (p)->GetMaterialMode() +#define IDirect3DRMFrame2_GetParent(p,a) (p)->GetParent(a) +#define IDirect3DRMFrame2_GetPosition(p,a,b) (p)->GetPosition(a,b) +#define IDirect3DRMFrame2_GetRotation(p,a,b,c) (p)->GetRotation(a,b,c) +#define IDirect3DRMFrame2_GetScene(p,a) (p)->GetScene(a) +#define IDirect3DRMFrame2_GetSortMode(p) (p)->GetSortMode() +#define IDirect3DRMFrame2_GetTexture(p,a) (p)->GetTexture(a) +#define IDirect3DRMFrame2_GetTransform(p,a) (p)->GetTransform(a) +#define IDirect3DRMFrame2_GetVelocity(p,a,b,c) (p)->GetVelocity(a,b,c) +#define IDirect3DRMFrame2_GetOrientation(p,a,b,c) (p)->GetOrientation(a,b,c) +#define IDirect3DRMFrame2_GetVisuals(p,a) (p)->GetVisuals(a) +#define IDirect3DRMFrame2_GetTextureTopology(p,a,b) (p)->GetTextureTopology(a,b) +#define IDirect3DRMFrame2_InverseTransform(p,a,b) (p)->InverseTransform(a,b) +#define IDirect3DRMFrame2_Load(p,a,b,c,d,e) (p)->Load(a,b,c,d,e) +#define IDirect3DRMFrame2_LookAt(p,a,b,c) (p)->LookAt(a,b,c) +#define IDirect3DRMFrame2_Move(p,a) (p)->Move(a) +#define IDirect3DRMFrame2_DeleteChild(p,a) (p)->DeleteChild(a) +#define IDirect3DRMFrame2_DeleteLight(p,a) (p)->DeleteLight(a) +#define IDirect3DRMFrame2_DeleteMoveCallback(p,a,b) (p)->DeleteMoveCallback(a,b) +#define IDirect3DRMFrame2_DeleteVisual(p,a) (p)->DeleteVisual(a) +#define IDirect3DRMFrame2_GetSceneBackground(p) (p)->GetSceneBackground() +#define IDirect3DRMFrame2_GetSceneBackgroundDepth(p,a) (p)->GetSceneBackgroundDepth(a) +#define IDirect3DRMFrame2_GetSceneFogColor(p) (p)->GetSceneFogColor() +#define IDirect3DRMFrame2_GetSceneFogEnable(p) (p)->GetSceneFogEnable() +#define IDirect3DRMFrame2_GetSceneFogMode(p) (p)->GetSceneFogMode() +#define IDirect3DRMFrame2_GetSceneFogParams(p,a,b,c) (p)->GetSceneFogParams(a,b,c) +#define IDirect3DRMFrame2_SetSceneBackground(p,a) (p)->SetSceneBackground(a) +#define IDirect3DRMFrame2_SetSceneBackgroundRGB(p,a,b,c) (p)->SetSceneBackgroundRGB(a,b,c) +#define IDirect3DRMFrame2_SetSceneBackgroundDepth(p,a) (p)->SetSceneBackgroundDepth(a) +#define IDirect3DRMFrame2_SetSceneBackgroundImage(p,a) (p)->SetSceneBackgroundImage(a) +#define IDirect3DRMFrame2_SetSceneFogEnable(p,a) (p)->SetSceneFogEnable(a) +#define IDirect3DRMFrame2_SetSceneFogColor(p,a) (p)->SetSceneFogColor(a) +#define IDirect3DRMFrame2_SetSceneFogMode(p,a) (p)->SetSceneFogMode(a) +#define IDirect3DRMFrame2_SetSceneFogParams(p,a,b,c) (p)->SetSceneFogParams(a,b,c) +#define IDirect3DRMFrame2_SetColor(p,a) (p)->SetColor(a) +#define IDirect3DRMFrame2_SetColorRGB(p,a,b,c) (p)->SetColorRGB(a,b,c) +#define IDirect3DRMFrame2_GetZbufferMode(p) (p)->GetZbufferMode() +#define IDirect3DRMFrame2_SetMaterialMode(p,a) (p)->SetMaterialMode(a) +#define IDirect3DRMFrame2_SetOrientation(p,a,b,c,d,e,f,g) (p)->SetOrientation(a,b,c,d,e,f,g) +#define IDirect3DRMFrame2_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d) +#define IDirect3DRMFrame2_SetRotation(p,a,b,c,d,e) (p)->SetRotation(a,b,c,d,e) +#define IDirect3DRMFrame2_SetSortMode(p,a) (p)->SetSortMode(a) +#define IDirect3DRMFrame2_SetTexture(p,a) (p)->SetTexture(a) +#define IDirect3DRMFrame2_SetTextureTopology(p,a,b) (p)->SetTextureTopology(a,b) +#define IDirect3DRMFrame2_SetVelocity(p,a,b,c,d,e) (p)->SetVelocity(a,b,c,d,e) +#define IDirect3DRMFrame2_SetZbufferMode(p,a) (p)->SetZbufferMode(a) +#define IDirect3DRMFrame2_Transform(p,a,b) (p)->Transform(a,b) +/*** IDirect3DRMFrame2 methods ***/ +#define IDirect3DRMFrame2_AddMoveCallback2(p,a,b,c) (p)->AddMoveCallback2(a,b,c) +#define IDirect3DRMFrame2_GetBox(p,a) (p)->GetBox(a) +#define IDirect3DRMFrame2_GetBoxEnable(p) (p)->GetBoxEnable() +#define IDirect3DRMFrame2_GetAxes(p,a,b) (p)->GetAxes(a,b) +#define IDirect3DRMFrame2_GetMaterial(p,a) (p)->GetMaterial(a) +#define IDirect3DRMFrame2_GetInheritAxes(p,a,b) (p)->GetInheritAxes(a,b) +#define IDirect3DRMFrame2_GetHierarchyBox(p,a) (p)->GetHierarchyBox(a) +#define IDirect3DRMFrame2_SetBox(p,a) (p)->SetBox(a) +#define IDirect3DRMFrame2_SetBoxEnable(p,a) (p)->SetBoxEnable(a) +#define IDirect3DRMFrame2_SetAxes(p,a,b,c,d,e,f) (p)->SetAxes(a,b,c,d,e,f) +#define IDirect3DRMFrame2_SetInheritAxes(p,a) (p)->SetInheritAxes(a) +#define IDirect3DRMFrame2_SetMaterial(p,a) (p)->SetMaterial(a) +#define IDirect3DRMFrame2_SetQuaternion(p,a,b) (p)->SetQuaternion(a,b) +#define IDirect3DRMFrame2_RayPick(p,a,b,c,d) (p)->RayPick(a,b,c,d) +#define IDirect3DRMFrame2_Save(p,a,b,c) (p)->Save(a,b,c) +#endif + +/***************************************************************************** + * IDirect3DRMFrame3 interface + */ +#define INTERFACE IDirect3DRMFrame3 +DECLARE_INTERFACE_(IDirect3DRMFrame3,IDirect3DRMVisual) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMFrame3 methods ***/ + STDMETHOD(AddChild)(THIS_ IDirect3DRMFrame3 *child) PURE; + STDMETHOD(AddLight)(THIS_ struct IDirect3DRMLight *light) PURE; + STDMETHOD(AddMoveCallback)(THIS_ D3DRMFRAME3MOVECALLBACK cb, void *ctx, DWORD flags) PURE; + STDMETHOD(AddTransform)(THIS_ D3DRMCOMBINETYPE, D3DRMMATRIX4D) PURE; + STDMETHOD(AddTranslation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(AddScale)(THIS_ D3DRMCOMBINETYPE, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; + STDMETHOD(AddRotation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; + STDMETHOD(AddVisual)(THIS_ IUnknown *visual) PURE; + STDMETHOD(GetChildren)(THIS_ struct IDirect3DRMFrameArray **children) PURE; + STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; + STDMETHOD(GetLights)(THIS_ struct IDirect3DRMLightArray **lights) PURE; + STDMETHOD_(D3DRMMATERIALMODE, GetMaterialMode)(THIS) PURE; + STDMETHOD(GetParent)(THIS_ IDirect3DRMFrame3 **parent) PURE; + STDMETHOD(GetPosition)(THIS_ IDirect3DRMFrame3 *reference, D3DVECTOR *return_position) PURE; + STDMETHOD(GetRotation)(THIS_ IDirect3DRMFrame3 *reference, D3DVECTOR *axis, D3DVALUE *return_theta) PURE; + STDMETHOD(GetScene)(THIS_ IDirect3DRMFrame3 **scene) PURE; + STDMETHOD_(D3DRMSORTMODE, GetSortMode)(THIS) PURE; + STDMETHOD(GetTexture)(THIS_ struct IDirect3DRMTexture3 **texture) PURE; + STDMETHOD(GetTransform)(THIS_ IDirect3DRMFrame3 *reference, D3DRMMATRIX4D matrix) PURE; + STDMETHOD(GetVelocity)(THIS_ IDirect3DRMFrame3 *reference, D3DVECTOR *return_velocity, BOOL with_rotation) PURE; + STDMETHOD(GetOrientation)(THIS_ IDirect3DRMFrame3 *reference, D3DVECTOR *dir, D3DVECTOR *up) PURE; + STDMETHOD(GetVisuals)(THIS_ DWORD *count, IUnknown **visuals) PURE; + STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; + STDMETHOD(Load)(THIS_ void *filename, void *name, D3DRMLOADOPTIONS flags, + D3DRMLOADTEXTURE3CALLBACK cb, void *ctx) PURE; + STDMETHOD(LookAt)(THIS_ IDirect3DRMFrame3 *target, IDirect3DRMFrame3 *reference, + D3DRMFRAMECONSTRAINT constraint) PURE; + STDMETHOD(Move)(THIS_ D3DVALUE delta) PURE; + STDMETHOD(DeleteChild)(THIS_ IDirect3DRMFrame3 *child) PURE; + STDMETHOD(DeleteLight)(THIS_ struct IDirect3DRMLight *light) PURE; + STDMETHOD(DeleteMoveCallback)(THIS_ D3DRMFRAME3MOVECALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteVisual)(THIS_ IUnknown *visual) PURE; + STDMETHOD_(D3DCOLOR, GetSceneBackground)(THIS) PURE; + STDMETHOD(GetSceneBackgroundDepth)(THIS_ IDirectDrawSurface **surface) PURE; + STDMETHOD_(D3DCOLOR, GetSceneFogColor)(THIS) PURE; + STDMETHOD_(BOOL, GetSceneFogEnable)(THIS) PURE; + STDMETHOD_(D3DRMFOGMODE, GetSceneFogMode)(THIS) PURE; + STDMETHOD(GetSceneFogParams)(THIS_ D3DVALUE *return_start, D3DVALUE *return_end, + D3DVALUE *return_density) PURE; + STDMETHOD(SetSceneBackground)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetSceneBackgroundRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetSceneBackgroundDepth)(THIS_ IDirectDrawSurface *surface) PURE; + STDMETHOD(SetSceneBackgroundImage)(THIS_ struct IDirect3DRMTexture3 *texture) PURE; + STDMETHOD(SetSceneFogEnable)(THIS_ BOOL) PURE; + STDMETHOD(SetSceneFogColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetSceneFogMode)(THIS_ D3DRMFOGMODE) PURE; + STDMETHOD(SetSceneFogParams)(THIS_ D3DVALUE start, D3DVALUE end, D3DVALUE density) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD_(D3DRMZBUFFERMODE, GetZbufferMode)(THIS) PURE; + STDMETHOD(SetMaterialMode)(THIS_ D3DRMMATERIALMODE) PURE; + STDMETHOD(SetOrientation)(THIS_ IDirect3DRMFrame3 *reference, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, + D3DVALUE ux, D3DVALUE uy, D3DVALUE uz) PURE; + STDMETHOD(SetPosition)(THIS_ IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetRotation)(THIS_ IDirect3DRMFrame3 *reference, + D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; + STDMETHOD(SetSortMode)(THIS_ D3DRMSORTMODE) PURE; + STDMETHOD(SetTexture)(THIS_ struct IDirect3DRMTexture3 *texture) PURE; + STDMETHOD(SetVelocity)(THIS_ IDirect3DRMFrame3 *reference, + D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation) PURE; + STDMETHOD(SetZbufferMode)(THIS_ D3DRMZBUFFERMODE) PURE; + STDMETHOD(Transform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; + STDMETHOD(GetBox)(THIS_ D3DRMBOX *box) PURE; + STDMETHOD_(BOOL, GetBoxEnable)(THIS) PURE; + STDMETHOD(GetAxes)(THIS_ D3DVECTOR *dir, D3DVECTOR *up); + STDMETHOD(GetMaterial)(THIS_ struct IDirect3DRMMaterial2 **material) PURE; + STDMETHOD_(BOOL, GetInheritAxes)(THIS); + STDMETHOD(GetHierarchyBox)(THIS_ D3DRMBOX *box) PURE; + STDMETHOD(SetBox)(THIS_ D3DRMBOX *box) PURE; + STDMETHOD(SetBoxEnable)(THIS_ BOOL) PURE; + STDMETHOD(SetAxes)(THIS_ D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz); + STDMETHOD(SetInheritAxes)(THIS_ BOOL inherit_from_parent); + STDMETHOD(SetMaterial)(THIS_ struct IDirect3DRMMaterial2 *material) PURE; + STDMETHOD(SetQuaternion)(THIS_ IDirect3DRMFrame3 *reference, D3DRMQUATERNION *q) PURE; + STDMETHOD(RayPick)(THIS_ IDirect3DRMFrame3 *reference, D3DRMRAY *ray, DWORD flags, + struct IDirect3DRMPicked2Array **return_visuals) PURE; + STDMETHOD(Save)(THIS_ const char *filename, D3DRMXOFFORMAT format, D3DRMSAVEOPTIONS flags); + STDMETHOD(TransformVectors)(THIS_ IDirect3DRMFrame3 *reference, DWORD vector_count, + D3DVECTOR *dst_vectors, D3DVECTOR *src_vectors) PURE; + STDMETHOD(InverseTransformVectors)(THIS_ IDirect3DRMFrame3 *reference, DWORD vector_count, + D3DVECTOR *dst_vectors, D3DVECTOR *src_vectors) PURE; + STDMETHOD(SetTraversalOptions)(THIS_ DWORD flags) PURE; + STDMETHOD(GetTraversalOptions)(THIS_ DWORD *flags) PURE; + STDMETHOD(SetSceneFogMethod)(THIS_ DWORD flags) PURE; + STDMETHOD(GetSceneFogMethod)(THIS_ DWORD *fog_mode) PURE; + STDMETHOD(SetMaterialOverride)(THIS_ D3DRMMATERIALOVERRIDE *override) PURE; + STDMETHOD(GetMaterialOverride)(THIS_ D3DRMMATERIALOVERRIDE *override) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMFrame3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMFrame3_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMFrame3_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMFrame3_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMFrame3_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMFrame3_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMFrame3_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMFrame3_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMFrame3_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMFrame3_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMFrame3_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMFrame3 methods ***/ +#define IDirect3DRMFrame3_AddChild(p,a) (p)->lpVtbl->AddChild(p,a) +#define IDirect3DRMFrame3_AddLight(p,a) (p)->lpVtbl->AddLight(p,a) +#define IDirect3DRMFrame3_AddMoveCallback(p,a,b,c) (p)->lpVtbl->AddMoveCallback(p,a,b,c) +#define IDirect3DRMFrame3_AddTransform(p,a,b) (p)->lpVtbl->AddTransform(p,a,b) +#define IDirect3DRMFrame3_AddTranslation(p,a,b,c,d) (p)->lpVtbl->AddTranslation(p,a,b,c,d) +#define IDirect3DRMFrame3_AddScale(p,a,b,c,d) (p)->lpVtbl->AddScale(p,a,b,c,d) +#define IDirect3DRMFrame3_AddRotation(p,a,b,c,d,e) (p)->lpVtbl->AddRotation(p,a,b,c,d,e) +#define IDirect3DRMFrame3_AddVisual(p,a) (p)->lpVtbl->AddVisual(p,a) +#define IDirect3DRMFrame3_GetChildren(p,a) (p)->lpVtbl->GetChildren(p,a) +#define IDirect3DRMFrame3_GetColor(p) (p)->lpVtbl->GetColor(p) +#define IDirect3DRMFrame3_GetLights(p,a) (p)->lpVtbl->GetLights(p,a) +#define IDirect3DRMFrame3_GetMaterialMode(p) (p)->lpVtbl->GetMaterialMode(p) +#define IDirect3DRMFrame3_GetParent(p,a) (p)->lpVtbl->GetParent(p,a) +#define IDirect3DRMFrame3_GetPosition(p,a,b) (p)->lpVtbl->GetPosition(p,a,b) +#define IDirect3DRMFrame3_GetRotation(p,a,b,c) (p)->lpVtbl->GetRotation(p,a,b,c) +#define IDirect3DRMFrame3_GetScene(p,a) (p)->lpVtbl->GetScene(p,a) +#define IDirect3DRMFrame3_GetSortMode(p) (p)->lpVtbl->GetSortMode(p) +#define IDirect3DRMFrame3_GetTexture(p,a) (p)->lpVtbl->GetTexture(p,a) +#define IDirect3DRMFrame3_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) +#define IDirect3DRMFrame3_GetVelocity(p,a,b,c) (p)->lpVtbl->GetVelocity(p,a,b,c) +#define IDirect3DRMFrame3_GetOrientation(p,a,b,c) (p)->lpVtbl->GetOrientation(p,a,b,c) +#define IDirect3DRMFrame3_GetVisuals(p,a,b) (p)->lpVtbl->GetVisuals(p,a,b) +#define IDirect3DRMFrame3_InverseTransform(p,a,b) (p)->lpVtbl->InverseTransform(p,a,b) +#define IDirect3DRMFrame3_Load(p,a,b,c,d,e) (p)->lpVtbl->Load(p,a,b,c,d,e) +#define IDirect3DRMFrame3_LookAt(p,a,b,c) (p)->lpVtbl->LookAt(p,a,b,c) +#define IDirect3DRMFrame3_Move(p,a) (p)->lpVtbl->Move(p,a) +#define IDirect3DRMFrame3_DeleteChild(p,a) (p)->lpVtbl->DeleteChild(p,a) +#define IDirect3DRMFrame3_DeleteLight(p,a) (p)->lpVtbl->DeleteLight(p,a) +#define IDirect3DRMFrame3_DeleteMoveCallback(p,a,b) (p)->lpVtbl->DeleteMoveCallback(p,a,b) +#define IDirect3DRMFrame3_DeleteVisual(p,a) (p)->lpVtbl->DeleteVisual(p,a) +#define IDirect3DRMFrame3_GetSceneBackground(p) (p)->lpVtbl->GetSceneBackground(p) +#define IDirect3DRMFrame3_GetSceneBackgroundDepth(p,a) (p)->lpVtbl->GetSceneBackgroundDepth(p,a) +#define IDirect3DRMFrame3_GetSceneFogColor(p) (p)->lpVtbl->GetSceneFogColor(p) +#define IDirect3DRMFrame3_GetSceneFogEnable(p) (p)->lpVtbl->GetSceneFogEnable(p) +#define IDirect3DRMFrame3_GetSceneFogMode(p) (p)->lpVtbl->GetSceneFogMode(p) +#define IDirect3DRMFrame3_GetSceneFogParams(p,a,b,c) (p)->lpVtbl->GetSceneFogParams(p,a,b,c) +#define IDirect3DRMFrame3_SetSceneBackground(p,a) (p)->lpVtbl->SetSceneBackground(p,a) +#define IDirect3DRMFrame3_SetSceneBackgroundRGB(p,a,b,c) (p)->lpVtbl->SetSceneBackgroundRGB(p,a,b,c) +#define IDirect3DRMFrame3_SetSceneBackgroundDepth(p,a) (p)->lpVtbl->SetSceneBackgroundDepth(p,a) +#define IDirect3DRMFrame3_SetSceneBackgroundImage(p,a) (p)->lpVtbl->SetSceneBackgroundImage(p,a) +#define IDirect3DRMFrame3_SetSceneFogEnable(p,a) (p)->lpVtbl->SetSceneFogEnable(p,a) +#define IDirect3DRMFrame3_SetSceneFogColor(p,a) (p)->lpVtbl->SetSceneFogColor(p,a) +#define IDirect3DRMFrame3_SetSceneFogMode(p,a) (p)->lpVtbl->SetSceneFogMode(p,a) +#define IDirect3DRMFrame3_SetSceneFogParams(p,a,b,c) (p)->lpVtbl->SetSceneFogParams(p,a,b,c) +#define IDirect3DRMFrame3_SetColor(p,a) (p)->lpVtbl->SetColor(p,a) +#define IDirect3DRMFrame3_SetColorRGB(p,a,b,c) (p)->lpVtbl->SetColorRGB(p,a,b,c) +#define IDirect3DRMFrame3_GetZbufferMode(p) (p)->lpVtbl->GetZbufferMode(p) +#define IDirect3DRMFrame3_SetMaterialMode(p,a) (p)->lpVtbl->SetMaterialMode(p,a) +#define IDirect3DRMFrame3_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g) +#define IDirect3DRMFrame3_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d) +#define IDirect3DRMFrame3_SetRotation(p,a,b,c,d,e) (p)->lpVtbl->SetRotation(p,a,b,c,d,e) +#define IDirect3DRMFrame3_SetSortMode(p,a) (p)->lpVtbl->SetSortMode(p,a) +#define IDirect3DRMFrame3_SetTexture(p,a) (p)->lpVtbl->SetTexture(p,a) +#define IDirect3DRMFrame3_SetVelocity(p,a,b,c,d,e) (p)->lpVtbl->SetVelocity(p,a,b,c,d,e) +#define IDirect3DRMFrame3_SetZbufferMode(p,a) (p)->lpVtbl->SetZbufferMode(p,a) +#define IDirect3DRMFrame3_Transform(p,a,b) (p)->lpVtbl->Transform(p,a,b) +#define IDirect3DRMFrame3_GetBox(p,a) (p)->lpVtbl->GetBox(p,a) +#define IDirect3DRMFrame3_GetBoxEnable(p) (p)->lpVtbl->GetBoxEnable(p) +#define IDirect3DRMFrame3_GetAxes(p,a,b) (p)->lpVtbl->GetAxes(p,a,b) +#define IDirect3DRMFrame3_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) +#define IDirect3DRMFrame3_GetInheritAxes(p) (p)->lpVtbl->GetInheritAxes(p) +#define IDirect3DRMFrame3_GetHierarchyBox(p,a) (p)->lpVtbl->GetHierarchyBox(p,a) +#define IDirect3DRMFrame3_SetBox(p,a) (p)->lpVtbl->SetBox(p,a) +#define IDirect3DRMFrame3_SetBoxEnable(p,a) (p)->lpVtbl->SetBoxEnable(p,a) +#define IDirect3DRMFrame3_SetAxes(p,a,b,c,d,e,f) (p)->lpVtbl->SetAxes(p,a,b,c,d,e,f) +#define IDirect3DRMFrame3_SetInheritAxes(p,a) (p)->lpVtbl->SetInheritAxes(p,a) +#define IDirect3DRMFrame3_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) +#define IDirect3DRMFrame3_SetQuaternion(p,a,b) (p)->lpVtbl->SetQuaternion(p,a,b) +#define IDirect3DRMFrame3_RayPick(p,a,b,c,d) (p)->lpVtbl->RayPick(p,a,b,c,d) +#define IDirect3DRMFrame3_Save(p,a,b,c) (p)->lpVtbl->Save(p,a,b,c) +#define IDirect3DRMFrame3_TransformVectors(p,a,b,c,d) (p)->lpVtbl->TransformVectors(p,a,b,c,d) +#define IDirect3DRMFrame3_InverseTransformVectors(p,a,b,c,d) (p)->lpVtbl->InverseTransformVectors(p,a,b,c,d) +#define IDirect3DRMFrame3_SetTraversalOptions(p,a) (p)->lpVtbl->SetTraversalOptions(p,a) +#define IDirect3DRMFrame3_GetTraversalOptions(p,a) (p)->lpVtbl->GetTraversalOptions(p,a) +#define IDirect3DRMFrame3_SetSceneFogMethod(p,a) (p)->lpVtbl->SetSceneFogMethod(p,a) +#define IDirect3DRMFrame3_GetSceneFogMethod(p,a) (p)->lpVtbl->GetSceneFogMethod(p,a) +#define IDirect3DRMFrame3_SetMaterialOverride(p,a) (p)->lpVtbl->SetMaterialOverride(p,a) +#define IDirect3DRMFrame3_GetMaterialOverride(p,a) (p)->lpVtbl->GetMaterialOverride(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMFrame3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMFrame3_AddRef(p) (p)->AddRef() +#define IDirect3DRMFrame3_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMFrame3_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMFrame3_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMFrame3_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMFrame3_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMFrame3_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMFrame3_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMFrame3_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMFrame3_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMFrame3 methods ***/ +#define IDirect3DRMFrame3_AddChild(p,a) (p)->AddChild(a) +#define IDirect3DRMFrame3_AddLight(p,a) (p)->AddLight(a) +#define IDirect3DRMFrame3_AddMoveCallback(p,a,b,c) (p)->AddMoveCallback(a,b,c) +#define IDirect3DRMFrame3_AddTransform(p,a,b) (p)->AddTransform(a,b) +#define IDirect3DRMFrame3_AddTranslation(p,a,b,c,d) (p)->AddTranslation(a,b,c,d) +#define IDirect3DRMFrame3_AddScale(p,a,b,c,d) (p)->AddScale(a,b,c,d) +#define IDirect3DRMFrame3_AddRotation(p,a,b,c,d,e) (p)->AddRotation(a,b,c,d,e) +#define IDirect3DRMFrame3_AddVisual(p,a) (p)->AddVisual(a) +#define IDirect3DRMFrame3_GetChildren(p,a) (p)->GetChildren(a) +#define IDirect3DRMFrame3_GetColor(p) (p)->GetColor() +#define IDirect3DRMFrame3_GetLights(p,a) (p)->GetLights(a) +#define IDirect3DRMFrame3_GetMaterialMode(p) (p)->GetMaterialMode() +#define IDirect3DRMFrame3_GetParent(p,a) (p)->GetParent(a) +#define IDirect3DRMFrame3_GetPosition(p,a,b) (p)->GetPosition(a,b) +#define IDirect3DRMFrame3_GetRotation(p,a,b,c) (p)->GetRotation(a,b,c) +#define IDirect3DRMFrame3_GetScene(p,a) (p)->GetScene(a) +#define IDirect3DRMFrame3_GetSortMode(p) (p)->GetSortMode() +#define IDirect3DRMFrame3_GetTexture(p,a) (p)->GetTexture(a) +#define IDirect3DRMFrame3_GetTransform(p,a,b) (p)->GetTransform(a,b) +#define IDirect3DRMFrame3_GetVelocity(p,a,b,c) (p)->GetVelocity(a,b,c) +#define IDirect3DRMFrame3_GetOrientation(p,a,b,c) (p)->GetOrientation(a,b,c) +#define IDirect3DRMFrame3_GetVisuals(p,a,b) (p)->GetVisuals(a,b) +#define IDirect3DRMFrame3_InverseTransform(p,a,b) (p)->InverseTransform(a,b) +#define IDirect3DRMFrame3_Load(p,a,b,c,d,e) (p)->Load(a,b,c,d,e) +#define IDirect3DRMFrame3_LookAt(p,a,b,c) (p)->LookAt(a,b,c) +#define IDirect3DRMFrame3_Move(p,a) (p)->Move(a) +#define IDirect3DRMFrame3_DeleteChild(p,a) (p)->DeleteChild(a) +#define IDirect3DRMFrame3_DeleteLight(p,a) (p)->DeleteLight(a) +#define IDirect3DRMFrame3_DeleteMoveCallback(p,a,b) (p)->DeleteMoveCallback(a,b) +#define IDirect3DRMFrame3_DeleteVisual(p,a) (p)->DeleteVisual(a) +#define IDirect3DRMFrame3_GetSceneBackground(p) (p)->GetSceneBackground() +#define IDirect3DRMFrame3_GetSceneBackgroundDepth(p,a) (p)->GetSceneBackgroundDepth(a) +#define IDirect3DRMFrame3_GetSceneFogColor(p) (p)->GetSceneFogColor() +#define IDirect3DRMFrame3_GetSceneFogEnable(p) (p)->GetSceneFogEnable() +#define IDirect3DRMFrame3_GetSceneFogMode(p) (p)->GetSceneFogMode() +#define IDirect3DRMFrame3_GetSceneFogParams(p,a,b,c) (p)->GetSceneFogParams(a,b,c) +#define IDirect3DRMFrame3_SetSceneBackground(p,a) (p)->SetSceneBackground(a) +#define IDirect3DRMFrame3_SetSceneBackgroundRGB(p,a,b,c) (p)->SetSceneBackgroundRGB(a,b,c) +#define IDirect3DRMFrame3_SetSceneBackgroundDepth(p,a) (p)->SetSceneBackgroundDepth(a) +#define IDirect3DRMFrame3_SetSceneBackgroundImage(p,a) (p)->SetSceneBackgroundImage(a) +#define IDirect3DRMFrame3_SetSceneFogEnable(p,a) (p)->SetSceneFogEnable(a) +#define IDirect3DRMFrame3_SetSceneFogColor(p,a) (p)->SetSceneFogColor(a) +#define IDirect3DRMFrame3_SetSceneFogMode(p,a) (p)->SetSceneFogMode(a) +#define IDirect3DRMFrame3_SetSceneFogParams(p,a,b,c) (p)->SetSceneFogParams(a,b,c) +#define IDirect3DRMFrame3_SetColor(p,a) (p)->SetColor(a) +#define IDirect3DRMFrame3_SetColorRGB(p,a,b,c) (p)->SetColorRGB(a,b,c) +#define IDirect3DRMFrame3_GetZbufferMode(p) (p)->GetZbufferMode() +#define IDirect3DRMFrame3_SetMaterialMode(p,a) (p)->SetMaterialMode(a) +#define IDirect3DRMFrame3_SetOrientation(p,a,b,c,d,e,f,g) (p)->SetOrientation(a,b,c,d,e,f,g) +#define IDirect3DRMFrame3_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d) +#define IDirect3DRMFrame3_SetRotation(p,a,b,c,d,e) (p)->SetRotation(a,b,c,d,e) +#define IDirect3DRMFrame3_SetSortMode(p,a) (p)->SetSortMode(a) +#define IDirect3DRMFrame3_SetTexture(p,a) (p)->SetTexture(a) +#define IDirect3DRMFrame3_SetVelocity(p,a,b,c,d,e) (p)->SetVelocity(a,b,c,d,e) +#define IDirect3DRMFrame3_SetZbufferMode(p,a) (p)->SetZbufferMode(a) +#define IDirect3DRMFrame3_Transform(p,a,b) (p)->Transform(a,b) +#define IDirect3DRMFrame3_GetBox(p,a) (p)->GetBox(a) +#define IDirect3DRMFrame3_GetBoxEnable(p) (p)->GetBoxEnable() +#define IDirect3DRMFrame3_GetAxes(p,a,b) (p)->GetAxes(a,b) +#define IDirect3DRMFrame3_GetMaterial(p,a) (p)->GetMaterial(a) +#define IDirect3DRMFrame3_GetInheritAxes(p) (p)->GetInheritAxes() +#define IDirect3DRMFrame3_GetHierarchyBox(p,a) (p)->GetHierarchyBox(a) +#define IDirect3DRMFrame3_SetBox(p,a) (p)->SetBox(a) +#define IDirect3DRMFrame3_SetBoxEnable(p,a) (p)->SetBoxEnable(a) +#define IDirect3DRMFrame3_SetAxes(p,a,b,c,d,e,f) (p)->SetAxes(a,b,c,d,e,f) +#define IDirect3DRMFrame3_SetInheritAxes(p,a) (p)->SetInheritAxes(a) +#define IDirect3DRMFrame3_SetMaterial(p,a) (p)->SetMaterial(a) +#define IDirect3DRMFrame3_SetQuaternion(p,a,b) (p)->SetQuaternion(a,b) +#define IDirect3DRMFrame3_RayPick(p,a,b,c,d) (p)->RayPick(a,b,c,d) +#define IDirect3DRMFrame3_Save(p,a,b,c) (p)->Save(a,b,c) +#define IDirect3DRMFrame3_TransformVectors(p,a,b,c,d) (p)->TransformVectors(a,b,c,d) +#define IDirect3DRMFrame3_InverseTransformVectors(p,a,b,c,d) (p)->InverseTransformVectors(a,b,c,d) +#define IDirect3DRMFrame3_SetTraversalOptions(p,a) (p)->SetTraversalOptions(a) +#define IDirect3DRMFrame3_GetTraversalOptions(p,a) (p)->GetTraversalOptions(a) +#define IDirect3DRMFrame3_SetSceneFogMethod(p,a) (p)->SetSceneFogMethod(a) +#define IDirect3DRMFrame3_GetSceneFogMethod(p,a) (p)->GetSceneFogMethod(a) +#define IDirect3DRMFrame3_SetMaterialOverride(p,a) (p)->SetMaterialOverride(a) +#define IDirect3DRMFrame3_GetMaterialOverride(p,a) (p)->GetMaterialOverride(a) +#endif + +/***************************************************************************** + * IDirect3DRMMesh interface + */ +#define INTERFACE IDirect3DRMMesh +DECLARE_INTERFACE_(IDirect3DRMMesh,IDirect3DRMVisual) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMMesh methods ***/ + STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; + STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE; + STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE; + STDMETHOD(AddGroup)(THIS_ unsigned vCount, unsigned fCount, unsigned vPerFace, unsigned *fData, + D3DRMGROUPINDEX *returnId) PURE; + STDMETHOD(SetVertices)(THIS_ D3DRMGROUPINDEX id, unsigned index, unsigned count, + D3DRMVERTEX *values) PURE; + STDMETHOD(SetGroupColor)(THIS_ D3DRMGROUPINDEX id, D3DCOLOR value) PURE; + STDMETHOD(SetGroupColorRGB)(THIS_ D3DRMGROUPINDEX id, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetGroupMapping)(THIS_ D3DRMGROUPINDEX id, D3DRMMAPPING value) PURE; + STDMETHOD(SetGroupQuality)(THIS_ D3DRMGROUPINDEX id, D3DRMRENDERQUALITY value) PURE; + STDMETHOD(SetGroupMaterial)(THIS_ D3DRMGROUPINDEX id, struct IDirect3DRMMaterial *material) PURE; + STDMETHOD(SetGroupTexture)(THIS_ D3DRMGROUPINDEX id, struct IDirect3DRMTexture *texture) PURE; + STDMETHOD_(unsigned, GetGroupCount)(THIS) PURE; + STDMETHOD(GetGroup)(THIS_ D3DRMGROUPINDEX id, unsigned *vCount, unsigned *fCount, unsigned *vPerFace, + DWORD *fDataSize, unsigned *fData) PURE; + STDMETHOD(GetVertices)(THIS_ D3DRMGROUPINDEX id, DWORD index, DWORD count, D3DRMVERTEX *returnPtr) PURE; + STDMETHOD_(D3DCOLOR, GetGroupColor)(THIS_ D3DRMGROUPINDEX id) PURE; + STDMETHOD_(D3DRMMAPPING, GetGroupMapping)(THIS_ D3DRMGROUPINDEX id) PURE; + STDMETHOD_(D3DRMRENDERQUALITY, GetGroupQuality)(THIS_ D3DRMGROUPINDEX id) PURE; + STDMETHOD(GetGroupMaterial)(THIS_ D3DRMGROUPINDEX id, struct IDirect3DRMMaterial **material) PURE; + STDMETHOD(GetGroupTexture)(THIS_ D3DRMGROUPINDEX id, struct IDirect3DRMTexture **texture) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMMesh_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMMesh_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMMesh_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMMesh_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMMesh_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMMesh_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMMesh_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMMesh_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMMesh_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMMesh_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMMesh_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMMesh methods ***/ +#define IDirect3DRMMesh_Scale(p,a,b,c) (p)->lpVtbl->Scale(p,a,b,c) +#define IDirect3DRMMesh_Translate(p,a,b,c) (p)->lpVtbl->Translate(p,a,b,c) +#define IDirect3DRMMesh_GetBox(p,a) (p)->lpVtbl->GetBox(p,a) +#define IDirect3DRMMesh_AddGroup(p,a,b,c,d,e) (p)->lpVtbl->AddGroup(p,a,b,c,d,e) +#define IDirect3DRMMesh_SetVertices(p,a,b,c,d) (p)->lpVtbl->SetVertices(p,a,b,c,d) +#define IDirect3DRMMesh_SetGroupColor(p,a,b) (p)->lpVtbl->SetGroupColor(p,a,b) +#define IDirect3DRMMesh_SetGroupColorRGB(p,a,b,c,d) (p)->lpVtbl->SetGroupColorRGB(p,a,b,c,d) +#define IDirect3DRMMesh_SetGroupMapping(p,a,b) (p)->lpVtbl->SetGroupMapping(p,a,b) +#define IDirect3DRMMesh_SetGroupQuality(p,a,b) (p)->lpVtbl->SetGroupQuality(p,a,b) +#define IDirect3DRMMesh_SetGroupMaterial(p,a,b) (p)->lpVtbl->SetGroupMaterial(p,a,b) +#define IDirect3DRMMesh_SetGroupTexture(p,a,b) (p)->lpVtbl->SetGroupTexture(p,a,b) +#define IDirect3DRMMesh_GetGroupCount(p) (p)->lpVtbl->GetGroupCount(p) +#define IDirect3DRMMesh_GetGroup(p,a,b,c,d,e,f) (p)->lpVtbl->GetGroup(p,a,b,c,d,e,f) +#define IDirect3DRMMesh_GetVertices(p,a,b,c,d) (p)->lpVtbl->GetVertices(p,a,b,c,d) +#define IDirect3DRMMesh_GetGroupColor(p,a) (p)->lpVtbl->GetGroupColor(p,a) +#define IDirect3DRMMesh_GetGroupMapping(p,a) (p)->lpVtbl->GetGroupMapping(p,a) +#define IDirect3DRMMesh_GetGroupQuality(p,a) (p)->lpVtbl->GetGroupQuality(p,a) +#define IDirect3DRMMesh_GetGroupMaterial(p,a,b) (p)->lpVtbl->GetGroupMaterial(p,a,b) +#define IDirect3DRMMesh_GetGroupTexture(p,a,b) (p)->lpVtbl->GetGroupTexture(p,a,b) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMMesh_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMMesh_AddRef(p) (p)->AddRef() +#define IDirect3DRMMesh_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMMesh_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMMesh_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMMesh_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMMesh_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMMesh_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMMesh_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMMesh_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMMesh_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMMesh methods ***/ +#define IDirect3DRMMesh_Scale(p,a,b,c) (p)->Scale(a,b,c) +#define IDirect3DRMMesh_Translate(p,a,b,c) (p)->Translate(a,b,c) +#define IDirect3DRMMesh_GetBox(p,a) (p)->GetBox(a) +#define IDirect3DRMMesh_AddGroup(p,a,b,c,d,e) (p)->AddGroup(a,b,c,d,e) +#define IDirect3DRMMesh_SetVertices(p,a,b,c,d) (p)->SetVertices(a,b,c,d) +#define IDirect3DRMMesh_SetGroupColor(p,a,b) (p)->SetGroupColor(a,b) +#define IDirect3DRMMesh_SetGroupColorRGB(p,a,b,c,d) (p)->SetGroupColorRGB(a,b,c,d) +#define IDirect3DRMMesh_SetGroupMapping(p,a,b) (p)->SetGroupMapping(a,b) +#define IDirect3DRMMesh_SetGroupQuality(p,a,b) (p)->SetGroupQuality(a,b) +#define IDirect3DRMMesh_SetGroupMaterial(p,a,b) (p)->SetGroupMaterial(a,b) +#define IDirect3DRMMesh_SetGroupTexture(p,a,b) (p)->SetGroupTexture(a,b) +#define IDirect3DRMMesh_GetGroupCount(p) (p)->GetGroupCount() +#define IDirect3DRMMesh_GetGroup(p,a,b,c,d,e,f) (p)->GetGroup(a,b,c,d,e,f) +#define IDirect3DRMMesh_GetVertices(p,a,b,c,d) (p)->GetVertices(a,b,c,d) +#define IDirect3DRMMesh_GetGroupColor(p,a) (p)->GetGroupColor(a) +#define IDirect3DRMMesh_GetGroupMapping(p,a) (p)->GetGroupMapping(a) +#define IDirect3DRMMesh_GetGroupQuality(p,a) (p)->GetGroupQuality(a) +#define IDirect3DRMMesh_GetGroupMaterial(p,a,b) (p)->GetGroupMaterial(a,b) +#define IDirect3DRMMesh_GetGroupTexture(p,a,b) (p)->GetGroupTexture(a,b) +#endif + +/***************************************************************************** + * IDirect3DRMProgressiveMesh interface + */ +#define INTERFACE IDirect3DRMProgressiveMesh +DECLARE_INTERFACE_(IDirect3DRMProgressiveMesh,IDirect3DRMVisual) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMProgressiveMesh methods ***/ + STDMETHOD(Load) (THIS_ void *filename, void *name, D3DRMLOADOPTIONS flags, + D3DRMLOADTEXTURECALLBACK cb, void *ctx) PURE; + STDMETHOD(GetLoadStatus) (THIS_ D3DRMPMESHLOADSTATUS *status) PURE; + STDMETHOD(SetMinRenderDetail) (THIS_ D3DVALUE d3dVal) PURE; + STDMETHOD(Abort) (THIS_ DWORD flags) PURE; + STDMETHOD(GetFaceDetail) (THIS_ DWORD *count) PURE; + STDMETHOD(GetVertexDetail) (THIS_ DWORD *count) PURE; + STDMETHOD(SetFaceDetail) (THIS_ DWORD count) PURE; + STDMETHOD(SetVertexDetail) (THIS_ DWORD count) PURE; + STDMETHOD(GetFaceDetailRange) (THIS_ DWORD *min_detail, DWORD *max_detail) PURE; + STDMETHOD(GetVertexDetailRange) (THIS_ DWORD *min_detail, DWORD *max_detail) PURE; + STDMETHOD(GetDetail) (THIS_ D3DVALUE *pdvVal) PURE; + STDMETHOD(SetDetail) (THIS_ D3DVALUE d3dVal) PURE; + STDMETHOD(RegisterEvents) (THIS_ HANDLE event, DWORD flags, DWORD reserved) PURE; + STDMETHOD(CreateMesh) (THIS_ IDirect3DRMMesh **mesh) PURE; + STDMETHOD(Duplicate) (THIS_ IDirect3DRMProgressiveMesh **mesh) PURE; + STDMETHOD(GetBox) (THIS_ D3DRMBOX *box) PURE; + STDMETHOD(SetQuality) (THIS_ D3DRMRENDERQUALITY quality) PURE; + STDMETHOD(GetQuality) (THIS_ D3DRMRENDERQUALITY *quality) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMProgressiveMesh_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMProgressiveMesh_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMProgressiveMesh_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMProgressiveMesh_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMProgressiveMesh_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMProgressiveMesh_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMProgressiveMesh_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMProgressiveMesh_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMProgressiveMesh_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMProgressiveMesh_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMProgressiveMesh_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMProgressiveMesh methods ***/ +#define IDirect3DRMProgressiveMesh_Load(p,a,b,c,d,e) (p)->lpVtbl->Load(p,a,b,c,d,e) +#define IDirect3DRMProgressiveMesh_GetLoadStatus(p,a) (p)->lpVtbl->GetLoadStatus(p,a) +#define IDirect3DRMProgressiveMesh_SetMinRenderDetail(p,a) (p)->lpVtbl->SetMinRenderDetail(p,a) +#define IDirect3DRMProgressiveMesh_Abort(p,a) (p)->lpVtbl->Abort(p,a) +#define IDirect3DRMProgressiveMesh_GetFaceDetail(p,a) (p)->lpVtbl->GetFaceDetail(p,a) +#define IDirect3DRMProgressiveMesh_GetVertexDetail(p,a) (p)->lpVtbl->GetVertexDetail(p,a) +#define IDirect3DRMProgressiveMesh_SetFaceDetail(p,a) (p)->lpVtbl->SetFaceDetail(p,a) +#define IDirect3DRMProgressiveMesh_SetVertexDetail(p,a) (p)->lpVtbl->SetVertexDetail(p,a) +#define IDirect3DRMProgressiveMesh_GetFaceDetailRange(p,a,b) (p)->lpVtbl->GetFaceDetailRange(p,a,b) +#define IDirect3DRMProgressiveMesh_GetVertexDetailRange(p,a,b) (p)->lpVtbl->GetVertexDetailRange(p,a,b) +#define IDirect3DRMProgressiveMesh_GetDetail(p,a) (p)->lpVtbl->GetDetail(p,a) +#define IDirect3DRMProgressiveMesh_SetDetail(p,a) (p)->lpVtbl->SetDetail(p,a) +#define IDirect3DRMProgressiveMesh_RegisterEvents(p,a,b,c) (p)->lpVtbl->RegisterEvents(p,a,b,c) +#define IDirect3DRMProgressiveMesh_CreateMesh(p,a) (p)->lpVtbl->CreateMesh(p,a) +#define IDirect3DRMProgressiveMesh_Duplicate(p,a) (p)->lpVtbl->Duplicate(p,a) +#define IDirect3DRMProgressiveMesh_GetBox(p,a) (p)->lpVtbl->GetBox(p,a) +#define IDirect3DRMProgressiveMesh_SetQuality(p,a) (p)->lpVtbl->SetQuality(p,a) +#define IDirect3DRMProgressiveMesh_GetQuality(p,a) (p)->lpVtbl->GetQuality(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMProgressiveMesh_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMProgressiveMesh_AddRef(p) (p)->AddRef() +#define IDirect3DRMProgressiveMesh_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMProgressiveMesh_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMProgressiveMesh_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMProgressiveMesh_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMProgressiveMesh_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMProgressiveMesh_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMProgressiveMesh_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMProgressiveMesh_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMProgressiveMesh_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMProgressiveMesh methods ***/ +#define IDirect3DRMProgressiveMesh_Load(p,a,b,c,d,e) (p)->Load(a,b,c,d,e) +#define IDirect3DRMProgressiveMesh_GetLoadStatus(p,a) (p)->GetLoadStatus(a) +#define IDirect3DRMProgressiveMesh_SetMinRenderDetail(p,a) (p)->SetMinRenderDetail(a) +#define IDirect3DRMProgressiveMesh_Abort(p,a) (p)->Abort(a) +#define IDirect3DRMProgressiveMesh_GetFaceDetail(p,a) (p)->GetFaceDetail(a) +#define IDirect3DRMProgressiveMesh_GetVertexDetail(p,a) (p)->GetVertexDetail(a) +#define IDirect3DRMProgressiveMesh_SetFaceDetail(p,a) (p)->SetFaceDetail(a) +#define IDirect3DRMProgressiveMesh_SetVertexDetail(p,a) (p)->SetVertexDetail(a) +#define IDirect3DRMProgressiveMesh_GetFaceDetailRange(p,a,b) (p)->GetFaceDetailRange(a,b) +#define IDirect3DRMProgressiveMesh_GetVertexDetailRange(p,a,b) (p)->GetVertexDetailRange(a,b) +#define IDirect3DRMProgressiveMesh_GetDetail(p,a) (p)->GetDetail(a) +#define IDirect3DRMProgressiveMesh_SetDetail(p,a) (p)->SetDetail(a) +#define IDirect3DRMProgressiveMesh_RegisterEvents(p,a,b,c) (p)->RegisterEvents(a,b,c) +#define IDirect3DRMProgressiveMesh_CreateMesh(p,a) (p)->CreateMesh(a) +#define IDirect3DRMProgressiveMesh_Duplicate(p,a) (p)->Duplicate(a) +#define IDirect3DRMProgressiveMesh_GetBox(p,a) (p)->GetBox(a) +#define IDirect3DRMProgressiveMesh_SetQuality(p,a) (p)->SetQuality(a) +#define IDirect3DRMProgressiveMesh_GetQuality(p,a) (p)->GetQuality(a) +#endif + +/***************************************************************************** + * IDirect3DRMShadow interface + */ +#define INTERFACE IDirect3DRMShadow +DECLARE_INTERFACE_(IDirect3DRMShadow,IDirect3DRMVisual) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMShadow methods ***/ + STDMETHOD(Init)(THIS_ IDirect3DRMVisual *visual, struct IDirect3DRMLight *light, + D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMShadow_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMShadow_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMShadow_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMShadow_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMShadow_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMShadow_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMShadow_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMShadow_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMShadow_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMShadow_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMShadow_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMShadow methods ***/ +#define IDirect3DRMShadow_Init(p,a,b,c,d,e,f,g) (p)->lpVtbl->Load(p,a,b,c,d,e,f,g) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMShadow_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMShadow_AddRef(p) (p)->AddRef() +#define IDirect3DRMShadow_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMShadow_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMShadow_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMShadow_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMShadow_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMShadow_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMShadow_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMShadow_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMShadow_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMShadow methods ***/ +#define IDirect3DRMShadow_Init(p,a,b,c,d,e,f,g) (p)->Load(a,b,c,d,e,f,g) +#endif + +/***************************************************************************** + * IDirect3DRMShadow2 interface + */ +#define INTERFACE IDirect3DRMShadow2 +DECLARE_INTERFACE_(IDirect3DRMShadow2,IDirect3DRMVisual) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMShadow methods ***/ + STDMETHOD(Init)(THIS_ IUnknown *object, struct IDirect3DRMLight *light, + D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz) PURE; + /*** IDirect3DRMShadow2 methods ***/ + STDMETHOD(GetVisual)(THIS_ IDirect3DRMVisual **visual) PURE; + STDMETHOD(SetVisual)(THIS_ IUnknown *visual, DWORD flags) PURE; + STDMETHOD(GetLight)(THIS_ struct IDirect3DRMLight **light) PURE; + STDMETHOD(SetLight)(THIS_ struct IDirect3DRMLight *light, DWORD flags) PURE; + STDMETHOD(GetPlane)(THIS_ D3DVALUE *px, D3DVALUE *py, D3DVALUE *pz, + D3DVALUE *nx, D3DVALUE *ny, D3DVALUE *nz) PURE; + STDMETHOD(SetPlane)(THIS_ D3DVALUE px, D3DVALUE py, D3DVALUE pz, + D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, DWORD) PURE; + STDMETHOD(GetOptions)(THIS_ DWORD *flags) PURE; + STDMETHOD(SetOptions)(THIS_ DWORD) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMShadow2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMShadow2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMShadow2_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMShadow2_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMShadow2_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMShadow2_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMShadow2_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMShadow2_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMShadow2_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMShadow2_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMShadow2_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMShadow methods ***/ +#define IDirect3DRMShadow2_Init(p,a,b,c,d,e,f,g) (p)->lpVtbl->Init(p,a,b,c,d,e,f,g) +/*** IDirect3DRMShadow2 methods ***/ +#define IDirect3DRMShadow2_GetVisual(p,a) (p)->lpVtbl->GetVisual(p,a) +#define IDirect3DRMShadow2_SetVisual(p,a,b) (p)->lpVtbl->SetVisual(p,a,b) +#define IDirect3DRMShadow2_GetLight(p,a) (p)->lpVtbl->GetLight(p,a) +#define IDirect3DRMShadow2_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b) +#define IDirect3DRMShadow2_GetPlane(p,a,b,c,d,e,f) (p)->lpVtbl->GetPlane(p,a,b,c,d,e,f) +#define IDirect3DRMShadow2_SetPlane(p,a,b,c,d,e,f) (p)->lpVtbl->SetPlane(p,a,b,c,d,e,f) +#define IDirect3DRMShadow2_GetOptions(p,a) (p)->lpVtbl->GetOptions(p,a) +#define IDirect3DRMShadow2_SetOptions(p,a) (p)->lpVtbl->SetOptions(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMShadow2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMShadow2_AddRef(p) (p)->AddRef() +#define IDirect3DRMShadow2_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMShadow2_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMShadow2_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMShadow2_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMShadow2_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMShadow2_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMShadow2_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMShadow2_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMShadow2_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMShadow methods ***/ +#define IDirect3DRMShadow2_Init(p,a,b,c,d,e,f,g) (p)->Init(a,b,c,d,e,f,g) +/*** IDirect3DRMShadow2 methods ***/ +#define IDirect3DRMShadow2_GetVisual(p,a) (p)->GetVisual(a) +#define IDirect3DRMShadow2_SetVisual(p,a,b) (p)->SetVisual(a,b) +#define IDirect3DRMShadow2_GetLight(p,a) (p)->GetLight(a) +#define IDirect3DRMShadow2_SetLight(p,a,b) (p)->SetLight(a,b) +#define IDirect3DRMShadow2_GetPlane(p,a,b,c,d,e,f) (p)->GetPlane(a,b,c,d,e,f) +#define IDirect3DRMShadow2_SetPlane(p,a,b,c,d,e,f) (p)->SetPlane(a,b,c,d,e,f) +#define IDirect3DRMShadow2_GetOptions(p,a) (p)->GetOptions(a) +#define IDirect3DRMShadow2_SetOptions(p,a) (p)->SetOptions(a) +#endif + +/***************************************************************************** + * IDirect3DRMFace interface + */ +#define INTERFACE IDirect3DRMFace +DECLARE_INTERFACE_(IDirect3DRMFace,IDirect3DRMObject) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMFace methods ***/ + STDMETHOD(AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(AddVertexAndNormalIndexed)(THIS_ DWORD vertex, DWORD normal) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE, D3DVALUE, D3DVALUE) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetTexture)(THIS_ struct IDirect3DRMTexture *texture) PURE; + STDMETHOD(SetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE u, D3DVALUE v) PURE; + STDMETHOD(SetMaterial)(THIS_ struct IDirect3DRMMaterial *material) PURE; + STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; + STDMETHOD(GetVertex)(THIS_ DWORD index, D3DVECTOR *vertex, D3DVECTOR *normal) PURE; + STDMETHOD(GetVertices)(THIS_ DWORD *vertex_count, D3DVECTOR *coords, D3DVECTOR *normals); + STDMETHOD(GetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE *u, D3DVALUE *v) PURE; + STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE; + STDMETHOD(GetNormal)(THIS_ D3DVECTOR *) PURE; + STDMETHOD(GetTexture)(THIS_ struct IDirect3DRMTexture **texture) PURE; + STDMETHOD(GetMaterial)(THIS_ struct IDirect3DRMMaterial **material) PURE; + STDMETHOD_(int, GetVertexCount)(THIS) PURE; + STDMETHOD_(int, GetVertexIndex)(THIS_ DWORD which) PURE; + STDMETHOD_(int, GetTextureCoordinateIndex)(THIS_ DWORD which) PURE; + STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMFace_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMFace_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMFace_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMFace_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMFace_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMFace_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMFace_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMFace_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMFace_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMFace_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMFace_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMFace methods ***/ +#define IDirect3DRMFace_AddVertex(p,a,b,c) (p)->lpVtbl->AddVertex(p,a,b,c) +#define IDirect3DRMFace_AddVertexAndNormalIndexed(p,a,b) (p)->lpVtbl->AddVertexAndNormalIndexed(p,a,b) +#define IDirect3DRMFace_SetColorRGB(p,a,b,c) (p)->lpVtbl->SetColorRGB(p,a,b,c) +#define IDirect3DRMFace_SetColor(p,a) (p)->lpVtbl->SetColor(p,a) +#define IDirect3DRMFace_SetTexture(p,a) (p)->lpVtbl->SetTexture(p,a) +#define IDirect3DRMFace_SetTextureCoordinates(p,a,b,c) (p)->lpVtbl->SetTextureCoordinates(p,a,b,c) +#define IDirect3DRMFace_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) +#define IDirect3DRMFace_SetTextureTopology(p,a,b) (p)->lpVtbl->SetTextureTopology(p,a,b) +#define IDirect3DRMFace_GetVertex(p,a,b,c) (p)->lpVtbl->GetVertex(p,a,b,c) +#define IDirect3DRMFace_GetVertices(p,a,b,c) (p)->lpVtbl->GetVertices(p,a,b,c) +#define IDirect3DRMFace_GetTextureCoordinates(p,a,b,c) (p)->lpVtbl->GetTextureCoordinates(p,a,b,c) +#define IDirect3DRMFace_GetTextureTopology(p,a,b) (p)->lpVtbl->GetTextureTopology(p,a,b) +#define IDirect3DRMFace_GetNormal(p,a) (p)->lpVtbl->GetNormal(p,a) +#define IDirect3DRMFace_GetTexture(p,a) (p)->lpVtbl->GetTexture(p,a) +#define IDirect3DRMFace_GetVertexCount(p) (p)->lpVtbl->GetVertexCount(p) +#define IDirect3DRMFace_GetVertexIndex(p,a) (p)->lpVtbl->GetVertexIndex(p,a) +#define IDirect3DRMFace_GetTextureCoordinateIndex(p,a) (p)->lpVtbl->GetTextureCoordinateIndex(p,a) +#define IDirect3DRMFace_GetColor(p,a) (p)->lpVtbl->GetColor(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMFace_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMFace_AddRef(p) (p)->AddRef() +#define IDirect3DRMFace_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMFace_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMFace_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMFace_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMFace_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMFace_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMFace_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMFace_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMFace_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMFace methods ***/ +#define IDirect3DRMFace_AddVertex(p,a,b,c) (p)->AddVertex(a,b,c) +#define IDirect3DRMFace_AddVertexAndNormalIndexed(p,a,b) (p)->AddVertexAndNormalIndexed(a,b) +#define IDirect3DRMFace_SetColorRGB(p,a,b,c) (p)->SetColorRGB(a,b,c) +#define IDirect3DRMFace_SetColor(p,a) (p)->SetColor(a) +#define IDirect3DRMFace_SetTexture(p,a) (p)->SetTexture(a) +#define IDirect3DRMFace_SetTextureCoordinates(p,a,b,c) (p)->SetTextureCoordinates(a,b,c) +#define IDirect3DRMFace_SetMaterial(p,a) (p)->SetMaterial(a) +#define IDirect3DRMFace_SetTextureTopology(p,a,b) (p)->SetTextureTopology(a,b) +#define IDirect3DRMFace_GetVertex(p,a,b,c) (p)->GetVertex(a,b,c) +#define IDirect3DRMFace_GetVertices(p,a,b,c) (p)->GetVertices(a,b,c) +#define IDirect3DRMFace_GetTextureCoordinates(p,a,b,c) (p)->GetTextureCoordinates(a,b,c) +#define IDirect3DRMFace_GetTextureTopology(p,a,b) (p)->GetTextureTopology(a,b) +#define IDirect3DRMFace_GetNormal(p,a) (p)->GetNormal(a) +#define IDirect3DRMFace_GetTexture(p,a) (p)->GetTexture(a) +#define IDirect3DRMFace_GetVertexCount(p) (p)->GetVertexCount() +#define IDirect3DRMFace_GetVertexIndex(p,a) (p)->GetVertexIndex(a) +#define IDirect3DRMFace_GetTextureCoordinateIndex(p,a) (p)->GetTextureCoordinateIndex(a) +#define IDirect3DRMFace_GetColor(p,a) (p)->GetColor(a) +#endif + +/***************************************************************************** + * IDirect3DRMFace2 interface + */ +#define INTERFACE IDirect3DRMFace2 +DECLARE_INTERFACE_(IDirect3DRMFace2,IDirect3DRMObject) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMFace methods ***/ + STDMETHOD(AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(AddVertexAndNormalIndexed)(THIS_ DWORD vertex, DWORD normal) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE, D3DVALUE, D3DVALUE) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetTexture)(THIS_ struct IDirect3DRMTexture3 *texture) PURE; + STDMETHOD(SetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE u, D3DVALUE v) PURE; + STDMETHOD(SetMaterial)(THIS_ struct IDirect3DRMMaterial2 *material) PURE; + STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; + STDMETHOD(GetVertex)(THIS_ DWORD index, D3DVECTOR *vertex, D3DVECTOR *normal) PURE; + STDMETHOD(GetVertices)(THIS_ DWORD *vertex_count, D3DVECTOR *coords, D3DVECTOR *normals); + STDMETHOD(GetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE *u, D3DVALUE *v) PURE; + STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE; + STDMETHOD(GetNormal)(THIS_ D3DVECTOR *) PURE; + STDMETHOD(GetTexture)(THIS_ struct IDirect3DRMTexture3 **texture) PURE; + STDMETHOD(GetMaterial)(THIS_ struct IDirect3DRMMaterial2 **material) PURE; + STDMETHOD_(int, GetVertexCount)(THIS) PURE; + STDMETHOD_(int, GetVertexIndex)(THIS_ DWORD which) PURE; + STDMETHOD_(int, GetTextureCoordinateIndex)(THIS_ DWORD which) PURE; + STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMFace2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMFace2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMFace2_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMFace2_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMFace2_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMFace2_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMFace2_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMFace2_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMFace2_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMFace2_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMFace2_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMFace methods ***/ +#define IDirect3DRMFace2_AddVertex(p,a,b,c) (p)->lpVtbl->AddVertex(p,a,b,c) +#define IDirect3DRMFace2_AddVertexAndNormalIndexed(p,a,b) (p)->lpVtbl->AddVertexAndNormalIndexed(p,a,b) +#define IDirect3DRMFace2_SetColorRGB(p,a,b,c) (p)->lpVtbl->SetColorRGB(p,a,b,c) +#define IDirect3DRMFace2_SetColor(p,a) (p)->lpVtbl->SetColor(p,a) +#define IDirect3DRMFace2_SetTexture(p,a) (p)->lpVtbl->SetTexture(p,a) +#define IDirect3DRMFace2_SetTextureCoordinates(p,a,b,c) (p)->lpVtbl->SetTextureCoordinates(p,a,b,c) +#define IDirect3DRMFace2_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) +#define IDirect3DRMFace2_SetTextureTopology(p,a,b) (p)->lpVtbl->SetTextureTopology(p,a,b) +#define IDirect3DRMFace2_GetVertex(p,a,b,c) (p)->lpVtbl->GetVertex(p,a,b,c) +#define IDirect3DRMFace2_GetVertices(p,a,b,c) (p)->lpVtbl->GetVertices(p,a,b,c) +#define IDirect3DRMFace2_GetTextureCoordinates(p,a,b,c) (p)->lpVtbl->GetTextureCoordinates(p,a,b,c) +#define IDirect3DRMFace2_GetTextureTopology(p,a,b) (p)->lpVtbl->GetTextureTopology(p,a,b) +#define IDirect3DRMFace2_GetNormal(p,a) (p)->lpVtbl->GetNormal(p,a) +#define IDirect3DRMFace2_GetTexture(p,a) (p)->lpVtbl->GetTexture(p,a) +#define IDirect3DRMFace2_GetVertexCount(p) (p)->lpVtbl->GetVertexCount(p) +#define IDirect3DRMFace2_GetVertexIndex(p,a) (p)->lpVtbl->GetVertexIndex(p,a) +#define IDirect3DRMFace2_GetTextureCoordinateIndex(p,a) (p)->lpVtbl->GetTextureCoordinateIndex(p,a) +#define IDirect3DRMFace2_GetColor(p,a) (p)->lpVtbl->GetColor(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMFace2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMFace2_AddRef(p) (p)->AddRef() +#define IDirect3DRMFace2_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMFace2_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMFace2_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMFace2_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMFace2_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMFace2_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMFace2_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMFace2_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMFace2_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMFace methods ***/ +#define IDirect3DRMFace2_AddVertex(p,a,b,c) (p)->AddVertex(a,b,c) +#define IDirect3DRMFace2_AddVertexAndNormalIndexed(p,a,b) (p)->AddVertexAndNormalIndexed(a,b) +#define IDirect3DRMFace2_SetColorRGB(p,a,b,c) (p)->SetColorRGB(a,b,c) +#define IDirect3DRMFace2_SetColor(p,a) (p)->SetColor(a) +#define IDirect3DRMFace2_SetTexture(p,a) (p)->SetTexture(a) +#define IDirect3DRMFace2_SetTextureCoordinates(p,a,b,c) (p)->SetTextureCoordinates(a,b,c) +#define IDirect3DRMFace2_SetMaterial(p,a) (p)->SetMaterial(a) +#define IDirect3DRMFace2_SetTextureTopology(p,a,b) (p)->SetTextureTopology(a,b) +#define IDirect3DRMFace2_GetVertex(p,a,b,c) (p)->GetVertex(a,b,c) +#define IDirect3DRMFace2_GetVertices(p,a,b,c) (p)->GetVertices(a,b,c) +#define IDirect3DRMFace2_GetTextureCoordinates(p,a,b,c) (p)->GetTextureCoordinates(a,b,c) +#define IDirect3DRMFace2_GetTextureTopology(p,a,b) (p)->GetTextureTopology(a,b) +#define IDirect3DRMFace2_GetNormal(p,a) (p)->GetNormal(a) +#define IDirect3DRMFace2_GetTexture(p,a) (p)->GetTexture(a) +#define IDirect3DRMFace2_GetVertexCount(p) (p)->GetVertexCount() +#define IDirect3DRMFace2_GetVertexIndex(p,a) (p)->GetVertexIndex(a) +#define IDirect3DRMFace2_GetTextureCoordinateIndex(p,a) (p)->GetTextureCoordinateIndex(a) +#define IDirect3DRMFace2_GetColor(p,a) (p)->GetColor(a) +#endif + +/***************************************************************************** + * IDirect3DRMMeshBuilder interface + */ +#define INTERFACE IDirect3DRMMeshBuilder +DECLARE_INTERFACE_(IDirect3DRMMeshBuilder,IDirect3DRMVisual) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMMeshBuilder methods ***/ + STDMETHOD(Load)(THIS_ void *filename, void *name, D3DRMLOADOPTIONS flags, + D3DRMLOADTEXTURECALLBACK cb, void *ctx) PURE; + STDMETHOD(Save)(THIS_ const char *filename, D3DRMXOFFORMAT, D3DRMSAVEOPTIONS save) PURE; + STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; + STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE; + STDMETHOD(SetColorSource)(THIS_ D3DRMCOLORSOURCE) PURE; + STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE; + STDMETHOD(GenerateNormals)(THIS) PURE; + STDMETHOD_(D3DRMCOLORSOURCE, GetColorSource)(THIS) PURE; + STDMETHOD(AddMesh)(THIS_ IDirect3DRMMesh *mesh) PURE; + STDMETHOD(AddMeshBuilder)(THIS_ IDirect3DRMMeshBuilder *mesh_builder) PURE; + STDMETHOD(AddFrame)(THIS_ IDirect3DRMFrame *frame) PURE; + STDMETHOD(AddFace)(THIS_ IDirect3DRMFace *face) PURE; + STDMETHOD(AddFaces)(THIS_ DWORD vertex_count, D3DVECTOR *vertices, DWORD normal_count, + D3DVECTOR *normals, DWORD *face_data, struct IDirect3DRMFaceArray **array) PURE; + STDMETHOD(ReserveSpace)(THIS_ DWORD vertex_Count, DWORD normal_count, DWORD face_count) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetTexture)(THIS_ struct IDirect3DRMTexture *texture) PURE; + STDMETHOD(SetMaterial)(THIS_ struct IDirect3DRMMaterial *material) PURE; + STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; + STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; + STDMETHOD(SetPerspective)(THIS_ BOOL) PURE; + STDMETHOD(SetVertex)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetNormal)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetTextureCoordinates)(THIS_ DWORD index, D3DVALUE u, D3DVALUE v) PURE; + STDMETHOD(SetVertexColor)(THIS_ DWORD index, D3DCOLOR) PURE; + STDMETHOD(SetVertexColorRGB)(THIS_ DWORD index, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(GetFaces)(THIS_ struct IDirect3DRMFaceArray **array) PURE; + STDMETHOD(GetVertices)(THIS_ DWORD *vcount, D3DVECTOR *vertices, DWORD *ncount, D3DVECTOR *normals, + DWORD *face_data_size, DWORD *face_data) PURE; + STDMETHOD(GetTextureCoordinates)(THIS_ DWORD index, D3DVALUE *u, D3DVALUE *v) PURE; + STDMETHOD_(int, AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD_(int, AddNormal)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(CreateFace)(THIS_ IDirect3DRMFace **face) PURE; + STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; + STDMETHOD_(BOOL, GetPerspective)(THIS) PURE; + STDMETHOD_(int, GetFaceCount)(THIS) PURE; + STDMETHOD_(int, GetVertexCount)(THIS) PURE; + STDMETHOD_(D3DCOLOR, GetVertexColor)(THIS_ DWORD index) PURE; + STDMETHOD(CreateMesh)(THIS_ IDirect3DRMMesh **mesh) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMMeshBuilder_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMMeshBuilder_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMMeshBuilder_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMMeshBuilder_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMMeshBuilder_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMMeshBuilder_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMMeshBuilder_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMMeshBuilder_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMMeshBuilder_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMMeshBuilder_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMMeshBuilder_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMMeshBuilder methods ***/ +#define IDirect3DRMMeshBuilder_Load(p,a,b,c,d,e) (p)->lpVtbl->Load(p,a,b,c,d,e) +#define IDirect3DRMMeshBuilder_Save(p,a,b,c) (p)->lpVtbl->Save(p,a,b,c) +#define IDirect3DRMMeshBuilder_Scale(p,a,b,c) (p)->lpVtbl->Scale(p,a,b,c) +#define IDirect3DRMMeshBuilder_Translate(p,a,b,c) (p)->lpVtbl->Translate(p,a) +#define IDirect3DRMMeshBuilder_SetColorSource(p,a) (p)->lpVtbl->SetColorSource(p,a,b,c) +#define IDirect3DRMMeshBuilder_GetBox(p,a) (p)->lpVtbl->GetBox(p,a) +#define IDirect3DRMMeshBuilder_GenerateNormals(p) (p)->lpVtbl->GenerateNormals(p) +#define IDirect3DRMMeshBuilder_GetColorSource(p) (p)->lpVtbl->GetColorSource(p) +#define IDirect3DRMMeshBuilder_AddMesh(p,a) (p)->lpVtbl->AddMesh(p,a) +#define IDirect3DRMMeshBuilder_AddMeshBuilder(p,a) (p)->lpVtbl->AddMeshBuilder(p,a) +#define IDirect3DRMMeshBuilder_AddFrame(p,a) (p)->lpVtbl->AddFrame(p,a) +#define IDirect3DRMMeshBuilder_AddFace(p,a) (p)->lpVtbl->AddFace(p,a) +#define IDirect3DRMMeshBuilder_AddFaces(p,a,b,c,d,e,f) (p)->lpVtbl->AddFaces(p,a,b,c,d,e,f) +#define IDirect3DRMMeshBuilder_ReserveSpace(p,a,b,c) (p)->lpVtbl->ReserveSpace(p,a,b,c) +#define IDirect3DRMMeshBuilder_SetColorRGB(p,a,b,c) (p)->lpVtbl->SetColorRGB(p,a,b,c) +#define IDirect3DRMMeshBuilder_SetColor(p,a) (p)->lpVtbl->SetColor(p,a) +#define IDirect3DRMMeshBuilder_SetTexture(p,a) (p)->lpVtbl->SetTexture(p,a) +#define IDirect3DRMMeshBuilder_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) +#define IDirect3DRMMeshBuilder_SetTextureTopology(p,a,b) (p)->lpVtbl->SetTextureTopology(p,a,b) +#define IDirect3DRMMeshBuilder_SetQuality(p,a) (p)->lpVtbl->SetQuality(p,a) +#define IDirect3DRMMeshBuilder_SetPerspective(p,a) (p)->lpVtbl->SetPerspective(p,a) +#define IDirect3DRMMeshBuilder_SetVertex(p,a,b,c,d) (p)->lpVtbl->SetVertex(p,a,b,c,d) +#define IDirect3DRMMeshBuilder_SetNormal(p,a,b,c,d) (p)->lpVtbl->SetNormal(p,a,b,c,d) +#define IDirect3DRMMeshBuilder_SetTextureCoordinates(p,a,b,c) (p)->lpVtbl->SetTextureCoordinates(p,a,b,c) +#define IDirect3DRMMeshBuilder_SetVertexColor(p,a,b) (p)->lpVtbl->SetVertexColor(p,a,b) +#define IDirect3DRMMeshBuilder_SetVertexColorRGB(p,a,b,c,d) (p)->lpVtbl->SetVertexColorRGB(p,a,b,c,d) +#define IDirect3DRMMeshBuilder_GetFaces(p,a) (p)->lpVtbl->GetFaces(p,a) +#define IDirect3DRMMeshBuilder_GetVertices(p,a,b,c,d,e,f) (p)->lpVtbl->GetVertices(p,a,b,c,d,e,f) +#define IDirect3DRMMeshBuilder_GetTextureCoordinates(p,a,b,c) (p)->lpVtbl->GetTextureCoordinates(p,a,b,c) +#define IDirect3DRMMeshBuilder_AddVertex(p,a,b,c) (p)->lpVtbl->AddVertex(p,a,b,c) +#define IDirect3DRMMeshBuilder_AddNormal(p,a,b,c) (p)->lpVtbl->AddNormal(p,a,b,c) +#define IDirect3DRMMeshBuilder_CreateFace(p,a) (p)->lpVtbl->CreateFace(p,a) +#define IDirect3DRMMeshBuilder_GetQuality(p) (p)->lpVtbl->GetQuality(p) +#define IDirect3DRMMeshBuilder_GetPerspective(p) (p)->lpVtbl->GetPerspective(p) +#define IDirect3DRMMeshBuilder_GetFaceCount(p) (p)->lpVtbl->GetFaceCount(p) +#define IDirect3DRMMeshBuilder_GetVertexCount(p) (p)->lpVtbl->GetVertexCount(p) +#define IDirect3DRMMeshBuilder_GetVertexColor(p,a) (p)->lpVtbl->GetVertexColor(p,a) +#define IDirect3DRMMeshBuilder_CreateMesh(p,a) (p)->lpVtbl->CreateMesh(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMMeshBuilder_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMMeshBuilder_AddRef(p) (p)->AddRef() +#define IDirect3DRMMeshBuilder_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMMeshBuilder_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMMeshBuilder_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMMeshBuilder_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMMeshBuilder_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMMeshBuilder_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMMeshBuilder_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMMeshBuilder_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMMeshBuilder_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMMeshBuilder methods ***/ +#define IDirect3DRMMeshBuilder_Load(p,a,b,c,d,e) (p)->Load(a,b,c,d,e) +#define IDirect3DRMMeshBuilder_Save(p,a,b,c) (p)->Save(a,b,c) +#define IDirect3DRMMeshBuilder_Scale(p,a,b,c) (p)->Scale(a,b,c) +#define IDirect3DRMMeshBuilder_Translate(p,a,b,c) (p)->Translate(a) +#define IDirect3DRMMeshBuilder_SetColorSource(p,a) (p)->SetColorSource(a,b,c) +#define IDirect3DRMMeshBuilder_GetBox(p,a) (p)->GetBox(a) +#define IDirect3DRMMeshBuilder_GenerateNormals(p) (p)->GenerateNormals() +#define IDirect3DRMMeshBuilder_GetColorSource(p) (p)->GetColorSource() +#define IDirect3DRMMeshBuilder_AddMesh(p,a) (p)-->AddMesh(a) +#define IDirect3DRMMeshBuilder_AddMeshBuilder(p,a) (p)->AddMeshBuilder(a) +#define IDirect3DRMMeshBuilder_AddFrame(p,a) (p)->AddFrame(a) +#define IDirect3DRMMeshBuilder_AddFace(p,a) (p)->AddFace(a) +#define IDirect3DRMMeshBuilder_AddFaces(p,a,b,c,d,e,f) (p)->AddFaces(a,b,c,d,e,f) +#define IDirect3DRMMeshBuilder_ReserveSpace(p,a,b,c) (p)->ReserveSpace(a,b,c) +#define IDirect3DRMMeshBuilder_SetColorRGB(p,a,b,c) (p)->SetColorRGB(a,b,c) +#define IDirect3DRMMeshBuilder_SetColor(p,a) (p)->SetColor(a) +#define IDirect3DRMMeshBuilder_SetTexture(p,a) (p)->SetTexture(a) +#define IDirect3DRMMeshBuilder_SetMaterial(p,a) (p)->SetMaterial(a) +#define IDirect3DRMMeshBuilder_SetTextureTopology(p,a,b) (p)->SetTextureTopology(a,b) +#define IDirect3DRMMeshBuilder_SetQuality(p,a) (p)->SetQuality(a) +#define IDirect3DRMMeshBuilder_SetPerspective(p,a) (p)->SetPerspective(a) +#define IDirect3DRMMeshBuilder_SetVertex(p,a,b,c,d) (p)->SetVertex(a,b,c,d) +#define IDirect3DRMMeshBuilder_SetNormal(p,a,b,c,d) (p)->SetNormal(a,b,c,d) +#define IDirect3DRMMeshBuilder_SetTextureCoordinates(p,a,b,c) (p)->SetTextureCoordinates(a,b,c) +#define IDirect3DRMMeshBuilder_SetVertexColor(p,a,b) (p)->SetVertexColor(a,b) +#define IDirect3DRMMeshBuilder_SetVertexColorRGB(p,a,b,c,d) (p)->SetVertexColorRGB(a,b,c,d) +#define IDirect3DRMMeshBuilder_GetFaces(p,a) (p)->GetFaces(a) +#define IDirect3DRMMeshBuilder_GetVertices(p,a,b,c,d,e,f) (p)->GetVertices(a,b,c,d,e,f) +#define IDirect3DRMMeshBuilder_GetTextureCoordinates(p,a,b,c) (p)->GetTextureCoordinates(a,b,c) +#define IDirect3DRMMeshBuilder_AddVertex(p,a,b,c) (p)->AddVertex(a,b,c) +#define IDirect3DRMMeshBuilder_AddNormal(p,a,b,c) (p)->AddNormal(a,b,c) +#define IDirect3DRMMeshBuilder_CreateFace(p,a) (p)->CreateFace(a) +#define IDirect3DRMMeshBuilder_GetQuality(p) (p)->GetQuality() +#define IDirect3DRMMeshBuilder_GetPerspective(p) (p)->GetPerspective() +#define IDirect3DRMMeshBuilder_GetFaceCount(p) (p)->GetFaceCount() +#define IDirect3DRMMeshBuilder_GetVertexCount(p) (p)->GetVertexCount() +#define IDirect3DRMMeshBuilder_GetVertexColor(p,a) (p)->GetVertexColor(a) +#define IDirect3DRMMeshBuilder_CreateMesh(p,a) (p)->CreateMesh(a) +#endif + +/***************************************************************************** + * IDirect3DRMMeshBuilder2 interface + */ +#define INTERFACE IDirect3DRMMeshBuilder2 +DECLARE_INTERFACE_(IDirect3DRMMeshBuilder2,IDirect3DRMMeshBuilder) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMMeshBuilder methods ***/ + STDMETHOD(Load)(THIS_ void *filename, void *name, D3DRMLOADOPTIONS flags, + D3DRMLOADTEXTURECALLBACK cb, void *ctx) PURE; + STDMETHOD(Save)(THIS_ const char *filename, D3DRMXOFFORMAT, D3DRMSAVEOPTIONS save) PURE; + STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; + STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE; + STDMETHOD(SetColorSource)(THIS_ D3DRMCOLORSOURCE) PURE; + STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE; + STDMETHOD(GenerateNormals)(THIS) PURE; + STDMETHOD_(D3DRMCOLORSOURCE, GetColorSource)(THIS) PURE; + STDMETHOD(AddMesh)(THIS_ IDirect3DRMMesh *mesh) PURE; + STDMETHOD(AddMeshBuilder)(THIS_ IDirect3DRMMeshBuilder *mesh_builder) PURE; + STDMETHOD(AddFrame)(THIS_ IDirect3DRMFrame *frame) PURE; + STDMETHOD(AddFace)(THIS_ IDirect3DRMFace *face) PURE; + STDMETHOD(AddFaces)(THIS_ DWORD vertex_count, D3DVECTOR *vertices, DWORD normal_count, + D3DVECTOR *normals, DWORD *face_data, struct IDirect3DRMFaceArray **array) PURE; + STDMETHOD(ReserveSpace)(THIS_ DWORD vertex_Count, DWORD normal_count, DWORD face_count) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetTexture)(THIS_ struct IDirect3DRMTexture *texture) PURE; + STDMETHOD(SetMaterial)(THIS_ struct IDirect3DRMMaterial *material) PURE; + STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; + STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; + STDMETHOD(SetPerspective)(THIS_ BOOL) PURE; + STDMETHOD(SetVertex)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetNormal)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetTextureCoordinates)(THIS_ DWORD index, D3DVALUE u, D3DVALUE v) PURE; + STDMETHOD(SetVertexColor)(THIS_ DWORD index, D3DCOLOR) PURE; + STDMETHOD(SetVertexColorRGB)(THIS_ DWORD index, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(GetFaces)(THIS_ struct IDirect3DRMFaceArray **array) PURE; + STDMETHOD(GetVertices)(THIS_ DWORD *vcount, D3DVECTOR *vertices, DWORD *ncount, D3DVECTOR *normals, + DWORD *face_data_size, DWORD *face_data) PURE; + STDMETHOD(GetTextureCoordinates)(THIS_ DWORD index, D3DVALUE *u, D3DVALUE *v) PURE; + STDMETHOD_(int, AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD_(int, AddNormal)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(CreateFace)(THIS_ IDirect3DRMFace **face) PURE; + STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; + STDMETHOD_(BOOL, GetPerspective)(THIS) PURE; + STDMETHOD_(int, GetFaceCount)(THIS) PURE; + STDMETHOD_(int, GetVertexCount)(THIS) PURE; + STDMETHOD_(D3DCOLOR, GetVertexColor)(THIS_ DWORD index) PURE; + STDMETHOD(CreateMesh)(THIS_ IDirect3DRMMesh **mesh) PURE; + /*** IDirect3DRMMeshBuilder2 methods ***/ + STDMETHOD(GenerateNormals2)(THIS_ D3DVALUE crease, DWORD flags) PURE; + STDMETHOD(GetFace)(THIS_ DWORD index, IDirect3DRMFace **face) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMMeshBuilder2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMMeshBuilder2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMMeshBuilder2_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMMeshBuilder2_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMMeshBuilder2_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMMeshBuilder2_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMMeshBuilder2_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMMeshBuilder2_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMMeshBuilder2_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMMeshBuilder2_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMMeshBuilder2_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMMeshBuilder methods ***/ +#define IDirect3DRMMeshBuilder2_Load(p,a,b,c,d,e) (p)->lpVtbl->Load(p,a,b,c,d,e) +#define IDirect3DRMMeshBuilder2_Save(p,a,b,c) (p)->lpVtbl->Save(p,a,b,c) +#define IDirect3DRMMeshBuilder2_Scale(p,a,b,c) (p)->lpVtbl->Scale(p,a,b,c) +#define IDirect3DRMMeshBuilder2_Translate(p,a,b,c) (p)->lpVtbl->Translate(p,a) +#define IDirect3DRMMeshBuilder2_SetColorSource(p,a) (p)->lpVtbl->SetColorSource(p,a,b,c) +#define IDirect3DRMMeshBuilder2_GetBox(p,a) (p)->lpVtbl->GetBox(p,a) +#define IDirect3DRMMeshBuilder2_GenerateNormals(p) (p)->lpVtbl->GenerateNormals(p) +#define IDirect3DRMMeshBuilder2_GetColorSource(p) (p)->lpVtbl->GetColorSource(p) +#define IDirect3DRMMeshBuilder2_AddMesh(p,a) (p)->lpVtbl->AddMesh(p,a) +#define IDirect3DRMMeshBuilder2_AddMeshBuilder(p,a) (p)->lpVtbl->AddMeshBuilder(p,a) +#define IDirect3DRMMeshBuilder2_AddFrame(p,a) (p)->lpVtbl->AddFrame(p,a) +#define IDirect3DRMMeshBuilder2_AddFace(p,a) (p)->lpVtbl->AddFace(p,a) +#define IDirect3DRMMeshBuilder2_AddFaces(p,a,b,c,d,e,f) (p)->lpVtbl->AddFaces(p,a,b,c,d,e,f) +#define IDirect3DRMMeshBuilder2_ReserveSpace(p,a,b,c) (p)->lpVtbl->ReserveSpace(p,a,b,c) +#define IDirect3DRMMeshBuilder2_SetColorRGB(p,a,b,c) (p)->lpVtbl->SetColorRGB(p,a,b,c) +#define IDirect3DRMMeshBuilder2_SetColor(p,a) (p)->lpVtbl->SetColor(p,a) +#define IDirect3DRMMeshBuilder2_SetTexture(p,a) (p)->lpVtbl->SetTexture(p,a) +#define IDirect3DRMMeshBuilder2_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) +#define IDirect3DRMMeshBuilder2_SetTextureTopology(p,a,b) (p)->lpVtbl->SetTextureTopology(p,a,b) +#define IDirect3DRMMeshBuilder2_SetQuality(p,a) (p)->lpVtbl->SetQuality(p,a) +#define IDirect3DRMMeshBuilder2_SetPerspective(p,a) (p)->lpVtbl->SetPerspective(p,a) +#define IDirect3DRMMeshBuilder2_SetVertex(p,a,b,c,d) (p)->lpVtbl->SetVertex(p,a,b,c,d) +#define IDirect3DRMMeshBuilder2_SetNormal(p,a,b,c,d) (p)->lpVtbl->SetNormal(p,a,b,c,d) +#define IDirect3DRMMeshBuilder2_SetTextureCoordinates(p,a,b,c) (p)->lpVtbl->SetTextureCoordinates(p,a,b,c) +#define IDirect3DRMMeshBuilder2_SetVertexColor(p,a,b) (p)->lpVtbl->SetVertexColor(p,a,b) +#define IDirect3DRMMeshBuilder2_SetVertexColorRGB(p,a,b,c,d) (p)->lpVtbl->SetVertexColorRGB(p,a,b,c,d) +#define IDirect3DRMMeshBuilder2_GetFaces(p,a) (p)->lpVtbl->GetFaces(p,a) +#define IDirect3DRMMeshBuilder2_GetVertices(p,a,b,c,d,e,f) (p)->lpVtbl->GetVertices(p,a,b,c,d,e,f) +#define IDirect3DRMMeshBuilder2_GetTextureCoordinates(p,a,b,c) (p)->lpVtbl->GetTextureCoordinates(p,a,b,c) +#define IDirect3DRMMeshBuilder2_AddVertex(p,a,b,c) (p)->lpVtbl->AddVertex(p,a,b,c) +#define IDirect3DRMMeshBuilder2_AddNormal(p,a,b,c) (p)->lpVtbl->AddNormal(p,a,b,c) +#define IDirect3DRMMeshBuilder2_CreateFace(p,a) (p)->lpVtbl->CreateFace(p,a) +#define IDirect3DRMMeshBuilder2_GetQuality(p) (p)->lpVtbl->GetQuality(p) +#define IDirect3DRMMeshBuilder2_GetPerspective(p) (p)->lpVtbl->GetPerspective(p) +#define IDirect3DRMMeshBuilder2_GetFaceCount(p) (p)->lpVtbl->GetFaceCount(p) +#define IDirect3DRMMeshBuilder2_GetVertexCount(p) (p)->lpVtbl->GetVertexCount(p) +#define IDirect3DRMMeshBuilder2_GetVertexColor(p,a) (p)->lpVtbl->GetVertexColor(p,a) +#define IDirect3DRMMeshBuilder2_CreateMesh(p,a) (p)->lpVtbl->CreateMesh(p,a) +/*** IDirect3DRMMeshBuilder2 methods ***/ +#define IDirect3DRMMeshBuilder2_GenerateNormals2(p,a,b) (p)->lpVtbl->GenerateNormals2(p,a,b) +#define IDirect3DRMMeshBuilder2_GetFace(p,a,b) (p)->lpVtbl->GetFace(p,a,b) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMMeshBuilder2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMMeshBuilder2_AddRef(p) (p)->AddRef() +#define IDirect3DRMMeshBuilder2_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMMeshBuilder2_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMMeshBuilder2_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMMeshBuilder2_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMMeshBuilder2_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMMeshBuilder2_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMMeshBuilder2_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMMeshBuilder2_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMMeshBuilder2_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMMeshBuilder methods ***/ +#define IDirect3DRMMeshBuilder2_Load(p,a,b,c,d,e) (p)->Load(a,b,c,d,e) +#define IDirect3DRMMeshBuilder2_Save(p,a,b,c) (p)->Save(a,b,c) +#define IDirect3DRMMeshBuilder2_Scale(p,a,b,c) (p)->Scale(a,b,c) +#define IDirect3DRMMeshBuilder2_Translate(p,a,b,c) (p)->Translate(a) +#define IDirect3DRMMeshBuilder2_SetColorSource(p,a) (p)->SetColorSource(a,b,c) +#define IDirect3DRMMeshBuilder2_GetBox(p,a) (p)->GetBox(a) +#define IDirect3DRMMeshBuilder2_GenerateNormals(p) (p)->GenerateNormals() +#define IDirect3DRMMeshBuilder2_GetColorSource(p) (p)->GetColorSource() +#define IDirect3DRMMeshBuilder2_AddMesh(p,a) (p)-->AddMesh(a) +#define IDirect3DRMMeshBuilder2_AddMeshBuilder(p,a) (p)->AddMeshBuilder(a) +#define IDirect3DRMMeshBuilder2_AddFrame(p,a) (p)->AddFrame(a) +#define IDirect3DRMMeshBuilder2_AddFace(p,a) (p)->AddFace(a) +#define IDirect3DRMMeshBuilder2_AddFaces(p,a,b,c,d,e,f) (p)->AddFaces(a,b,c,d,e,f) +#define IDirect3DRMMeshBuilder2_ReserveSpace(p,a,b,c) (p)->ReserveSpace(a,b,c) +#define IDirect3DRMMeshBuilder2_SetColorRGB(p,a,b,c) (p)->SetColorRGB(a,b,c) +#define IDirect3DRMMeshBuilder2_SetColor(p,a) (p)->SetColor(a) +#define IDirect3DRMMeshBuilder2_SetTexture(p,a) (p)->SetTexture(a) +#define IDirect3DRMMeshBuilder2_SetMaterial(p,a) (p)->SetMaterial(a) +#define IDirect3DRMMeshBuilder2_SetTextureTopology(p,a,b) (p)->SetTextureTopology(a,b) +#define IDirect3DRMMeshBuilder2_SetQuality(p,a) (p)->SetQuality(a) +#define IDirect3DRMMeshBuilder2_SetPerspective(p,a) (p)->SetPerspective(a) +#define IDirect3DRMMeshBuilder2_SetVertex(p,a,b,c,d) (p)->SetVertex(a,b,c,d) +#define IDirect3DRMMeshBuilder2_SetNormal(p,a,b,c,d) (p)->SetNormal(a,b,c,d) +#define IDirect3DRMMeshBuilder2_SetTextureCoordinates(p,a,b,c) (p)->SetTextureCoordinates(a,b,c) +#define IDirect3DRMMeshBuilder2_SetVertexColor(p,a,b) (p)->SetVertexColor(a,b) +#define IDirect3DRMMeshBuilder2_SetVertexColorRGB(p,a,b,c,d) (p)->SetVertexColorRGB(a,b,c,d) +#define IDirect3DRMMeshBuilder2_GetFaces(p,a) (p)->GetFaces(a) +#define IDirect3DRMMeshBuilder2_GetVertices(p,a,b,c,d,e,f) (p)->GetVertices(a,b,c,d,e,f) +#define IDirect3DRMMeshBuilder2_GetTextureCoordinates(p,a,b,c) (p)->GetTextureCoordinates(a,b,c) +#define IDirect3DRMMeshBuilder2_AddVertex(p,a,b,c) (p)->AddVertex(a,b,c) +#define IDirect3DRMMeshBuilder2_AddNormal(p,a,b,c) (p)->AddNormal(a,b,c) +#define IDirect3DRMMeshBuilder2_CreateFace(p,a) (p)->CreateFace(a) +#define IDirect3DRMMeshBuilder2_GetQuality(p) (p)->GetQuality() +#define IDirect3DRMMeshBuilder2_GetPerspective(p) (p)->GetPerspective() +#define IDirect3DRMMeshBuilder2_GetFaceCount(p) (p)->GetFaceCount() +#define IDirect3DRMMeshBuilder2_GetVertexCount(p) (p)->GetVertexCount() +#define IDirect3DRMMeshBuilder2_GetVertexColor(p,a) (p)->GetVertexColor(a) +#define IDirect3DRMMeshBuilder2_CreateMesh(p,a) (p)->CreateMesh(a) +/*** IDirect3DRMMeshBuilder2 methods ***/ +#define IDirect3DRMMeshBuilder2_GenerateNormals2(p,a,b) (p)->GenerateNormals2(a,b) +#define IDirect3DRMMeshBuilder2_GetFace(p,a,b) (p)->GetFace(a,b) +#endif + +/***************************************************************************** + * IDirect3DRMMeshBuilder3 interface + */ +#define INTERFACE IDirect3DRMMeshBuilder3 +DECLARE_INTERFACE_(IDirect3DRMMeshBuilder3,IDirect3DRMVisual) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMMeshBuilder3 methods ***/ + STDMETHOD(Load)(THIS_ void *filename, void *name, D3DRMLOADOPTIONS flags, + D3DRMLOADTEXTURE3CALLBACK cb, void *ctx) PURE; + STDMETHOD(Save)(THIS_ const char *filename, D3DRMXOFFORMAT, D3DRMSAVEOPTIONS save) PURE; + STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; + STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE; + STDMETHOD(SetColorSource)(THIS_ D3DRMCOLORSOURCE) PURE; + STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE; + STDMETHOD(GenerateNormals)(THIS_ D3DVALUE crease, DWORD flags) PURE; + STDMETHOD_(D3DRMCOLORSOURCE, GetColorSource)(THIS) PURE; + STDMETHOD(AddMesh)(THIS_ IDirect3DRMMesh *mesh) PURE; + STDMETHOD(AddMeshBuilder)(THIS_ IDirect3DRMMeshBuilder3 *mesh_builder, DWORD flags) PURE; + STDMETHOD(AddFrame)(THIS_ IDirect3DRMFrame3 *frame) PURE; + STDMETHOD(AddFace)(THIS_ IDirect3DRMFace2 *face) PURE; + STDMETHOD(AddFaces)(THIS_ DWORD vertex_count, D3DVECTOR *vertices, DWORD normal_count, + D3DVECTOR *normals, DWORD *face_data, struct IDirect3DRMFaceArray **array) PURE; + STDMETHOD(ReserveSpace)(THIS_ DWORD vertex_Count, DWORD normal_count, DWORD face_count) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetTexture)(THIS_ struct IDirect3DRMTexture3 *texture) PURE; + STDMETHOD(SetMaterial)(THIS_ struct IDirect3DRMMaterial2 *material) PURE; + STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; + STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; + STDMETHOD(SetPerspective)(THIS_ BOOL) PURE; + STDMETHOD(SetVertex)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetNormal)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetTextureCoordinates)(THIS_ DWORD index, D3DVALUE u, D3DVALUE v) PURE; + STDMETHOD(SetVertexColor)(THIS_ DWORD index, D3DCOLOR) PURE; + STDMETHOD(SetVertexColorRGB)(THIS_ DWORD index, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(GetFaces)(THIS_ struct IDirect3DRMFaceArray **array) PURE; + STDMETHOD(GetGeometry)(THIS_ DWORD *vcount, D3DVECTOR *vertices, DWORD *ncount, D3DVECTOR *normals, + DWORD *face_data_size, DWORD *face_data) PURE; + STDMETHOD(GetTextureCoordinates)(THIS_ DWORD index, D3DVALUE *u, D3DVALUE *v) PURE; + STDMETHOD_(int, AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD_(int, AddNormal)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(CreateFace)(THIS_ IDirect3DRMFace2 **face) PURE; + STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; + STDMETHOD_(BOOL, GetPerspective)(THIS) PURE; + STDMETHOD_(int, GetFaceCount)(THIS) PURE; + STDMETHOD_(int, GetVertexCount)(THIS) PURE; + STDMETHOD_(D3DCOLOR, GetVertexColor)(THIS_ DWORD index) PURE; + STDMETHOD(CreateMesh)(THIS_ IDirect3DRMMesh **mesh) PURE; + STDMETHOD(GetFace)(THIS_ DWORD index, IDirect3DRMFace2 **face) PURE; + STDMETHOD(GetVertex)(THIS_ DWORD index, D3DVECTOR *vector) PURE; + STDMETHOD(GetNormal)(THIS_ DWORD index, D3DVECTOR *vector) PURE; + STDMETHOD(DeleteVertices)(THIS_ DWORD IndexFirst, DWORD count) PURE; + STDMETHOD(DeleteNormals)(THIS_ DWORD IndexFirst, DWORD count) PURE; + STDMETHOD(DeleteFace)(THIS_ IDirect3DRMFace2 *face) PURE; + STDMETHOD(Empty)(THIS_ DWORD flags) PURE; + STDMETHOD(Optimize)(THIS_ DWORD flags) PURE; + STDMETHOD(AddFacesIndexed)(THIS_ DWORD flags, DWORD *pvIndices, DWORD *pIndexFirst, DWORD *pCount) PURE; + STDMETHOD(CreateSubMesh)(THIS_ IUnknown **mesh) PURE; + STDMETHOD(GetParentMesh)(THIS_ DWORD flags, IUnknown **parent) PURE; + STDMETHOD(GetSubMeshes)(THIS_ DWORD *count, IUnknown **meshes) PURE; + STDMETHOD(DeleteSubMesh)(THIS_ IUnknown *mesh) PURE; + STDMETHOD(Enable)(THIS_ DWORD) PURE; + STDMETHOD(GetEnable)(THIS_ DWORD *) PURE; + STDMETHOD(AddTriangles)(THIS_ DWORD flags, DWORD format, DWORD vertex_count, void *data) PURE; + STDMETHOD(SetVertices)(THIS_ DWORD start_idx, DWORD count, D3DVECTOR *v) PURE; + STDMETHOD(GetVertices)(THIS_ DWORD start_idx, DWORD *count, D3DVECTOR *v) PURE; + STDMETHOD(SetNormals)(THIS_ DWORD start_idx, DWORD count, D3DVECTOR *v) PURE; + STDMETHOD(GetNormals)(THIS_ DWORD start_idx, DWORD *count, D3DVECTOR *v) PURE; + STDMETHOD_(int, GetNormalCount)(THIS) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMMeshBuilder3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMMeshBuilder3_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMMeshBuilder3_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMMeshBuilder3_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMMeshBuilder3_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMMeshBuilder3_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMMeshBuilder3_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMMeshBuilder3_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMMeshBuilder3_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMMeshBuilder3_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMMeshBuilder3_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) + +/*** IDirect3DRMMeshBuilder3 methods ***/ +#define IDirect3DRMMeshBuilder3_Load(p,a,b,c,d,e) (p)->lpVtbl->Load(p,a,b,c,d,e) +#define IDirect3DRMMeshBuilder3_Save(p,a,b,c) (p)->lpVtbl->Save(p,a,b,c) +#define IDirect3DRMMeshBuilder3_Scale(p,a,b,c) (p)->lpVtbl->Scale(p,a,b,c) +#define IDirect3DRMMeshBuilder3_Translate(p,a,b,c) (p)->lpVtbl->Translate(p,a) +#define IDirect3DRMMeshBuilder3_SetColorSource(p,a) (p)->lpVtbl->SetColorSource(p,a,b,c) +#define IDirect3DRMMeshBuilder3_GetBox(p,a) (p)->lpVtbl->GetBox(p,a) +#define IDirect3DRMMeshBuilder3_GenerateNormals(p,a,b) (p)->lpVtbl->GenerateNormals(p,a,b) +#define IDirect3DRMMeshBuilder3_GetColorSource(p) (p)->lpVtbl->GetColorSource(p) +#define IDirect3DRMMeshBuilder3_AddMesh(p,a) (p)->lpVtbl->AddMesh(p,a) +#define IDirect3DRMMeshBuilder3_AddMeshBuilder(p,a) (p)->lpVtbl->AddMeshBuilder(p,a) +#define IDirect3DRMMeshBuilder3_AddFrame(p,a) (p)->lpVtbl->AddFrame(p,a) +#define IDirect3DRMMeshBuilder3_AddFace(p,a) (p)->lpVtbl->AddFace(p,a) +#define IDirect3DRMMeshBuilder3_AddFaces(p,a,b,c,d,e,f) (p)->lpVtbl->AddFaces(p,a,b,c,d,e,f) +#define IDirect3DRMMeshBuilder3_ReserveSpace(p,a,b,c) (p)->lpVtbl->ReserveSpace(p,a,b,c) +#define IDirect3DRMMeshBuilder3_SetColorRGB(p,a,b,c) (p)->lpVtbl->SetColorRGB(p,a,b,c) +#define IDirect3DRMMeshBuilder3_SetColor(p,a) (p)->lpVtbl->SetColor(p,a) +#define IDirect3DRMMeshBuilder3_SetTexture(p,a) (p)->lpVtbl->SetTexture(p,a) +#define IDirect3DRMMeshBuilder3_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) +#define IDirect3DRMMeshBuilder3_SetTextureTopology(p,a,b) (p)->lpVtbl->SetTextureTopology(p,a,b) +#define IDirect3DRMMeshBuilder3_SetQuality(p,a) (p)->lpVtbl->SetQuality(p,a) +#define IDirect3DRMMeshBuilder3_SetPerspective(p,a) (p)->lpVtbl->SetPerspective(p,a) +#define IDirect3DRMMeshBuilder3_SetVertex(p,a,b,c,d) (p)->lpVtbl->SetVertex(p,a,b,c,d) +#define IDirect3DRMMeshBuilder3_SetNormal(p,a,b,c,d) (p)->lpVtbl->SetNormal(p,a,b,c,d) +#define IDirect3DRMMeshBuilder3_SetTextureCoordinates(p,a,b,c) (p)->lpVtbl->SetTextureCoordinates(p,a,b,c) +#define IDirect3DRMMeshBuilder3_SetVertexColor(p,a,b) (p)->lpVtbl->SetVertexColor(p,a,b) +#define IDirect3DRMMeshBuilder3_SetVertexColorRGB(p,a,b,c,d) (p)->lpVtbl->SetVertexColorRGB(p,a,b,c,d) +#define IDirect3DRMMeshBuilder3_GetFaces(p,a) (p)->lpVtbl->GetFaces(p,a) +#define IDirect3DRMMeshBuilder3_GetGeometry(p,a,b,c,d,e,f) (p)->lpVtbl->GetGeometry(p,a,b,c,d,e,f) +#define IDirect3DRMMeshBuilder3_GetTextureCoordinates(p,a,b,c) (p)->lpVtbl->GetTextureCoordinates(p,a,b,c) +#define IDirect3DRMMeshBuilder3_AddVertex(p,a,b,c) (p)->lpVtbl->AddVertex(p,a,b,c) +#define IDirect3DRMMeshBuilder3_AddNormal(p,a,b,c) (p)->lpVtbl->AddNormal(p,a,b,c) + +#define IDirect3DRMMeshBuilder3_CreateFace(p,a) (p)->lpVtbl->CreateFace(p,a) +#define IDirect3DRMMeshBuilder3_GetQuality(p) (p)->lpVtbl->GetQuality(p) +#define IDirect3DRMMeshBuilder3_GetPerspective(p) (p)->lpVtbl->GetPerspective(p) + +#define IDirect3DRMMeshBuilder3_GetFaceCount(p) (p)->lpVtbl->GetFaceCount(p) +#define IDirect3DRMMeshBuilder3_GetVertexCount(p) (p)->lpVtbl->GetVertexCount(p) +#define IDirect3DRMMeshBuilder3_GetVertexColor(p,a) (p)->lpVtbl->GetVertexColor(p,a) +#define IDirect3DRMMeshBuilder3_CreateMesh(p,a) (p)->lpVtbl->CreateMesh(p,a) +#define IDirect3DRMMeshBuilder3_GetFace(p,a,b) (p)->lpVtbl->GetFace(p,a,b) +#define IDirect3DRMMeshBuilder3_GetVertex(p,a,b) (p)->lpVtbl->GetVertex(p,a,b) +#define IDirect3DRMMeshBuilder3_GetNormal(p,a,b) (p)->lpVtbl->GetNormal(p,a,b) +#define IDirect3DRMMeshBuilder3_DeleteVertices(p,a,b) (p)->lpVtbl->DeleteVertices(p,a,b) +#define IDirect3DRMMeshBuilder3_DeleteNormals(p,a,b) (p)->lpVtbl->DeleteNormals(p,a,b) +#define IDirect3DRMMeshBuilder3_DeleteFace(p,a) (p)->lpVtbl->DeleteFace(p,a) +#define IDirect3DRMMeshBuilder3_Empty(p,a) (p)->lpVtbl->Empty(p,a) +#define IDirect3DRMMeshBuilder3_Optimize(p,a) (p)->lpVtbl->Optimize(p,a) +#define IDirect3DRMMeshBuilder3_AddFacesIndexed(p,a,b,c,d) (p)->lpVtbl->AddFacesIndexed(p,a,b,c,d) +#define IDirect3DRMMeshBuilder3_CreateSubMesh(p,a) (p)->lpVtbl->CreateSubMesh(p,a) +#define IDirect3DRMMeshBuilder3_GetParentMesh(p,a,b) (p)->lpVtbl->GetParentMesh(p,a,b) +#define IDirect3DRMMeshBuilder3_GetSubMeshes(p,a,b) (p)->lpVtbl->GetSubMeshes(p,a,b) +#define IDirect3DRMMeshBuilder3_DeleteSubMesh(p,a) (p)->lpVtbl->DeleteSubMesh(p,a) +#define IDirect3DRMMeshBuilder3_Enable(p,a) (p)->lpVtbl->Enable(p,a) +#define IDirect3DRMMeshBuilder3_AddTriangles(p,a,b,c,d) (p)->lpVtbl->AddTriangles(p,a,b,c,d) +#define IDirect3DRMMeshBuilder3_SetVertices(p,a,b,c) (p)->lpVtbl->SetVertices(p,a,b,c) +#define IDirect3DRMMeshBuilder3_GetVertices(p,a,b,c) (p)->lpVtbl->GetVertices(p,a,b,c) +#define IDirect3DRMMeshBuilder3_SetNormals(p,a,b,c) (p)->lpVtbl->SetNormals(p,a,b,c) +#define IDirect3DRMMeshBuilder3_GetNormals(p,a,b,c) (p)->lpVtbl->GetNormals(p,a,b,c) +#define IDirect3DRMMeshBuilder3_GetNormalCount(p) (p)->lpVtbl->GetNormalCount(p) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMMeshBuilder3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMMeshBuilder3_AddRef(p) (p)->AddRef() +#define IDirect3DRMMeshBuilder3_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMMeshBuilder3_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMMeshBuilder3_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMMeshBuilder3_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMMeshBuilder3_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMMeshBuilder3_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMMeshBuilder3_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMMeshBuilder3_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMMeshBuilder3_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMMeshBuilder3 methods ***/ +#define IDirect3DRMMeshBuilder3_Load(p,a,b,c,d,e) (p)->Load(a,b,c,d,e) +#define IDirect3DRMMeshBuilder3_Save(p,a,b,c) (p)->Save(a,b,c) +#define IDirect3DRMMeshBuilder3_Scale(p,a,b,c) (p)->Scale(a,b,c) +#define IDirect3DRMMeshBuilder3_Translate(p,a,b,c) (p)->Translate(a) +#define IDirect3DRMMeshBuilder3_SetColorSource(p,a) (p)->SetColorSource(a,b,c) +#define IDirect3DRMMeshBuilder3_GetBox(p,a) (p)->GetBox(a) +#define IDirect3DRMMeshBuilder3_GenerateNormals(p,a,b) (p)->GenerateNormals(a,b) +#define IDirect3DRMMeshBuilder3_GetColorSource(p) (p)->GetColorSource() +#define IDirect3DRMMeshBuilder3_AddMesh(p,a) (p)-->AddMesh(a) +#define IDirect3DRMMeshBuilder3_AddMeshBuilder(p,a) (p)->AddMeshBuilder(a) +#define IDirect3DRMMeshBuilder3_AddFrame(p,a) (p)->AddFrame(a) +#define IDirect3DRMMeshBuilder3_AddFace(p,a) (p)->AddFace(a) +#define IDirect3DRMMeshBuilder3_AddFaces(p,a,b,c,d,e,f) (p)->AddFaces(a,b,c,d,e,f) +#define IDirect3DRMMeshBuilder3_ReserveSpace(p,a,b,c) (p)->ReserveSpace(a,b,c) +#define IDirect3DRMMeshBuilder3_SetColorRGB(p,a,b,c) (p)->SetColorRGB(a,b,c) +#define IDirect3DRMMeshBuilder3_SetColor(p,a) (p)->SetColor(a) +#define IDirect3DRMMeshBuilder3_SetTexture(p,a) (p)->SetTexture(a) +#define IDirect3DRMMeshBuilder3_SetMaterial(p,a) (p)->SetMaterial(a) +#define IDirect3DRMMeshBuilder3_SetTextureTopology(p,a,b) (p)->SetTextureTopology(a,b) +#define IDirect3DRMMeshBuilder3_SetQuality(p,a) (p)->SetQuality(a) +#define IDirect3DRMMeshBuilder3_SetPerspective(p,a) (p)->SetPerspective(a) +#define IDirect3DRMMeshBuilder3_SetVertex(p,a,b,c,d) (p)->SetVertex(a,b,c,d) +#define IDirect3DRMMeshBuilder3_SetNormal(p,a,b,c,d) (p)->SetNormal(a,b,c,d) +#define IDirect3DRMMeshBuilder3_SetTextureCoordinates(p,a,b,c) (p)->SetTextureCoordinates(a,b,c) +#define IDirect3DRMMeshBuilder3_SetVertexColor(p,a,b) (p)->SetVertexColor(a,b) +#define IDirect3DRMMeshBuilder3_SetVertexColorRGB(p,a,b,c,d) (p)->SetVertexColorRGB(a,b,c,d) +#define IDirect3DRMMeshBuilder3_GetFaces(p,a) (p)->GetFaces(a) +#define IDirect3DRMMeshBuilder3_GetGeometry(p,a,b,c,d,e,f) (p)->GetGeometry(a,b,c,d,e,f) +#define IDirect3DRMMeshBuilder3_GetTextureCoordinates(p,a,b,c) (p)->GetTextureCoordinates(a,b,c) +#define IDirect3DRMMeshBuilder3_AddVertex(p,a,b,c) (p)->AddVertex(a,b,c) +#define IDirect3DRMMeshBuilder3_AddNormal(p,a,b,c) (p)->AddNormal(a,b,c) +#define IDirect3DRMMeshBuilder3_CreateFace(p,a) (p)->CreateFace(a) + +#define IDirect3DRMMeshBuilder3_GetQuality(p) (p)->GetQuality() +#define IDirect3DRMMeshBuilder3_GetPerspective(p) (p)->GetPerspective() +#define IDirect3DRMMeshBuilder3_GetFaceCount(p) (p)->GetFaceCount() +#define IDirect3DRMMeshBuilder3_GetVertexCount(p) (p)->GetVertexCount() +#define IDirect3DRMMeshBuilder3_GetVertexColor(p,a) (p)->GetVertexColor(a) +#define IDirect3DRMMeshBuilder3_CreateMesh(p,a) (p)->CreateMesh(a) +#define IDirect3DRMMeshBuilder3_GetFace(p,a,b) (p)->GetFace(a,b) +#define IDirect3DRMMeshBuilder3_GetVertex(p,a,b) (p)->GetVertex(a,b) +#define IDirect3DRMMeshBuilder3_GetNormal(p,a,b) (p)->GetNormal(a,b) +#define IDirect3DRMMeshBuilder3_DeleteVertices(p,a,b) (p)->DeleteVertices(a,b) +#define IDirect3DRMMeshBuilder3_DeleteNormals(p,a,b) (p)->DeleteNormals(a,b) +#define IDirect3DRMMeshBuilder3_DeleteFace(p,a) (p)->DeleteFace(a) +#define IDirect3DRMMeshBuilder3_Empty(p,a) (p)->Empty(a) +#define IDirect3DRMMeshBuilder3_Optimize(p,a) (p)->Optimize(a) +#define IDirect3DRMMeshBuilder3_AddFacesIndexed(p,a,b,c,d) (p)->AddFacesIndexed(a,b,c,d) +#define IDirect3DRMMeshBuilder3_CreateSubMesh(p,a) (p)->CreateSubMesh(a) +#define IDirect3DRMMeshBuilder3_GetParentMesh(p,a,b) (p)->GetParentMesh(a,b) +#define IDirect3DRMMeshBuilder3_GetSubMeshes(p,a,b) (p)->GetSubMeshes(a,b) +#define IDirect3DRMMeshBuilder3_DeleteSubMesh(p,a) (p)->DeleteSubMesh(a) +#define IDirect3DRMMeshBuilder3_Enable(p,a) (p)->Enable(a) +#define IDirect3DRMMeshBuilder3_AddTriangles(p,a,b,c,d) (p)->AddTriangles(a,b,c,d) +#define IDirect3DRMMeshBuilder3_SetVertices(p,a,b,c) (p)->SetVertices(a,b,c) +#define IDirect3DRMMeshBuilder3_GetVertices(p,a,b,c) (p)->GetVertices(a,b,c) +#define IDirect3DRMMeshBuilder3_SetNormals(p,a,b,c) (p)->SetNormals(a,b,c) +#define IDirect3DRMMeshBuilder3_GetNormals(p,a,b,c) (p)->GetNormals(a,b,c) +#define IDirect3DRMMeshBuilder3_GetNormalCount(p) (p)->GetNormalCount() +#endif + +/***************************************************************************** + * IDirect3DRMLight interface + */ +#define INTERFACE IDirect3DRMLight +DECLARE_INTERFACE_(IDirect3DRMLight,IDirect3DRMObject) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMLight methods ***/ + STDMETHOD(SetType)(THIS_ D3DRMLIGHTTYPE) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetRange)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetUmbra)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetPenumbra)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetConstantAttenuation)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetLinearAttenuation)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetQuadraticAttenuation)(THIS_ D3DVALUE) PURE; + STDMETHOD_(D3DVALUE, GetRange)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetUmbra)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetPenumbra)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetConstantAttenuation)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetLinearAttenuation)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetQuadraticAttenuation)(THIS) PURE; + STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; + STDMETHOD_(D3DRMLIGHTTYPE, GetType)(THIS) PURE; + STDMETHOD(SetEnableFrame)(THIS_ IDirect3DRMFrame *frame) PURE; + STDMETHOD(GetEnableFrame)(THIS_ IDirect3DRMFrame **frame) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMLight_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMLight_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMLight_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMLight_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMLight_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMLight_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMLight_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMLight_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMLight_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMLight_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMLight_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMLight methods ***/ +#define IDirect3DRMLight_SetType(p,a) (p)->lpVtbl->SetType(p,a) +#define IDirect3DRMLight_SetColor(p,a) (p)->lpVtbl->SetColor(p,a) +#define IDirect3DRMLight_SetColorRGB(p,a,b,c) (p)->lpVtbl->SetColorRGB(p,a,b,c) +#define IDirect3DRMLight_SetRange(p,a) (p)->lpVtbl->SetRange(p,a) +#define IDirect3DRMLight_SetUmbra(p,a) (p)->lpVtbl->SetUmbra(p,a) +#define IDirect3DRMLight_SetPenumbra(p,a) (p)->lpVtbl->SetPenumbra(p,a) +#define IDirect3DRMLight_SetConstantAttenuation(p,a) (p)->lpVtbl->SetConstantAttenuation(p,a) +#define IDirect3DRMLight_SetLinearAttenuation(p,a) (p)->lpVtbl->SetLinearAttenuation(p,a) +#define IDirect3DRMLight_SetQuadraticAttenuation(p,a) (p)->lpVtbl->SetQuadraticAttenuation(p,a) +#define IDirect3DRMLight_GetRange(p) (p)->lpVtbl->GetRange(p) +#define IDirect3DRMLight_GetUmbra(p) (p)->lpVtbl->GetUmbra(p) +#define IDirect3DRMLight_GetPenumbra(p) (p)->lpVtbl->GetPenumbra(p) +#define IDirect3DRMLight_GetConstantAttenuation(p) (p)->lpVtbl->GetConstantAttenuation(p) +#define IDirect3DRMLight_GetLinearAttenuation(p) (p)->lpVtbl->GetLinearAttenuation(p) +#define IDirect3DRMLight_GetQuadraticAttenuation(p) (p)->lpVtbl->GetQuadraticAttenuation(p) +#define IDirect3DRMLight_GetColor(p) (p)->lpVtbl->GetColor(p) +#define IDirect3DRMLight_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DRMLight_SetEnableFrame(p,a) (p)->lpVtbl->SetEnableFrame(p,a) +#define IDirect3DRMLight_GetEnableFrame(p,a) (p)->lpVtbl->GetEnableFrame(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMLight_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMLight_AddRef(p) (p)->AddRef() +#define IDirect3DRMLight_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMLight_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMLight_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMLight_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMLight_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMLight_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMLight_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMLight_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMLight_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMLight methods ***/ +#define IDirect3DRMLight_SetType(p,a) (p)->SetType(a) +#define IDirect3DRMLight_SetColor(p,a) (p)->SetColor(a) +#define IDirect3DRMLight_SetColorRGB(p,a,b,c) (p)->SetColorRGB(a,b,c) +#define IDirect3DRMLight_SetRange(p,a) (p)->SetRange(a) +#define IDirect3DRMLight_SetUmbra(p,a) (p)->SetUmbra(a) +#define IDirect3DRMLight_SetPenumbra(p,a) (p)->SetPenumbra(a) +#define IDirect3DRMLight_SetConstantAttenuation(p,a) (p)->SetConstantAttenuation(a) +#define IDirect3DRMLight_SetLinearAttenuation(p,a) (p)->SetLinearAttenuation(a) +#define IDirect3DRMLight_SetQuadraticAttenuation(p,a) (p)->SetQuadraticAttenuation(a) +#define IDirect3DRMLight_GetRange(p) (p)->GetRange() +#define IDirect3DRMLight_GetUmbra(p) (p)->GetUmbra() +#define IDirect3DRMLight_GetPenumbra(p) (p)->GetPenumbra() +#define IDirect3DRMLight_GetConstantAttenuation(p) (p)->GetConstantAttenuation() +#define IDirect3DRMLight_GetLinearAttenuation(p) (p)->GetLinearAttenuation() +#define IDirect3DRMLight_GetQuadraticAttenuation(p) (p)->GetQuadraticAttenuation() +#define IDirect3DRMLight_GetColor(p) (p)->GetColor() +#define IDirect3DRMLight_GetType(p) (p)->GetType() +#define IDirect3DRMLight_SetEnableFrame(p,a) (p)->SetEnableFrame(a) +#define IDirect3DRMLight_GetEnableFrame(p,a) (p)->GetEnableFrame(a) +#endif + +/***************************************************************************** + * IDirect3DRMTexture interface + */ +#define INTERFACE IDirect3DRMTexture +DECLARE_INTERFACE_(IDirect3DRMTexture, IDirect3DRMVisual) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMTexture methods ***/ + STDMETHOD(InitFromFile)(THIS_ const char *filename) PURE; + STDMETHOD(InitFromSurface)(THIS_ IDirectDrawSurface *surface) PURE; + STDMETHOD(InitFromResource)(THIS_ HRSRC) PURE; + STDMETHOD(Changed)(THIS_ BOOL pixels, BOOL palette) PURE; + STDMETHOD(SetColors)(THIS_ DWORD) PURE; + STDMETHOD(SetShades)(THIS_ DWORD) PURE; + STDMETHOD(SetDecalSize)(THIS_ D3DVALUE width, D3DVALUE height) PURE; + STDMETHOD(SetDecalOrigin)(THIS_ LONG x, LONG y) PURE; + STDMETHOD(SetDecalScale)(THIS_ DWORD) PURE; + STDMETHOD(SetDecalTransparency)(THIS_ BOOL) PURE; + STDMETHOD(SetDecalTransparentColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(GetDecalSize)(THIS_ D3DVALUE *width_return, D3DVALUE *height_return) PURE; + STDMETHOD(GetDecalOrigin)(THIS_ LONG *x_return, LONG *y_return) PURE; + STDMETHOD_(D3DRMIMAGE *, GetImage)(THIS) PURE; + STDMETHOD_(DWORD, GetShades)(THIS) PURE; + STDMETHOD_(DWORD, GetColors)(THIS) PURE; + STDMETHOD_(DWORD, GetDecalScale)(THIS) PURE; + STDMETHOD_(BOOL, GetDecalTransparency)(THIS) PURE; + STDMETHOD_(D3DCOLOR, GetDecalTransparentColor)(THIS) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMTexture_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMTexture_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMTexture_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMTexture_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMTexture_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMTexture_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMTexture_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMTexture_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMTexture_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMTexture_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMTexture_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMTexture methods ***/ +#define IDirect3DRMTexture_InitFromFile(p,a) (p)->lpVtbl->InitFromFile(p,a) +#define IDirect3DRMTexture_InitFromSurface(p,a) (p)->lpVtbl->InitFromSurface(p,a) +#define IDirect3DRMTexture_InitFromResource(p,a) (p)->lpVtbl->InitFromResource(p,a) +#define IDirect3DRMTexture_Changed(p,a,b) (p)->lpVtbl->Changed(p,a,b) +#define IDirect3DRMTexture_SetColors(p,a) (p)->lpVtbl->SetColors(p,a) +#define IDirect3DRMTexture_SetShades(p,a) (p)->lpVtbl->SetShades(p,a) +#define IDirect3DRMTexture_SetDecalSize(p,a,b) (p)->lpVtbl->SetDecalSize(p,a,b) +#define IDirect3DRMTexture_SetDecalOrigin(p,a,b) (p)->lpVtbl->SetDecalOrigin(p,a,b) +#define IDirect3DRMTexture_SetDecalScale(p,a) (p)->lpVtbl->SetDecalScale(p,a) +#define IDirect3DRMTexture_SetDecalTransparency(p,a) (p)->lpVtbl->SetDecalTransparency(p,a) +#define IDirect3DRMTexture_SetDecalTransparencyColor(p,a) (p)->lpVtbl->SetDecalTransparentColor(p,a) +#define IDirect3DRMTexture_GetDecalSize(p,a,b) (p)->lpVtbl->GetDecalSize(p,a,b) +#define IDirect3DRMTexture_GetDecalOrigin(p,a,b) (p)->lpVtbl->GetDecalOrigin(p,a,b) +#define IDirect3DRMTexture_GetImage(p) (p)->lpVtbl->GetImage(p) +#define IDirect3DRMTexture_GetShades(p) (p)->lpVtbl->GetShades(p) +#define IDirect3DRMTexture_GetColors(p) (p)->lpVtbl->GetColors(p) +#define IDirect3DRMTexture_GetDecalScale(p) (p)->lpVtbl->GetDecalScale(p) +#define IDirect3DRMTexture_GetDecalTransparency(p) (p)->lpVtbl->GetDecalTransparency(p) +#define IDirect3DRMTexture_GetDecalTransparencyColor(p) (p)->lpVtbl->GetDecalTransparencyColor(p) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMTexture_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMTexture_AddRef(p) (p)->AddRef() +#define IDirect3DRMTexture_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMTexture_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMTexture_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMTexture_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMTexture_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMTexture_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMTexture_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMTexture_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMTexture_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMTexture methods ***/ +#define IDirect3DRMTexture_InitFromFile(p,a) (p)->InitFromFile(a) +#define IDirect3DRMTexture_InitFromSurface(p,a) (p)->InitFromSurface(a) +#define IDirect3DRMTexture_InitFromResource(p,a) (p)->InitFromResource(a) +#define IDirect3DRMTexture_Changed(p,a,b) (p)->Changed(a,b) +#define IDirect3DRMTexture_SetColors(p,a) (p)->SetColors(a) +#define IDirect3DRMTexture_SetShades(p,a) (p)->SetShades(a) +#define IDirect3DRMTexture_SetDecalSize(p,a,b) (p)->SetDecalSize(a,b) +#define IDirect3DRMTexture_SetDecalOrigin(p,a,b) (p)->SetDecalOrigin(a,b) +#define IDirect3DRMTexture_SetDecalScale(p,a) (p)->SetDecalScale(a) +#define IDirect3DRMTexture_SetDecalTransparency(p,a) (p)->SetDecalTransparency(a) +#define IDirect3DRMTexture_SetDecalTransparencyColor(p,a) (p)->SetDecalTransparentColor(a) +#define IDirect3DRMTexture_GetDecalSize(p,a,b) (p)->GetDecalSize(a,b) +#define IDirect3DRMTexture_GetDecalOrigin(p,a,b) (p)->GetDecalOrigin(a,b) +#define IDirect3DRMTexture_GetImage(p) (p)->GetImage() +#define IDirect3DRMTexture_GetShades(p) (p)->GetShades() +#define IDirect3DRMTexture_GetColors(p) (p)->GetColors() +#define IDirect3DRMTexture_GetDecalScale(p) (p)->GetDecalScale() +#define IDirect3DRMTexture_GetDecalTransparency(p) (p)->GetDecalTransparency() +#define IDirect3DRMTexture_GetDecalTransparencyColor(p) (p)->GetDecalTransparencyColor() +#endif + +/***************************************************************************** + * IDirect3DRMTexture2 interface + */ +#define INTERFACE IDirect3DRMTexture2 +DECLARE_INTERFACE_(IDirect3DRMTexture2, IDirect3DRMTexture) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMTexture methods ***/ + STDMETHOD(InitFromFile)(THIS_ const char *filename) PURE; + STDMETHOD(InitFromSurface)(THIS_ IDirectDrawSurface *surface) PURE; + STDMETHOD(InitFromResource)(THIS_ HRSRC) PURE; + STDMETHOD(Changed)(THIS_ BOOL pixels, BOOL palette) PURE; + STDMETHOD(SetColors)(THIS_ DWORD) PURE; + STDMETHOD(SetShades)(THIS_ DWORD) PURE; + STDMETHOD(SetDecalSize)(THIS_ D3DVALUE width, D3DVALUE height) PURE; + STDMETHOD(SetDecalOrigin)(THIS_ LONG x, LONG y) PURE; + STDMETHOD(SetDecalScale)(THIS_ DWORD) PURE; + STDMETHOD(SetDecalTransparency)(THIS_ BOOL) PURE; + STDMETHOD(SetDecalTransparentColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(GetDecalSize)(THIS_ D3DVALUE *width_return, D3DVALUE *height_return) PURE; + STDMETHOD(GetDecalOrigin)(THIS_ LONG *x_return, LONG *y_return) PURE; + STDMETHOD_(D3DRMIMAGE *, GetImage)(THIS) PURE; + STDMETHOD_(DWORD, GetShades)(THIS) PURE; + STDMETHOD_(DWORD, GetColors)(THIS) PURE; + STDMETHOD_(DWORD, GetDecalScale)(THIS) PURE; + STDMETHOD_(BOOL, GetDecalTransparency)(THIS) PURE; + STDMETHOD_(D3DCOLOR, GetDecalTransparentColor)(THIS) PURE; + /*** IDirect3DRMTexture2 methods ***/ + STDMETHOD(InitFromImage)(THIS_ D3DRMIMAGE *image) PURE; + STDMETHOD(InitFromResource2)(THIS_ HMODULE module, const char *name, const char *type) PURE; + STDMETHOD(GenerateMIPMap)(THIS_ DWORD) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMTexture2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMTexture2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMTexture2_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMTexture2_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMTexture2_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMTexture2_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMTexture2_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMTexture2_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMTexture2_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMTexture2_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMTexture2_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMTexture methods ***/ +#define IDirect3DRMTexture2_InitFromFile(p,a) (p)->lpVtbl->InitFromFile(p,a) +#define IDirect3DRMTexture2_InitFromSurface(p,a) (p)->lpVtbl->InitFromSurface(p,a) +#define IDirect3DRMTexture2_InitFromResource(p,a) (p)->lpVtbl->InitFromResource(p,a) +#define IDirect3DRMTexture2_Changed(p,a,b) (p)->lpVtbl->Changed(p,a,b) +#define IDirect3DRMTexture2_SetColors(p,a) (p)->lpVtbl->SetColors(p,a) +#define IDirect3DRMTexture2_SetShades(p,a) (p)->lpVtbl->SetShades(p,a) +#define IDirect3DRMTexture2_SetDecalSize(p,a,b) (p)->lpVtbl->SetDecalSize(p,a,b) +#define IDirect3DRMTexture2_SetDecalOrigin(p,a,b) (p)->lpVtbl->SetDecalOrigin(p,a,b) +#define IDirect3DRMTexture2_SetDecalScale(p,a) (p)->lpVtbl->SetDecalScale(p,a) +#define IDirect3DRMTexture2_SetDecalTransparency(p,a) (p)->lpVtbl->SetDecalTransparency(p,a) +#define IDirect3DRMTexture2_SetDecalTransparencyColor(p,a) (p)->lpVtbl->SetDecalTransparentColor(p,a) +#define IDirect3DRMTexture2_GetDecalSize(p,a,b) (p)->lpVtbl->GetDecalSize(p,a,b) +#define IDirect3DRMTexture2_GetDecalOrigin(p,a,b) (p)->lpVtbl->GetDecalOrigin(p,a,b) +#define IDirect3DRMTexture2_GetImage(p) (p)->lpVtbl->GetImage(p) +#define IDirect3DRMTexture2_GetShades(p) (p)->lpVtbl->GetShades(p) +#define IDirect3DRMTexture2_GetColors(p) (p)->lpVtbl->GetColors(p) +#define IDirect3DRMTexture2_GetDecalScale(p) (p)->lpVtbl->GetDecalScale(p) +#define IDirect3DRMTexture2_GetDecalTransparency(p) (p)->lpVtbl->GetDecalTransparency(p) +#define IDirect3DRMTexture2_GetDecalTransparencyColor(p) (p)->lpVtbl->GetDecalTransparencyColor(p) +/*** IDirect3DRMTexture2 methods ***/ +#define IDirect3DRMTexture2_InitFromImage(p,a) (p)->lpVtbl->InitFromImage(p,a) +#define IDirect3DRMTexture2_InitFromResource2(p,a,b,c) (p)->lpVtbl->InitFromResource2(p,a,b,c) +#define IDirect3DRMTexture2_GenerateMIPMap(p,a) (p)->lpVtbl->GenerateMIPMap(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMTexture2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMTexture2_AddRef(p) (p)->AddRef() +#define IDirect3DRMTexture2_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMTexture2_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMTexture2_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMTexture2_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMTexture2_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMTexture2_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMTexture2_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMTexture2_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMTexture2_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMTexture methods ***/ +#define IDirect3DRMTexture2_InitFromFile(p,a) (p)->InitFromFile(a) +#define IDirect3DRMTexture2_InitFromSurface(p,a) (p)->InitFromSurface(a) +#define IDirect3DRMTexture2_InitFromResource(p,a) (p)->InitFromResource(a) +#define IDirect3DRMTexture2_Changed(p,a,b) (p)->Changed(a,b) +#define IDirect3DRMTexture2_SetColors(p,a) (p)->SetColors(a) +#define IDirect3DRMTexture2_SetShades(p,a) (p)->SetShades(a) +#define IDirect3DRMTexture2_SetDecalSize(p,a,b) (p)->SetDecalSize(a,b) +#define IDirect3DRMTexture2_SetDecalOrigin(p,a,b) (p)->SetDecalOrigin(a,b) +#define IDirect3DRMTexture2_SetDecalScale(p,a) (p)->SetDecalScale(a) +#define IDirect3DRMTexture2_SetDecalTransparency(p,a) (p)->SetDecalTransparency(a) +#define IDirect3DRMTexture2_SetDecalTransparencyColor(p,a) (p)->SetDecalTransparentColor(a) +#define IDirect3DRMTexture2_GetDecalSize(p,a,b) (p)->GetDecalSize(a,b) +#define IDirect3DRMTexture2_GetDecalOrigin(p,a,b) (p)->GetDecalOrigin(a,b) +#define IDirect3DRMTexture2_GetImage(p) (p)->GetImage() +#define IDirect3DRMTexture2_GetShades(p) (p)->GetShades() +#define IDirect3DRMTexture2_GetColors(p) (p)->GetColors() +#define IDirect3DRMTexture2_GetDecalScale(p) (p)->GetDecalScale() +#define IDirect3DRMTexture2_GetDecalTransparency(p) (p)->GetDecalTransparency() +#define IDirect3DRMTexture2_GetDecalTransparencyColor(p) (p)->GetDecalTransparencyColor() +/*** IDirect3DRMTexture2 methods ***/ +#define IDirect3DRMTexture2_InitFromImage(p,a) (p)->InitFromImage(a) +#define IDirect3DRMTexture2_InitFromResource2(p,a,b,c) (p)->InitFromResource2(a,b,c) +#define IDirect3DRMTexture2_GenerateMIPMap(p,a) (p)->GenerateMIPMap(a) +#endif + +/***************************************************************************** + * IDirect3DRMTexture3 interface + */ +#define INTERFACE IDirect3DRMTexture3 +DECLARE_INTERFACE_(IDirect3DRMTexture3, IDirect3DRMVisual) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMTexture3 methods ***/ + STDMETHOD(InitFromFile)(THIS_ const char *filename) PURE; + STDMETHOD(InitFromSurface)(THIS_ IDirectDrawSurface *surface) PURE; + STDMETHOD(InitFromResource)(THIS_ HRSRC) PURE; + STDMETHOD(Changed)(THIS_ DWORD flags, DWORD rect_count, RECT *rects) PURE; + STDMETHOD(SetColors)(THIS_ DWORD) PURE; + STDMETHOD(SetShades)(THIS_ DWORD) PURE; + STDMETHOD(SetDecalSize)(THIS_ D3DVALUE width, D3DVALUE height) PURE; + STDMETHOD(SetDecalOrigin)(THIS_ LONG x, LONG y) PURE; + STDMETHOD(SetDecalScale)(THIS_ DWORD) PURE; + STDMETHOD(SetDecalTransparency)(THIS_ BOOL) PURE; + STDMETHOD(SetDecalTransparentColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(GetDecalSize)(THIS_ D3DVALUE *width_return, D3DVALUE *height_return) PURE; + STDMETHOD(GetDecalOrigin)(THIS_ LONG *x_return, LONG *y_return) PURE; + STDMETHOD_(D3DRMIMAGE *, GetImage)(THIS) PURE; + STDMETHOD_(DWORD, GetShades)(THIS) PURE; + STDMETHOD_(DWORD, GetColors)(THIS) PURE; + STDMETHOD_(DWORD, GetDecalScale)(THIS) PURE; + STDMETHOD_(BOOL, GetDecalTransparency)(THIS) PURE; + STDMETHOD_(D3DCOLOR, GetDecalTransparentColor)(THIS) PURE; + STDMETHOD(InitFromImage)(THIS_ D3DRMIMAGE *image) PURE; + STDMETHOD(InitFromResource2)(THIS_ HMODULE module, const char *name, const char *type) PURE; + STDMETHOD(GenerateMIPMap)(THIS_ DWORD) PURE; + STDMETHOD(GetSurface)(THIS_ DWORD flags, IDirectDrawSurface **surface) PURE; + STDMETHOD(SetCacheOptions)(THIS_ LONG lImportance, DWORD dwFlags) PURE; + STDMETHOD(GetCacheOptions)(THIS_ LONG *importance, DWORD *flags) PURE; + STDMETHOD(SetDownsampleCallback)(THIS_ D3DRMDOWNSAMPLECALLBACK cb, void *ctx) PURE; + STDMETHOD(SetValidationCallback)(THIS_ D3DRMVALIDATIONCALLBACK cb, void *ctx) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMTexture3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMTexture3_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMTexture3_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMTexture3_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMTexture3_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMTexture3_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMTexture3_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMTexture3_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMTexture3_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMTexture3_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMTexture3_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMTexture3 methods ***/ +#define IDirect3DRMTexture3_InitFromFile(p,a) (p)->lpVtbl->InitFromFile(p,a) +#define IDirect3DRMTexture3_InitFromSurface(p,a) (p)->lpVtbl->InitFromSurface(p,a) +#define IDirect3DRMTexture3_InitFromResource(p,a) (p)->lpVtbl->InitFromResource(p,a) +#define IDirect3DRMTexture3_Changed(p,a,b,c) (p)->lpVtbl->Changed(p,a,b,c) +#define IDirect3DRMTexture3_SetColors(p,a) (p)->lpVtbl->SetColors(p,a) +#define IDirect3DRMTexture3_SetShades(p,a) (p)->lpVtbl->SetShades(p,a) +#define IDirect3DRMTexture3_SetDecalSize(p,a,b) (p)->lpVtbl->SetDecalSize(p,a,b) +#define IDirect3DRMTexture3_SetDecalOrigin(p,a,b) (p)->lpVtbl->SetDecalOrigin(p,a,b) +#define IDirect3DRMTexture3_SetDecalScale(p,a) (p)->lpVtbl->SetDecalScale(p,a) +#define IDirect3DRMTexture3_SetDecalTransparency(p,a) (p)->lpVtbl->SetDecalTransparency(p,a) +#define IDirect3DRMTexture3_SetDecalTransparencyColor(p,a) (p)->lpVtbl->SetDecalTransparentColor(p,a) +#define IDirect3DRMTexture3_GetDecalSize(p,a,b) (p)->lpVtbl->GetDecalSize(p,a,b) +#define IDirect3DRMTexture3_GetDecalOrigin(p,a,b) (p)->lpVtbl->GetDecalOrigin(p,a,b) +#define IDirect3DRMTexture3_GetImage(p) (p)->lpVtbl->GetImage(p) +#define IDirect3DRMTexture3_GetShades(p) (p)->lpVtbl->GetShades(p) +#define IDirect3DRMTexture3_GetColors(p) (p)->lpVtbl->GetColors(p) +#define IDirect3DRMTexture3_GetDecalScale(p) (p)->lpVtbl->GetDecalScale(p) +#define IDirect3DRMTexture3_GetDecalTransparency(p) (p)->lpVtbl->GetDecalTransparency(p) +#define IDirect3DRMTexture3_GetDecalTransparencyColor(p) (p)->lpVtbl->GetDecalTransparencyColor(p) +#define IDirect3DRMTexture3_InitFromImage(p,a) (p)->lpVtbl->InitFromImage(p,a) +#define IDirect3DRMTexture3_InitFromResource2(p,a,b,c) (p)->lpVtbl->InitFromResource2(p,a,b,c) +#define IDirect3DRMTexture3_GenerateMIPMap(p,a) (p)->lpVtbl->GenerateMIPMap(p,a) +#define IDirect3DRMTexture3_GetSurface(p,a,b) (p)->lpVtbl->GetSurface(p,a,b) +#define IDirect3DRMTexture3_SetCacheOptions(p,a,b) (p)->lpVtbl->SetCacheOptions(p,a,b) +#define IDirect3DRMTexture3_GetCacheOptions(p,a,b) (p)->lpVtbl->GetCacheOptions(p,a,b) +#define IDirect3DRMTexture3_SetDownsampleCallback(p,a,b) (p)->lpVtbl->SetDownsampleCallback(p,a,b) +#define IDirect3DRMTexture3_SetValidationCallback(p,a,b) (p)->lpVtbl->SetValidationCallback(p,a,b) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMTexture3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMTexture3_AddRef(p) (p)->AddRef() +#define IDirect3DRMTexture3_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMTexture3_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMTexture3_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMTexture3_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMTexture3_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMTexture3_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMTexture3_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMTexture3_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMTexture3_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMTexture3 methods ***/ +#define IDirect3DRMTexture3_InitFromFile(p,a) (p)->InitFromFile(a) +#define IDirect3DRMTexture3_InitFromSurface(p,a) (p)->InitFromSurface(a) +#define IDirect3DRMTexture3_InitFromResource(p,a) (p)->InitFromResource(a) +#define IDirect3DRMTexture3_Changed(p,a,b,c) (p)->Changed(a,b,c) +#define IDirect3DRMTexture3_SetColors(p,a) (p)->SetColors(a) +#define IDirect3DRMTexture3_SetShades(p,a) (p)->SetShades(a) +#define IDirect3DRMTexture3_SetDecalSize(p,a,b) (p)->SetDecalSize(a,b) +#define IDirect3DRMTexture3_SetDecalOrigin(p,a,b) (p)->SetDecalOrigin(a,b) +#define IDirect3DRMTexture3_SetDecalScale(p,a) (p)->SetDecalScale(a) +#define IDirect3DRMTexture3_SetDecalTransparency(p,a) (p)->SetDecalTransparency(a) +#define IDirect3DRMTexture3_SetDecalTransparencyColor(p,a) (p)->SetDecalTransparentColor(a) +#define IDirect3DRMTexture3_GetDecalSize(p,a,b) (p)->GetDecalSize(a,b) +#define IDirect3DRMTexture3_GetDecalOrigin(p,a,b) (p)->GetDecalOrigin(a,b) +#define IDirect3DRMTexture3_GetImage(p) (p)->GetImage() +#define IDirect3DRMTexture3_GetShades(p) (p)->GetShades() +#define IDirect3DRMTexture3_GetColors(p) (p)->GetColors() +#define IDirect3DRMTexture3_GetDecalScale(p) (p)->GetDecalScale() +#define IDirect3DRMTexture3_GetDecalTransparency(p) (p)->GetDecalTransparency() +#define IDirect3DRMTexture3_GetDecalTransparencyColor(p) (p)->GetDecalTransparencyColor() +#define IDirect3DRMTexture3_InitFromImage(p,a) (p)->InitFromImage(a) +#define IDirect3DRMTexture3_InitFromResource2(p,a,b,c) (p)->InitFromResource2(a,b,c) +#define IDirect3DRMTexture3_GenerateMIPMap(p,a) (p)->GenerateMIPMap(a) +#define IDirect3DRMTexture3_GetSurface(p,a,b) (p)->GetSurface(a,b) +#define IDirect3DRMTexture3_SetCacheOptions(p,a,b) (p)->SetCacheOptions(a,b) +#define IDirect3DRMTexture3_GetCacheOptions(p,a,b) (p)->GetCacheOptions(a,b) +#define IDirect3DRMTexture3_SetDownsampleCallback(p,a,b) (p)->SetDownsampleCallback(a,b) +#define IDirect3DRMTexture3_SetValidationCallback(p,a,b) (p)->SetValidationCallback(a,b) +#endif + +/***************************************************************************** + * IDirect3DRMWrap interface + */ +#define INTERFACE IDirect3DRMWrap +DECLARE_INTERFACE_(IDirect3DRMWrap, IDirect3DRMObject) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMWrap methods ***/ + STDMETHOD(Init)(THIS_ D3DRMWRAPTYPE type, IDirect3DRMFrame *reference, D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, + D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, + D3DVALUE ou, D3DVALUE ov, D3DVALUE su, D3DVALUE sv) PURE; + STDMETHOD(Apply)(THIS_ IDirect3DRMObject *object) PURE; + STDMETHOD(ApplyRelative)(THIS_ IDirect3DRMFrame *frame, IDirect3DRMObject *object) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMWrap_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMWrap_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMWrap_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMWrap_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMWrap_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMWrap_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMWrap_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMWrap_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMWrap_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMWrap_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMWrap_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMWrap methods ***/ +#define IDirect3DRMWrap_Init(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) (p)->lpVtbl->Init(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) +#define IDirect3DRMWrap_Apply(p,a) (p)->lpVtbl->Apply(p,a) +#define IDirect3DRMWrap_ApplyRelative(p,a,b) (p)->lpVtbl->ApplyRelative(p,a,b) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMWrap_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMWrap_AddRef(p) (p)->AddRef() +#define IDirect3DRMWrap_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMWrap_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMWrap_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMWrap_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMWrap_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMWrap_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMWrap_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMWrap_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMWrap_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMWrap methods ***/ +#define IDirect3DRMWrap_Init(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) (p)->Init(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) +#define IDirect3DRMWrap_Apply(p,a) (p)->Apply(p,a) +#define IDirect3DRMWrap_ApplyRelative(p,a,b) (p)->ApplyRelative(p,a,b) +#endif + +/***************************************************************************** + * IDirect3DRMMaterial interface + */ +#define INTERFACE IDirect3DRMMaterial +DECLARE_INTERFACE_(IDirect3DRMMaterial, IDirect3DRMObject) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMMaterial methods ***/ + STDMETHOD(SetPower)(THIS_ D3DVALUE power) PURE; + STDMETHOD(SetSpecular)(THIS_ D3DVALUE r, D3DVALUE g, D3DVALUE b) PURE; + STDMETHOD(SetEmissive)(THIS_ D3DVALUE r, D3DVALUE g, D3DVALUE b) PURE; + STDMETHOD_(D3DVALUE, GetPower)(THIS) PURE; + STDMETHOD(GetSpecular)(THIS_ D3DVALUE* r, D3DVALUE* g, D3DVALUE* b) PURE; + STDMETHOD(GetEmissive)(THIS_ D3DVALUE* r, D3DVALUE* g, D3DVALUE* b) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMMaterial_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMMaterial_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMMaterial_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMMaterial_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMMaterial_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMMaterial_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMMaterial_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMMaterial_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMMaterial_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMMaterial_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMMaterial_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMMaterial methods ***/ +#define IDirect3DRMMaterial_SetPower(p,a) (p)->lpVtbl->SetPower(p,a) +#define IDirect3DRMMaterial_SetSpecular(p,a,b,c) (p)->lpVtbl->SetSpecular(p,a,b,c) +#define IDirect3DRMMaterial_SetEmissive(p,a,b,c) (p)->lpVtbl->SetEmissive(p,a,b,c) +#define IDirect3DRMMaterial_GetPower(p) (p)->lpVtbl->GetPower(p) +#define IDirect3DRMMaterial_GetSpecular(p,a,b,c) (p)->lpVtbl->GetSpecular(p,a,b,c) +#define IDirect3DRMMaterial_GetEmissive(p,a,b,c) (p)->lpVtbl->GetEmissive(p,a,b,c) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMMaterial_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMMaterial_AddRef(p) (p)->AddRef() +#define IDirect3DRMMaterial_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMMaterial_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMMaterial_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMMaterial_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMMaterial_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMMaterial_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMMaterial_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMMaterial_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMMaterial_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMMaterial methods ***/ +#define IDirect3DRMMaterial_SetPower(p,a) (p)->SetPower(a) +#define IDirect3DRMMaterial_SetSpecular(p,a,b,c) (p)->SetSpecular(a,b,c) +#define IDirect3DRMMaterial_SetEmissive(p,a,b,c) (p)->SetEmissive(a,b,c) +#define IDirect3DRMMaterial_GetPower(p) (p)->GetPower() +#define IDirect3DRMMaterial_GetSpecular(p,a,b,c) (p)->GetSpecular(a,b,c) +#define IDirect3DRMMaterial_GetEmissive(p,a,b,c) (p)->GetEmissive(a,b,c) +#endif + +/***************************************************************************** + * IDirect3DRMMaterial2 interface + */ +#define INTERFACE IDirect3DRMMaterial2 +DECLARE_INTERFACE_(IDirect3DRMMaterial2, IDirect3DRMObject) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMMaterial2 methods ***/ + STDMETHOD(SetPower)(THIS_ D3DVALUE power) PURE; + STDMETHOD(SetSpecular)(THIS_ D3DVALUE r, D3DVALUE g, D3DVALUE b) PURE; + STDMETHOD(SetEmissive)(THIS_ D3DVALUE r, D3DVALUE g, D3DVALUE b) PURE; + STDMETHOD_(D3DVALUE, GetPower)(THIS) PURE; + STDMETHOD(GetSpecular)(THIS_ D3DVALUE* r, D3DVALUE* g, D3DVALUE* b) PURE; + STDMETHOD(GetEmissive)(THIS_ D3DVALUE* r, D3DVALUE* g, D3DVALUE* b) PURE; + STDMETHOD(GetAmbient)(THIS_ D3DVALUE* r, D3DVALUE* g, D3DVALUE* b) PURE; + STDMETHOD(SetAmbient)(THIS_ D3DVALUE r, D3DVALUE g, D3DVALUE b) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMMaterial2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMMaterial2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMMaterial2_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMMaterial2_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMMaterial2_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMMaterial2_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMMaterial2_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMMaterial2_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMMaterial2_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMMaterial2_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMMaterial2_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMMaterial2 methods ***/ +#define IDirect3DRMMaterial2_SetPower(p,a) (p)->lpVtbl->SetPower(p,a) +#define IDirect3DRMMaterial2_SetSpecular(p,a,b,c) (p)->lpVtbl->SetSpecular(p,a,b,c) +#define IDirect3DRMMaterial2_SetEmissive(p,a,b,c) (p)->lpVtbl->SetEmissive(p,a,b,c) +#define IDirect3DRMMaterial2_GetPower(p) (p)->lpVtbl->GetPower(p) +#define IDirect3DRMMaterial2_GetSpecular(p,a,b,c) (p)->lpVtbl->GetSpecular(p,a,b,c) +#define IDirect3DRMMaterial2_GetEmissive(p,a,b,c) (p)->lpVtbl->GetEmissive(p,a,b,c) +#define IDirect3DRMMaterial2_SetAmbient(p,a,b,c) (p)->lpVtbl->SetAmbient(p,a,b,c) +#define IDirect3DRMMaterial2_GetAmbient(p,a,b,c) (p)->lpVtbl->GetAmbient(p,a,b,c) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMMaterial2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMMaterial2_AddRef(p) (p)->AddRef() +#define IDirect3DRMMaterial2_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMMaterial2_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMMaterial2_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMMaterial2_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMMaterial2_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMMaterial2_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMMaterial2_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMMaterial2_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMMaterial2_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMMaterial2 methods ***/ +#define IDirect3DRMMaterial2_SetPower(p,a) (p)->SetPower(a) +#define IDirect3DRMMaterial2_SetSpecular(p,a,b,c) (p)->SetSpecular(a,b,c) +#define IDirect3DRMMaterial2_SetEmissive(p,a,b,c) (p)->SetEmissive(a,b,c) +#define IDirect3DRMMaterial2_GetPower(p) (p)->GetPower() +#define IDirect3DRMMaterial2_GetSpecular(p,a,b,c) (p)->GetSpecular(a,b,c) +#define IDirect3DRMMaterial2_GetEmissive(p,a,b,c) (p)->GetEmissive(a,b,c) +#define IDirect3DRMMaterial2_SetAmbient(p,a,b,c) (p)->SetAmbient(a,b,c) +#define IDirect3DRMMaterial2_GetAmbient(p,a,b,c) (p)->GetAmbient(a,b,c) +#endif + +/***************************************************************************** + * IDirect3DRMAnimation interface + */ +#define INTERFACE IDirect3DRMAnimation +DECLARE_INTERFACE_(IDirect3DRMAnimation, IDirect3DRMObject) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMAnimation methods ***/ + STDMETHOD(SetOptions)(THIS_ D3DRMANIMATIONOPTIONS flags) PURE; + STDMETHOD(AddRotateKey)(THIS_ D3DVALUE time, D3DRMQUATERNION *q) PURE; + STDMETHOD(AddPositionKey)(THIS_ D3DVALUE time, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(AddScaleKey)(THIS_ D3DVALUE time, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(DeleteKey)(THIS_ D3DVALUE time) PURE; + STDMETHOD(SetFrame)(THIS_ IDirect3DRMFrame *frame) PURE; + STDMETHOD(SetTime)(THIS_ D3DVALUE time) PURE; + STDMETHOD_(D3DRMANIMATIONOPTIONS, GetOptions)(THIS) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMAnimation_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMAnimation_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMAnimation_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMAnimation_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMAnimation_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMAnimation_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMAnimation_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMAnimation_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMAnimation_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMAnimation_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMAnimation_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMAnimation methods ***/ +#define IDirect3DRMAnimation_SetOptions(p,a) (p)->lpVtbl->SetOptions(p,a) +#define IDirect3DRMAnimation_AddRotateKey(p,a,b) (p)->lpVtbl->AddRotateKey(p,a,b) +#define IDirect3DRMAnimation_AddPositionKey(p,a,b,c,d) (p)->lpVtbl->AddPositionKey(p,a,b,c,d) +#define IDirect3DRMAnimation_AddScaleKey(p,a,b,c,d) (p)->lpVtbl->AddScaleKey(p,a,b,c,d) +#define IDirect3DRMAnimation_DeleteKey(p,a) (p)->lpVtbl->DeleteKey(p,a) +#define IDirect3DRMAnimation_SetFrame(p,a) (p)->lpVtbl->SetFrame(p,a) +#define IDirect3DRMAnimation_SetTime(p,a) (p)->lpVtbl->SetTime(p,a) +#define IDirect3DRMAnimation_GetOptions(p) (p)->lpVtbl->GetOptions(p) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMAnimation_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMAnimation_AddRef(p) (p)->AddRef() +#define IDirect3DRMAnimation_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMAnimation_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMAnimation_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMAnimation_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMAnimation_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMAnimation_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMAnimation_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMAnimation_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMAnimation_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMAnimation methods ***/ +#define IDirect3DRMAnimation_SetOptions(p,a) (p)->SetOptions(a) +#define IDirect3DRMAnimation_AddRotateKey(p,a,b) (p)->AddRotateKey(a,b) +#define IDirect3DRMAnimation_AddPositionKey(p,a,b,c,d) (p)->AddPositionKey(a,b,c,d) +#define IDirect3DRMAnimation_AddScaleKey(p,a,b,c,d) (p)->AddScaleKey(a,b,c,d) +#define IDirect3DRMAnimation_DeleteKey(p,a) (p)->DeleteKey(a) +#define IDirect3DRMAnimation_SetFrame(p,a) (p)->SetFrame(a) +#define IDirect3DRMAnimation_SetTime(p,a) (p)->SetTime(a) +#define IDirect3DRMAnimation_GetOptions(p) (p)->GetOptions() +#endif + +/***************************************************************************** + * IDirect3DRMAnimation2 interface + */ +#define INTERFACE IDirect3DRMAnimation2 +DECLARE_INTERFACE_(IDirect3DRMAnimation2, IDirect3DRMObject) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMAnimation2 methods ***/ + STDMETHOD(SetOptions)(THIS_ D3DRMANIMATIONOPTIONS flags) PURE; + STDMETHOD(AddRotateKey)(THIS_ D3DVALUE time, D3DRMQUATERNION *q) PURE; + STDMETHOD(AddPositionKey)(THIS_ D3DVALUE time, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(AddScaleKey)(THIS_ D3DVALUE time, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(DeleteKey)(THIS_ D3DVALUE time) PURE; + STDMETHOD(SetFrame)(THIS_ IDirect3DRMFrame3 *frame) PURE; + STDMETHOD(SetTime)(THIS_ D3DVALUE time) PURE; + STDMETHOD_(D3DRMANIMATIONOPTIONS, GetOptions)(THIS) PURE; + STDMETHOD(GetFrame)(THIS_ IDirect3DRMFrame3 **frame) PURE; + STDMETHOD(DeleteKeyByID)(THIS_ DWORD dwID) PURE; + STDMETHOD(AddKey)(THIS_ D3DRMANIMATIONKEY *key) PURE; + STDMETHOD(ModifyKey)(THIS_ D3DRMANIMATIONKEY *key) PURE; + STDMETHOD(GetKeys)(THIS_ D3DVALUE time_min, D3DVALUE time_max, DWORD *key_count, D3DRMANIMATIONKEY *keys); +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMAnimation2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMAnimation2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMAnimation2_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMAnimation2_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMAnimation2_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMAnimation2_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMAnimation2_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMAnimation2_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMAnimation2_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMAnimation2_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMAnimation2_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMAnimation2 methods ***/ +#define IDirect3DRMAnimation2_SetOptions(p,a) (p)->lpVtbl->SetOptions(p,a) +#define IDirect3DRMAnimation2_AddRotateKey(p,a,b) (p)->lpVtbl->AddRotateKey(p,a,b) +#define IDirect3DRMAnimation2_AddPositionKey(p,a,b,c,d) (p)->lpVtbl->AddPositionKey(p,a,b,c,d) +#define IDirect3DRMAnimation2_AddScaleKey(p,a,b,c,d) (p)->lpVtbl->AddScaleKey(p,a,b,c,d) +#define IDirect3DRMAnimation2_DeleteKey(p,a) (p)->lpVtbl->DeleteKey(p,a) +#define IDirect3DRMAnimation2_SetFrame(p,a) (p)->lpVtbl->SetFrame(p,a) +#define IDirect3DRMAnimation2_SetTime(p,a) (p)->lpVtbl->SetTime(p,a) +#define IDirect3DRMAnimation2_GetOptions(p) (p)->lpVtbl->GetOptions(p) +#define IDirect3DRMAnimation2_GetFrame(p,a) (p)->lpVtbl->GetFrame(p,a) +#define IDirect3DRMAnimation2_DeleteKeyByID(p,a) (p)->lpVtbl->DeleteKeyByID(p,a) +#define IDirect3DRMAnimation2_AddKey(p,a) (p)->lpVtbl->AddKey(p,a) +#define IDirect3DRMAnimation2_ModifyKey(p,a) (p)->lpVtbl->ModifyKey(p,a) +#define IDirect3DRMAnimation2_GetKeys(p,a,b,c,d) (p)->lpVtbl->GetKeys(p,a,b,c,d) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMAnimation2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMAnimation2_AddRef(p) (p)->AddRef() +#define IDirect3DRMAnimation2_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMAnimation2_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMAnimation2_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMAnimation2_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMAnimation2_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMAnimation2_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMAnimation2_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMAnimation2_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMAnimation2_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMAnimation2 methods ***/ +#define IDirect3DRMAnimation2_SetOptions(p,a) (p)->SetOptions(a) +#define IDirect3DRMAnimation2_AddRotateKey(p,a,b) (p)->AddRotateKey(a,b) +#define IDirect3DRMAnimation2_AddPositionKey(p,a,b,c,d) (p)->AddPositionKey(a,b,c,d) +#define IDirect3DRMAnimation2_AddScaleKey(p,a,b,c,d) (p)->AddScaleKey(a,b,c,d) +#define IDirect3DRMAnimation2_DeleteKey(p,a) (p)->DeleteKey(a) +#define IDirect3DRMAnimation2_SetFrame(p,a) (p)->SetFrame(a) +#define IDirect3DRMAnimation2_SetTime(p,a) (p)->SetTime(a) +#define IDirect3DRMAnimation2_GetOptions(p) (p)->GetOptions() +#define IDirect3DRMAnimation2_GetFrame(p,a) (p)->GetFrame(a) +#define IDirect3DRMAnimation2_DeleteKeyByID(p,a) (p)->DeleteKeyByID(a) +#define IDirect3DRMAnimation2_AddKey(p,a) (p)->AddKey(a) +#define IDirect3DRMAnimation2_ModifyKey(p,a) (p)->ModifyKey(a) +#define IDirect3DRMAnimation2_GetKeys(p,a,b,c,d) (p)->GetKeys(a,b,c,d) +#endif + +/***************************************************************************** + * IDirect3DRMAnimationSet interface + */ +#define INTERFACE IDirect3DRMAnimationSet +DECLARE_INTERFACE_(IDirect3DRMAnimationSet, IDirect3DRMObject) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMAnimationSet methods ***/ + STDMETHOD(AddAnimation)(THIS_ IDirect3DRMAnimation *animation) PURE; + STDMETHOD(Load)(THIS_ void *filename, void *name, D3DRMLOADOPTIONS flags, + D3DRMLOADTEXTURECALLBACK cb, void *ctx, IDirect3DRMFrame *parent)PURE; + STDMETHOD(DeleteAnimation)(THIS_ IDirect3DRMAnimation *animation) PURE; + STDMETHOD(SetTime)(THIS_ D3DVALUE time) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMAnimationSet_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMAnimationSet_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMAnimationSet_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMAnimationSet_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMAnimationSet_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMAnimationSet_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMAnimationSet_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMAnimationSet_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMAnimationSet_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMAnimationSet_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMAnimationSet_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMAnimationSet methods ***/ +#define IDirect3DRMAnimationSet_AddAnimation(p,a) (p)->lpVtbl->AddAnimation(p,a) +#define IDirect3DRMAnimationSet_Load(p,a,b,c,d,e,f) (p)->lpVtbl->Load(p,a,b,c,d,e,f) +#define IDirect3DRMAnimationSet_DeleteAnimation(p,a) (p)->lpVtbl->DeleteAnimation(p,a) +#define IDirect3DRMAnimationSet_SetTime(p,a) (p)->lpVtbl->SetTime(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMAnimationSet_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMAnimationSet_AddRef(p) (p)->AddRef() +#define IDirect3DRMAnimationSet_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMAnimationSet_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMAnimationSet_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMAnimationSet_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMAnimationSet_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMAnimationSet_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMAnimationSet_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMAnimationSet_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMAnimationSet_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMAnimationSet methods ***/ +#define IDirect3DRMAnimationSet_AddAnimation(p,a) (p)->AddAnimation(a) +#define IDirect3DRMAnimationSet_Load(p,a,b,c,d,e,f) (p)->Load(a,b,c,d,e,f) +#define IDirect3DRMAnimationSet_DeleteAnimation(p,a) (p)->DeleteAnimation(a) +#define IDirect3DRMAnimationSet_SetTime(p,a) (p)->SetTime(a) +#endif + +/***************************************************************************** + * IDirect3DRMAnimationSet2 interface + */ +#define INTERFACE IDirect3DRMAnimationSet2 +DECLARE_INTERFACE_(IDirect3DRMAnimationSet2, IDirect3DRMObject) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMAnimationSet2 methods ***/ + STDMETHOD(AddAnimation)(THIS_ IDirect3DRMAnimation2 *animation) PURE; + STDMETHOD(Load)(THIS_ void *source, void *object_id, D3DRMLOADOPTIONS flags, + D3DRMLOADTEXTURE3CALLBACK cb, void *ctx, IDirect3DRMFrame3 *parent_frame)PURE; + STDMETHOD(DeleteAnimation)(THIS_ IDirect3DRMAnimation2 *animation) PURE; + STDMETHOD(SetTime)(THIS_ D3DVALUE time) PURE; + STDMETHOD(GetAnimations)(THIS_ struct IDirect3DRMAnimationArray **array) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMAnimationSet2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMAnimationSet2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMAnimationSet2_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMAnimationSet2_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMAnimationSet2_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMAnimationSet2_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMAnimationSet2_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMAnimationSet2_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMAnimationSet2_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMAnimationSet2_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMAnimationSet2_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMAnimationSet2 methods ***/ +#define IDirect3DRMAnimationSet2_AddAnimation(p,a) (p)->lpVtbl->AddAnimation(p,a) +#define IDirect3DRMAnimationSet2_Load(p,a,b,c,d,e,f) (p)->lpVtbl->Load(p,a,b,c,d,e,f) +#define IDirect3DRMAnimationSet2_DeleteAnimation(p,a) (p)->lpVtbl->DeleteAnimation(p,a) +#define IDirect3DRMAnimationSet2_SetTime(p,a) (p)->lpVtbl->SetTime(p,a) +#define IDirect3DRMAnimationSet2_GetAnimations(p,a) (p)->lpVtbl->GetAnimations(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMAnimationSet2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMAnimationSet2_AddRef(p) (p)->AddRef() +#define IDirect3DRMAnimationSet2_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMAnimationSet2_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMAnimationSet2_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMAnimationSet2_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMAnimationSet2_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMAnimationSet2_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMAnimationSet2_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMAnimationSet2_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMAnimationSet2_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMAnimationSet2 methods ***/ +#define IDirect3DRMAnimationSet2_AddAnimation(p,a) (p)->AddAnimation(a) +#define IDirect3DRMAnimationSet2_Load(p,a,b,c,d,e,f) (p)->Load(a,b,c,d,e,f) +#define IDirect3DRMAnimationSet2_DeleteAnimation(p,a) (p)->DeleteAnimation(a) +#define IDirect3DRMAnimationSet2_SetTime(p,a) (p)->SetTime(a) +#define IDirect3DRMAnimationSet2_GetAnimations(p,a) (p)->GetAnimations(a) +#endif + +/***************************************************************************** + * IDirect3DRMUserVisual interface + */ +#define INTERFACE IDirect3DRMUserVisual +DECLARE_INTERFACE_(IDirect3DRMUserVisual, IDirect3DRMVisual) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMUserVisual methods ***/ + STDMETHOD(Init)(THIS_ D3DRMUSERVISUALCALLBACK fn, void *arg) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMUserVisual_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMUserVisual_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMUserVisual_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMUserVisual_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMUserVisual_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMUserVisual_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMUserVisual_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMUserVisual_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMUserVisual_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMUserVisual_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMUserVisual_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMUserVisual methods ***/ +#define IDirect3DRMUserVisual_Init(p,a,b) (p)->lpVtbl->Init(p,a,b) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMUserVisual_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMUserVisual_AddRef(p) (p)->AddRef() +#define IDirect3DRMUserVisual_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMUserVisual_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMUserVisual_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMUserVisual_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMUserVisual_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMUserVisual_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMUserVisual_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMUserVisual_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMUserVisual_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMUserVisual methods ***/ +#define IDirect3DRMUserVisual_Init(p,a,b) (p)->Init(a,b) +#endif + +/***************************************************************************** + * IDirect3DRMArray interface + */ +#define INTERFACE IDirect3DRMArray +DECLARE_INTERFACE_(IDirect3DRMArray, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMArray methods ***/ + STDMETHOD_(DWORD, GetSize)(THIS) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMArray_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMArray_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMArray_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMArray_GetSize(p) (p)->lpVtbl->GetSize(p) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMArray_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMArray_AddRef(p) (p)->AddRef() +#define IDirect3DRMArray_Release(p) (p)->Release() +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMArray_GetSize(p) (p)->GetSize() +#endif + +/***************************************************************************** + * IDirect3DRMObjectArray interface + */ +#define INTERFACE IDirect3DRMObjectArray +DECLARE_INTERFACE_(IDirect3DRMObjectArray, IDirect3DRMArray) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMArray methods ***/ + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + /*** IDirect3DRMObjectArray methods ***/ + STDMETHOD(GetElement)(THIS_ DWORD index, IDirect3DRMObject **element) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMObjectArray_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMObjectArray_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMObjectArray_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMObjectArray_GetSize(p) (p)->lpVtbl->GetSize(p) +/*** IDirect3DRMObjectArray methods ***/ +#define IDirect3DRMObjectArray_GetElement(p,a,b) (p)->lpVtbl->GetElement(p,a,b) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMObjectArray_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMObjectArray_AddRef(p) (p)->AddRef() +#define IDirect3DRMObjectArray_Release(p) (p)->Release() +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMObjectArray_GetSize(p) (p)->GetSize() +/*** IDirect3DRMObjectArray methods ***/ +#define IDirect3DRMObjectArray_GetElement(p,a,b) (p)->GetElement(a,b) +#endif + +/***************************************************************************** + * IDirect3DRMDeviceArray interface + */ +#define INTERFACE IDirect3DRMDeviceArray +DECLARE_INTERFACE_(IDirect3DRMDeviceArray, IDirect3DRMArray) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMArray methods ***/ + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + /*** IDirect3DRMDeviceArray methods ***/ + STDMETHOD(GetElement)(THIS_ DWORD index, IDirect3DRMDevice **element) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMDeviceArray_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMDeviceArray_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMDeviceArray_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMDeviceArray_GetSize(p) (p)->lpVtbl->GetSize(p) +/*** IDirect3DRMDeviceArray methods ***/ +#define IDirect3DRMDeviceArray_GetElement(p,a,b) (p)->lpVtbl->GetElement(p,a,b) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMDeviceArray_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMDeviceArray_AddRef(p) (p)->AddRef() +#define IDirect3DRMDeviceArray_Release(p) (p)->Release() +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMDeviceArray_GetSize(p) (p)->GetSize() +/*** IDirect3DRMDeviceArray methods ***/ +#define IDirect3DRMDeviceArray_GetElement(p,a,b) (p)->GetElement(a,b) +#endif + +/***************************************************************************** + * IDirect3DRMFrameArray interface + */ +#define INTERFACE IDirect3DRMFrameArray +DECLARE_INTERFACE_(IDirect3DRMFrameArray, IDirect3DRMArray) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMArray methods ***/ + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + /*** IDirect3DRMFrameArray methods ***/ + STDMETHOD(GetElement)(THIS_ DWORD index, IDirect3DRMFrame **element) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMFrameArray_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMFrameArray_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMFrameArray_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMFrameArray_GetSize(p) (p)->lpVtbl->GetSize(p) +/*** IDirect3DRMFrameArray methods ***/ +#define IDirect3DRMFrameArray_GetElement(p,a,b) (p)->lpVtbl->GetElement(p,a,b) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMFrameArray_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMFrameArray_AddRef(p) (p)->AddRef() +#define IDirect3DRMFrameArray_Release(p) (p)->Release() +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMFrameArray_GetSize(p) (p)->GetSize() +/*** IDirect3DRMFrameArray methods ***/ +#define IDirect3DRMFrameArray_GetElement(p,a,b) (p)->GetElement(a,b) +#endif + +/***************************************************************************** + * IDirect3DRMViewportArray interface + */ +#define INTERFACE IDirect3DRMViewportArray +DECLARE_INTERFACE_(IDirect3DRMViewportArray, IDirect3DRMArray) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMArray methods ***/ + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + /*** IDirect3DRMViewportArray methods ***/ + STDMETHOD(GetElement)(THIS_ DWORD index, IDirect3DRMViewport **element) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMViewportArray_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMViewportArray_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMViewportArray_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMViewportArray_GetSize(p) (p)->lpVtbl->GetSize(p) +/*** IDirect3DRMViewportArray methods ***/ +#define IDirect3DRMViewportArray_GetElement(p,a,b) (p)->lpVtbl->GetElement(p,a,b) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMViewportArray_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMViewportArray_AddRef(p) (p)->AddRef() +#define IDirect3DRMViewportArray_Release(p) (p)->Release() +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMViewportArray_GetSize(p) (p)->GetSize() +/*** IDirect3DRMViewportArray methods ***/ +#define IDirect3DRMviewportArray_GetElement(p,a,b) (p)->GetElement(a,b) +#endif + +/***************************************************************************** + * IDirect3DRMVisualArray interface + */ +#define INTERFACE IDirect3DRMVisualArray +DECLARE_INTERFACE_(IDirect3DRMVisualArray, IDirect3DRMArray) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMArray methods ***/ + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + /*** IDirect3DRMVisualArray methods ***/ + STDMETHOD(GetElement)(THIS_ DWORD index, IDirect3DRMVisual **element) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMVisualArray_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMVisualArray_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMVisualArray_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMVisualArray_GetSize(p) (p)->lpVtbl->GetSize(p) +/*** IDirect3DRMVisualArray methods ***/ +#define IDirect3DRMVisualArray_GetElement(p,a,b) (p)->lpVtbl->GetElement(p,a,b) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMVisualArray_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMVisualArray_AddRef(p) (p)->AddRef() +#define IDirect3DRMVisualArray_Release(p) (p)->Release() +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMVisualArray_GetSize(p) (p)->GetSize() +/*** IDirect3DRMVisualArray methods ***/ +#define IDirect3DRMVisualArray_GetElement(p,a,b) (p)->GetElement(a,b) +#endif + +/***************************************************************************** + * IDirect3DRMAnimationArray interface + */ +#define INTERFACE IDirect3DRMAnimationArray +DECLARE_INTERFACE_(IDirect3DRMAnimationArray, IDirect3DRMArray) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMArray methods ***/ + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + /*** IDirect3DRMAnimationArray methods ***/ + STDMETHOD(GetElement)(THIS_ DWORD index, IDirect3DRMAnimation2 **element) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMAnimationArray_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMAnimationArray_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMAnimationArray_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMAnimationArray_GetSize(p) (p)->lpVtbl->GetSize(p) +/*** IDirect3DRMAnimationArray methods ***/ +#define IDirect3DRMAnimationArray_GetElement(p,a,b) (p)->lpVtbl->GetElement(p,a,b) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMAnimationArray_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMAnimationArray_AddRef(p) (p)->AddRef() +#define IDirect3DRMAnimationArray_Release(p) (p)->Release() +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMAnimationArray_GetSize(p) (p)->GetSize() +/*** IDirect3DRMAnimationArray methods ***/ +#define IDirect3DRMAnimationArray_GetElement(p,a,b) (p)->GetElement(a,b) +#endif + +/***************************************************************************** + * IDirect3DRMPickedArray interface + */ +#define INTERFACE IDirect3DRMPickedArray +DECLARE_INTERFACE_(IDirect3DRMPickedArray, IDirect3DRMArray) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMArray methods ***/ + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + /*** IDirect3DRMPickedArray methods ***/ + STDMETHOD(GetPick)(THIS_ DWORD index, IDirect3DRMVisual **visual, + IDirect3DRMFrameArray **frame_array, D3DRMPICKDESC *pick_desc) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMPickedArray_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMPickedArray_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMPickedArray_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMPickedArray_GetSize(p) (p)->lpVtbl->GetSize(p) +/*** IDirect3DRMPickedArray methods ***/ +#define IDirect3DRMPickedArray_GetPick(p,a,b,c,d) (p)->lpVtbl->GetPick(p,a,b,c,d) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMPickedArray_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMPickedArray_AddRef(p) (p)->AddRef() +#define IDirect3DRMPickedArray_Release(p) (p)->Release() +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMPickedArray_GetSize(p) (p)->GetSize() +/*** IDirect3DRMPickedArray methods ***/ +#define IDirect3DRMPickedArray_GetPick(p,a,b,c,d) (p)->GetPick(a,b,c,d) +#endif + +/***************************************************************************** + * IDirect3DRMLightArray interface + */ +#define INTERFACE IDirect3DRMLightArray +DECLARE_INTERFACE_(IDirect3DRMLightArray, IDirect3DRMArray) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMArray methods ***/ + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + /*** IDirect3DRMLightArray methods ***/ + STDMETHOD(GetElement)(THIS_ DWORD index, IDirect3DRMLight **element) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMLightArray_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMLightArray_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMLightArray_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMLightArray_GetSize(p) (p)->lpVtbl->GetSize(p) +/*** IDirect3DRMLightArray methods ***/ +#define IDirect3DRMLightArray_GetElement(p,a,b) (p)->lpVtbl->GetElement(p,a,b) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMLightArray_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMLightArray_AddRef(p) (p)->AddRef() +#define IDirect3DRMLightArray_Release(p) (p)->Release() +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMLightArray_GetSize(p) (p)->GetSize() +/*** IDirect3DRMLightArray methods ***/ +#define IDirect3DRMLightArray_GetElement(p,a,b) (p)->GetElement(a,b) +#endif + +/***************************************************************************** + * IDirect3DRMFaceArray interface + */ +#define INTERFACE IDirect3DRMFaceArray +DECLARE_INTERFACE_(IDirect3DRMFaceArray, IDirect3DRMArray) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMArray methods ***/ + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + /*** IDirect3DRMFaceArray methods ***/ + STDMETHOD(GetElement)(THIS_ DWORD index, IDirect3DRMFace **element) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMFaceArray_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMFaceArray_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMFaceArray_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMFaceArray_GetSize(p) (p)->lpVtbl->GetSize(p) +/*** IDirect3DRMFaceArray methods ***/ +#define IDirect3DRMFaceArray_GetElement(p,a,b) (p)->lpVtbl->GetElement(p,a,b) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMFaceArray_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMFaceArray_AddRef(p) (p)->AddRef() +#define IDirect3DRMFaceArray_Release(p) (p)->Release() +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMFaceArray_GetSize(p) (p)->GetSize() +/*** IDirect3DRMFaceArray methods ***/ +#define IDirect3DRMFaceArray_GetElement(p,a,b) (p)->GetElement(a,b) +#endif + +/***************************************************************************** + * IDirect3DRMPicked2Array interface + */ +#define INTERFACE IDirect3DRMPicked2Array +DECLARE_INTERFACE_(IDirect3DRMPicked2Array, IDirect3DRMArray) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMArray methods ***/ + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + /*** IDirect3DRMPicked2Array methods ***/ + STDMETHOD(GetPick)(THIS_ DWORD index, IDirect3DRMVisual **visual, + IDirect3DRMFrameArray **frame_array, D3DRMPICKDESC2 *pick_desc) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMPicked2Array_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMPicked2Array_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMPicked2Array_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMPicked2Array_GetSize(p) (p)->lpVtbl->GetSize(p) +/*** IDirect3DRMPicked2Array methods ***/ +#define IDirect3DRMPicked2Array_GetPick(p,a,b,c,d) (p)->lpVtbl->GetPick(p,a,b,c,d) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMPicked2Array_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMPicked2Array_AddRef(p) (p)->AddRef() +#define IDirect3DRMPicked2Array_Release(p) (p)->Release() +/*** IDirect3DRMArray methods ***/ +#define IDirect3DRMPicked2Array_GetSize(p) (p)->GetSize() +/*** IDirect3DRMPicked2Array methods ***/ +#define IDirect3DRMPicked2Array_GetPick(p,a,b,c,d) (p)->GetPick(a,b,c,d) +#endif + +/***************************************************************************** + * IDirect3DRMInterpolator interface + */ +#define INTERFACE IDirect3DRMInterpolator +DECLARE_INTERFACE_(IDirect3DRMInterpolator, IDirect3DRMObject) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMInterpolator methods ***/ + STDMETHOD(AttachObject)(THIS_ IDirect3DRMObject *object) PURE; + STDMETHOD(GetAttachedObjects)(THIS_ IDirect3DRMObjectArray **array) PURE; + STDMETHOD(DetachObject)(THIS_ IDirect3DRMObject *object) PURE; + STDMETHOD(SetIndex)(THIS_ D3DVALUE) PURE; + STDMETHOD_(D3DVALUE, GetIndex)(THIS) PURE; + STDMETHOD(Interpolate)(THIS_ D3DVALUE index, IDirect3DRMObject *object, D3DRMINTERPOLATIONOPTIONS flags) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMInterpolator_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMInterpolator_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMInterpolator_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMInterpolator_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMInterpolator_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMInterpolator_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMInterpolator_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMInterpolator_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMInterpolator_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMInterpolator_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMInterpolator_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMInterpolator methods ***/ +#define IDirect3DRMInterpolator_AttachObject(p,a) (p)->lpVtbl->AttachObject(p,a) +#define IDirect3DRMInterpolator_GetAttachedObjects(p,a) (p)->lpVtbl->GetAttachedObjects(p,a) +#define IDirect3DRMInterpolator_DetachObject(p,a) (p)->lpVtbl->DetachObject(p,a) +#define IDirect3DRMInterpolator_SetIndex(p,a) (p)->lpVtbl->SetIndex(p,a) +#define IDirect3DRMInterpolator_GetIndex(p) (p)->lpVtbl->GetIndex(p) +#define IDirect3DRMInterpolator_Interpolate(p,a,b,c) (p)->lpVtbl->Interpolate(p,a,b,c) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMInterpolator_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMInterpolator_AddRef(p) (p)->AddRef() +#define IDirect3DRMInterpolator_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMInterpolator_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMInterpolator_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMInterpolator_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMInterpolator_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMInterpolator_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMInterpolator_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMInterpolator_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMInterpolator_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMInterpolator methods ***/ +#define IDirect3DRMInterpolator_AttachObject(p,a) (p)->AttachObject(a) +#define IDirect3DRMInterpolator_GetAttachedObjects(p,a) (p)->GetAttachedObjects(a) +#define IDirect3DRMInterpolator_DetachObject(p,a) (p)->DetachObject(a) +#define IDirect3DRMInterpolator_SetIndex(p,a) (p)->SetIndex(a) +#define IDirect3DRMInterpolator_GetIndex(p) (p)->GetIndex() +#define IDirect3DRMInterpolator_Interpolate(p,a,b,c) (p)->Interpolate(a,b,c) +#endif + +/***************************************************************************** + * IDirect3DRMClippedVisual interface + */ +#define INTERFACE IDirect3DRMClippedVisual +DECLARE_INTERFACE_(IDirect3DRMClippedVisual, IDirect3DRMVisual) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMClippedVisual methods ***/ + STDMETHOD(Init) (THIS_ IDirect3DRMVisual *visual) PURE; + STDMETHOD(AddPlane) (THIS_ IDirect3DRMFrame3 *reference, D3DVECTOR *point, + D3DVECTOR *normal, DWORD flags, DWORD *id) PURE; + STDMETHOD(DeletePlane)(THIS_ DWORD, DWORD) PURE; + STDMETHOD(GetPlaneIDs)(THIS_ DWORD *count, DWORD *id, DWORD flags) PURE; + STDMETHOD(GetPlane) (THIS_ DWORD id, IDirect3DRMFrame3 *reference, D3DVECTOR *point, + D3DVECTOR *normal, DWORD flags) PURE; + STDMETHOD(SetPlane) (THIS_ DWORD id, IDirect3DRMFrame3 *reference, D3DVECTOR *point, + D3DVECTOR *normal, DWORD flags) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMClippedVisual_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMClippedVisual_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMClippedVisual_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMClippedVisual_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMClippedVisual_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMClippedVisual_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMClippedVisual_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMClippedVisual_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMClippedVisual_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMClippedVisual_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMClippedVisual_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMClippedVisual methods ***/ +#define IDirect3DRMClippedVisual_Init(p,a) (p)->lpVtbl->Init(p,a) +#define IDirect3DRMClippedVisual_AddPlane(p,a,b,c,d,e) (p)->lpVtbl->AddPlane(p,a,b,c,d,e) +#define IDirect3DRMClippedVisual_DeletePlane(p,a,b) (p)->lpVtbl->DeletePlane(p,a,b) +#define IDirect3DRMClippedVisual_GetPlaneIDs(p,a,b,c) (p)->lpVtbl->GetPlaneIDs(p,a,b,c) +#define IDirect3DRMClippedVisual_GetPlane(p,a,b,c,d,e) (p)->lpVtbl->GetPlane(p,a,b,c,d,e) +#define IDirect3DRMClippedVisual_SetPlane(p,a,b,c,d,e) (p)->lpVtbl->SetPlane(p,a,b,c,d,e) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMClippedVisual_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMClippedVisual_AddRef(p) (p)->AddRef() +#define IDirect3DRMClippedVisual_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMClippedVisual_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMClippedVisual_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMClippedVisual_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMClippedVisual_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMClippedVisual_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMClippedVisual_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMClippedVisual_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMClippedVisual_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMClippedVisual methods ***/ +#define IDirect3DRMClippedVisual_Init(p,a) (p)->Init(a) +#define IDirect3DRMClippedVisual_AddPlane(p,a,b,c,d,e) (p)->AddPlane(a,b,c,d,e) +#define IDirect3DRMClippedVisual_DeletePlane(p,a,b) (p)->DeletePlane(a,b) +#define IDirect3DRMClippedVisual_GetPlaneIDs(p,a,b,c) (p)->GetPlaneIDs(a,b,c) +#define IDirect3DRMClippedVisual_GetPlane(p,a,b,c,d,e) (p)->GetPlane(a,b,c,d,e) +#define IDirect3DRMClippedVisual_SetPlane(p,a,b,c,d,e) (p)->SetPlane(a,b,c,d,e) +#endif + +#ifdef __cplusplus +}; +#endif + +#endif /* __D3DRMOBJ_H__ */ diff --git a/include/psdk/d3drmwin.h b/include/psdk/d3drmwin.h new file mode 100644 index 00000000000..bd3a40d8d09 --- /dev/null +++ b/include/psdk/d3drmwin.h @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2010 Vijay Kiran Kamuju + * + * 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 + */ + +#ifndef __D3DRMWIN_H__ +#define __D3DRMWIN_H__ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/***************************************************************************** + * Direct3DRMWinDevice interface GUID + */ + +DEFINE_GUID(IID_IDirect3DRMWinDevice, 0xc5016cc0, 0xd273, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1); + +typedef struct IDirect3DRMWinDevice *LPDIRECT3DRMWINDEVICE, **LPLPDIRECT3DRMWINDEVICE; + +/***************************************************************************** + * IDirect3DRMWinDevice interface + */ +#define INTERFACE IDirect3DRMWinDevice +DECLARE_INTERFACE_(IDirect3DRMWinDevice,IDirect3DRMObject) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DRMObject methods ***/ + STDMETHOD(Clone)(THIS_ IUnknown *outer, REFIID iid, void **out) PURE; + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK cb, void *ctx) PURE; + STDMETHOD(SetAppData)(THIS_ DWORD data) PURE; + STDMETHOD_(DWORD, GetAppData)(THIS) PURE; + STDMETHOD(SetName)(THIS_ const char *name) PURE; + STDMETHOD(GetName)(THIS_ DWORD *size, char *name) PURE; + STDMETHOD(GetClassName)(THIS_ DWORD *size, char *name) PURE; + /*** IDirect3DRMWinDevice methods ***/ + STDMETHOD(HandlePaint)(THIS_ HDC) PURE; + STDMETHOD(HandleActivate)(THIS_ WORD) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DRMWinDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DRMWinDevice_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DRMWinDevice_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMWinDevice_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirect3DRMWinDevice_AddDestroyCallback(p,a,b) (p)->lpVtbl->AddDestroyCallback(p,a,b) +#define IDirect3DRMWinDevice_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b) +#define IDirect3DRMWinDevice_SetAppData(p,a) (p)->lpVtbl->SetAppData(p,a) +#define IDirect3DRMWinDevice_GetAppData(p) (p)->lpVtbl->GetAppData(p) +#define IDirect3DRMWinDevice_SetName(p,a) (p)->lpVtbl->SetName(p,a) +#define IDirect3DRMWinDevice_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b) +#define IDirect3DRMWinDevice_GetClassName(p,a,b) (p)->lpVtbl->GetClassName(p,a,b) +/*** IDirect3DRMWinDevice methods ***/ +#define IDirect3DRMWinDevice_HandlePaint(p,a) (p)->lpVtbl->HandlePaint(p,a) +#define IDirect3DRMWinDevice_HandleActivate(p,a) (p)->lpVtbl->HandleActivate(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DRMWinDevice_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DRMWinDevice_AddRef(p) (p)->AddRef() +#define IDirect3DRMwinDevice_Release(p) (p)->Release() +/*** IDirect3DRMObject methods ***/ +#define IDirect3DRMWinDevice_Clone(p,a,b,c) (p)->Clone(a,b,c) +#define IDirect3DRMWinDevice_AddDestroyCallback(p,a,b) (p)->AddDestroyCallback(a,b) +#define IDirect3DRMWinDevice_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b) +#define IDirect3DRMWinDevice_SetAppData(p,a) (p)->SetAppData(a) +#define IDirect3DRMWinDevice_GetAppData(p) (p)->GetAppData() +#define IDirect3DRMWinDevice_SetName(p,a) (p)->SetName(a) +#define IDirect3DRMWinDevice_GetName(p,a,b) (p)->GetName(a,b) +#define IDirect3DRMWinDevice_GetClassName(p,a,b) (p)->GetClassName(a,b) +/*** IDirect3DRMWinDevice methods ***/ +#define IDirect3DRMWinDevice_HandlePaint(p,a) (p)->HandlePaint(a) +#define IDirect3DRMWinDevice_HandleActivate(p,a) (p)->HandleActivate(a) +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __D3DRMWIN_H__ */ diff --git a/include/psdk/ddraw.h b/include/psdk/ddraw.h index a7cf71eaa48..0d0889d9da9 100644 --- a/include/psdk/ddraw.h +++ b/include/psdk/ddraw.h @@ -13,7 +13,10 @@ #endif #define _FACDD 0x876 + +#ifndef MAKE_DDHRESULT #define MAKE_DDHRESULT(c) MAKE_HRESULT(1,_FACDD,c) +#endif #ifndef DIRECTDRAW_VERSION #define DIRECTDRAW_VERSION 0x0700 diff --git a/include/reactos/subsys/lsass/lsass.h b/include/reactos/subsys/lsass/lsass.h index 5a4616dff44..f5c7afc36c9 100644 --- a/include/reactos/subsys/lsass/lsass.h +++ b/include/reactos/subsys/lsass/lsass.h @@ -22,6 +22,7 @@ typedef enum _LSA_API_NUMBER LSASS_REQUEST_LOGON_USER, LSASS_REQUEST_LOOKUP_AUTHENTICATION_PACKAGE, LSASS_REQUEST_ENUM_LOGON_SESSIONS, + LSASS_REQUEST_GET_LOGON_SESSION_DATA, LSASS_REQUEST_MAXIMUM } LSA_API_NUMBER, *PLSA_API_NUMBER; @@ -129,13 +130,28 @@ typedef struct _LSA_ENUM_LOGON_SESSIONS_MSG struct { ULONG LogonSessionCount; - ULONG LogonSessionBufferLength; PVOID LogonSessionBuffer; } Reply; }; } LSA_ENUM_LOGON_SESSIONS_MSG, *PLSA_ENUM_LOGON_SESSIONS_MSG; +typedef struct _LSA_GET_LOGON_SESSION_DATA_MSG +{ + union + { + struct + { + LUID LogonId; + } Request; + struct + { + PVOID SessionDataBuffer; + } Reply; + }; +} LSA_GET_LOGON_SESSION_DATA_MSG, *PLSA_GET_LOGON_SESSION_DATA_MSG; + + typedef struct _LSA_API_MSG { PORT_MESSAGE h; @@ -153,6 +169,7 @@ typedef struct _LSA_API_MSG LSA_DEREGISTER_LOGON_PROCESS_MSG DeregisterLogonProcess; LSA_LOOKUP_AUTHENTICATION_PACKAGE_MSG LookupAuthenticationPackage; LSA_ENUM_LOGON_SESSIONS_MSG EnumLogonSessions; + LSA_GET_LOGON_SESSION_DATA_MSG GetLogonSessionData; }; }; }; diff --git a/lib/fast486/common.c b/lib/fast486/common.c index 4babb2d366b..2105457204c 100644 --- a/lib/fast486/common.c +++ b/lib/fast486/common.c @@ -317,6 +317,10 @@ Fast486ExceptionWithErrorCode(PFAST486_STATE State, /* Check if this is a triple fault */ if (State->ExceptionCount == 3) { + DPRINT("Fast486ExceptionWithErrorCode(%04X:%08X) -- Triple fault\n", + State->SegmentRegs[FAST486_REG_CS].Selector, + State->InstPtr.Long); + /* Reset the CPU */ Fast486Reset(State); return; diff --git a/lib/fast486/fast486.c b/lib/fast486/fast486.c index ffbe5aec25d..ce80a8c7f41 100644 --- a/lib/fast486/fast486.c +++ b/lib/fast486/fast486.c @@ -346,7 +346,7 @@ Fast486DumpState(PFAST486_STATE State) State->SegmentRegs[FAST486_REG_GS].Base, State->SegmentRegs[FAST486_REG_GS].Limit, State->SegmentRegs[FAST486_REG_GS].Dpl); - DbgPrint("\nFlags: %08X (%s %s %s %s %s %s %s %s %s %s %s %s) Iopl: %u\n", + DbgPrint("\nFlags: %08X (%s %s %s %s %s %s %s %s %s %s %s %s %s) Iopl: %u\n", State->Flags.Long, State->Flags.Cf ? "CF" : "cf", State->Flags.Pf ? "PF" : "pf", @@ -360,6 +360,7 @@ Fast486DumpState(PFAST486_STATE State) State->Flags.Nt ? "NT" : "nt", State->Flags.Rf ? "RF" : "rf", State->Flags.Vm ? "VM" : "vm", + State->Flags.Ac ? "AC" : "ac", State->Flags.Iopl); DbgPrint("\nControl Registers:\n" "CR0 = %08X\tCR2 = %08X\tCR3 = %08X\n", diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 187b1fb08f8..0eb34450c99 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -31,6 +31,7 @@ reactos/dll/directx/wine/amstream # Synced to Wine-1.7.27 reactos/dll/directx/wine/d3d8 # Synced to Wine-1.7.27 reactos/dll/directx/wine/d3d9 # Synced to Wine-1.7.27 reactos/dll/directx/wine/d3dcompiler_43 # Synced to Wine-1.7.27 +reactos/dll/directx/wine/d3drm # Synced to Wine-1.7.27 reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to Wine-1.7.27 reactos/dll/directx/wine/d3dxof # Synced to Wine-1.7.27 reactos/dll/directx/wine/ddraw # Synced to Wine-1.7.27 @@ -40,7 +41,7 @@ reactos/dll/directx/wine/dinput8 # Synced to Wine-1.7.27 reactos/dll/directx/wine/dmusic # Synced to Wine-1.7.27 reactos/dll/directx/wine/dplay # Synced to Wine-1.7.27 reactos/dll/directx/wine/dplayx # Synced to Wine-1.7.27 -reactos/dll/directx/wine/dsound # Synced to Wine-1.5.26 +reactos/dll/directx/wine/dsound # Synced to Wine-1.3.29 reactos/dll/directx/wine/dxdiagn # Synced to Wine-1.7.27 reactos/dll/directx/wine/dxgi # Synced to Wine-1.7.27 reactos/dll/directx/wine/msdmo # Synced to Wine-1.7.27 @@ -97,7 +98,7 @@ reactos/dll/win32/jscript # Synced to Wine-1.7.27 reactos/dll/win32/jsproxy # Synced to Wine-1.7.27 reactos/dll/win32/loadperf # Synced to Wine-1.7.17 reactos/dll/win32/localspl # Synced to Wine-1.7.17 -reactos/dll/win32/localui # Synced to Wine-1.7.17 +reactos/dll/win32/localui # Synced to Wine-1.7.27 reactos/dll/win32/lz32 # Synced to Wine-1.7.17 reactos/dll/win32/mapi32 # Synced to Wine-1.7.17 reactos/dll/win32/mciavi32 # Synced to Wine-1.7.17 @@ -105,9 +106,10 @@ reactos/dll/win32/mcicda # Synced to Wine-1.7.17 reactos/dll/win32/mciqtz32 # Synced to Wine-1.7.17 reactos/dll/win32/mciseq # Synced to Wine-1.7.17 reactos/dll/win32/mciwave # Synced to Wine-1.7.17 +reactos/dll/win32/mgmtapi # Synced to Wine-1.7.27 reactos/dll/win32/mlang # Synced to Wine-1.7.17 -reactos/dll/win32/mmdevapi # Synced to Wine-1.7.1 -reactos/dll/win32/mpr # Synced to Wine-1.7.17 +reactos/dll/win32/mmdevapi # Synced to Wine-1.7.27 +reactos/dll/win32/mpr # Synced to Wine-1.7.27 reactos/dll/win32/mprapi # Synced to Wine-1.7.17 reactos/dll/win32/msacm32 # Synced to Wine-1.7.17 reactos/dll/win32/msacm32/msacm32.drv # Synced to Wine-1.7.17 diff --git a/ntoskrnl/config/cmapi.c b/ntoskrnl/config/cmapi.c index 467afd5466f..e3b18049ff5 100644 --- a/ntoskrnl/config/cmapi.c +++ b/ntoskrnl/config/cmapi.c @@ -1514,13 +1514,103 @@ CmpQueryFlagsInformation( return STATUS_SUCCESS; } +static +NTSTATUS +CmpQueryNameInformation( + _In_ PCM_KEY_CONTROL_BLOCK Kcb, + _Out_opt_ PKEY_NAME_INFORMATION KeyNameInfo, + _In_ ULONG Length, + _Out_ PULONG ResultLength) +{ + ULONG NeededLength; + PCM_KEY_CONTROL_BLOCK CurrentKcb; + + NeededLength = 0; + CurrentKcb = Kcb; + + /* Count the needed buffer size */ + while (CurrentKcb) + { + if (CurrentKcb->NameBlock->Compressed) + NeededLength += CmpCompressedNameSize(CurrentKcb->NameBlock->Name, CurrentKcb->NameBlock->NameLength); + else + NeededLength += CurrentKcb->NameBlock->NameLength; + + NeededLength += sizeof(OBJ_NAME_PATH_SEPARATOR); + + CurrentKcb = CurrentKcb->ParentKcb; + } + + _SEH2_TRY + { + *ResultLength = NeededLength + FIELD_OFFSET(KEY_NAME_INFORMATION, Name[0]); + if (Length < *ResultLength) + return STATUS_BUFFER_TOO_SMALL; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + return _SEH2_GetExceptionCode(); + } + _SEH2_END; + + /* Do the real copy */ + KeyNameInfo->NameLength = 0; + CurrentKcb = Kcb; + while (CurrentKcb) + { + ULONG NameLength; + + _SEH2_TRY + { + if (CurrentKcb->NameBlock->Compressed) + { + NameLength = CmpCompressedNameSize(CurrentKcb->NameBlock->Name, CurrentKcb->NameBlock->NameLength); + /* Copy the compressed name */ + CmpCopyCompressedName(&KeyNameInfo->Name[(NeededLength - NameLength)/sizeof(WCHAR)], + NameLength, + CurrentKcb->NameBlock->Name, + CurrentKcb->NameBlock->NameLength); + } + else + { + NameLength = CurrentKcb->NameBlock->NameLength; + /* Otherwise, copy the raw name */ + RtlCopyMemory(&KeyNameInfo->Name[(NeededLength - NameLength)/sizeof(WCHAR)], + CurrentKcb->NameBlock->Name, + NameLength); + } + + NeededLength -= NameLength; + NeededLength -= sizeof(OBJ_NAME_PATH_SEPARATOR); + /* Add path separator */ + KeyNameInfo->Name[NeededLength/sizeof(WCHAR)] = OBJ_NAME_PATH_SEPARATOR; + KeyNameInfo->NameLength += NameLength + sizeof(OBJ_NAME_PATH_SEPARATOR); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + return _SEH2_GetExceptionCode(); + } + _SEH2_END; + + CurrentKcb = CurrentKcb->ParentKcb; + } + + /* Make sure we copied everything */ + ASSERT(NeededLength == 0); + ASSERT(KeyNameInfo->Name[0] == OBJ_NAME_PATH_SEPARATOR); + + /* We're done */ + return STATUS_SUCCESS; +} + + NTSTATUS NTAPI -CmQueryKey(IN PCM_KEY_CONTROL_BLOCK Kcb, - IN KEY_INFORMATION_CLASS KeyInformationClass, - IN PVOID KeyInformation, - IN ULONG Length, - IN PULONG ResultLength) +CmQueryKey(_In_ PCM_KEY_CONTROL_BLOCK Kcb, + _In_ KEY_INFORMATION_CLASS KeyInformationClass, + _Out_opt_ PVOID KeyInformation, + _In_ ULONG Length, + _Out_ PULONG ResultLength) { NTSTATUS Status; PHHIVE Hive; @@ -1588,12 +1678,12 @@ CmQueryKey(IN PCM_KEY_CONTROL_BLOCK Kcb, ResultLength); break; - /* Unsupported class for now */ case KeyNameInformation: - - /* Print message and fail */ - DPRINT1("Unsupported class: %d!\n", KeyInformationClass); - Status = STATUS_NOT_IMPLEMENTED; + /* Call the internal API */ + Status = CmpQueryNameInformation(Kcb, + KeyInformation, + Length, + ResultLength); break; /* Illegal classes */ diff --git a/ntoskrnl/fsrtl/name.c b/ntoskrnl/fsrtl/name.c index e833a7a8a11..38ccca4162b 100644 --- a/ntoskrnl/fsrtl/name.c +++ b/ntoskrnl/fsrtl/name.c @@ -130,13 +130,6 @@ FsRtlIsNameInExpressionPrivate(IN PUNICODE_STRING Expression, ExpressionPosition++; } - /* If star is at the end, then eat all rest and leave */ - if (ExpressionPosition == Expression->Length / sizeof(WCHAR)) - { - NamePosition = Name->Length / sizeof(WCHAR); - break; - } - /* Save star position */ StarFound++; if (StarFound >= BackTrackingSize) @@ -150,6 +143,13 @@ FsRtlIsNameInExpressionPrivate(IN PUNICODE_STRING Expression, } BackTracking[StarFound] = ExpressionPosition++; + /* If star is at the end, then eat all rest and leave */ + if (ExpressionPosition == Expression->Length / sizeof(WCHAR)) + { + NamePosition = Name->Length / sizeof(WCHAR); + break; + } + /* Allow null matching */ if (Expression->Buffer[ExpressionPosition] != L'?' && Expression->Buffer[ExpressionPosition] != Name->Buffer[NamePosition]) diff --git a/subsystems/ntvdm/bios/bios32/bios32.c b/subsystems/ntvdm/bios/bios32/bios32.c index b012d90ec20..f6138d92792 100644 --- a/subsystems/ntvdm/bios/bios32/bios32.c +++ b/subsystems/ntvdm/bios/bios32/bios32.c @@ -240,10 +240,22 @@ static VOID WINAPI BiosMiscService(LPWORD Stack) break; } + /* Return Extended-Bios Data-Area Segment Address (PS) */ case 0xC1: + { + // Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; + // setES(???); + + /* We do not support EBDA yet */ + Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; + + break; + } + + /* Pointing Device BIOS Interface (PS) */ case 0xC2: { - DPRINT1("INT 15h, AH = 0x%02X must be implemented in order to support vendor mouse drivers\n"); + DPRINT1("INT 15h, AH = C2h must be implemented in order to support vendor mouse drivers\n"); break; } @@ -499,6 +511,8 @@ static VOID InitializeBiosInt32(VOID) static VOID InitializeBiosInfo(VOID) { + RtlZeroMemory(Bct, sizeof(*Bct)); + Bct->Length = sizeof(*Bct); Bct->Model = BIOS_MODEL; Bct->SubModel = BIOS_SUBMODEL; @@ -527,6 +541,7 @@ static VOID InitializeBiosData(VOID) *(PBYTE)(SEG_OFF_TO_PTR(0xF000, 0xFFFE)) = BIOS_MODEL; /* Initialize the BDA contents */ + RtlZeroMemory(Bda, sizeof(*Bda)); Bda->EquipmentList = BIOS_EQUIPMENT_LIST; /* diff --git a/subsystems/ntvdm/emulator.c b/subsystems/ntvdm/emulator.c index 21a0644b985..06d1e234676 100644 --- a/subsystems/ntvdm/emulator.c +++ b/subsystems/ntvdm/emulator.c @@ -549,8 +549,12 @@ BOOLEAN EmulatorInitialize(HANDLE ConsoleInput, HANDLE ConsoleOutput) wprintf(L"FATAL: Failed to allocate VDM memory.\n"); return FALSE; } - // For diagnostics purposes!! - FillMemory(BaseAddress, MAX_ADDRESS, 0xFF); + /* + * For diagnostics purposes, we fill the memory with INT 0x03 codes + * so that if a program wants to execute random code in memory, we can + * retrieve the exact CS:IP where the problem happens. + */ + RtlFillMemory(BaseAddress, MAX_ADDRESS, 0xCC); /* Initialize I/O ports */ /* Initialize RAM */ diff --git a/win32ss/user/winsrv/consrv.cmake b/win32ss/user/winsrv/consrv.cmake index a60a546d356..c78700d958b 100644 --- a/win32ss/user/winsrv/consrv.cmake +++ b/win32ss/user/winsrv/consrv.cmake @@ -50,6 +50,7 @@ else() endif() add_library(consrv ${CONSRV_SOURCE}) +add_dependencies(consrv psdk) add_pch(consrv consrv/consrv.h CONSRV_SOURCE) #add_object_library(consrv ${CONSRV_SOURCE})