mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[D3DRM]
* Import from Wine 1.7.27. CORE-8082 #resolve #comment Imported in r64396. Thanks! CORE-8540 svn path=/trunk/; revision=64398
This commit is contained in:
parent
2b79e54427
commit
a9daa53a6c
17 changed files with 10879 additions and 0 deletions
|
@ -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)
|
||||
|
|
35
reactos/dll/directx/wine/d3drm/CMakeLists.txt
Normal file
35
reactos/dll/directx/wine/d3drm/CMakeLists.txt
Normal file
|
@ -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)
|
1489
reactos/dll/directx/wine/d3drm/d3drm.c
Normal file
1489
reactos/dll/directx/wine/d3drm/d3drm.c
Normal file
File diff suppressed because it is too large
Load diff
23
reactos/dll/directx/wine/d3drm/d3drm.spec
Normal file
23
reactos/dll/directx/wine/d3drm/d3drm.spec
Normal file
|
@ -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
|
36
reactos/dll/directx/wine/d3drm/d3drm_main.c
Normal file
36
reactos/dll/directx/wine/d3drm/d3drm_main.c
Normal file
|
@ -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;
|
||||
}
|
63
reactos/dll/directx/wine/d3drm/d3drm_private.h
Normal file
63
reactos/dll/directx/wine/d3drm/d3drm_private.h
Normal file
|
@ -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 <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <wingdi.h>
|
||||
#include <d3drm.h>
|
||||
#include <dxfile.h>
|
||||
#include <rmxfguid.h>
|
||||
|
||||
#include <wine/debug.h>
|
||||
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__ */
|
984
reactos/dll/directx/wine/d3drm/device.c
Normal file
984
reactos/dll/directx/wine/d3drm/device.c
Normal file
|
@ -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 <d3drmwin.h>
|
||||
|
||||
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;
|
||||
}
|
606
reactos/dll/directx/wine/d3drm/face.c
Normal file
606
reactos/dll/directx/wine/d3drm/face.c
Normal file
|
@ -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;
|
||||
}
|
2297
reactos/dll/directx/wine/d3drm/frame.c
Normal file
2297
reactos/dll/directx/wine/d3drm/frame.c
Normal file
File diff suppressed because it is too large
Load diff
383
reactos/dll/directx/wine/d3drm/light.c
Normal file
383
reactos/dll/directx/wine/d3drm/light.c
Normal file
|
@ -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;
|
||||
}
|
298
reactos/dll/directx/wine/d3drm/material.c
Normal file
298
reactos/dll/directx/wine/d3drm/material.c
Normal file
|
@ -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;
|
||||
}
|
274
reactos/dll/directx/wine/d3drm/math.c
Normal file
274
reactos/dll/directx/wine/d3drm/math.c
Normal file
|
@ -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 <math.h>
|
||||
|
||||
/* 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;
|
||||
}
|
2810
reactos/dll/directx/wine/d3drm/meshbuilder.c
Normal file
2810
reactos/dll/directx/wine/d3drm/meshbuilder.c
Normal file
File diff suppressed because it is too large
Load diff
729
reactos/dll/directx/wine/d3drm/texture.c
Normal file
729
reactos/dll/directx/wine/d3drm/texture.c
Normal file
|
@ -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;
|
||||
}
|
26
reactos/dll/directx/wine/d3drm/version.rc
Normal file
26
reactos/dll/directx/wine/d3drm/version.rc
Normal file
|
@ -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"
|
824
reactos/dll/directx/wine/d3drm/viewport.c
Normal file
824
reactos/dll/directx/wine/d3drm/viewport.c
Normal file
|
@ -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;
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue