mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-21 07:11:16 +00:00
Merge branch 'isledecomp:master' into mxbitmap-vtable
This commit is contained in:
commit
3729b879d3
28
.github/workflows/build.yml
vendored
28
.github/workflows/build.yml
vendored
@ -14,34 +14,6 @@ jobs:
|
||||
repository: 'itsmattkc/msvc420'
|
||||
path: msvc420
|
||||
|
||||
- name: Restore cached DX5 SDK
|
||||
id: cache-dx5
|
||||
uses: actions/cache/restore@v3
|
||||
with:
|
||||
path: dx5sdk
|
||||
key: dx5sdk
|
||||
|
||||
- name: Download DX5 SDK
|
||||
if: ${{ !steps.cache-dx5.outputs.cache-hit }}
|
||||
run: |
|
||||
cd dx5sdk
|
||||
curl -fLOSs https://archive.org/download/idx5sdk/idx5sdk.exe
|
||||
7z x .\idx5sdk.exe
|
||||
7z x .\DX5SDK.EXE
|
||||
|
||||
- name: Cache DX5 SDK
|
||||
if: ${{ !steps.cache-dx5.outputs.cache-hit }}
|
||||
uses: actions/cache/save@v3
|
||||
with:
|
||||
path: dx5sdk
|
||||
key: dx5sdk
|
||||
|
||||
- name: Setup DX5 SDK
|
||||
run: |
|
||||
cd dx5sdk
|
||||
cd cdrom
|
||||
.\SETUP.EXE /s
|
||||
|
||||
- name: Setup cmake
|
||||
uses: jwlawson/actions-setup-cmake@v1.13
|
||||
with:
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,7 @@
|
||||
Debug/
|
||||
Release/
|
||||
*.ncb
|
||||
/.vs
|
||||
ISLE.EXE
|
||||
LEGO1.DLL
|
||||
build/
|
||||
|
||||
896
3rdparty/dx5/inc/d3d.h
vendored
Normal file
896
3rdparty/dx5/inc/d3d.h
vendored
Normal file
@ -0,0 +1,896 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: d3d.h
|
||||
* Content: Direct3D include file
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _D3D_H_
|
||||
#define _D3D_H_
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <objbase.h>
|
||||
#else
|
||||
#include "d3dcom.h"
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define D3DAPI WINAPI
|
||||
#else
|
||||
#define D3DAPI
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Interface IID's
|
||||
*/
|
||||
#if defined( _WIN32 ) && !defined( _NO_COM)
|
||||
DEFINE_GUID( IID_IDirect3D, 0x3BBA0080,0x2421,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
|
||||
DEFINE_GUID( IID_IDirect3D2, 0x6aae1ec1,0x662a,0x11d0,0x88,0x9d,0x00,0xaa,0x00,0xbb,0xb7,0x6a);
|
||||
|
||||
DEFINE_GUID( IID_IDirect3DRampDevice, 0xF2086B20,0x259F,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
|
||||
DEFINE_GUID( IID_IDirect3DRGBDevice, 0xA4665C60,0x2673,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
|
||||
DEFINE_GUID( IID_IDirect3DHALDevice, 0x84E63dE0,0x46AA,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
|
||||
DEFINE_GUID( IID_IDirect3DMMXDevice, 0x881949a1,0xd6f3,0x11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 );
|
||||
|
||||
DEFINE_GUID( IID_IDirect3DDevice, 0x64108800,0x957d,0X11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 );
|
||||
DEFINE_GUID( IID_IDirect3DDevice2, 0x93281501, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
|
||||
DEFINE_GUID( IID_IDirect3DTexture, 0x2CDCD9E0,0x25A0,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
|
||||
DEFINE_GUID( IID_IDirect3DTexture2, 0x93281502, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
|
||||
DEFINE_GUID( IID_IDirect3DLight, 0x4417C142,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
|
||||
DEFINE_GUID( IID_IDirect3DMaterial, 0x4417C144,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
|
||||
DEFINE_GUID( IID_IDirect3DMaterial2, 0x93281503, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
|
||||
DEFINE_GUID( IID_IDirect3DExecuteBuffer,0x4417C145,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
|
||||
DEFINE_GUID( IID_IDirect3DViewport, 0x4417C146,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
|
||||
DEFINE_GUID( IID_IDirect3DViewport2, 0x93281500, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Data structures
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
|
||||
/* 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined */
|
||||
struct IDirect3D;
|
||||
struct IDirect3D2;
|
||||
struct IDirect3DDevice;
|
||||
struct IDirect3DDevice2;
|
||||
struct IDirect3DExecuteBuffer;
|
||||
struct IDirect3DLight;
|
||||
struct IDirect3DMaterial;
|
||||
struct IDirect3DMaterial2;
|
||||
struct IDirect3DTexture;
|
||||
struct IDirect3DTexture2;
|
||||
struct IDirect3DViewport;
|
||||
struct IDirect3DViewport2;
|
||||
typedef struct IDirect3D *LPDIRECT3D;
|
||||
typedef struct IDirect3D2 *LPDIRECT3D2;
|
||||
typedef struct IDirect3DDevice *LPDIRECT3DDEVICE;
|
||||
typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2;
|
||||
typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER;
|
||||
typedef struct IDirect3DLight *LPDIRECT3DLIGHT;
|
||||
typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL;
|
||||
typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2;
|
||||
typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE;
|
||||
typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2;
|
||||
typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT;
|
||||
typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2;
|
||||
|
||||
#else
|
||||
|
||||
typedef struct IDirect3D *LPDIRECT3D;
|
||||
typedef struct IDirect3D2 *LPDIRECT3D2;
|
||||
typedef struct IDirect3DDevice *LPDIRECT3DDEVICE;
|
||||
typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2;
|
||||
typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER;
|
||||
typedef struct IDirect3DLight *LPDIRECT3DLIGHT;
|
||||
typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL;
|
||||
typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2;
|
||||
typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE;
|
||||
typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2;
|
||||
typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT;
|
||||
typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2;
|
||||
|
||||
#endif
|
||||
|
||||
#include "d3dtypes.h"
|
||||
#include "d3dcaps.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3D
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3D
|
||||
DECLARE_INTERFACE_(IDirect3D, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3D methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ REFIID) PURE;
|
||||
STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE;
|
||||
STDMETHOD(CreateLight) (THIS_ LPDIRECT3DLIGHT*, IUnknown*) PURE;
|
||||
STDMETHOD(CreateMaterial) (THIS_ LPDIRECT3DMATERIAL*, IUnknown*) PURE;
|
||||
STDMETHOD(CreateViewport) (THIS_ LPDIRECT3DVIEWPORT*, IUnknown*) PURE;
|
||||
STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3D_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3D_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3D_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3D_Initialize(p, a) (p)->lpVtbl->Initialize(p, a)
|
||||
#define IDirect3D_EnumDevices(p, a, b) (p)->lpVtbl->EnumDevices(p, a, b)
|
||||
#define IDirect3D_CreateLight(p, a, b) (p)->lpVtbl->CreateLight(p, a, b)
|
||||
#define IDirect3D_CreateMaterial(p, a, b) (p)->lpVtbl->CreateMaterial(p, a, b)
|
||||
#define IDirect3D_CreateViewport(p, a, b) (p)->lpVtbl->CreateViewport(p, a, b)
|
||||
#define IDirect3D_FindDevice(p, a, b) (p)->lpVtbl->FindDevice(p, a, b)
|
||||
#else
|
||||
#define IDirect3D_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3D_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3D_Release(p) (p)->Release()
|
||||
#define IDirect3D_Initialize(p, a) (p)->Initialize(a)
|
||||
#define IDirect3D_EnumDevices(p, a, b) (p)->EnumDevices(a, b)
|
||||
#define IDirect3D_CreateLight(p, a, b) (p)->CreateLight(a, b)
|
||||
#define IDirect3D_CreateMaterial(p, a, b) (p)->CreateMaterial(a, b)
|
||||
#define IDirect3D_CreateViewport(p, a, b) (p)->CreateViewport(a, b)
|
||||
#define IDirect3D_FindDevice(p, a, b) (p)->FindDevice(a, b)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3D2
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3D2
|
||||
DECLARE_INTERFACE_(IDirect3D2, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3D methods ***/
|
||||
STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE;
|
||||
STDMETHOD(CreateLight) (THIS_ LPDIRECT3DLIGHT*, IUnknown*) PURE;
|
||||
STDMETHOD(CreateMaterial) (THIS_ LPDIRECT3DMATERIAL2*, IUnknown*) PURE;
|
||||
STDMETHOD(CreateViewport) (THIS_ LPDIRECT3DVIEWPORT2*, IUnknown*) PURE;
|
||||
STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE;
|
||||
|
||||
STDMETHOD(CreateDevice)(THIS_ REFCLSID, LPDIRECTDRAWSURFACE, LPDIRECT3DDEVICE2 *) PURE;
|
||||
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3D2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3D2_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3D2_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3D2_EnumDevices(p, a, b) (p)->lpVtbl->EnumDevices(p, a, b)
|
||||
#define IDirect3D2_CreateLight(p, a, b) (p)->lpVtbl->CreateLight(p, a, b)
|
||||
#define IDirect3D2_CreateMaterial(p, a, b) (p)->lpVtbl->CreateMaterial(p, a, b)
|
||||
#define IDirect3D2_CreateViewport(p, a, b) (p)->lpVtbl->CreateViewport(p, a, b)
|
||||
#define IDirect3D2_FindDevice(p, a, b) (p)->lpVtbl->FindDevice(p, a, b)
|
||||
#define IDirect3D2_CreateDevice(p, a, b, c) (p)->lpVtbl->CreateDevice(p, a, b, c)
|
||||
#else
|
||||
#define IDirect3D2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3D2_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3D2_Release(p) (p)->Release()
|
||||
#define IDirect3D2_EnumDevices(p, a, b) (p)->EnumDevices(a, b)
|
||||
#define IDirect3D2_CreateLight(p, a, b) (p)->CreateLight(a, b)
|
||||
#define IDirect3D2_CreateMaterial(p, a, b) (p)->CreateMaterial(a, b)
|
||||
#define IDirect3D2_CreateViewport(p, a, b) (p)->CreateViewport(a, b)
|
||||
#define IDirect3D2_FindDevice(p, a, b) (p)->FindDevice(a, b)
|
||||
#define IDirect3D2_CreateDevice(p, a, b, c) (p)->CreateDevice(a, b, c)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DDevice
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DDevice
|
||||
DECLARE_INTERFACE_(IDirect3DDevice, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DDevice methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3D, LPGUID, LPD3DDEVICEDESC) PURE;
|
||||
STDMETHOD(GetCaps) (THIS_ LPD3DDEVICEDESC, LPD3DDEVICEDESC) PURE;
|
||||
STDMETHOD(SwapTextureHandles) (THIS_ LPDIRECT3DTEXTURE, LPDIRECT3DTEXTURE) PURE;
|
||||
STDMETHOD(CreateExecuteBuffer) (THIS_ LPD3DEXECUTEBUFFERDESC, LPDIRECT3DEXECUTEBUFFER*, IUnknown*) PURE;
|
||||
STDMETHOD(GetStats) (THIS_ LPD3DSTATS) PURE;
|
||||
STDMETHOD(Execute) (THIS_ LPDIRECT3DEXECUTEBUFFER, LPDIRECT3DVIEWPORT, DWORD) PURE;
|
||||
STDMETHOD(AddViewport) (THIS_ LPDIRECT3DVIEWPORT) PURE;
|
||||
STDMETHOD(DeleteViewport) (THIS_ LPDIRECT3DVIEWPORT) PURE;
|
||||
STDMETHOD(NextViewport) (THIS_ LPDIRECT3DVIEWPORT, LPDIRECT3DVIEWPORT*, DWORD) PURE;
|
||||
STDMETHOD(Pick) (THIS_ LPDIRECT3DEXECUTEBUFFER, LPDIRECT3DVIEWPORT, DWORD, LPD3DRECT) PURE;
|
||||
STDMETHOD(GetPickRecords)(THIS_ LPDWORD, LPD3DPICKRECORD) PURE;
|
||||
STDMETHOD(EnumTextureFormats) (THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK, LPVOID) PURE;
|
||||
STDMETHOD(CreateMatrix) (THIS_ LPD3DMATRIXHANDLE) PURE;
|
||||
STDMETHOD(SetMatrix) (THIS_ D3DMATRIXHANDLE, const LPD3DMATRIX) PURE;
|
||||
STDMETHOD(GetMatrix) (THIS_ D3DMATRIXHANDLE, LPD3DMATRIX) PURE;
|
||||
STDMETHOD(DeleteMatrix) (THIS_ D3DMATRIXHANDLE) PURE;
|
||||
STDMETHOD_(HRESULT, BeginScene) (THIS) PURE;
|
||||
STDMETHOD_(HRESULT, EndScene) (THIS) PURE;
|
||||
STDMETHOD(GetDirect3D) (THIS_ LPDIRECT3D*) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DDevice_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DDevice_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DDevice_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DDevice_Initialize(p, a, b, c) (p)->lpVtbl->Initialize(p, a, b, c)
|
||||
#define IDirect3DDevice_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b)
|
||||
#define IDirect3DDevice_SwapTextureHandles(p, a, b) (p)->lpVtbl->SwapTextureHandles(p, a, b)
|
||||
#define IDirect3DDevice_CreateExecuteBuffer(p, a, b, c) (p)->lpVtbl->CreateExecuteBuffer(p, a, b, c)
|
||||
#define IDirect3DDevice_GetStats(p, a) (p)->lpVtbl->GetStats(p, a)
|
||||
#define IDirect3DDevice_Execute(p, a, b, c) (p)->lpVtbl->Execute(p, a, b, c)
|
||||
#define IDirect3DDevice_AddViewport(p, a) (p)->lpVtbl->AddViewport(p, a)
|
||||
#define IDirect3DDevice_DeleteViewport(p, a) (p)->lpVtbl->DeleteViewport(p, a)
|
||||
#define IDirect3DDevice_NextViewport(p, a, b) (p)->lpVtbl->NextViewport(p, a, b)
|
||||
#define IDirect3DDevice_Pick(p, a, b, c, d) (p)->lpVtbl->Pick(p, a, b, c, d)
|
||||
#define IDirect3DDevice_GetPickRecords(p, a, b) (p)->lpVtbl->GetPickRecords(p, a, b)
|
||||
#define IDirect3DDevice_EnumTextureFormats(p, a, b) (p)->lpVtbl->EnumTextureFormats(p, a, b)
|
||||
#define IDirect3DDevice_CreateMatrix(p, a) (p)->lpVtbl->CreateMatrix(p, a)
|
||||
#define IDirect3DDevice_SetMatrix(p, a, b) (p)->lpVtbl->SetMatrix(p, a, b)
|
||||
#define IDirect3DDevice_GetMatrix(p, a, b) (p)->lpVtbl->GetMatrix(p, a, b)
|
||||
#define IDirect3DDevice_DeleteMatrix(p, a) (p)->lpVtbl->DeleteMatrix(p, a)
|
||||
#define IDirect3DDevice_BeginScene(p) (p)->lpVtbl->BeginScene(p)
|
||||
#define IDirect3DDevice_EndScene(p) (p)->lpVtbl->EndScene(p)
|
||||
#define IDirect3DDevice_GetDirect3D(p, a) (p)->lpVtbl->GetDirect3D(p, a)
|
||||
#else
|
||||
#define IDirect3DDevice_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DDevice_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DDevice_Release(p) (p)->Release()
|
||||
#define IDirect3DDevice_Initialize(p, a, b, c) (p)->Initialize(a, b, c)
|
||||
#define IDirect3DDevice_GetCaps(p, a, b) (p)->GetCaps(a, b)
|
||||
#define IDirect3DDevice_SwapTextureHandles(p, a, b) (p)->SwapTextureHandles(a, b)
|
||||
#define IDirect3DDevice_CreateExecuteBuffer(p, a, b, c) (p)->CreateExecuteBuffer(a, b, c)
|
||||
#define IDirect3DDevice_GetStats(p, a) (p)->GetStats(a)
|
||||
#define IDirect3DDevice_Execute(p, a, b, c) (p)->Execute(a, b, c)
|
||||
#define IDirect3DDevice_AddViewport(p, a) (p)->AddViewport(a)
|
||||
#define IDirect3DDevice_DeleteViewport(p, a) (p)->DeleteViewport(a)
|
||||
#define IDirect3DDevice_NextViewport(p, a, b) (p)->NextViewport(a, b)
|
||||
#define IDirect3DDevice_Pick(p, a, b, c, d) (p)->Pick(a, b, c, d)
|
||||
#define IDirect3DDevice_GetPickRecords(p, a, b) (p)->GetPickRecords(a, b)
|
||||
#define IDirect3DDevice_EnumTextureFormats(p, a, b) (p)->EnumTextureFormats(a, b)
|
||||
#define IDirect3DDevice_CreateMatrix(p, a) (p)->CreateMatrix(a)
|
||||
#define IDirect3DDevice_SetMatrix(p, a, b) (p)->SetMatrix(a, b)
|
||||
#define IDirect3DDevice_GetMatrix(p, a, b) (p)->GetMatrix(a, b)
|
||||
#define IDirect3DDevice_DeleteMatrix(p, a) (p)->DeleteMatrix(a)
|
||||
#define IDirect3DDevice_BeginScene(p) (p)->BeginScene()
|
||||
#define IDirect3DDevice_EndScene(p) (p)->EndScene()
|
||||
#define IDirect3DDevice_GetDirect3D(p, a) (p)->GetDirect3D(a)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DDevice2
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DDevice2
|
||||
DECLARE_INTERFACE_(IDirect3DDevice2, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DDevice2 methods ***/
|
||||
STDMETHOD(GetCaps) (THIS_ LPD3DDEVICEDESC, LPD3DDEVICEDESC) PURE;
|
||||
STDMETHOD(SwapTextureHandles) (THIS_ LPDIRECT3DTEXTURE2, LPDIRECT3DTEXTURE2) PURE;
|
||||
STDMETHOD(GetStats) (THIS_ LPD3DSTATS) PURE;
|
||||
STDMETHOD(AddViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE;
|
||||
STDMETHOD(DeleteViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE;
|
||||
STDMETHOD(NextViewport) (THIS_ LPDIRECT3DVIEWPORT2, LPDIRECT3DVIEWPORT2*, DWORD) PURE;
|
||||
STDMETHOD(EnumTextureFormats) (THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK, LPVOID) PURE;
|
||||
STDMETHOD_(HRESULT, BeginScene) (THIS) PURE;
|
||||
STDMETHOD_(HRESULT, EndScene) (THIS) PURE;
|
||||
STDMETHOD(GetDirect3D) (THIS_ LPDIRECT3D2*) PURE;
|
||||
|
||||
/*** DrawPrimitive API ***/
|
||||
STDMETHOD(SetCurrentViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE;
|
||||
STDMETHOD(GetCurrentViewport) (THIS_ LPDIRECT3DVIEWPORT2 *) PURE;
|
||||
|
||||
STDMETHOD(SetRenderTarget) (THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
|
||||
STDMETHOD(GetRenderTarget) (THIS_ LPDIRECTDRAWSURFACE *) PURE;
|
||||
|
||||
STDMETHOD(Begin) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, DWORD) PURE;
|
||||
STDMETHOD(BeginIndexed) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, DWORD) PURE;
|
||||
STDMETHOD(Vertex) (THIS_ LPVOID) PURE;
|
||||
STDMETHOD(Index) (THIS_ WORD) PURE;
|
||||
STDMETHOD(End) (THIS_ DWORD) PURE;
|
||||
|
||||
STDMETHOD(GetRenderState) (THIS_ D3DRENDERSTATETYPE, LPDWORD) PURE;
|
||||
STDMETHOD(SetRenderState) (THIS_ D3DRENDERSTATETYPE, DWORD) PURE;
|
||||
STDMETHOD(GetLightState) (THIS_ D3DLIGHTSTATETYPE, LPDWORD) PURE;
|
||||
STDMETHOD(SetLightState) (THIS_ D3DLIGHTSTATETYPE, DWORD) PURE;
|
||||
STDMETHOD(SetTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE;
|
||||
STDMETHOD(GetTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE;
|
||||
STDMETHOD(MultiplyTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE;
|
||||
|
||||
STDMETHOD(DrawPrimitive) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, DWORD) PURE;
|
||||
STDMETHOD(DrawIndexedPrimitive) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, LPWORD, DWORD, DWORD) PURE;
|
||||
|
||||
STDMETHOD(SetClipStatus) (THIS_ LPD3DCLIPSTATUS) PURE;
|
||||
STDMETHOD(GetClipStatus) (THIS_ LPD3DCLIPSTATUS) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DDevice2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DDevice2_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DDevice2_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DDevice2_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b)
|
||||
#define IDirect3DDevice2_SwapTextureHandles(p, a, b) (p)->lpVtbl->SwapTextureHandles(p, a, b)
|
||||
#define IDirect3DDevice2_GetStats(p, a) (p)->lpVtbl->CreateViewport(p, a)
|
||||
#define IDirect3DDevice2_AddViewport(p, a) (p)->lpVtbl->AddViewport(p, a)
|
||||
#define IDirect3DDevice2_DeleteViewport(p, a) (p)->lpVtbl->DeleteViewport(p, a)
|
||||
#define IDirect3DDevice2_NextViewport(p, a, b) (p)->lpVtbl->NextViewport(p, a, b)
|
||||
#define IDirect3DDevice2_EnumTextureFormats(p, a, b) (p)->lpVtbl->EnumTextureFormats(p, a, b)
|
||||
#define IDirect3DDevice2_BeginScene(p) (p)->lpVtbl->BeginScene(p)
|
||||
#define IDirect3DDevice2_EndScene(p) (p)->lpVtbl->EndScene(p)
|
||||
#define IDirect3DDevice2_GetDirect3D(p, a) (p)->lpVtbl->GetDirect3D(p, a)
|
||||
|
||||
#define IDirect3DDevice2_SetCurrentViewport(p, a) (p)->lpVtbl->SetCurrentViewport(p, a)
|
||||
#define IDirect3DDevice2_GetCurrentViewport(p, a) (p)->lpVtbl->GetCurrentViewport(p, a)
|
||||
|
||||
#define IDirect3DDevice2_SetRenderTarget(p, a, b) (p)->lpVtbl->SetRenderTarget(p, a, b)
|
||||
#define IDirect3DDevice2_GetRenderTarget(p, a) (p)->lpVtbl->GetRenderTarget(p, a)
|
||||
|
||||
#define IDirect3DDevice2_Begin(p, a, b, c) (p)->lpVtbl->Begin(p, a, b, c)
|
||||
#define IDirect3DDevice2_BeginIndexed(p, a, b, c, d, e) (p)->lpVtbl->Begin(p, a, b, c, d, e)
|
||||
#define IDirect3DDevice2_Vertex(p, a) (p)->lpVtbl->Vertex(p, a)
|
||||
#define IDirect3DDevice2_Index(p, a) (p)->lpVtbl->Index(p, a)
|
||||
#define IDirect3DDevice2_End(p, a) (p)->lpVtbl->End(p, a)
|
||||
|
||||
#define IDirect3DDevice2_GetRenderState(p, a, b) (p)->lpVtbl->GetRenderState(p, a, b)
|
||||
#define IDirect3DDevice2_SetRenderState(p, a, b) (p)->lpVtbl->SetRenderState(p, a, b)
|
||||
#define IDirect3DDevice2_GetLightState(p, a, b) (p)->lpVtbl->GetLightState(p, a, b)
|
||||
#define IDirect3DDevice2_SetLightState(p, a, b) (p)->lpVtbl->SetLightState(p, a, b)
|
||||
#define IDirect3DDevice2_SetTransform(p, a, b) (p)->lpVtbl->SetTransform(p, a, b)
|
||||
#define IDirect3DDevice2_GetTransform(p, a, b) (p)->lpVtbl->GetTransform(p, a, b)
|
||||
#define IDirect3DDevice2_MultiplyTransform(p, a, b) (p)->lpVtbl->MultiplyTransform(p, a, b)
|
||||
|
||||
#define IDirect3DDevice2_DrawPrimitive(p, a, b, c, d, e) (p)->lpVtbl->DrawPrimitive(p, a, b, c, d, e)
|
||||
#define IDirect3DDevice2_DrawIndexedPrimitive(p, a, b, c, d, e, f, g) \
|
||||
(p)->lpVtbl->DrawIndexedPrimitive(p, a, b, c, d, e, f, g)
|
||||
#define IDirect3DDevice2_SetClipStatus(p, a) (p)->lpVtbl->SetClipStatus(p, a)
|
||||
#define IDirect3DDevice2_GetClipStatus(p, a) (p)->lpVtbl->GetClipStatus(p, a)
|
||||
#else
|
||||
#define IDirect3DDevice2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DDevice2_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DDevice2_Release(p) (p)->Release()
|
||||
#define IDirect3DDevice2_GetCaps(p, a, b) (p)->GetCaps(a, b)
|
||||
#define IDirect3DDevice2_SwapTextureHandles(p, a, b) (p)->SwapTextureHandles(a, b)
|
||||
#define IDirect3DDevice2_GetStats(p, a) (p)->CreateViewport(a)
|
||||
#define IDirect3DDevice2_AddViewport(p, a) (p)->AddViewport(a)
|
||||
#define IDirect3DDevice2_DeleteViewport(p, a) (p)->DeleteViewport(a)
|
||||
#define IDirect3DDevice2_NextViewport(p, a, b) (p)->NextViewport(a, b)
|
||||
#define IDirect3DDevice2_EnumTextureFormats(p, a, b) (p)->EnumTextureFormats(a, b)
|
||||
#define IDirect3DDevice2_BeginScene(p) (p)->BeginScene()
|
||||
#define IDirect3DDevice2_EndScene(p) (p)->EndScene()
|
||||
#define IDirect3DDevice2_GetDirect3D(p, a) (p)->GetDirect3D(a)
|
||||
|
||||
#define IDirect3DDevice2_SetCurrentViewport(p, a) (p)->SetCurrentViewport(a)
|
||||
#define IDirect3DDevice2_GetCurrentViewport(p, a) (p)->GetCurrentViewport(a)
|
||||
|
||||
#define IDirect3DDevice2_SetRenderTarget(p, a, b) (p)->SetRenderTarget(a, b)
|
||||
#define IDirect3DDevice2_GetRenderTarget(p, a) (p)->GetRenderTarget(a)
|
||||
|
||||
#define IDirect3DDevice2_Begin(p, a, b, c) (p)->Begin(a, b, c)
|
||||
#define IDirect3DDevice2_BeginIndexed(p, a, b, c, d, e) (p)->Begin(a, b, c, d, e)
|
||||
#define IDirect3DDevice2_Vertex(p, a) (p)->Vertex(a)
|
||||
#define IDirect3DDevice2_Index(p, a) (p)->Index(a)
|
||||
#define IDirect3DDevice2_End(p, a) (p)->End(a)
|
||||
|
||||
#define IDirect3DDevice2_GetRenderState(p, a, b) (p)->GetRenderState(a, b)
|
||||
#define IDirect3DDevice2_SetRenderState(p, a, b) (p)->SetRenderState(a, b)
|
||||
#define IDirect3DDevice2_GetLightState(p, a, b) (p)->GetLightState(a, b)
|
||||
#define IDirect3DDevice2_SetLightState(p, a, b) (p)->SetLightState(a, b)
|
||||
#define IDirect3DDevice2_SetTransform(p, a, b) (p)->SetTransform(a, b)
|
||||
#define IDirect3DDevice2_GetTransform(p, a, b) (p)->GetTransform(a, b)
|
||||
#define IDirect3DDevice2_MultiplyTransform(p, a, b) (p)->MultiplyTransform(a, b)
|
||||
|
||||
#define IDirect3DDevice2_DrawPrimitive(p, a, b, c, d, e) (p)->DrawPrimitive(a, b, c, d, e)
|
||||
#define IDirect3DDevice2_DrawIndexedPrimitive(p, a, b, c, d, e, f, g) \
|
||||
(p)->DrawIndexedPrimitive(a, b, c, d, e, f, g)
|
||||
#define IDirect3DDevice2_SetClipStatus(p, a) (p)->SetClipStatus(a)
|
||||
#define IDirect3DDevice2_GetClipStatus(p, a) (p)->GetClipStatus(a)
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DExecuteBuffer
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DExecuteBuffer
|
||||
DECLARE_INTERFACE_(IDirect3DExecuteBuffer, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DExecuteBuffer methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3DDEVICE, LPD3DEXECUTEBUFFERDESC) PURE;
|
||||
STDMETHOD(Lock) (THIS_ LPD3DEXECUTEBUFFERDESC) PURE;
|
||||
STDMETHOD_(HRESULT, Unlock) (THIS) PURE;
|
||||
STDMETHOD(SetExecuteData) (THIS_ LPD3DEXECUTEDATA) PURE;
|
||||
STDMETHOD(GetExecuteData) (THIS_ LPD3DEXECUTEDATA) PURE;
|
||||
STDMETHOD(Validate) (THIS_ LPDWORD, LPD3DVALIDATECALLBACK, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(Optimize) (THIS_ DWORD) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DExecuteBuffer_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DExecuteBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DExecuteBuffer_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DExecuteBuffer_Initialize(p, a, b) (p)->lpVtbl->Initialize(p, a, b)
|
||||
#define IDirect3DExecuteBuffer_Lock(p, a) (p)->lpVtbl->Lock(p, a)
|
||||
#define IDirect3DExecuteBuffer_Unlock(p) (p)->lpVtbl->Unlock(p)
|
||||
#define IDirect3DExecuteBuffer_SetExecuteData(p, a) (p)->lpVtbl->SetExecuteData(p, a)
|
||||
#define IDirect3DExecuteBuffer_GetExecuteData(p, a) (p)->lpVtbl->GetExecuteData(p, a)
|
||||
#define IDirect3DExecuteBuffer_Validate(p, a, b, c, d) (p)->lpVtbl->Validate(p, a, b, c, d)
|
||||
#define IDirect3DExecuteBuffer_Optimize(p, a) (p)->lpVtbl->Optimize(p, a)
|
||||
#else
|
||||
#define IDirect3DExecuteBuffer_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DExecuteBuffer_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DExecuteBuffer_Release(p) (p)->Release()
|
||||
#define IDirect3DExecuteBuffer_Initialize(p, a, b) (p)->Initialize(a, b)
|
||||
#define IDirect3DExecuteBuffer_Lock(p, a) (p)->Lock(a)
|
||||
#define IDirect3DExecuteBuffer_Unlock(p) (p)->Unlock()
|
||||
#define IDirect3DExecuteBuffer_SetExecuteData(p, a) (p)->SetExecuteData(a)
|
||||
#define IDirect3DExecuteBuffer_GetExecuteData(p, a) (p)->GetExecuteData(a)
|
||||
#define IDirect3DExecuteBuffer_Validate(p, a, b, c, d) (p)->Validate(a, b, c, d)
|
||||
#define IDirect3DExecuteBuffer_Optimize(p, a) (p)->Optimize(a)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DLight
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DLight
|
||||
DECLARE_INTERFACE_(IDirect3DLight, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DLight methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
|
||||
STDMETHOD(SetLight) (THIS_ LPD3DLIGHT) PURE;
|
||||
STDMETHOD(GetLight) (THIS_ LPD3DLIGHT) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DLight_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DLight_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DLight_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DLight_Initialize(p, a) (p)->lpVtbl->Initialize(p, a)
|
||||
#define IDirect3DLight_SetLight(p, a) (p)->lpVtbl->SetLight(p, a)
|
||||
#define IDirect3DLight_GetLight(p, a) (p)->lpVtbl->GetLight(p, a)
|
||||
#else
|
||||
#define IDirect3DLight_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DLight_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DLight_Release(p) (p)->Release()
|
||||
#define IDirect3DLight_Initialize(p, a) (p)->Initialize(a)
|
||||
#define IDirect3DLight_SetLight(p, a) (p)->SetLight(a)
|
||||
#define IDirect3DLight_GetLight(p, a) (p)->GetLight(a)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DMaterial
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DMaterial
|
||||
DECLARE_INTERFACE_(IDirect3DMaterial, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DMaterial methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
|
||||
STDMETHOD(SetMaterial) (THIS_ LPD3DMATERIAL) PURE;
|
||||
STDMETHOD(GetMaterial) (THIS_ LPD3DMATERIAL) PURE;
|
||||
STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE, LPD3DMATERIALHANDLE) PURE;
|
||||
STDMETHOD_(HRESULT, Reserve) (THIS) PURE;
|
||||
STDMETHOD_(HRESULT, Unreserve) (THIS) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DMaterial_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DMaterial_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DMaterial_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DMaterial_Initialize(p, a) (p)->lpVtbl->Initialize(p, a)
|
||||
#define IDirect3DMaterial_SetMaterial(p, a) (p)->lpVtbl->SetMaterial(p, a)
|
||||
#define IDirect3DMaterial_GetMaterial(p, a) (p)->lpVtbl->GetMaterial(p, a)
|
||||
#define IDirect3DMaterial_GetHandle(p, a, b) (p)->lpVtbl->GetHandle(p, a, b)
|
||||
#define IDirect3DMaterial_Reserve(p) (p)->lpVtbl->Reserve(p)
|
||||
#define IDirect3DMaterial_Unreserve(p) (p)->lpVtbl->Unreserve(p)
|
||||
#else
|
||||
#define IDirect3DMaterial_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DMaterial_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DMaterial_Release(p) (p)->Release()
|
||||
#define IDirect3DMaterial_Initialize(p, a) (p)->Initialize(a)
|
||||
#define IDirect3DMaterial_SetMaterial(p, a) (p)->SetMaterial(a)
|
||||
#define IDirect3DMaterial_GetMaterial(p, a) (p)->GetMaterial(a)
|
||||
#define IDirect3DMaterial_GetHandle(p, a, b) (p)->GetHandle(a, b)
|
||||
#define IDirect3DMaterial_Reserve(p) (p)->Reserve()
|
||||
#define IDirect3DMaterial_Unreserve(p) (p)->Unreserve()
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DMaterial2
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DMaterial2
|
||||
DECLARE_INTERFACE_(IDirect3DMaterial2, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DMaterial2 methods ***/
|
||||
STDMETHOD(SetMaterial) (THIS_ LPD3DMATERIAL) PURE;
|
||||
STDMETHOD(GetMaterial) (THIS_ LPD3DMATERIAL) PURE;
|
||||
STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE2, LPD3DMATERIALHANDLE) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DMaterial2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DMaterial2_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DMaterial2_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DMaterial2_SetMaterial(p, a) (p)->lpVtbl->SetMaterial(p, a)
|
||||
#define IDirect3DMaterial2_GetMaterial(p, a) (p)->lpVtbl->GetMaterial(p, a)
|
||||
#define IDirect3DMaterial2_GetHandle(p, a, b) (p)->lpVtbl->GetHandle(p, a, b)
|
||||
#else
|
||||
#define IDirect3DMaterial2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DMaterial2_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DMaterial2_Release(p) (p)->Release()
|
||||
#define IDirect3DMaterial2_SetMaterial(p, a) (p)->SetMaterial(a)
|
||||
#define IDirect3DMaterial2_GetMaterial(p, a) (p)->GetMaterial(a)
|
||||
#define IDirect3DMaterial2_GetHandle(p, a, b) (p)->GetHandle(a, b)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DTexture
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DTexture
|
||||
DECLARE_INTERFACE_(IDirect3DTexture, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DTexture methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3DDEVICE, LPDIRECTDRAWSURFACE) PURE;
|
||||
STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE, LPD3DTEXTUREHANDLE) PURE;
|
||||
STDMETHOD(PaletteChanged) (THIS_ DWORD, DWORD) PURE;
|
||||
STDMETHOD(Load) (THIS_ LPDIRECT3DTEXTURE) PURE;
|
||||
STDMETHOD_(HRESULT, Unload) (THIS) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DTexture_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DTexture_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DTexture_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DTexture_Initialize(p, a, b) (p)->lpVtbl->Initialize(p, a, b)
|
||||
#define IDirect3DTexture_GetHandle(p, a, b) (p)->lpVtbl->GetHandle(p, a, b)
|
||||
#define IDirect3DTexture_PaletteChanged(p, a, b) (p)->lpVtbl->PaletteChanged(p, a, b)
|
||||
#define IDirect3DTexture_Load(p, a) (p)->lpVtbl->Load(p, a)
|
||||
#define IDirect3DTexture_Unload(p) (p)->lpVtbl->Unload(p)
|
||||
#else
|
||||
#define IDirect3DTexture_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DTexture_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DTexture_Release(p) (p)->Release()
|
||||
#define IDirect3DTexture_Initialize(p, a, b) (p)->Initialize(a, b)
|
||||
#define IDirect3DTexture_GetHandle(p, a, b) (p)->GetHandle(a, b)
|
||||
#define IDirect3DTexture_PaletteChanged(p, a, b) (p)->PaletteChanged(a, b)
|
||||
#define IDirect3DTexture_Load(p, a) (p)->Load(a)
|
||||
#define IDirect3DTexture_Unload(p) (p)->Unload()
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DTexture2
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DTexture2
|
||||
DECLARE_INTERFACE_(IDirect3DTexture2, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DTexture2 methods ***/
|
||||
STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE2, LPD3DTEXTUREHANDLE) PURE;
|
||||
STDMETHOD(PaletteChanged) (THIS_ DWORD, DWORD) PURE;
|
||||
STDMETHOD(Load) (THIS_ LPDIRECT3DTEXTURE2) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DTexture2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DTexture2_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DTexture2_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DTexture2_GetHandle(p, a, b) (p)->lpVtbl->GetHandle(p, a, b)
|
||||
#define IDirect3DTexture2_PaletteChanged(p, a, b) (p)->lpVtbl->PaletteChanged(p, a, b)
|
||||
#define IDirect3DTexture2_Load(p, a) (p)->lpVtbl->Load(p, a)
|
||||
#else
|
||||
#define IDirect3DTexture2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DTexture2_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DTexture2_Release(p) (p)->Release()
|
||||
#define IDirect3DTexture2_GetHandle(p, a, b) (p)->GetHandle(a, b)
|
||||
#define IDirect3DTexture2_PaletteChanged(p, a, b) (p)->PaletteChanged(a, b)
|
||||
#define IDirect3DTexture2_Load(p, a) (p)->Load(a)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DViewport
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DViewport
|
||||
DECLARE_INTERFACE_(IDirect3DViewport, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DViewport methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
|
||||
STDMETHOD(GetViewport) (THIS_ LPD3DVIEWPORT) PURE;
|
||||
STDMETHOD(SetViewport) (THIS_ LPD3DVIEWPORT) PURE;
|
||||
STDMETHOD(TransformVertices) (THIS_ DWORD, LPD3DTRANSFORMDATA, DWORD, LPDWORD) PURE;
|
||||
STDMETHOD(LightElements) (THIS_ DWORD, LPD3DLIGHTDATA) PURE;
|
||||
STDMETHOD(SetBackground) (THIS_ D3DMATERIALHANDLE) PURE;
|
||||
STDMETHOD(GetBackground) (THIS_ LPD3DMATERIALHANDLE, LPBOOL) PURE;
|
||||
STDMETHOD(SetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE) PURE;
|
||||
STDMETHOD(GetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE*, LPBOOL) PURE;
|
||||
STDMETHOD(Clear) (THIS_ DWORD, LPD3DRECT, DWORD) PURE;
|
||||
STDMETHOD(AddLight) (THIS_ LPDIRECT3DLIGHT) PURE;
|
||||
STDMETHOD(DeleteLight) (THIS_ LPDIRECT3DLIGHT) PURE;
|
||||
STDMETHOD(NextLight) (THIS_ LPDIRECT3DLIGHT, LPDIRECT3DLIGHT*, DWORD) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DViewport_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DViewport_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DViewport_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DViewport_Initialize(p, a) (p)->lpVtbl->Initialize(p, a)
|
||||
#define IDirect3DViewport_GetViewport(p, a) (p)->lpVtbl->GetViewport(p, a)
|
||||
#define IDirect3DViewport_SetViewport(p, a) (p)->lpVtbl->SetViewport(p, a)
|
||||
#define IDirect3DViewport_TransformVertices(p, a, b, c, d) (p)->lpVtbl->TransformVertices(p, a, b, c, d)
|
||||
#define IDirect3DViewport_LightElements(p, a, b) (p)->lpVtbl->LightElements(p, a, b)
|
||||
#define IDirect3DViewport_SetBackground(p, a) (p)->lpVtbl->SetBackground(p, a)
|
||||
#define IDirect3DViewport_GetBackground(p, a, b) (p)->lpVtbl->GetBackground(p, a, b)
|
||||
#define IDirect3DViewport_SetBackgroundDepth(p, a) (p)->lpVtbl->SetBackgroundDepth(p, a)
|
||||
#define IDirect3DViewport_GetBackgroundDepth(p, a, b) (p)->lpVtbl->GetBackgroundDepth(p, a, b)
|
||||
#define IDirect3DViewport_Clear(p, a, b, c) (p)->lpVtbl->Clear(p, a, b, c)
|
||||
#define IDirect3DViewport_AddLight(p, a) (p)->lpVtbl->AddLight(p, a)
|
||||
#define IDirect3DViewport_DeleteLight(p, a) (p)->lpVtbl->DeleteLight(p, a)
|
||||
#define IDirect3DViewport_NextLight(p, a, b, c) (p)->lpVtbl->NextLight(p, a, b, c)
|
||||
#else
|
||||
#define IDirect3DViewport_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DViewport_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DViewport_Release(p) (p)->Release()
|
||||
#define IDirect3DViewport_Initialize(p, a) (p)->Initialize(a)
|
||||
#define IDirect3DViewport_GetViewport(p, a) (p)->GetViewport(a)
|
||||
#define IDirect3DViewport_SetViewport(p, a) (p)->SetViewport(a)
|
||||
#define IDirect3DViewport_TransformVertices(p, a, b, c, d) (p)->TransformVertices(a, b, c, d)
|
||||
#define IDirect3DViewport_LightElements(p, a, b) (p)->LightElements(a, b)
|
||||
#define IDirect3DViewport_SetBackground(p, a) (p)->SetBackground(a)
|
||||
#define IDirect3DViewport_GetBackground(p, a, b) (p)->GetBackground(a, b)
|
||||
#define IDirect3DViewport_SetBackgroundDepth(p, a) (p)->SetBackgroundDepth(a)
|
||||
#define IDirect3DViewport_GetBackgroundDepth(p, a, b) (p)->GetBackgroundDepth(a, b)
|
||||
#define IDirect3DViewport_Clear(p, a, b, c) (p)->Clear(a, b, c)
|
||||
#define IDirect3DViewport_AddLight(p, a) (p)->AddLight(a)
|
||||
#define IDirect3DViewport_DeleteLight(p, a) (p)->DeleteLight(a)
|
||||
#define IDirect3DViewport_NextLight(p, a, b, c) (p)->NextLight(a, b, c)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DViewport2
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DViewport2
|
||||
DECLARE_INTERFACE_(IDirect3DViewport2, IDirect3DViewport)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DViewport methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
|
||||
STDMETHOD(GetViewport) (THIS_ LPD3DVIEWPORT) PURE;
|
||||
STDMETHOD(SetViewport) (THIS_ LPD3DVIEWPORT) PURE;
|
||||
STDMETHOD(TransformVertices) (THIS_ DWORD, LPD3DTRANSFORMDATA, DWORD, LPDWORD) PURE;
|
||||
STDMETHOD(LightElements) (THIS_ DWORD, LPD3DLIGHTDATA) PURE;
|
||||
STDMETHOD(SetBackground) (THIS_ D3DMATERIALHANDLE) PURE;
|
||||
STDMETHOD(GetBackground) (THIS_ LPD3DMATERIALHANDLE, LPBOOL) PURE;
|
||||
STDMETHOD(SetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE) PURE;
|
||||
STDMETHOD(GetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE*, LPBOOL) PURE;
|
||||
STDMETHOD(Clear) (THIS_ DWORD, LPD3DRECT, DWORD) PURE;
|
||||
STDMETHOD(AddLight) (THIS_ LPDIRECT3DLIGHT) PURE;
|
||||
STDMETHOD(DeleteLight) (THIS_ LPDIRECT3DLIGHT) PURE;
|
||||
STDMETHOD(NextLight) (THIS_ LPDIRECT3DLIGHT, LPDIRECT3DLIGHT*, DWORD) PURE;
|
||||
/*** IDirect3DViewport2 methods ***/
|
||||
STDMETHOD(GetViewport2) (THIS_ LPD3DVIEWPORT2) PURE;
|
||||
STDMETHOD(SetViewport2) (THIS_ LPD3DVIEWPORT2) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DViewport2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DViewport2_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DViewport2_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DViewport2_Initialize(p, a) (p)->lpVtbl->Initialize(p, a)
|
||||
#define IDirect3DViewport2_GetViewport(p, a) (p)->lpVtbl->GetViewport(p, a)
|
||||
#define IDirect3DViewport2_SetViewport(p, a) (p)->lpVtbl->SetViewport(p, a)
|
||||
#define IDirect3DViewport2_TransformVertices(p, a, b, c, d) (p)->lpVtbl->TransformVertices(p, a, b, c, d)
|
||||
#define IDirect3DViewport2_LightElements(p, a, b) (p)->lpVtbl->LightElements(p, a, b)
|
||||
#define IDirect3DViewport2_SetBackground(p, a) (p)->lpVtbl->SetBackground(p, a)
|
||||
#define IDirect3DViewport2_GetBackground(p, a, b) (p)->lpVtbl->GetBackground(p, a, b)
|
||||
#define IDirect3DViewport2_SetBackgroundDepth(p, a) (p)->lpVtbl->SetBackgroundDepth(p, a)
|
||||
#define IDirect3DViewport2_GetBackgroundDepth(p, a, b) (p)->lpVtbl->GetBackgroundDepth(p, a, b)
|
||||
#define IDirect3DViewport2_Clear(p, a, b, c) (p)->lpVtbl->Clear(p, a, b, c)
|
||||
#define IDirect3DViewport2_AddLight(p, a) (p)->lpVtbl->AddLight(p, a)
|
||||
#define IDirect3DViewport2_DeleteLight(p, a) (p)->lpVtbl->DeleteLight(p, a)
|
||||
#define IDirect3DViewport2_NextLight(p, a, b, c) (p)->lpVtbl->NextLight(p, a, b, c)
|
||||
#define IDirect3DViewport2_GetViewport2(p, a) (p)->lpVtbl->GetViewport2(p, a)
|
||||
#define IDirect3DViewport2_SetViewport2(p, a) (p)->lpVtbl->SetViewport2(p, a)
|
||||
#else
|
||||
#define IDirect3DViewport2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DViewport2_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DViewport2_Release(p) (p)->Release()
|
||||
#define IDirect3DViewport2_Initialize(p, a) (p)->Initialize(a)
|
||||
#define IDirect3DViewport2_GetViewport(p, a) (p)->GetViewport(a)
|
||||
#define IDirect3DViewport2_SetViewport(p, a) (p)->SetViewport(a)
|
||||
#define IDirect3DViewport2_TransformVertices(p, a, b, c, d) (p)->TransformVertices(a, b, c, d)
|
||||
#define IDirect3DViewport2_LightElements(p, a, b) (p)->LightElements(a, b)
|
||||
#define IDirect3DViewport2_SetBackground(p, a) (p)->SetBackground(a)
|
||||
#define IDirect3DViewport2_GetBackground(p, a, b) (p)->GetBackground(a, b)
|
||||
#define IDirect3DViewport2_SetBackgroundDepth(p, a) (p)->SetBackgroundDepth(a)
|
||||
#define IDirect3DViewport2_GetBackgroundDepth(p, a, b) (p)->GetBackgroundDepth(a, b)
|
||||
#define IDirect3DViewport2_Clear(p, a, b, c) (p)->Clear(a, b, c)
|
||||
#define IDirect3DViewport2_AddLight(p, a) (p)->AddLight(a)
|
||||
#define IDirect3DViewport2_DeleteLight(p, a) (p)->DeleteLight(a)
|
||||
#define IDirect3DViewport2_NextLight(p, a, b, c) (p)->NextLight(a, b, c)
|
||||
#define IDirect3DViewport2_GetViewport2(p, a) (p)->GetViewport2(a)
|
||||
#define IDirect3DViewport2_SetViewport2(p, a) (p)->SetViewport2(a)
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Flags for IDirect3DDevice::NextViewport
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Return the next viewport
|
||||
*/
|
||||
#define D3DNEXT_NEXT 0x00000001l
|
||||
|
||||
/*
|
||||
* Return the first viewport
|
||||
*/
|
||||
#define D3DNEXT_HEAD 0x00000002l
|
||||
|
||||
/*
|
||||
* Return the last viewport
|
||||
*/
|
||||
#define D3DNEXT_TAIL 0x00000004l
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Flags for DrawPrimitive/DrawIndexedPrimitive
|
||||
* Also valid for Begin/BeginIndexed
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Wait until the device is ready to draw the primitive
|
||||
* This will cause DP to not return DDERR_WASSTILLDRAWING
|
||||
*/
|
||||
#define D3DDP_WAIT 0x00000001l
|
||||
|
||||
|
||||
/*
|
||||
* Hint that the primitives have been clipped by the application.
|
||||
*/
|
||||
#define D3DDP_DONOTCLIP 0x00000004l
|
||||
|
||||
/*
|
||||
* Hint that the extents need not be updated.
|
||||
*/
|
||||
#define D3DDP_DONOTUPDATEEXTENTS 0x00000008l
|
||||
|
||||
/*
|
||||
* Direct3D Errors
|
||||
* DirectDraw error codes are used when errors not specified here.
|
||||
*/
|
||||
#define D3D_OK DD_OK
|
||||
#define D3DERR_BADMAJORVERSION MAKE_DDHRESULT(700)
|
||||
#define D3DERR_BADMINORVERSION MAKE_DDHRESULT(701)
|
||||
|
||||
/*
|
||||
* An invalid device was requested by the application.
|
||||
*/
|
||||
#define D3DERR_INVALID_DEVICE MAKE_DDHRESULT(705)
|
||||
#define D3DERR_INITFAILED MAKE_DDHRESULT(706)
|
||||
|
||||
/*
|
||||
* SetRenderTarget attempted on a device that was
|
||||
* QI'd off the render target.
|
||||
*/
|
||||
#define D3DERR_DEVICEAGGREGATED MAKE_DDHRESULT(707)
|
||||
|
||||
#define D3DERR_EXECUTE_CREATE_FAILED MAKE_DDHRESULT(710)
|
||||
#define D3DERR_EXECUTE_DESTROY_FAILED MAKE_DDHRESULT(711)
|
||||
#define D3DERR_EXECUTE_LOCK_FAILED MAKE_DDHRESULT(712)
|
||||
#define D3DERR_EXECUTE_UNLOCK_FAILED MAKE_DDHRESULT(713)
|
||||
#define D3DERR_EXECUTE_LOCKED MAKE_DDHRESULT(714)
|
||||
#define D3DERR_EXECUTE_NOT_LOCKED MAKE_DDHRESULT(715)
|
||||
|
||||
#define D3DERR_EXECUTE_FAILED MAKE_DDHRESULT(716)
|
||||
#define D3DERR_EXECUTE_CLIPPED_FAILED MAKE_DDHRESULT(717)
|
||||
|
||||
#define D3DERR_TEXTURE_NO_SUPPORT MAKE_DDHRESULT(720)
|
||||
#define D3DERR_TEXTURE_CREATE_FAILED MAKE_DDHRESULT(721)
|
||||
#define D3DERR_TEXTURE_DESTROY_FAILED MAKE_DDHRESULT(722)
|
||||
#define D3DERR_TEXTURE_LOCK_FAILED MAKE_DDHRESULT(723)
|
||||
#define D3DERR_TEXTURE_UNLOCK_FAILED MAKE_DDHRESULT(724)
|
||||
#define D3DERR_TEXTURE_LOAD_FAILED MAKE_DDHRESULT(725)
|
||||
#define D3DERR_TEXTURE_SWAP_FAILED MAKE_DDHRESULT(726)
|
||||
#define D3DERR_TEXTURE_LOCKED MAKE_DDHRESULT(727)
|
||||
#define D3DERR_TEXTURE_NOT_LOCKED MAKE_DDHRESULT(728)
|
||||
#define D3DERR_TEXTURE_GETSURF_FAILED MAKE_DDHRESULT(729)
|
||||
|
||||
#define D3DERR_MATRIX_CREATE_FAILED MAKE_DDHRESULT(730)
|
||||
#define D3DERR_MATRIX_DESTROY_FAILED MAKE_DDHRESULT(731)
|
||||
#define D3DERR_MATRIX_SETDATA_FAILED MAKE_DDHRESULT(732)
|
||||
#define D3DERR_MATRIX_GETDATA_FAILED MAKE_DDHRESULT(733)
|
||||
#define D3DERR_SETVIEWPORTDATA_FAILED MAKE_DDHRESULT(734)
|
||||
|
||||
#define D3DERR_INVALIDCURRENTVIEWPORT MAKE_DDHRESULT(735)
|
||||
#define D3DERR_INVALIDPRIMITIVETYPE MAKE_DDHRESULT(736)
|
||||
#define D3DERR_INVALIDVERTEXTYPE MAKE_DDHRESULT(737)
|
||||
#define D3DERR_TEXTURE_BADSIZE MAKE_DDHRESULT(738)
|
||||
#define D3DERR_INVALIDRAMPTEXTURE MAKE_DDHRESULT(739)
|
||||
|
||||
#define D3DERR_MATERIAL_CREATE_FAILED MAKE_DDHRESULT(740)
|
||||
#define D3DERR_MATERIAL_DESTROY_FAILED MAKE_DDHRESULT(741)
|
||||
#define D3DERR_MATERIAL_SETDATA_FAILED MAKE_DDHRESULT(742)
|
||||
#define D3DERR_MATERIAL_GETDATA_FAILED MAKE_DDHRESULT(743)
|
||||
#define D3DERR_INVALIDPALETTE MAKE_DDHRESULT(744)
|
||||
|
||||
#define D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY MAKE_DDHRESULT(745)
|
||||
#define D3DERR_ZBUFF_NEEDS_VIDEOMEMORY MAKE_DDHRESULT(746)
|
||||
#define D3DERR_SURFACENOTINVIDMEM MAKE_DDHRESULT(747)
|
||||
|
||||
#define D3DERR_LIGHT_SET_FAILED MAKE_DDHRESULT(750)
|
||||
#define D3DERR_LIGHTHASVIEWPORT MAKE_DDHRESULT(751)
|
||||
#define D3DERR_LIGHTNOTINTHISVIEWPORT MAKE_DDHRESULT(752)
|
||||
|
||||
#define D3DERR_SCENE_IN_SCENE MAKE_DDHRESULT(760)
|
||||
#define D3DERR_SCENE_NOT_IN_SCENE MAKE_DDHRESULT(761)
|
||||
#define D3DERR_SCENE_BEGIN_FAILED MAKE_DDHRESULT(762)
|
||||
#define D3DERR_SCENE_END_FAILED MAKE_DDHRESULT(763)
|
||||
|
||||
#define D3DERR_INBEGIN MAKE_DDHRESULT(770)
|
||||
#define D3DERR_NOTINBEGIN MAKE_DDHRESULT(771)
|
||||
#define D3DERR_NOVIEWPORTS MAKE_DDHRESULT(772)
|
||||
#define D3DERR_VIEWPORTDATANOTSET MAKE_DDHRESULT(773)
|
||||
#define D3DERR_VIEWPORTHASNODEVICE MAKE_DDHRESULT(774)
|
||||
#define D3DERR_NOCURRENTVIEWPORT MAKE_DDHRESULT(775)
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* _D3D_H_ */
|
||||
313
3rdparty/dx5/inc/d3dcaps.h
vendored
Normal file
313
3rdparty/dx5/inc/d3dcaps.h
vendored
Normal file
@ -0,0 +1,313 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: d3dcaps.h
|
||||
* Content: Direct3D capabilities include file
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _D3DCAPS_H
|
||||
#define _D3DCAPS_H
|
||||
|
||||
/*
|
||||
* Pull in DirectDraw include file automatically:
|
||||
*/
|
||||
#include <ddraw.h>
|
||||
|
||||
#pragma pack(4)
|
||||
|
||||
/* Description of capabilities of transform */
|
||||
|
||||
typedef struct _D3DTRANSFORMCAPS {
|
||||
DWORD dwSize;
|
||||
DWORD dwCaps;
|
||||
} D3DTRANSFORMCAPS, *LPD3DTRANSFORMCAPS;
|
||||
|
||||
#define D3DTRANSFORMCAPS_CLIP 0x00000001L /* Will clip whilst transforming */
|
||||
|
||||
/* Description of capabilities of lighting */
|
||||
|
||||
typedef struct _D3DLIGHTINGCAPS {
|
||||
DWORD dwSize;
|
||||
DWORD dwCaps; /* Lighting caps */
|
||||
DWORD dwLightingModel; /* Lighting model - RGB or mono */
|
||||
DWORD dwNumLights; /* Number of lights that can be handled */
|
||||
} D3DLIGHTINGCAPS, *LPD3DLIGHTINGCAPS;
|
||||
|
||||
#define D3DLIGHTINGMODEL_RGB 0x00000001L
|
||||
#define D3DLIGHTINGMODEL_MONO 0x00000002L
|
||||
|
||||
#define D3DLIGHTCAPS_POINT 0x00000001L /* Point lights supported */
|
||||
#define D3DLIGHTCAPS_SPOT 0x00000002L /* Spot lights supported */
|
||||
#define D3DLIGHTCAPS_DIRECTIONAL 0x00000004L /* Directional lights supported */
|
||||
#define D3DLIGHTCAPS_PARALLELPOINT 0x00000008L /* Parallel point lights supported */
|
||||
|
||||
/* Description of capabilities for each primitive type */
|
||||
|
||||
typedef struct _D3DPrimCaps {
|
||||
DWORD dwSize;
|
||||
DWORD dwMiscCaps; /* Capability flags */
|
||||
DWORD dwRasterCaps;
|
||||
DWORD dwZCmpCaps;
|
||||
DWORD dwSrcBlendCaps;
|
||||
DWORD dwDestBlendCaps;
|
||||
DWORD dwAlphaCmpCaps;
|
||||
DWORD dwShadeCaps;
|
||||
DWORD dwTextureCaps;
|
||||
DWORD dwTextureFilterCaps;
|
||||
DWORD dwTextureBlendCaps;
|
||||
DWORD dwTextureAddressCaps;
|
||||
DWORD dwStippleWidth; /* maximum width and height of */
|
||||
DWORD dwStippleHeight; /* of supported stipple (up to 32x32) */
|
||||
} D3DPRIMCAPS, *LPD3DPRIMCAPS;
|
||||
|
||||
/* D3DPRIMCAPS dwMiscCaps */
|
||||
|
||||
#define D3DPMISCCAPS_MASKPLANES 0x00000001L
|
||||
#define D3DPMISCCAPS_MASKZ 0x00000002L
|
||||
#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L
|
||||
#define D3DPMISCCAPS_CONFORMANT 0x00000008L
|
||||
#define D3DPMISCCAPS_CULLNONE 0x00000010L
|
||||
#define D3DPMISCCAPS_CULLCW 0x00000020L
|
||||
#define D3DPMISCCAPS_CULLCCW 0x00000040L
|
||||
|
||||
/* D3DPRIMCAPS dwRasterCaps */
|
||||
|
||||
#define D3DPRASTERCAPS_DITHER 0x00000001L
|
||||
#define D3DPRASTERCAPS_ROP2 0x00000002L
|
||||
#define D3DPRASTERCAPS_XOR 0x00000004L
|
||||
#define D3DPRASTERCAPS_PAT 0x00000008L
|
||||
#define D3DPRASTERCAPS_ZTEST 0x00000010L
|
||||
#define D3DPRASTERCAPS_SUBPIXEL 0x00000020L
|
||||
#define D3DPRASTERCAPS_SUBPIXELX 0x00000040L
|
||||
#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L
|
||||
#define D3DPRASTERCAPS_FOGTABLE 0x00000100L
|
||||
#define D3DPRASTERCAPS_STIPPLE 0x00000200L
|
||||
#define D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT 0x00000400L
|
||||
#define D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT 0x00000800L
|
||||
#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L
|
||||
#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L
|
||||
#define D3DPRASTERCAPS_ZBIAS 0x00004000L
|
||||
#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L
|
||||
#define D3DPRASTERCAPS_FOGRANGE 0x00010000L
|
||||
#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L
|
||||
|
||||
/* D3DPRIMCAPS dwZCmpCaps, dwAlphaCmpCaps */
|
||||
|
||||
#define D3DPCMPCAPS_NEVER 0x00000001L
|
||||
#define D3DPCMPCAPS_LESS 0x00000002L
|
||||
#define D3DPCMPCAPS_EQUAL 0x00000004L
|
||||
#define D3DPCMPCAPS_LESSEQUAL 0x00000008L
|
||||
#define D3DPCMPCAPS_GREATER 0x00000010L
|
||||
#define D3DPCMPCAPS_NOTEQUAL 0x00000020L
|
||||
#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L
|
||||
#define D3DPCMPCAPS_ALWAYS 0x00000080L
|
||||
|
||||
/* D3DPRIMCAPS dwSourceBlendCaps, dwDestBlendCaps */
|
||||
|
||||
#define D3DPBLENDCAPS_ZERO 0x00000001L
|
||||
#define D3DPBLENDCAPS_ONE 0x00000002L
|
||||
#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L
|
||||
#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L
|
||||
#define D3DPBLENDCAPS_SRCALPHA 0x00000010L
|
||||
#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L
|
||||
#define D3DPBLENDCAPS_DESTALPHA 0x00000040L
|
||||
#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L
|
||||
#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L
|
||||
#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L
|
||||
#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L
|
||||
#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L
|
||||
#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L
|
||||
|
||||
/* D3DPRIMCAPS dwShadeCaps */
|
||||
|
||||
#define D3DPSHADECAPS_COLORFLATMONO 0x00000001L
|
||||
#define D3DPSHADECAPS_COLORFLATRGB 0x00000002L
|
||||
#define D3DPSHADECAPS_COLORGOURAUDMONO 0x00000004L
|
||||
#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L
|
||||
#define D3DPSHADECAPS_COLORPHONGMONO 0x00000010L
|
||||
#define D3DPSHADECAPS_COLORPHONGRGB 0x00000020L
|
||||
|
||||
#define D3DPSHADECAPS_SPECULARFLATMONO 0x00000040L
|
||||
#define D3DPSHADECAPS_SPECULARFLATRGB 0x00000080L
|
||||
#define D3DPSHADECAPS_SPECULARGOURAUDMONO 0x00000100L
|
||||
#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L
|
||||
#define D3DPSHADECAPS_SPECULARPHONGMONO 0x00000400L
|
||||
#define D3DPSHADECAPS_SPECULARPHONGRGB 0x00000800L
|
||||
|
||||
#define D3DPSHADECAPS_ALPHAFLATBLEND 0x00001000L
|
||||
#define D3DPSHADECAPS_ALPHAFLATSTIPPLED 0x00002000L
|
||||
#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L
|
||||
#define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED 0x00008000L
|
||||
#define D3DPSHADECAPS_ALPHAPHONGBLEND 0x00010000L
|
||||
#define D3DPSHADECAPS_ALPHAPHONGSTIPPLED 0x00020000L
|
||||
|
||||
#define D3DPSHADECAPS_FOGFLAT 0x00040000L
|
||||
#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L
|
||||
#define D3DPSHADECAPS_FOGPHONG 0x00100000L
|
||||
|
||||
/* D3DPRIMCAPS dwTextureCaps */
|
||||
|
||||
#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L
|
||||
#define D3DPTEXTURECAPS_POW2 0x00000002L
|
||||
#define D3DPTEXTURECAPS_ALPHA 0x00000004L
|
||||
#define D3DPTEXTURECAPS_TRANSPARENCY 0x00000008L
|
||||
#define D3DPTEXTURECAPS_BORDER 0x00000010L
|
||||
#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L
|
||||
|
||||
/* D3DPRIMCAPS dwTextureFilterCaps */
|
||||
|
||||
#define D3DPTFILTERCAPS_NEAREST 0x00000001L
|
||||
#define D3DPTFILTERCAPS_LINEAR 0x00000002L
|
||||
#define D3DPTFILTERCAPS_MIPNEAREST 0x00000004L
|
||||
#define D3DPTFILTERCAPS_MIPLINEAR 0x00000008L
|
||||
#define D3DPTFILTERCAPS_LINEARMIPNEAREST 0x00000010L
|
||||
#define D3DPTFILTERCAPS_LINEARMIPLINEAR 0x00000020L
|
||||
|
||||
/* D3DPRIMCAPS dwTextureBlendCaps */
|
||||
|
||||
#define D3DPTBLENDCAPS_DECAL 0x00000001L
|
||||
#define D3DPTBLENDCAPS_MODULATE 0x00000002L
|
||||
#define D3DPTBLENDCAPS_DECALALPHA 0x00000004L
|
||||
#define D3DPTBLENDCAPS_MODULATEALPHA 0x00000008L
|
||||
#define D3DPTBLENDCAPS_DECALMASK 0x00000010L
|
||||
#define D3DPTBLENDCAPS_MODULATEMASK 0x00000020L
|
||||
#define D3DPTBLENDCAPS_COPY 0x00000040L
|
||||
#define D3DPTBLENDCAPS_ADD 0x00000080L
|
||||
|
||||
/* D3DPRIMCAPS dwTextureAddressCaps */
|
||||
#define D3DPTADDRESSCAPS_WRAP 0x00000001L
|
||||
#define D3DPTADDRESSCAPS_MIRROR 0x00000002L
|
||||
#define D3DPTADDRESSCAPS_CLAMP 0x00000004L
|
||||
#define D3DPTADDRESSCAPS_BORDER 0x00000008L
|
||||
#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L
|
||||
|
||||
/*
|
||||
* Description for a device.
|
||||
* This is used to describe a device that is to be created or to query
|
||||
* the current device.
|
||||
*/
|
||||
typedef struct _D3DDeviceDesc {
|
||||
DWORD dwSize; /* Size of D3DDEVICEDESC structure */
|
||||
DWORD dwFlags; /* Indicates which fields have valid data */
|
||||
D3DCOLORMODEL dcmColorModel; /* Color model of device */
|
||||
DWORD dwDevCaps; /* Capabilities of device */
|
||||
D3DTRANSFORMCAPS dtcTransformCaps; /* Capabilities of transform */
|
||||
BOOL bClipping; /* Device can do 3D clipping */
|
||||
D3DLIGHTINGCAPS dlcLightingCaps; /* Capabilities of lighting */
|
||||
D3DPRIMCAPS dpcLineCaps;
|
||||
D3DPRIMCAPS dpcTriCaps;
|
||||
DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
|
||||
DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
|
||||
DWORD dwMaxBufferSize; /* Maximum execute buffer size */
|
||||
DWORD dwMaxVertexCount; /* Maximum vertex count */
|
||||
// *** New fields for DX5 *** //
|
||||
|
||||
// Width and height caps are 0 for legacy HALs.
|
||||
DWORD dwMinTextureWidth, dwMinTextureHeight;
|
||||
DWORD dwMaxTextureWidth, dwMaxTextureHeight;
|
||||
DWORD dwMinStippleWidth, dwMaxStippleWidth;
|
||||
DWORD dwMinStippleHeight, dwMaxStippleHeight;
|
||||
} D3DDEVICEDESC, *LPD3DDEVICEDESC;
|
||||
|
||||
#define D3DDEVICEDESCSIZE (sizeof(D3DDEVICEDESC))
|
||||
|
||||
typedef HRESULT (FAR PASCAL * LPD3DENUMDEVICESCALLBACK)(LPGUID lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC, LPD3DDEVICEDESC, LPVOID);
|
||||
|
||||
/* D3DDEVICEDESC dwFlags indicating valid fields */
|
||||
|
||||
#define D3DDD_COLORMODEL 0x00000001L /* dcmColorModel is valid */
|
||||
#define D3DDD_DEVCAPS 0x00000002L /* dwDevCaps is valid */
|
||||
#define D3DDD_TRANSFORMCAPS 0x00000004L /* dtcTransformCaps is valid */
|
||||
#define D3DDD_LIGHTINGCAPS 0x00000008L /* dlcLightingCaps is valid */
|
||||
#define D3DDD_BCLIPPING 0x00000010L /* bClipping is valid */
|
||||
#define D3DDD_LINECAPS 0x00000020L /* dpcLineCaps is valid */
|
||||
#define D3DDD_TRICAPS 0x00000040L /* dpcTriCaps is valid */
|
||||
#define D3DDD_DEVICERENDERBITDEPTH 0x00000080L /* dwDeviceRenderBitDepth is valid */
|
||||
#define D3DDD_DEVICEZBUFFERBITDEPTH 0x00000100L /* dwDeviceZBufferBitDepth is valid */
|
||||
#define D3DDD_MAXBUFFERSIZE 0x00000200L /* dwMaxBufferSize is valid */
|
||||
#define D3DDD_MAXVERTEXCOUNT 0x00000400L /* dwMaxVertexCount is valid */
|
||||
|
||||
/* D3DDEVICEDESC dwDevCaps flags */
|
||||
|
||||
#define D3DDEVCAPS_FLOATTLVERTEX 0x00000001L /* Device accepts floating point */
|
||||
/* for post-transform vertex data */
|
||||
#define D3DDEVCAPS_SORTINCREASINGZ 0x00000002L /* Device needs data sorted for increasing Z*/
|
||||
#define D3DDEVCAPS_SORTDECREASINGZ 0X00000004L /* Device needs data sorted for decreasing Z*/
|
||||
#define D3DDEVCAPS_SORTEXACT 0x00000008L /* Device needs data sorted exactly */
|
||||
|
||||
#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */
|
||||
#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */
|
||||
#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */
|
||||
#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */
|
||||
#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */
|
||||
#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */
|
||||
#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */
|
||||
#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */
|
||||
#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */
|
||||
|
||||
#define D3DFDS_COLORMODEL 0x00000001L /* Match color model */
|
||||
#define D3DFDS_GUID 0x00000002L /* Match guid */
|
||||
#define D3DFDS_HARDWARE 0x00000004L /* Match hardware/software */
|
||||
#define D3DFDS_TRIANGLES 0x00000008L /* Match in triCaps */
|
||||
#define D3DFDS_LINES 0x00000010L /* Match in lineCaps */
|
||||
#define D3DFDS_MISCCAPS 0x00000020L /* Match primCaps.dwMiscCaps */
|
||||
#define D3DFDS_RASTERCAPS 0x00000040L /* Match primCaps.dwRasterCaps */
|
||||
#define D3DFDS_ZCMPCAPS 0x00000080L /* Match primCaps.dwZCmpCaps */
|
||||
#define D3DFDS_ALPHACMPCAPS 0x00000100L /* Match primCaps.dwAlphaCmpCaps */
|
||||
#define D3DFDS_SRCBLENDCAPS 0x00000200L /* Match primCaps.dwSourceBlendCaps */
|
||||
#define D3DFDS_DSTBLENDCAPS 0x00000400L /* Match primCaps.dwDestBlendCaps */
|
||||
#define D3DFDS_SHADECAPS 0x00000800L /* Match primCaps.dwShadeCaps */
|
||||
#define D3DFDS_TEXTURECAPS 0x00001000L /* Match primCaps.dwTextureCaps */
|
||||
#define D3DFDS_TEXTUREFILTERCAPS 0x00002000L /* Match primCaps.dwTextureFilterCaps */
|
||||
#define D3DFDS_TEXTUREBLENDCAPS 0x00004000L /* Match primCaps.dwTextureBlendCaps */
|
||||
#define D3DFDS_TEXTUREADDRESSCAPS 0x00008000L /* Match primCaps.dwTextureBlendCaps */
|
||||
|
||||
/*
|
||||
* FindDevice arguments
|
||||
*/
|
||||
typedef struct _D3DFINDDEVICESEARCH {
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
BOOL bHardware;
|
||||
D3DCOLORMODEL dcmColorModel;
|
||||
GUID guid;
|
||||
DWORD dwCaps;
|
||||
D3DPRIMCAPS dpcPrimCaps;
|
||||
} D3DFINDDEVICESEARCH, *LPD3DFINDDEVICESEARCH;
|
||||
|
||||
typedef struct _D3DFINDDEVICERESULT {
|
||||
DWORD dwSize;
|
||||
GUID guid; /* guid which matched */
|
||||
D3DDEVICEDESC ddHwDesc; /* hardware D3DDEVICEDESC */
|
||||
D3DDEVICEDESC ddSwDesc; /* software D3DDEVICEDESC */
|
||||
} D3DFINDDEVICERESULT, *LPD3DFINDDEVICERESULT;
|
||||
|
||||
|
||||
/*
|
||||
* Description of execute buffer.
|
||||
*/
|
||||
typedef struct _D3DExecuteBufferDesc {
|
||||
DWORD dwSize; /* size of this structure */
|
||||
DWORD dwFlags; /* flags indicating which fields are valid */
|
||||
DWORD dwCaps; /* capabilities of execute buffer */
|
||||
DWORD dwBufferSize; /* size of execute buffer data */
|
||||
LPVOID lpData; /* pointer to actual data */
|
||||
} D3DEXECUTEBUFFERDESC, *LPD3DEXECUTEBUFFERDESC;
|
||||
|
||||
/* D3DEXECUTEBUFFER dwFlags indicating valid fields */
|
||||
|
||||
#define D3DDEB_BUFSIZE 0x00000001l /* buffer size valid */
|
||||
#define D3DDEB_CAPS 0x00000002l /* caps valid */
|
||||
#define D3DDEB_LPDATA 0x00000004l /* lpData valid */
|
||||
|
||||
/* D3DEXECUTEBUFFER dwCaps */
|
||||
|
||||
#define D3DDEBCAPS_SYSTEMMEMORY 0x00000001l /* buffer in system memory */
|
||||
#define D3DDEBCAPS_VIDEOMEMORY 0x00000002l /* buffer in device memory */
|
||||
#define D3DDEBCAPS_MEM (D3DDEBCAPS_SYSTEMMEMORY|D3DDEBCAPS_VIDEOMEMORY)
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif /* _D3DCAPS_H_ */
|
||||
229
3rdparty/dx5/inc/d3drm.h
vendored
Normal file
229
3rdparty/dx5/inc/d3drm.h
vendored
Normal file
@ -0,0 +1,229 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: d3drm.h
|
||||
* Content: Direct3DRM include file
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __D3DRM_H__
|
||||
#define __D3DRM_H__
|
||||
|
||||
#include "ddraw.h"
|
||||
#include "d3drmobj.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
struct IDirect3DRM;
|
||||
#endif
|
||||
|
||||
|
||||
DEFINE_GUID(IID_IDirect3DRM, 0x2bc49361, 0x8327, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
|
||||
DEFINE_GUID(IID_IDirect3DRM2, 0x4516ecc8, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
|
||||
WIN_TYPES(IDirect3DRM, DIRECT3DRM);
|
||||
WIN_TYPES(IDirect3DRM2, DIRECT3DRM2);
|
||||
|
||||
|
||||
/* Create a Direct3DRM API */
|
||||
STDAPI Direct3DRMCreate(LPDIRECT3DRM FAR *lplpDirect3DRM);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DRM
|
||||
|
||||
DECLARE_INTERFACE_(IDirect3DRM, IUnknown)
|
||||
{
|
||||
IUNKNOWN_METHODS(PURE);
|
||||
|
||||
STDMETHOD(CreateObject)
|
||||
(THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppv) PURE;
|
||||
STDMETHOD(CreateFrame) (THIS_ LPDIRECT3DRMFRAME, LPDIRECT3DRMFRAME *) PURE;
|
||||
STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *) PURE;
|
||||
STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER *) PURE;
|
||||
STDMETHOD(CreateFace) (THIS_ LPDIRECT3DRMFACE *) PURE;
|
||||
STDMETHOD(CreateAnimation) (THIS_ LPDIRECT3DRMANIMATION *) PURE;
|
||||
STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET *) PURE;
|
||||
STDMETHOD(CreateTexture) (THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE *) PURE;
|
||||
STDMETHOD(CreateLight) (THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE;
|
||||
STDMETHOD(CreateLightRGB)
|
||||
(THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE;
|
||||
STDMETHOD(CreateMaterial) (THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL *) PURE;
|
||||
STDMETHOD(CreateDevice) (THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE *) PURE;
|
||||
|
||||
/* Create a Windows Device using DirectDraw surfaces */
|
||||
STDMETHOD(CreateDeviceFromSurface)
|
||||
( THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD,
|
||||
LPDIRECTDRAWSURFACE lpDDSBack, LPDIRECT3DRMDEVICE *
|
||||
) PURE;
|
||||
|
||||
/* Create a Windows Device using D3D objects */
|
||||
STDMETHOD(CreateDeviceFromD3D)
|
||||
( THIS_ LPDIRECT3D lpD3D, LPDIRECT3DDEVICE lpD3DDev,
|
||||
LPDIRECT3DRMDEVICE *
|
||||
) PURE;
|
||||
|
||||
STDMETHOD(CreateDeviceFromClipper)
|
||||
( THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID,
|
||||
int width, int height, LPDIRECT3DRMDEVICE *) PURE;
|
||||
|
||||
STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DRMTEXTURE *) PURE;
|
||||
|
||||
STDMETHOD(CreateShadow)
|
||||
( THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMLIGHT,
|
||||
D3DVALUE px, D3DVALUE py, D3DVALUE pz,
|
||||
D3DVALUE nx, D3DVALUE ny, D3DVALUE nz,
|
||||
LPDIRECT3DRMVISUAL *
|
||||
) PURE;
|
||||
STDMETHOD(CreateViewport)
|
||||
( THIS_ LPDIRECT3DRMDEVICE, LPDIRECT3DRMFRAME, DWORD, DWORD,
|
||||
DWORD, DWORD, LPDIRECT3DRMVIEWPORT *
|
||||
) PURE;
|
||||
STDMETHOD(CreateWrap)
|
||||
( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME,
|
||||
D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
|
||||
D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
|
||||
D3DVALUE ux, D3DVALUE uy, D3DVALUE uz,
|
||||
D3DVALUE ou, D3DVALUE ov,
|
||||
D3DVALUE su, D3DVALUE sv,
|
||||
LPDIRECT3DRMWRAP *
|
||||
) PURE;
|
||||
STDMETHOD(CreateUserVisual) (THIS_ D3DRMUSERVISUALCALLBACK, LPVOID lPArg, LPDIRECT3DRMUSERVISUAL *) PURE;
|
||||
STDMETHOD(LoadTexture) (THIS_ const char *, LPDIRECT3DRMTEXTURE *) PURE;
|
||||
STDMETHOD(LoadTextureFromResource) (THIS_ HRSRC rs, LPDIRECT3DRMTEXTURE *) PURE;
|
||||
|
||||
STDMETHOD(SetSearchPath) (THIS_ LPCSTR) PURE;
|
||||
STDMETHOD(AddSearchPath) (THIS_ LPCSTR) PURE;
|
||||
STDMETHOD(GetSearchPath) (THIS_ DWORD *size_return, LPSTR path_return) PURE;
|
||||
STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE;
|
||||
STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE;
|
||||
|
||||
STDMETHOD(GetDevices) (THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE;
|
||||
STDMETHOD(GetNamedObject) (THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE;
|
||||
|
||||
STDMETHOD(EnumerateObjects) (THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE;
|
||||
|
||||
STDMETHOD(Load)
|
||||
( THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS,
|
||||
D3DRMLOADCALLBACK, LPVOID, D3DRMLOADTEXTURECALLBACK, LPVOID,
|
||||
LPDIRECT3DRMFRAME
|
||||
) PURE;
|
||||
STDMETHOD(Tick) (THIS_ D3DVALUE) PURE;
|
||||
};
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DRM2
|
||||
|
||||
DECLARE_INTERFACE_(IDirect3DRM2, IUnknown)
|
||||
{
|
||||
IUNKNOWN_METHODS(PURE);
|
||||
|
||||
STDMETHOD(CreateObject)
|
||||
(THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppv) PURE;
|
||||
STDMETHOD(CreateFrame) (THIS_ LPDIRECT3DRMFRAME, LPDIRECT3DRMFRAME2 *) PURE;
|
||||
STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *) PURE;
|
||||
STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER2 *) PURE;
|
||||
STDMETHOD(CreateFace) (THIS_ LPDIRECT3DRMFACE *) PURE;
|
||||
STDMETHOD(CreateAnimation) (THIS_ LPDIRECT3DRMANIMATION *) PURE;
|
||||
STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET *) PURE;
|
||||
STDMETHOD(CreateTexture) (THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE2 *) PURE;
|
||||
STDMETHOD(CreateLight) (THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE;
|
||||
STDMETHOD(CreateLightRGB)
|
||||
(THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE;
|
||||
STDMETHOD(CreateMaterial) (THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL *) PURE;
|
||||
STDMETHOD(CreateDevice) (THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE2 *) PURE;
|
||||
|
||||
/* Create a Windows Device using DirectDraw surfaces */
|
||||
STDMETHOD(CreateDeviceFromSurface)
|
||||
( THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD,
|
||||
LPDIRECTDRAWSURFACE lpDDSBack, LPDIRECT3DRMDEVICE2 *
|
||||
) PURE;
|
||||
|
||||
/* Create a Windows Device using D3D objects */
|
||||
STDMETHOD(CreateDeviceFromD3D)
|
||||
( THIS_ LPDIRECT3D2 lpD3D, LPDIRECT3DDEVICE2 lpD3DDev,
|
||||
LPDIRECT3DRMDEVICE2 *
|
||||
) PURE;
|
||||
|
||||
STDMETHOD(CreateDeviceFromClipper)
|
||||
( THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID,
|
||||
int width, int height, LPDIRECT3DRMDEVICE2 *) PURE;
|
||||
|
||||
STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DRMTEXTURE2 *) PURE;
|
||||
|
||||
STDMETHOD(CreateShadow)
|
||||
( THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMLIGHT,
|
||||
D3DVALUE px, D3DVALUE py, D3DVALUE pz,
|
||||
D3DVALUE nx, D3DVALUE ny, D3DVALUE nz,
|
||||
LPDIRECT3DRMVISUAL *
|
||||
) PURE;
|
||||
STDMETHOD(CreateViewport)
|
||||
( THIS_ LPDIRECT3DRMDEVICE, LPDIRECT3DRMFRAME, DWORD, DWORD,
|
||||
DWORD, DWORD, LPDIRECT3DRMVIEWPORT *
|
||||
) PURE;
|
||||
STDMETHOD(CreateWrap)
|
||||
( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME,
|
||||
D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
|
||||
D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
|
||||
D3DVALUE ux, D3DVALUE uy, D3DVALUE uz,
|
||||
D3DVALUE ou, D3DVALUE ov,
|
||||
D3DVALUE su, D3DVALUE sv,
|
||||
LPDIRECT3DRMWRAP *
|
||||
) PURE;
|
||||
STDMETHOD(CreateUserVisual) (THIS_ D3DRMUSERVISUALCALLBACK, LPVOID lPArg, LPDIRECT3DRMUSERVISUAL *) PURE;
|
||||
STDMETHOD(LoadTexture) (THIS_ const char *, LPDIRECT3DRMTEXTURE2 *) PURE;
|
||||
STDMETHOD(LoadTextureFromResource) (THIS_ HMODULE hModule, LPCTSTR strName, LPCTSTR strType, LPDIRECT3DRMTEXTURE2 *) PURE;
|
||||
|
||||
STDMETHOD(SetSearchPath) (THIS_ LPCSTR) PURE;
|
||||
STDMETHOD(AddSearchPath) (THIS_ LPCSTR) PURE;
|
||||
STDMETHOD(GetSearchPath) (THIS_ DWORD *size_return, LPSTR path_return) PURE;
|
||||
STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE;
|
||||
STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE;
|
||||
|
||||
STDMETHOD(GetDevices) (THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE;
|
||||
STDMETHOD(GetNamedObject) (THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE;
|
||||
|
||||
STDMETHOD(EnumerateObjects) (THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE;
|
||||
|
||||
STDMETHOD(Load)
|
||||
( THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS,
|
||||
D3DRMLOADCALLBACK, LPVOID, D3DRMLOADTEXTURECALLBACK, LPVOID,
|
||||
LPDIRECT3DRMFRAME
|
||||
) PURE;
|
||||
STDMETHOD(Tick) (THIS_ D3DVALUE) PURE;
|
||||
|
||||
STDMETHOD(CreateProgressiveMesh)(THIS_ LPDIRECT3DRMPROGRESSIVEMESH *) PURE;
|
||||
};
|
||||
|
||||
#define D3DRM_OK DD_OK
|
||||
#define D3DRMERR_BADOBJECT MAKE_DDHRESULT(781)
|
||||
#define D3DRMERR_BADTYPE MAKE_DDHRESULT(782)
|
||||
#define D3DRMERR_BADALLOC MAKE_DDHRESULT(783)
|
||||
#define D3DRMERR_FACEUSED MAKE_DDHRESULT(784)
|
||||
#define D3DRMERR_NOTFOUND MAKE_DDHRESULT(785)
|
||||
#define D3DRMERR_NOTDONEYET MAKE_DDHRESULT(786)
|
||||
#define D3DRMERR_FILENOTFOUND MAKE_DDHRESULT(787)
|
||||
#define D3DRMERR_BADFILE MAKE_DDHRESULT(788)
|
||||
#define D3DRMERR_BADDEVICE MAKE_DDHRESULT(789)
|
||||
#define D3DRMERR_BADVALUE MAKE_DDHRESULT(790)
|
||||
#define D3DRMERR_BADMAJORVERSION MAKE_DDHRESULT(791)
|
||||
#define D3DRMERR_BADMINORVERSION MAKE_DDHRESULT(792)
|
||||
#define D3DRMERR_UNABLETOEXECUTE MAKE_DDHRESULT(793)
|
||||
#define D3DRMERR_LIBRARYNOTFOUND MAKE_DDHRESULT(794)
|
||||
#define D3DRMERR_INVALIDLIBRARY MAKE_DDHRESULT(795)
|
||||
#define D3DRMERR_PENDING MAKE_DDHRESULT(796)
|
||||
#define D3DRMERR_NOTENOUGHDATA MAKE_DDHRESULT(797)
|
||||
#define D3DRMERR_REQUESTTOOLARGE MAKE_DDHRESULT(798)
|
||||
#define D3DRMERR_REQUESTTOOSMALL MAKE_DDHRESULT(799)
|
||||
#define D3DRMERR_CONNECTIONLOST MAKE_DDHRESULT(800)
|
||||
#define D3DRMERR_LOADABORTED MAKE_DDHRESULT(801)
|
||||
#define D3DRMERR_NOINTERNET MAKE_DDHRESULT(802)
|
||||
#define D3DRMERR_BADCACHEFILE MAKE_DDHRESULT(803)
|
||||
#define D3DRMERR_BOXNOTSET MAKE_DDHRESULT(804)
|
||||
#define D3DRMERR_BADPMDATA MAKE_DDHRESULT(805)
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* _D3DRMAPI_H_ */
|
||||
|
||||
472
3rdparty/dx5/inc/d3drmdef.h
vendored
Normal file
472
3rdparty/dx5/inc/d3drmdef.h
vendored
Normal file
@ -0,0 +1,472 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: d3drm.h
|
||||
* Content: Direct3DRM include file
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __D3DRMDEFS_H__
|
||||
#define __D3DRMDEFS_H__
|
||||
|
||||
#include <stddef.h>
|
||||
#include "d3dtypes.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#define D3DRMAPI __stdcall
|
||||
#else
|
||||
#define D3DRMAPI
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
typedef struct _D3DRMVECTOR4D
|
||||
{ D3DVALUE x, y, z, w;
|
||||
} D3DRMVECTOR4D, *LPD3DRMVECTOR4D;
|
||||
|
||||
typedef D3DVALUE D3DRMMATRIX4D[4][4];
|
||||
|
||||
typedef struct _D3DRMQUATERNION
|
||||
{ D3DVALUE s;
|
||||
D3DVECTOR v;
|
||||
} D3DRMQUATERNION, *LPD3DRMQUATERNION;
|
||||
|
||||
typedef struct _D3DRMRAY
|
||||
{ D3DVECTOR dvDir;
|
||||
D3DVECTOR dvPos;
|
||||
} D3DRMRAY, *LPD3DRMRAY;
|
||||
|
||||
typedef struct _D3DRMBOX
|
||||
{ D3DVECTOR min, max;
|
||||
} D3DRMBOX, *LPD3DRMBOX;
|
||||
|
||||
typedef void (*D3DRMWRAPCALLBACK)
|
||||
(LPD3DVECTOR, int* u, int* v, LPD3DVECTOR a, LPD3DVECTOR b, LPVOID);
|
||||
|
||||
typedef enum _D3DRMLIGHTTYPE
|
||||
{ D3DRMLIGHT_AMBIENT,
|
||||
D3DRMLIGHT_POINT,
|
||||
D3DRMLIGHT_SPOT,
|
||||
D3DRMLIGHT_DIRECTIONAL,
|
||||
D3DRMLIGHT_PARALLELPOINT
|
||||
} D3DRMLIGHTTYPE, *LPD3DRMLIGHTTYPE;
|
||||
|
||||
typedef enum _D3DRMSHADEMODE {
|
||||
D3DRMSHADE_FLAT = 0,
|
||||
D3DRMSHADE_GOURAUD = 1,
|
||||
D3DRMSHADE_PHONG = 2,
|
||||
|
||||
D3DRMSHADE_MASK = 7,
|
||||
D3DRMSHADE_MAX = 8
|
||||
} D3DRMSHADEMODE, *LPD3DRMSHADEMODE;
|
||||
|
||||
typedef enum _D3DRMLIGHTMODE {
|
||||
D3DRMLIGHT_OFF = 0 * D3DRMSHADE_MAX,
|
||||
D3DRMLIGHT_ON = 1 * D3DRMSHADE_MAX,
|
||||
|
||||
D3DRMLIGHT_MASK = 7 * D3DRMSHADE_MAX,
|
||||
D3DRMLIGHT_MAX = 8 * D3DRMSHADE_MAX
|
||||
} D3DRMLIGHTMODE, *LPD3DRMLIGHTMODE;
|
||||
|
||||
typedef enum _D3DRMFILLMODE {
|
||||
D3DRMFILL_POINTS = 0 * D3DRMLIGHT_MAX,
|
||||
D3DRMFILL_WIREFRAME = 1 * D3DRMLIGHT_MAX,
|
||||
D3DRMFILL_SOLID = 2 * D3DRMLIGHT_MAX,
|
||||
|
||||
D3DRMFILL_MASK = 7 * D3DRMLIGHT_MAX,
|
||||
D3DRMFILL_MAX = 8 * D3DRMLIGHT_MAX
|
||||
} D3DRMFILLMODE, *LPD3DRMFILLMODE;
|
||||
|
||||
typedef DWORD D3DRMRENDERQUALITY, *LPD3DRMRENDERQUALITY;
|
||||
|
||||
#define D3DRMRENDER_WIREFRAME (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_WIREFRAME)
|
||||
#define D3DRMRENDER_UNLITFLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_SOLID)
|
||||
#define D3DRMRENDER_FLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_ON+D3DRMFILL_SOLID)
|
||||
#define D3DRMRENDER_GOURAUD (D3DRMSHADE_GOURAUD+D3DRMLIGHT_ON+D3DRMFILL_SOLID)
|
||||
#define D3DRMRENDER_PHONG (D3DRMSHADE_PHONG+D3DRMLIGHT_ON+D3DRMFILL_SOLID)
|
||||
|
||||
#define D3DRMRENDERMODE_BLENDEDTRANSPARENCY 1
|
||||
#define D3DRMRENDERMODE_SORTEDTRANSPARENCY 2
|
||||
|
||||
typedef enum _D3DRMTEXTUREQUALITY
|
||||
{ D3DRMTEXTURE_NEAREST, /* choose nearest texel */
|
||||
D3DRMTEXTURE_LINEAR, /* interpolate 4 texels */
|
||||
D3DRMTEXTURE_MIPNEAREST, /* nearest texel in nearest mipmap */
|
||||
D3DRMTEXTURE_MIPLINEAR, /* interpolate 2 texels from 2 mipmaps */
|
||||
D3DRMTEXTURE_LINEARMIPNEAREST, /* interpolate 4 texels in nearest mipmap */
|
||||
D3DRMTEXTURE_LINEARMIPLINEAR /* interpolate 8 texels from 2 mipmaps */
|
||||
} D3DRMTEXTUREQUALITY, *LPD3DRMTEXTUREQUALITY;
|
||||
|
||||
typedef enum _D3DRMCOMBINETYPE
|
||||
{ D3DRMCOMBINE_REPLACE,
|
||||
D3DRMCOMBINE_BEFORE,
|
||||
D3DRMCOMBINE_AFTER
|
||||
} D3DRMCOMBINETYPE, *LPD3DRMCOMBINETYPE;
|
||||
|
||||
typedef D3DCOLORMODEL D3DRMCOLORMODEL, *LPD3DRMCOLORMODEL;
|
||||
|
||||
typedef enum _D3DRMPALETTEFLAGS
|
||||
{ D3DRMPALETTE_FREE, /* renderer may use this entry freely */
|
||||
D3DRMPALETTE_READONLY, /* fixed but may be used by renderer */
|
||||
D3DRMPALETTE_RESERVED /* may not be used by renderer */
|
||||
} D3DRMPALETTEFLAGS, *LPD3DRMPALETTEFLAGS;
|
||||
|
||||
typedef struct _D3DRMPALETTEENTRY
|
||||
{ unsigned char red; /* 0 .. 255 */
|
||||
unsigned char green; /* 0 .. 255 */
|
||||
unsigned char blue; /* 0 .. 255 */
|
||||
unsigned char flags; /* one of D3DRMPALETTEFLAGS */
|
||||
} D3DRMPALETTEENTRY, *LPD3DRMPALETTEENTRY;
|
||||
|
||||
typedef struct _D3DRMIMAGE
|
||||
{ int width, height; /* width and height in pixels */
|
||||
int aspectx, aspecty; /* aspect ratio for non-square pixels */
|
||||
int depth; /* bits per pixel */
|
||||
int rgb; /* if false, pixels are indices into a
|
||||
palette otherwise, pixels encode
|
||||
RGB values. */
|
||||
int bytes_per_line; /* number of bytes of memory for a
|
||||
scanline. This must be a multiple
|
||||
of 4. */
|
||||
void* buffer1; /* memory to render into (first buffer). */
|
||||
void* buffer2; /* second rendering buffer for double
|
||||
buffering, set to NULL for single
|
||||
buffering. */
|
||||
unsigned long red_mask;
|
||||
unsigned long green_mask;
|
||||
unsigned long blue_mask;
|
||||
unsigned long alpha_mask; /* if rgb is true, these are masks for
|
||||
the red, green and blue parts of a
|
||||
pixel. Otherwise, these are masks
|
||||
for the significant bits of the
|
||||
red, green and blue elements in the
|
||||
palette. For instance, most SVGA
|
||||
displays use 64 intensities of red,
|
||||
green and blue, so the masks should
|
||||
all be set to 0xfc. */
|
||||
int palette_size; /* number of entries in palette */
|
||||
D3DRMPALETTEENTRY* palette; /* description of the palette (only if
|
||||
rgb is false). Must be (1<<depth)
|
||||
elements. */
|
||||
} D3DRMIMAGE, *LPD3DRMIMAGE;
|
||||
|
||||
typedef enum _D3DRMWRAPTYPE
|
||||
{ D3DRMWRAP_FLAT,
|
||||
D3DRMWRAP_CYLINDER,
|
||||
D3DRMWRAP_SPHERE,
|
||||
D3DRMWRAP_CHROME
|
||||
} D3DRMWRAPTYPE, *LPD3DRMWRAPTYPE;
|
||||
|
||||
#define D3DRMWIREFRAME_CULL 1 /* cull backfaces */
|
||||
#define D3DRMWIREFRAME_HIDDENLINE 2 /* lines are obscured by closer objects */
|
||||
|
||||
typedef enum _D3DRMPROJECTIONTYPE
|
||||
{ D3DRMPROJECT_PERSPECTIVE,
|
||||
D3DRMPROJECT_ORTHOGRAPHIC,
|
||||
D3DRMPROJECT_RIGHTHANDPERSPECTIVE,
|
||||
D3DRMPROJECT_RIGHTHANDORTHOGRAPHIC
|
||||
} D3DRMPROJECTIONTYPE, *LPD3DRMPROJECTIONTYPE;
|
||||
|
||||
typedef enum _D3DRMXOFFORMAT
|
||||
{ D3DRMXOF_BINARY,
|
||||
D3DRMXOF_COMPRESSED,
|
||||
D3DRMXOF_TEXT
|
||||
} D3DRMXOFFORMAT, *LPD3DRMXOFFORMAT;
|
||||
|
||||
typedef DWORD D3DRMSAVEOPTIONS;
|
||||
#define D3DRMXOFSAVE_NORMALS 1
|
||||
#define D3DRMXOFSAVE_TEXTURECOORDINATES 2
|
||||
#define D3DRMXOFSAVE_MATERIALS 4
|
||||
#define D3DRMXOFSAVE_TEXTURENAMES 8
|
||||
#define D3DRMXOFSAVE_ALL 15
|
||||
#define D3DRMXOFSAVE_TEMPLATES 16
|
||||
#define D3DRMXOFSAVE_TEXTURETOPOLOGY 32
|
||||
|
||||
typedef enum _D3DRMCOLORSOURCE
|
||||
{ D3DRMCOLOR_FROMFACE,
|
||||
D3DRMCOLOR_FROMVERTEX
|
||||
} D3DRMCOLORSOURCE, *LPD3DRMCOLORSOURCE;
|
||||
|
||||
typedef enum _D3DRMFRAMECONSTRAINT
|
||||
{ D3DRMCONSTRAIN_Z, /* use only X and Y rotations */
|
||||
D3DRMCONSTRAIN_Y, /* use only X and Z rotations */
|
||||
D3DRMCONSTRAIN_X /* use only Y and Z rotations */
|
||||
} D3DRMFRAMECONSTRAINT, *LPD3DRMFRAMECONSTRAINT;
|
||||
|
||||
typedef enum _D3DRMMATERIALMODE
|
||||
{ D3DRMMATERIAL_FROMMESH,
|
||||
D3DRMMATERIAL_FROMPARENT,
|
||||
D3DRMMATERIAL_FROMFRAME
|
||||
} D3DRMMATERIALMODE, *LPD3DRMMATERIALMODE;
|
||||
|
||||
typedef enum _D3DRMFOGMODE
|
||||
{ D3DRMFOG_LINEAR, /* linear between start and end */
|
||||
D3DRMFOG_EXPONENTIAL, /* density * exp(-distance) */
|
||||
D3DRMFOG_EXPONENTIALSQUARED /* density * exp(-distance*distance) */
|
||||
} D3DRMFOGMODE, *LPD3DRMFOGMODE;
|
||||
|
||||
typedef enum _D3DRMZBUFFERMODE {
|
||||
D3DRMZBUFFER_FROMPARENT, /* default */
|
||||
D3DRMZBUFFER_ENABLE, /* enable zbuffering */
|
||||
D3DRMZBUFFER_DISABLE /* disable zbuffering */
|
||||
} D3DRMZBUFFERMODE, *LPD3DRMZBUFFERMODE;
|
||||
|
||||
typedef enum _D3DRMSORTMODE {
|
||||
D3DRMSORT_FROMPARENT, /* default */
|
||||
D3DRMSORT_NONE, /* don't sort child frames */
|
||||
D3DRMSORT_FRONTTOBACK, /* sort child frames front-to-back */
|
||||
D3DRMSORT_BACKTOFRONT /* sort child frames back-to-front */
|
||||
} D3DRMSORTMODE, *LPD3DRMSORTMODE;
|
||||
|
||||
/*
|
||||
* Values for flags in Frame2::AddMoveCallback.
|
||||
*/
|
||||
#define D3DRMCALLBACK_PREORDER 0
|
||||
#define D3DRMCALLBACK_POSTORDER 1
|
||||
|
||||
/*
|
||||
* Values for flags in MeshBuilder2::RayPick.
|
||||
*/
|
||||
#define D3DRMRAYPICK_ONLYBOUNDINGBOXES 1
|
||||
#define D3DRMRAYPICK_IGNOREFURTHERPRIMITIVES 2
|
||||
#define D3DRMRAYPICK_INTERPOLATEUV 4
|
||||
#define D3DRMRAYPICK_INTERPOLATECOLOR 8
|
||||
#define D3DRMRAYPICK_INTERPOLATENORMAL 0x10
|
||||
|
||||
/*
|
||||
* Values for flags in MeshBuilder2::GenerateNormals.
|
||||
*/
|
||||
#define D3DRMGENERATENORMALS_PRECOMPACT 1
|
||||
#define D3DRMGENERATENORMALS_USECREASEANGLE 2
|
||||
|
||||
typedef DWORD D3DRMANIMATIONOPTIONS;
|
||||
#define D3DRMANIMATION_OPEN 0x01L
|
||||
#define D3DRMANIMATION_CLOSED 0x02L
|
||||
#define D3DRMANIMATION_LINEARPOSITION 0x04L
|
||||
#define D3DRMANIMATION_SPLINEPOSITION 0x08L
|
||||
#define D3DRMANIMATION_SCALEANDROTATION 0x00000010L
|
||||
#define D3DRMANIMATION_POSITION 0x00000020L
|
||||
|
||||
typedef DWORD D3DRMINTERPOLATIONOPTIONS;
|
||||
#define D3DRMINTERPOLATION_OPEN 0x01L
|
||||
#define D3DRMINTERPOLATION_CLOSED 0x02L
|
||||
#define D3DRMINTERPOLATION_NEAREST 0x0100L
|
||||
#define D3DRMINTERPOLATION_LINEAR 0x04L
|
||||
#define D3DRMINTERPOLATION_SPLINE 0x08L
|
||||
#define D3DRMINTERPOLATION_VERTEXCOLOR 0x40L
|
||||
#define D3DRMINTERPOLATION_SLERPNORMALS 0x80L
|
||||
|
||||
typedef DWORD D3DRMLOADOPTIONS;
|
||||
|
||||
#define D3DRMLOAD_FROMFILE 0x00L
|
||||
#define D3DRMLOAD_FROMRESOURCE 0x01L
|
||||
#define D3DRMLOAD_FROMMEMORY 0x02L
|
||||
#define D3DRMLOAD_FROMSTREAM 0x04L
|
||||
#define D3DRMLOAD_FROMURL 0x08L
|
||||
|
||||
#define D3DRMLOAD_BYNAME 0x10L
|
||||
#define D3DRMLOAD_BYPOSITION 0x20L
|
||||
#define D3DRMLOAD_BYGUID 0x40L
|
||||
#define D3DRMLOAD_FIRST 0x80L
|
||||
|
||||
#define D3DRMLOAD_INSTANCEBYREFERENCE 0x100L
|
||||
#define D3DRMLOAD_INSTANCEBYCOPYING 0x200L
|
||||
|
||||
#define D3DRMLOAD_ASYNCHRONOUS 0x400L
|
||||
|
||||
typedef struct _D3DRMLOADRESOURCE {
|
||||
HMODULE hModule;
|
||||
LPCTSTR lpName;
|
||||
LPCTSTR lpType;
|
||||
} D3DRMLOADRESOURCE, *LPD3DRMLOADRESOURCE;
|
||||
|
||||
typedef struct _D3DRMLOADMEMORY {
|
||||
LPVOID lpMemory;
|
||||
DWORD dSize;
|
||||
} D3DRMLOADMEMORY, *LPD3DRMLOADMEMORY;
|
||||
|
||||
#define D3DRMPMESHSTATUS_VALID 0x01L
|
||||
#define D3DRMPMESHSTATUS_INTERRUPTED 0x02L
|
||||
#define D3DRMPMESHSTATUS_BASEMESHCOMPLETE 0x04L
|
||||
#define D3DRMPMESHSTATUS_COMPLETE 0x08L
|
||||
#define D3DRMPMESHSTATUS_RENDERABLE 0x10L
|
||||
|
||||
#define D3DRMPMESHEVENT_BASEMESH 0x01L
|
||||
#define D3DRMPMESHEVENT_COMPLETE 0x02L
|
||||
|
||||
typedef struct _D3DRMPMESHLOADSTATUS {
|
||||
DWORD dwSize; // Size of this structure
|
||||
DWORD dwPMeshSize; // Total Size (bytes)
|
||||
DWORD dwBaseMeshSize; // Total Size of the Base Mesh
|
||||
DWORD dwBytesLoaded; // Total bytes loaded
|
||||
DWORD dwVerticesLoaded; // Number of vertices loaded
|
||||
DWORD dwFacesLoaded; // Number of faces loaded
|
||||
HRESULT dwLoadResult; // Result of the load operation
|
||||
DWORD dwFlags;
|
||||
} D3DRMPMESHLOADSTATUS, *LPD3DRMPMESHLOADSTATUS;
|
||||
|
||||
typedef enum _D3DRMUSERVISUALREASON {
|
||||
D3DRMUSERVISUAL_CANSEE,
|
||||
D3DRMUSERVISUAL_RENDER
|
||||
} D3DRMUSERVISUALREASON, *LPD3DRMUSERVISUALREASON;
|
||||
|
||||
|
||||
typedef DWORD D3DRMMAPPING, D3DRMMAPPINGFLAG, *LPD3DRMMAPPING;
|
||||
static const D3DRMMAPPINGFLAG D3DRMMAP_WRAPU = 1;
|
||||
static const D3DRMMAPPINGFLAG D3DRMMAP_WRAPV = 2;
|
||||
static const D3DRMMAPPINGFLAG D3DRMMAP_PERSPCORRECT = 4;
|
||||
|
||||
typedef struct _D3DRMVERTEX
|
||||
{ D3DVECTOR position;
|
||||
D3DVECTOR normal;
|
||||
D3DVALUE tu, tv;
|
||||
D3DCOLOR color;
|
||||
} D3DRMVERTEX, *LPD3DRMVERTEX;
|
||||
|
||||
typedef LONG D3DRMGROUPINDEX; /* group indexes begin a 0 */
|
||||
static const D3DRMGROUPINDEX D3DRMGROUP_ALLGROUPS = -1;
|
||||
|
||||
/*
|
||||
* Create a color from three components in the range 0-1 inclusive.
|
||||
*/
|
||||
extern D3DCOLOR D3DRMAPI D3DRMCreateColorRGB(D3DVALUE red,
|
||||
D3DVALUE green,
|
||||
D3DVALUE blue);
|
||||
|
||||
/*
|
||||
* Create a color from four components in the range 0-1 inclusive.
|
||||
*/
|
||||
extern D3DCOLOR D3DRMAPI D3DRMCreateColorRGBA(D3DVALUE red,
|
||||
D3DVALUE green,
|
||||
D3DVALUE blue,
|
||||
D3DVALUE alpha);
|
||||
|
||||
/*
|
||||
* Get the red component of a color.
|
||||
*/
|
||||
extern D3DVALUE D3DRMAPI D3DRMColorGetRed(D3DCOLOR);
|
||||
|
||||
/*
|
||||
* Get the green component of a color.
|
||||
*/
|
||||
extern D3DVALUE D3DRMAPI D3DRMColorGetGreen(D3DCOLOR);
|
||||
|
||||
/*
|
||||
* Get the blue component of a color.
|
||||
*/
|
||||
extern D3DVALUE D3DRMAPI D3DRMColorGetBlue(D3DCOLOR);
|
||||
|
||||
/*
|
||||
* Get the alpha component of a color.
|
||||
*/
|
||||
extern D3DVALUE D3DRMAPI D3DRMColorGetAlpha(D3DCOLOR);
|
||||
|
||||
/*
|
||||
* Add two vectors. Returns its first argument.
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorAdd(LPD3DVECTOR d,
|
||||
LPD3DVECTOR s1,
|
||||
LPD3DVECTOR s2);
|
||||
|
||||
/*
|
||||
* Subtract two vectors. Returns its first argument.
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorSubtract(LPD3DVECTOR d,
|
||||
LPD3DVECTOR s1,
|
||||
LPD3DVECTOR s2);
|
||||
/*
|
||||
* Reflect a ray about a given normal. Returns its first argument.
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorReflect(LPD3DVECTOR d,
|
||||
LPD3DVECTOR ray,
|
||||
LPD3DVECTOR norm);
|
||||
|
||||
/*
|
||||
* Calculate the vector cross product. Returns its first argument.
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorCrossProduct(LPD3DVECTOR d,
|
||||
LPD3DVECTOR s1,
|
||||
LPD3DVECTOR s2);
|
||||
/*
|
||||
* Return the vector dot product.
|
||||
*/
|
||||
extern D3DVALUE D3DRMAPI D3DRMVectorDotProduct(LPD3DVECTOR s1,
|
||||
LPD3DVECTOR s2);
|
||||
|
||||
/*
|
||||
* Scale a vector so that its modulus is 1. Returns its argument or
|
||||
* NULL if there was an error (e.g. a zero vector was passed).
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorNormalize(LPD3DVECTOR);
|
||||
#define D3DRMVectorNormalise D3DRMVectorNormalize
|
||||
|
||||
/*
|
||||
* Return the length of a vector (e.g. sqrt(x*x + y*y + z*z)).
|
||||
*/
|
||||
extern D3DVALUE D3DRMAPI D3DRMVectorModulus(LPD3DVECTOR v);
|
||||
|
||||
/*
|
||||
* Set the rotation part of a matrix to be a rotation of theta radians
|
||||
* around the given axis.
|
||||
*/
|
||||
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorRotate(LPD3DVECTOR r, LPD3DVECTOR v, LPD3DVECTOR axis, D3DVALUE theta);
|
||||
|
||||
/*
|
||||
* Scale a vector uniformly in all three axes
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorScale(LPD3DVECTOR d, LPD3DVECTOR s, D3DVALUE factor);
|
||||
|
||||
/*
|
||||
* Return a random unit vector
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorRandom(LPD3DVECTOR d);
|
||||
|
||||
/*
|
||||
* Returns a unit quaternion that represents a rotation of theta radians
|
||||
* around the given axis.
|
||||
*/
|
||||
|
||||
extern LPD3DRMQUATERNION D3DRMAPI D3DRMQuaternionFromRotation(LPD3DRMQUATERNION quat,
|
||||
LPD3DVECTOR v,
|
||||
D3DVALUE theta);
|
||||
|
||||
/*
|
||||
* Calculate the product of two quaternions
|
||||
*/
|
||||
extern LPD3DRMQUATERNION D3DRMAPI D3DRMQuaternionMultiply(LPD3DRMQUATERNION q,
|
||||
LPD3DRMQUATERNION a,
|
||||
LPD3DRMQUATERNION b);
|
||||
|
||||
/*
|
||||
* Interpolate between two quaternions
|
||||
*/
|
||||
extern LPD3DRMQUATERNION D3DRMAPI D3DRMQuaternionSlerp(LPD3DRMQUATERNION q,
|
||||
LPD3DRMQUATERNION a,
|
||||
LPD3DRMQUATERNION b,
|
||||
D3DVALUE alpha);
|
||||
|
||||
/*
|
||||
* Calculate the matrix for the rotation that a unit quaternion represents
|
||||
*/
|
||||
extern void D3DRMAPI D3DRMMatrixFromQuaternion(D3DRMMATRIX4D dmMat, LPD3DRMQUATERNION lpDqQuat);
|
||||
|
||||
/*
|
||||
* Calculate the quaternion that corresponds to a rotation matrix
|
||||
*/
|
||||
extern LPD3DRMQUATERNION D3DRMAPI D3DRMQuaternionFromMatrix(LPD3DRMQUATERNION, D3DRMMATRIX4D);
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
1100
3rdparty/dx5/inc/d3drmobj.h
vendored
Normal file
1100
3rdparty/dx5/inc/d3drmobj.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
48
3rdparty/dx5/inc/d3drmwin.h
vendored
Normal file
48
3rdparty/dx5/inc/d3drmwin.h
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: d3drm.h
|
||||
* Content: Direct3DRM include file
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __D3DRMWIN_H__
|
||||
#define __D3DRMWIN_H__
|
||||
|
||||
#ifndef WIN32
|
||||
#define WIN32
|
||||
#endif
|
||||
|
||||
#include "d3drm.h"
|
||||
#include "ddraw.h"
|
||||
#include "d3d.h"
|
||||
|
||||
/*
|
||||
* GUIDS used by Direct3DRM Windows interface
|
||||
*/
|
||||
DEFINE_GUID(IID_IDirect3DRMWinDevice, 0xc5016cc0, 0xd273, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
|
||||
|
||||
WIN_TYPES(IDirect3DRMWinDevice, DIRECT3DRMWINDEVICE);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DRMWinDevice
|
||||
|
||||
DECLARE_INTERFACE_(IDirect3DRMWinDevice, IDirect3DRMObject)
|
||||
{
|
||||
IUNKNOWN_METHODS(PURE);
|
||||
IDIRECT3DRMOBJECT_METHODS(PURE);
|
||||
|
||||
/*
|
||||
* IDirect3DRMWinDevice methods
|
||||
*/
|
||||
|
||||
/* Repaint the window with the last frame which was rendered. */
|
||||
STDMETHOD(HandlePaint)(THIS_ HDC hdc) PURE;
|
||||
|
||||
/* Respond to a WM_ACTIVATE message. */
|
||||
STDMETHOD(HandleActivate)(THIS_ WORD wparam) PURE;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
1201
3rdparty/dx5/inc/d3dtypes.h
vendored
Normal file
1201
3rdparty/dx5/inc/d3dtypes.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
240
3rdparty/dx5/inc/d3dvec.inl
vendored
Normal file
240
3rdparty/dx5/inc/d3dvec.inl
vendored
Normal file
@ -0,0 +1,240 @@
|
||||
|
||||
/******************************************************************
|
||||
* *
|
||||
* D3DVec.inl *
|
||||
* *
|
||||
* Float-valued 3D vector class for Direct3D. *
|
||||
* *
|
||||
* Copyright (c) 1996-1997 Microsoft Corp. All rights reserved. *
|
||||
* *
|
||||
******************************************************************/
|
||||
|
||||
#include <math.h>
|
||||
|
||||
// =====================================
|
||||
// Constructors
|
||||
// =====================================
|
||||
|
||||
inline
|
||||
_D3DVECTOR::_D3DVECTOR(D3DVALUE f)
|
||||
{
|
||||
x = y = z = f;
|
||||
}
|
||||
|
||||
inline
|
||||
_D3DVECTOR::_D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z)
|
||||
{
|
||||
x = _x; y = _y; z = _z;
|
||||
}
|
||||
|
||||
inline
|
||||
_D3DVECTOR::_D3DVECTOR(const D3DVALUE f[3])
|
||||
{
|
||||
x = f[0]; y = f[1]; z = f[2];
|
||||
}
|
||||
|
||||
// =====================================
|
||||
// Access grants
|
||||
// =====================================
|
||||
|
||||
inline const D3DVALUE&
|
||||
_D3DVECTOR::operator[](int i) const
|
||||
{
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
inline D3DVALUE&
|
||||
_D3DVECTOR::operator[](int i)
|
||||
{
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
|
||||
// =====================================
|
||||
// Assignment operators
|
||||
// =====================================
|
||||
|
||||
inline _D3DVECTOR&
|
||||
_D3DVECTOR::operator += (const _D3DVECTOR& v)
|
||||
{
|
||||
x += v.x; y += v.y; z += v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR&
|
||||
_D3DVECTOR::operator -= (const _D3DVECTOR& v)
|
||||
{
|
||||
x -= v.x; y -= v.y; z -= v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR&
|
||||
_D3DVECTOR::operator *= (const _D3DVECTOR& v)
|
||||
{
|
||||
x *= v.x; y *= v.y; z *= v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR&
|
||||
_D3DVECTOR::operator /= (const _D3DVECTOR& v)
|
||||
{
|
||||
x /= v.x; y /= v.y; z /= v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR&
|
||||
_D3DVECTOR::operator *= (D3DVALUE s)
|
||||
{
|
||||
x *= s; y *= s; z *= s;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR&
|
||||
_D3DVECTOR::operator /= (D3DVALUE s)
|
||||
{
|
||||
x /= s; y /= s; z /= s;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator + (const _D3DVECTOR& v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator - (const _D3DVECTOR& v)
|
||||
{
|
||||
return _D3DVECTOR(-v.x, -v.y, -v.z);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return _D3DVECTOR(v1.x+v2.x, v1.y+v2.y, v1.z+v2.z);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return _D3DVECTOR(v1.x-v2.x, v1.y-v2.y, v1.z-v2.z);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator * (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return _D3DVECTOR(v1.x*v2.x, v1.y*v2.y, v1.z*v2.z);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator / (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return _D3DVECTOR(v1.x/v2.x, v1.y/v2.y, v1.z/v2.z);
|
||||
}
|
||||
|
||||
inline int
|
||||
operator < (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return v1[0] < v2[0] && v1[1] < v2[1] && v1[2] < v2[2];
|
||||
}
|
||||
|
||||
inline int
|
||||
operator <= (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return v1[0] <= v2[0] && v1[1] <= v2[1] && v1[2] <= v2[2];
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator * (const _D3DVECTOR& v, D3DVALUE s)
|
||||
{
|
||||
return _D3DVECTOR(s*v.x, s*v.y, s*v.z);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator * (D3DVALUE s, const _D3DVECTOR& v)
|
||||
{
|
||||
return _D3DVECTOR(s*v.x, s*v.y, s*v.z);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator / (const _D3DVECTOR& v, D3DVALUE s)
|
||||
{
|
||||
return _D3DVECTOR(v.x/s, v.y/s, v.z/s);
|
||||
}
|
||||
|
||||
inline int
|
||||
operator == (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return v1.x==v2.x && v1.y==v2.y && v1.z == v2.z;
|
||||
}
|
||||
|
||||
inline D3DVALUE
|
||||
Magnitude (const _D3DVECTOR& v)
|
||||
{
|
||||
return (D3DVALUE) sqrt(SquareMagnitude(v));
|
||||
}
|
||||
|
||||
inline D3DVALUE
|
||||
SquareMagnitude (const _D3DVECTOR& v)
|
||||
{
|
||||
return v.x*v.x + v.y*v.y + v.z*v.z;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
Normalize (const _D3DVECTOR& v)
|
||||
{
|
||||
return v / Magnitude(v);
|
||||
}
|
||||
|
||||
inline D3DVALUE
|
||||
Min (const _D3DVECTOR& v)
|
||||
{
|
||||
D3DVALUE ret = v.x;
|
||||
if (v.y < ret) ret = v.y;
|
||||
if (v.z < ret) ret = v.z;
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline D3DVALUE
|
||||
Max (const _D3DVECTOR& v)
|
||||
{
|
||||
D3DVALUE ret = v.x;
|
||||
if (ret < v.y) ret = v.y;
|
||||
if (ret < v.z) ret = v.z;
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
Minimize (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return _D3DVECTOR( v1[0] < v2[0] ? v1[0] : v2[0],
|
||||
v1[1] < v2[1] ? v1[1] : v2[1],
|
||||
v1[2] < v2[2] ? v1[2] : v2[2]);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
Maximize (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return _D3DVECTOR( v1[0] > v2[0] ? v1[0] : v2[0],
|
||||
v1[1] > v2[1] ? v1[1] : v2[1],
|
||||
v1[2] > v2[2] ? v1[2] : v2[2]);
|
||||
}
|
||||
|
||||
inline D3DVALUE
|
||||
DotProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return v1.x*v2.x + v1.y * v2.y + v1.z*v2.z;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
CrossProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
_D3DVECTOR result;
|
||||
|
||||
result[0] = v1[1] * v2[2] - v1[2] * v2[1];
|
||||
result[1] = v1[2] * v2[0] - v1[0] * v2[2];
|
||||
result[2] = v1[0] * v2[1] - v1[1] * v2[0];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
3791
3rdparty/dx5/inc/ddraw.h
vendored
Normal file
3791
3rdparty/dx5/inc/ddraw.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1849
3rdparty/dx5/inc/dinput.h
vendored
Normal file
1849
3rdparty/dx5/inc/dinput.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1710
3rdparty/dx5/inc/dplay.h
vendored
Normal file
1710
3rdparty/dx5/inc/dplay.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
627
3rdparty/dx5/inc/dplobby.h
vendored
Normal file
627
3rdparty/dx5/inc/dplobby.h
vendored
Normal file
@ -0,0 +1,627 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: dplobby.h
|
||||
* Content: DirectPlayLobby include file
|
||||
***************************************************************************/
|
||||
#ifndef __DPLOBBY_INCLUDED__
|
||||
#define __DPLOBBY_INCLUDED__
|
||||
|
||||
#include "dplay.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* GUIDS used by DirectPlay objects
|
||||
*/
|
||||
|
||||
/* {AF465C71-9588-11cf-A020-00AA006157AC} */
|
||||
DEFINE_GUID(IID_IDirectPlayLobby, 0xaf465c71, 0x9588, 0x11cf, 0xa0, 0x20, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
|
||||
/* {26C66A70-B367-11cf-A024-00AA006157AC} */
|
||||
DEFINE_GUID(IID_IDirectPlayLobbyA, 0x26c66a70, 0xb367, 0x11cf, 0xa0, 0x24, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
|
||||
/* {0194C220-A303-11d0-9C4F-00A0C905425E} */
|
||||
DEFINE_GUID(IID_IDirectPlayLobby2, 0x194c220, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
/* {1BB4AF80-A303-11d0-9C4F-00A0C905425E} */
|
||||
DEFINE_GUID(IID_IDirectPlayLobby2A, 0x1bb4af80, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
/* {2FE8F810-B2A5-11d0-A787-0000F803ABFC} */
|
||||
DEFINE_GUID(CLSID_DirectPlayLobby, 0x2fe8f810, 0xb2a5, 0x11d0, 0xa7, 0x87, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* IDirectPlayLobby Structures
|
||||
*
|
||||
* Various structures used to invoke DirectPlayLobby.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
typedef struct IDirectPlayLobby FAR *LPDIRECTPLAYLOBBY;
|
||||
typedef struct IDirectPlayLobby FAR *LPDIRECTPLAYLOBBYA;
|
||||
typedef struct IDirectPlayLobby IDirectPlayLobbyA;
|
||||
|
||||
typedef struct IDirectPlayLobby2 FAR *LPDIRECTPLAYLOBBY2;
|
||||
typedef struct IDirectPlayLobby2 FAR *LPDIRECTPLAYLOBBY2A;
|
||||
typedef struct IDirectPlayLobby2 IDirectPlayLobby2A;
|
||||
|
||||
|
||||
/*
|
||||
* DPLAPPINFO
|
||||
* Used to hold information about a registered DirectPlay
|
||||
* application
|
||||
*/
|
||||
typedef struct DPLAPPINFO
|
||||
{
|
||||
DWORD dwSize; // Size of this structure
|
||||
GUID guidApplication; // GUID of the Application
|
||||
union
|
||||
{
|
||||
LPSTR lpszAppNameA; // Pointer to the Application Name
|
||||
LPWSTR lpszAppName;
|
||||
};
|
||||
|
||||
} DPLAPPINFO, FAR *LPDPLAPPINFO;
|
||||
|
||||
/*
|
||||
* LPCDPLAPPINFO
|
||||
* A constant pointer to DPLAPPINFO
|
||||
*/
|
||||
typedef const DPLAPPINFO FAR *LPCDPLAPPINFO;
|
||||
|
||||
/*
|
||||
* DPCOMPOUNDADDRESSELEMENT
|
||||
*
|
||||
* An array of these is passed to CreateCompoundAddresses()
|
||||
*/
|
||||
typedef struct DPCOMPOUNDADDRESSELEMENT
|
||||
{
|
||||
GUID guidDataType;
|
||||
DWORD dwDataSize;
|
||||
LPVOID lpData;
|
||||
} DPCOMPOUNDADDRESSELEMENT, FAR *LPDPCOMPOUNDADDRESSELEMENT;
|
||||
|
||||
/*
|
||||
* LPCDPCOMPOUNDADDRESSELEMENT
|
||||
* A constant pointer to DPCOMPOUNDADDRESSELEMENT
|
||||
*/
|
||||
typedef const DPCOMPOUNDADDRESSELEMENT FAR *LPCDPCOMPOUNDADDRESSELEMENT;
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Enumeration Method Callback Prototypes
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Callback for EnumAddress()
|
||||
*/
|
||||
typedef BOOL (FAR PASCAL *LPDPENUMADDRESSCALLBACK)(
|
||||
REFGUID guidDataType,
|
||||
DWORD dwDataSize,
|
||||
LPCVOID lpData,
|
||||
LPVOID lpContext);
|
||||
|
||||
/*
|
||||
* Callback for EnumAddressTypes()
|
||||
*/
|
||||
typedef BOOL (FAR PASCAL *LPDPLENUMADDRESSTYPESCALLBACK)(
|
||||
REFGUID guidDataType,
|
||||
LPVOID lpContext,
|
||||
DWORD dwFlags);
|
||||
|
||||
/*
|
||||
* Callback for EnumLocalApplications()
|
||||
*/
|
||||
typedef BOOL (FAR PASCAL * LPDPLENUMLOCALAPPLICATIONSCALLBACK)(
|
||||
LPCDPLAPPINFO lpAppInfo,
|
||||
LPVOID lpContext,
|
||||
DWORD dwFlags);
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DirectPlayLobby API Prototypes
|
||||
*
|
||||
****************************************************************************/
|
||||
#ifdef UNICODE
|
||||
#define DirectPlayLobbyCreate DirectPlayLobbyCreateW
|
||||
#else
|
||||
#define DirectPlayLobbyCreate DirectPlayLobbyCreateA
|
||||
#endif /* UNICODE */
|
||||
|
||||
extern HRESULT WINAPI DirectPlayLobbyCreateW(LPGUID, LPDIRECTPLAYLOBBY *, IUnknown *, LPVOID, DWORD );
|
||||
extern HRESULT WINAPI DirectPlayLobbyCreateA(LPGUID, LPDIRECTPLAYLOBBYA *, IUnknown *, LPVOID, DWORD );
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* IDirectPlayLobby (and IDirectPlayLobbyA) Interface
|
||||
*
|
||||
****************************************************************************/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectPlayLobby
|
||||
DECLARE_INTERFACE_( IDirectPlayLobby, IUnknown )
|
||||
{
|
||||
/* IUnknown Methods */
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
/* IDirectPlayLobby Methods */
|
||||
STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE;
|
||||
STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE;
|
||||
STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE;
|
||||
STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE;
|
||||
STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE;
|
||||
STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE;
|
||||
STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE;
|
||||
STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE;
|
||||
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* IDirectPlayLobby2 (and IDirectPlayLobby2A) Interface
|
||||
*
|
||||
****************************************************************************/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectPlayLobby2
|
||||
DECLARE_INTERFACE_( IDirectPlayLobby2, IDirectPlayLobby )
|
||||
{
|
||||
/* IUnknown Methods */
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
/* IDirectPlayLobby Methods */
|
||||
STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE;
|
||||
STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE;
|
||||
STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE;
|
||||
STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE;
|
||||
STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE;
|
||||
STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE;
|
||||
STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE;
|
||||
STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE;
|
||||
|
||||
/* IDirectPlayLobby2 Methods */
|
||||
STDMETHOD(CreateCompoundAddress)(THIS_ LPCDPCOMPOUNDADDRESSELEMENT,DWORD,LPVOID,LPDWORD) PURE;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* IDirectPlayLobby interface macros
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
#define IDirectPlayLobby_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectPlayLobby_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectPlayLobby_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectPlayLobby_Connect(p,a,b,c) (p)->lpVtbl->Connect(p,a,b,c)
|
||||
#define IDirectPlayLobby_CreateAddress(p,a,b,c,d,e,f) (p)->lpVtbl->CreateAddress(p,a,b,c,d,e,f)
|
||||
#define IDirectPlayLobby_CreateCompoundAddress(p,a,b,c,d) (p)->lpVtbl->CreateCompoundAddress(p,a,b,c,d)
|
||||
#define IDirectPlayLobby_EnumAddress(p,a,b,c,d) (p)->lpVtbl->EnumAddress(p,a,b,c,d)
|
||||
#define IDirectPlayLobby_EnumAddressTypes(p,a,b,c,d) (p)->lpVtbl->EnumAddressTypes(p,a,b,c,d)
|
||||
#define IDirectPlayLobby_EnumLocalApplications(p,a,b,c) (p)->lpVtbl->EnumLocalApplications(p,a,b,c)
|
||||
#define IDirectPlayLobby_GetConnectionSettings(p,a,b,c) (p)->lpVtbl->GetConnectionSettings(p,a,b,c)
|
||||
#define IDirectPlayLobby_ReceiveLobbyMessage(p,a,b,c,d,e) (p)->lpVtbl->ReceiveLobbyMessage(p,a,b,c,d,e)
|
||||
#define IDirectPlayLobby_RunApplication(p,a,b,c,d) (p)->lpVtbl->RunApplication(p,a,b,c,d)
|
||||
#define IDirectPlayLobby_SendLobbyMessage(p,a,b,c,d) (p)->lpVtbl->SendLobbyMessage(p,a,b,c,d)
|
||||
#define IDirectPlayLobby_SetConnectionSettings(p,a,b,c) (p)->lpVtbl->SetConnectionSettings(p,a,b,c)
|
||||
#define IDirectPlayLobby_SetLobbyMessageEvent(p,a,b,c) (p)->lpVtbl->SetLobbyMessageEvent(p,a,b,c)
|
||||
|
||||
#else /* C++ */
|
||||
|
||||
#define IDirectPlayLobby_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectPlayLobby_AddRef(p) (p)->AddRef()
|
||||
#define IDirectPlayLobby_Release(p) (p)->Release()
|
||||
#define IDirectPlayLobby_Connect(p,a,b,c) (p)->Connect(a,b,c)
|
||||
#define IDirectPlayLobby_CreateAddress(p,a,b,c,d,e,f) (p)->CreateAddress(a,b,c,d,e,f)
|
||||
#define IDirectPlayLobby_CreateCompoundAddress(p,a,b,c,d) (p)->lpVtbl->CreateCompoundAddress(a,b,c,d)
|
||||
#define IDirectPlayLobby_EnumAddress(p,a,b,c,d) (p)->EnumAddress(a,b,c,d)
|
||||
#define IDirectPlayLobby_EnumAddressTypes(p,a,b,c,d) (p)->EnumAddressTypes(a,b,c,d)
|
||||
#define IDirectPlayLobby_EnumLocalApplications(p,a,b,c) (p)->EnumLocalApplications(a,b,c)
|
||||
#define IDirectPlayLobby_GetConnectionSettings(p,a,b,c) (p)->GetConnectionSettings(a,b,c)
|
||||
#define IDirectPlayLobby_ReceiveLobbyMessage(p,a,b,c,d,e) (p)->ReceiveLobbyMessage(a,b,c,d,e)
|
||||
#define IDirectPlayLobby_RunApplication(p,a,b,c,d) (p)->RunApplication(a,b,c,d)
|
||||
#define IDirectPlayLobby_SendLobbyMessage(p,a,b,c,d) (p)->SendLobbyMessage(a,b,c,d)
|
||||
#define IDirectPlayLobby_SetConnectionSettings(p,a,b,c) (p)->SetConnectionSettings(a,b,c)
|
||||
#define IDirectPlayLobby_SetLobbyMessageEvent(p,a,b,c) (p)->SetLobbyMessageEvent(a,b,c)
|
||||
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DirectPlayLobby Flags
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* This is a message flag used by ReceiveLobbyMessage. It can be
|
||||
* returned in the dwMessageFlags parameter to indicate a message from
|
||||
* the system.
|
||||
*/
|
||||
#define DPLMSG_SYSTEM 0x00000001
|
||||
|
||||
/*
|
||||
* This is a message flag used by ReceiveLobbyMessage and SendLobbyMessage.
|
||||
* It is used to indicate that the message is a standard lobby message.
|
||||
* DPLMSG_SETPROPERTY, DPLMSG_SETPROPERTYRESPONSE, DPLMSG_GETPROPERTY,
|
||||
* DPLMSG_GETPROPERTYRESPONSE
|
||||
*/
|
||||
#define DPLMSG_STANDARD 0x00000002
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DirectPlayLobby messages and message data structures
|
||||
*
|
||||
* All system messages have a dwMessageFlags value of DPLMSG_SYSTEM returned
|
||||
* from a call to ReceiveLobbyMessage.
|
||||
*
|
||||
* All standard messages have a dwMessageFlags value of DPLMSG_STANDARD returned
|
||||
* from a call to ReceiveLobbyMessage.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* DPLMSG_GENERIC
|
||||
* Generic message structure used to identify the message type.
|
||||
*/
|
||||
typedef struct _DPLMSG_GENERIC
|
||||
{
|
||||
DWORD dwType; // Message type
|
||||
} DPLMSG_GENERIC, FAR *LPDPLMSG_GENERIC;
|
||||
|
||||
/*
|
||||
* DPLMSG_SETPROPERTY
|
||||
* Standard message sent by an application to a lobby to set a
|
||||
* property
|
||||
*/
|
||||
typedef struct _DPLMSG_SETPROPERTY
|
||||
{
|
||||
DWORD dwType; // Message type
|
||||
DWORD dwRequestID; // Request ID (DPL_NOCONFIRMATION if no confirmation desired)
|
||||
GUID guidPlayer; // Player GUID
|
||||
GUID guidPropertyTag; // Property GUID
|
||||
DWORD dwDataSize; // Size of data
|
||||
DWORD dwPropertyData[1]; // Buffer containing data
|
||||
} DPLMSG_SETPROPERTY, FAR *LPDPLMSG_SETPROPERTY;
|
||||
|
||||
#define DPL_NOCONFIRMATION 0
|
||||
|
||||
/*
|
||||
* DPLMSG_SETPROPERTYRESPONSE
|
||||
* Standard message returned by a lobby to confirm a
|
||||
* DPLMSG_SETPROPERTY message.
|
||||
*/
|
||||
typedef struct _DPLMSG_SETPROPERTYRESPONSE
|
||||
{
|
||||
DWORD dwType; // Message type
|
||||
DWORD dwRequestID; // Request ID
|
||||
GUID guidPlayer; // Player GUID
|
||||
GUID guidPropertyTag; // Property GUID
|
||||
HRESULT hr; // Return Code
|
||||
} DPLMSG_SETPROPERTYRESPONSE, FAR *LPDPLMSG_SETPROPERTYRESPONSE;
|
||||
|
||||
/*
|
||||
* DPLMSG_GETPROPERTY
|
||||
* Standard message sent by an application to a lobby to request
|
||||
* the current value of a property
|
||||
*/
|
||||
typedef struct _DPLMSG_GETPROPERTY
|
||||
{
|
||||
DWORD dwType; // Message type
|
||||
DWORD dwRequestID; // Request ID
|
||||
GUID guidPlayer; // Player GUID
|
||||
GUID guidPropertyTag; // Property GUID
|
||||
} DPLMSG_GETPROPERTY, FAR *LPDPLMSG_GETPROPERTY;
|
||||
|
||||
/*
|
||||
* DPLMSG_GETPROPERTYRESPONSE
|
||||
* Standard message returned by a lobby in response to a
|
||||
* DPLMSG_GETPROPERTY message.
|
||||
*/
|
||||
typedef struct _DPLMSG_GETPROPERTYRESPONSE
|
||||
{
|
||||
DWORD dwType; // Message type
|
||||
DWORD dwRequestID; // Request ID
|
||||
GUID guidPlayer; // Player GUID
|
||||
GUID guidPropertyTag; // Property GUID
|
||||
HRESULT hr; // Return Code
|
||||
DWORD dwDataSize; // Size of data
|
||||
DWORD dwPropertyData[1]; // Buffer containing data
|
||||
} DPLMSG_GETPROPERTYRESPONSE, FAR *LPDPLMSG_GETPROPERTYRESPONSE;
|
||||
|
||||
|
||||
/******************************************
|
||||
*
|
||||
* DirectPlay Lobby message dwType values
|
||||
*
|
||||
*****************************************/
|
||||
|
||||
/*
|
||||
* The application has read the connection settings.
|
||||
* It is now O.K. for the lobby client to release
|
||||
* its IDirectPlayLobby interface.
|
||||
*/
|
||||
#define DPLSYS_CONNECTIONSETTINGSREAD 0x00000001
|
||||
|
||||
/*
|
||||
* The application's call to DirectPlayConnect failed
|
||||
*/
|
||||
#define DPLSYS_DPLAYCONNECTFAILED 0x00000002
|
||||
|
||||
/*
|
||||
* The application has created a DirectPlay session.
|
||||
*/
|
||||
#define DPLSYS_DPLAYCONNECTSUCCEEDED 0x00000003
|
||||
|
||||
/*
|
||||
* The application has terminated.
|
||||
*/
|
||||
#define DPLSYS_APPTERMINATED 0x00000004
|
||||
|
||||
/*
|
||||
* The message is a DPLMSG_SETPROPERTY message.
|
||||
*/
|
||||
#define DPLSYS_SETPROPERTY 0x00000005
|
||||
|
||||
/*
|
||||
* The message is a DPLMSG_SETPROPERTYRESPONSE message.
|
||||
*/
|
||||
#define DPLSYS_SETPROPERTYRESPONSE 0x00000006
|
||||
|
||||
/*
|
||||
* The message is a DPLMSG_GETPROPERTY message.
|
||||
*/
|
||||
#define DPLSYS_GETPROPERTY 0x00000007
|
||||
|
||||
/*
|
||||
* The message is a DPLMSG_GETPROPERTYRESPONSE message.
|
||||
*/
|
||||
#define DPLSYS_GETPROPERTYRESPONSE 0x00000008
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DirectPlay defined property GUIDs and associated data structures
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* DPLPROPERTY_MessagesSupported
|
||||
*
|
||||
* Request whether the lobby supports standard. Lobby with respond with either
|
||||
* TRUE or FALSE or may not respond at all.
|
||||
*
|
||||
* Property data is a single BOOL with TRUE or FALSE
|
||||
*/
|
||||
// {762CCDA1-D916-11d0-BA39-00C04FD7ED67}
|
||||
DEFINE_GUID(DPLPROPERTY_MessagesSupported,
|
||||
0x762ccda1, 0xd916, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
|
||||
|
||||
/*
|
||||
* DPLPROPERTY_LobbyGuid
|
||||
*
|
||||
* Request the GUID that identifies the lobby software that the application
|
||||
* is communicating with.
|
||||
*
|
||||
* Property data is a single GUID.
|
||||
*/
|
||||
// {F56920A0-D218-11d0-BA39-00C04FD7ED67}
|
||||
DEFINE_GUID(DPLPROPERTY_LobbyGuid,
|
||||
0xf56920a0, 0xd218, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
|
||||
|
||||
/*
|
||||
* DPLPROPERTY_PlayerGuid
|
||||
*
|
||||
* Request the GUID that identifies the player on this machine for sending
|
||||
* property data back to the lobby.
|
||||
*
|
||||
* Property data is the DPLDATA_PLAYERDATA structure
|
||||
*/
|
||||
// {B4319322-D20D-11d0-BA39-00C04FD7ED67}
|
||||
DEFINE_GUID(DPLPROPERTY_PlayerGuid,
|
||||
0xb4319322, 0xd20d, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
|
||||
|
||||
/*
|
||||
* DPLDATA_PLAYERGUID
|
||||
*
|
||||
* Data structure to hold the GUID of the player and player creation flags
|
||||
* from the lobby.
|
||||
*/
|
||||
typedef struct _DPLDATA_PLAYERGUID
|
||||
{
|
||||
GUID guidPlayer;
|
||||
DWORD dwPlayerFlags;
|
||||
} DPLDATA_PLAYERGUID, FAR *LPDPLDATA_PLAYERGUID;
|
||||
|
||||
/*
|
||||
* DPLPROPERTY_PlayerScore
|
||||
*
|
||||
* Used to send an array of long integers to the lobby indicating the
|
||||
* score of a player.
|
||||
*
|
||||
* Property data is the DPLDATA_PLAYERSCORE structure.
|
||||
*/
|
||||
// {48784000-D219-11d0-BA39-00C04FD7ED67}
|
||||
DEFINE_GUID(DPLPROPERTY_PlayerScore,
|
||||
0x48784000, 0xd219, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
|
||||
|
||||
/*
|
||||
* DPLDATA_PLAYERSCORE
|
||||
*
|
||||
* Data structure to hold an array of long integers representing a player score.
|
||||
* Application must allocate enough memory to hold all the scores.
|
||||
*/
|
||||
typedef struct _DPLDATA_PLAYERSCORE
|
||||
{
|
||||
DWORD dwScoreCount;
|
||||
LONG Score[1];
|
||||
} DPLDATA_PLAYERSCORE, FAR *LPDPLDATA_PLAYERSCORE;
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DirectPlay Address ID's
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* DirectPlay Address
|
||||
*
|
||||
* A DirectPlay address consists of multiple chunks of data, each tagged
|
||||
* with a GUID signifying the type of data in the chunk. The chunk also
|
||||
* has a length so that unknown chunk types can be skipped.
|
||||
*
|
||||
* The EnumAddress() function is used to parse these address data chunks.
|
||||
*/
|
||||
|
||||
/*
|
||||
* DPADDRESS
|
||||
*
|
||||
* Header for block of address data elements
|
||||
*/
|
||||
typedef struct _DPADDRESS
|
||||
{
|
||||
GUID guidDataType;
|
||||
DWORD dwDataSize;
|
||||
} DPADDRESS;
|
||||
|
||||
typedef DPADDRESS FAR *LPDPADDRESS;
|
||||
|
||||
/*
|
||||
* DPAID_TotalSize
|
||||
*
|
||||
* Chunk is a DWORD containing size of entire DPADDRESS structure
|
||||
*/
|
||||
|
||||
// {1318F560-912C-11d0-9DAA-00A0C90A43CB}
|
||||
DEFINE_GUID(DPAID_TotalSize,
|
||||
0x1318f560, 0x912c, 0x11d0, 0x9d, 0xaa, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb);
|
||||
|
||||
/*
|
||||
* DPAID_ServiceProvider
|
||||
*
|
||||
* Chunk is a GUID describing the service provider that created the chunk.
|
||||
* All addresses must contain this chunk.
|
||||
*/
|
||||
|
||||
// {07D916C0-E0AF-11cf-9C4E-00A0C905425E}
|
||||
DEFINE_GUID(DPAID_ServiceProvider,
|
||||
0x7d916c0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
|
||||
/*
|
||||
* DPAID_LobbyProvider
|
||||
*
|
||||
* Chunk is a GUID describing the lobby provider that created the chunk.
|
||||
* All addresses must contain this chunk.
|
||||
*/
|
||||
|
||||
// {59B95640-9667-11d0-A77D-0000F803ABFC}
|
||||
DEFINE_GUID(DPAID_LobbyProvider,
|
||||
0x59b95640, 0x9667, 0x11d0, 0xa7, 0x7d, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
|
||||
|
||||
/*
|
||||
* DPAID_Phone and DPAID_PhoneW
|
||||
*
|
||||
* Chunk is a string containing a phone number (i.e. "1-800-555-1212")
|
||||
* in ANSI or UNICODE format
|
||||
*/
|
||||
|
||||
// {78EC89A0-E0AF-11cf-9C4E-00A0C905425E}
|
||||
DEFINE_GUID(DPAID_Phone,
|
||||
0x78ec89a0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
|
||||
// {BA5A7A70-9DBF-11d0-9CC1-00A0C905425E}
|
||||
DEFINE_GUID(DPAID_PhoneW,
|
||||
0xba5a7a70, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
|
||||
/*
|
||||
* DPAID_Modem and DPAID_ModemW
|
||||
*
|
||||
* Chunk is a string containing a modem name registered with TAPI
|
||||
* in ANSI or UNICODE format
|
||||
*/
|
||||
|
||||
// {F6DCC200-A2FE-11d0-9C4F-00A0C905425E}
|
||||
DEFINE_GUID(DPAID_Modem,
|
||||
0xf6dcc200, 0xa2fe, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
|
||||
// {01FD92E0-A2FF-11d0-9C4F-00A0C905425E}
|
||||
DEFINE_GUID(DPAID_ModemW,
|
||||
0x1fd92e0, 0xa2ff, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
|
||||
/*
|
||||
* DPAID_Inet and DPAID_InetW
|
||||
*
|
||||
* Chunk is a string containing a TCP/IP host name or an IP address
|
||||
* (i.e. "dplay.microsoft.com" or "137.55.100.173") in ANSI or UNICODE format
|
||||
*/
|
||||
|
||||
// {C4A54DA0-E0AF-11cf-9C4E-00A0C905425E}
|
||||
DEFINE_GUID(DPAID_INet,
|
||||
0xc4a54da0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
|
||||
// {E63232A0-9DBF-11d0-9CC1-00A0C905425E}
|
||||
DEFINE_GUID(DPAID_INetW,
|
||||
0xe63232a0, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
|
||||
/*
|
||||
* DPCOMPORTADDRESS
|
||||
*
|
||||
* Used to specify com port settings. The constants that define baud rate,
|
||||
* stop bits and parity are defined in WINBASE.H. The constants for flow
|
||||
* control are given below.
|
||||
*/
|
||||
|
||||
#define DPCPA_NOFLOW 0 // no flow control
|
||||
#define DPCPA_XONXOFFFLOW 1 // software flow control
|
||||
#define DPCPA_RTSFLOW 2 // hardware flow control with RTS
|
||||
#define DPCPA_DTRFLOW 3 // hardware flow control with DTR
|
||||
#define DPCPA_RTSDTRFLOW 4 // hardware flow control with RTS and DTR
|
||||
|
||||
typedef struct _DPCOMPORTADDRESS
|
||||
{
|
||||
DWORD dwComPort; // COM port to use (1-4)
|
||||
DWORD dwBaudRate; // baud rate (100-256k)
|
||||
DWORD dwStopBits; // no. stop bits (1-2)
|
||||
DWORD dwParity; // parity (none, odd, even, mark)
|
||||
DWORD dwFlowControl; // flow control (none, xon/xoff, rts, dtr)
|
||||
} DPCOMPORTADDRESS;
|
||||
|
||||
typedef DPCOMPORTADDRESS FAR *LPDPCOMPORTADDRESS;
|
||||
|
||||
/*
|
||||
* DPAID_ComPort
|
||||
*
|
||||
* Chunk contains a DPCOMPORTADDRESS structure defining the serial port.
|
||||
*/
|
||||
|
||||
// {F2F0CE00-E0AF-11cf-9C4E-00A0C905425E}
|
||||
DEFINE_GUID(DPAID_ComPort,
|
||||
0xf2f0ce00, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* dplobby 1.0 obsolete definitions
|
||||
* Included for compatibility only.
|
||||
*
|
||||
****************************************************************************/
|
||||
#define DPLAD_SYSTEM DPLMSG_SYSTEM
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __DPLOBBY_INCLUDED__ */
|
||||
267
3rdparty/dx5/inc/dsetup.h
vendored
Normal file
267
3rdparty/dx5/inc/dsetup.h
vendored
Normal file
@ -0,0 +1,267 @@
|
||||
/*==========================================================================
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: dsetup.h
|
||||
* Content: DirectXSetup, error codes and flags
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __DSETUP_H__
|
||||
#define __DSETUP_H__
|
||||
|
||||
#include <windows.h> // windows stuff
|
||||
|
||||
#ifdef _WIN32
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <objbase.h>
|
||||
#else
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// DSETUP Error Codes, must remain compatible with previous setup.
|
||||
#define DSETUPERR_SUCCESS_RESTART 1
|
||||
#define DSETUPERR_SUCCESS 0
|
||||
#define DSETUPERR_BADWINDOWSVERSION -1
|
||||
#define DSETUPERR_SOURCEFILENOTFOUND -2
|
||||
#define DSETUPERR_BADSOURCESIZE -3
|
||||
#define DSETUPERR_BADSOURCETIME -4
|
||||
#define DSETUPERR_NOCOPY -5
|
||||
#define DSETUPERR_OUTOFDISKSPACE -6
|
||||
#define DSETUPERR_CANTFINDINF -7
|
||||
#define DSETUPERR_CANTFINDDIR -8
|
||||
#define DSETUPERR_INTERNAL -9
|
||||
#define DSETUPERR_NTWITHNO3D -10 /* REM: obsolete, you'll never see this */
|
||||
#define DSETUPERR_UNKNOWNOS -11
|
||||
#define DSETUPERR_USERHITCANCEL -12
|
||||
#define DSETUPERR_NOTPREINSTALLEDONNT -13
|
||||
|
||||
// DSETUP flags. DirectX 5.0 apps should use these flags only.
|
||||
#define DSETUP_DDRAWDRV 0x00000008 /* install DirectDraw Drivers */
|
||||
#define DSETUP_DSOUNDDRV 0x00000010 /* install DirectSound Drivers */
|
||||
#define DSETUP_DXCORE 0x00010000 /* install DirectX runtime */
|
||||
#define DSETUP_DIRECTX (DSETUP_DXCORE|DSETUP_DDRAWDRV|DSETUP_DSOUNDDRV)
|
||||
#define DSETUP_TESTINSTALL 0x00020000 /* just test install, don't do anything */
|
||||
|
||||
// These OBSOLETE flags are here for compatibility with pre-DX5 apps only.
|
||||
// They are present to allow DX3 apps to be recompiled with DX5 and still work.
|
||||
// DO NOT USE THEM for DX5. They will go away in future DX releases.
|
||||
#define DSETUP_DDRAW 0x00000001 /* OBSOLETE. install DirectDraw */
|
||||
#define DSETUP_DSOUND 0x00000002 /* OBSOLETE. install DirectSound */
|
||||
#define DSETUP_DPLAY 0x00000004 /* OBSOLETE. install DirectPlay */
|
||||
#define DSETUP_DPLAYSP 0x00000020 /* OBSOLETE. install DirectPlay Providers */
|
||||
#define DSETUP_DVIDEO 0x00000040 /* OBSOLETE. install DirectVideo */
|
||||
#define DSETUP_D3D 0x00000200 /* OBSOLETE. install Direct3D */
|
||||
#define DSETUP_DINPUT 0x00000800 /* OBSOLETE. install DirectInput */
|
||||
#define DSETUP_DIRECTXSETUP 0x00001000 /* OBSOLETE. install DirectXSetup DLL's */
|
||||
#define DSETUP_NOUI 0x00002000 /* OBSOLETE. install DirectX with NO UI */
|
||||
#define DSETUP_PROMPTFORDRIVERS 0x10000000 /* OBSOLETE. prompt when replacing display/audio drivers */
|
||||
#define DSETUP_RESTOREDRIVERS 0x20000000 /* OBSOLETE. restore display/audio drivers */
|
||||
|
||||
|
||||
|
||||
//******************************************************************
|
||||
// DirectX Setup Callback mechanism
|
||||
//******************************************************************
|
||||
|
||||
// DSETUP Message Info Codes, passed to callback as Reason parameter.
|
||||
#define DSETUP_CB_MSG_NOMESSAGE 0
|
||||
#define DSETUP_CB_MSG_CANTINSTALL_UNKNOWNOS 1
|
||||
#define DSETUP_CB_MSG_CANTINSTALL_NT 2
|
||||
#define DSETUP_CB_MSG_CANTINSTALL_BETA 3
|
||||
#define DSETUP_CB_MSG_CANTINSTALL_NOTWIN32 4
|
||||
#define DSETUP_CB_MSG_CANTINSTALL_WRONGLANGUAGE 5
|
||||
#define DSETUP_CB_MSG_CANTINSTALL_WRONGPLATFORM 6
|
||||
#define DSETUP_CB_MSG_PREINSTALL_NT 7
|
||||
#define DSETUP_CB_MSG_NOTPREINSTALLEDONNT 8
|
||||
#define DSETUP_CB_MSG_SETUP_INIT_FAILED 9
|
||||
#define DSETUP_CB_MSG_INTERNAL_ERROR 10
|
||||
#define DSETUP_CB_MSG_CHECK_DRIVER_UPGRADE 11
|
||||
#define DSETUP_CB_MSG_OUTOFDISKSPACE 12
|
||||
#define DSETUP_CB_MSG_BEGIN_INSTALL 13
|
||||
#define DSETUP_CB_MSG_BEGIN_INSTALL_RUNTIME 14
|
||||
#define DSETUP_CB_MSG_BEGIN_INSTALL_DRIVERS 15
|
||||
#define DSETUP_CB_MSG_BEGIN_RESTORE_DRIVERS 16
|
||||
#define DSETUP_CB_MSG_FILECOPYERROR 17
|
||||
|
||||
|
||||
#define DSETUP_CB_UPGRADE_TYPE_MASK 0x000F
|
||||
#define DSETUP_CB_UPGRADE_KEEP 0x0001
|
||||
#define DSETUP_CB_UPGRADE_SAFE 0x0002
|
||||
#define DSETUP_CB_UPGRADE_FORCE 0x0004
|
||||
#define DSETUP_CB_UPGRADE_UNKNOWN 0x0008
|
||||
|
||||
#define DSETUP_CB_UPGRADE_HASWARNINGS 0x0100
|
||||
#define DSETUP_CB_UPGRADE_CANTBACKUP 0x0200
|
||||
|
||||
#define DSETUP_CB_UPGRADE_DEVICE_ACTIVE 0x0800
|
||||
|
||||
#define DSETUP_CB_UPGRADE_DEVICE_DISPLAY 0x1000
|
||||
#define DSETUP_CB_UPGRADE_DEVICE_MEDIA 0x2000
|
||||
|
||||
|
||||
typedef struct _DSETUP_CB_UPGRADEINFO
|
||||
{
|
||||
DWORD UpgradeFlags;
|
||||
} DSETUP_CB_UPGRADEINFO;
|
||||
|
||||
typedef struct _DSETUP_CB_FILECOPYERROR
|
||||
{
|
||||
DWORD dwError;
|
||||
} DSETUP_CB_FILECOPYERROR;
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
//
|
||||
// Data Structures
|
||||
//
|
||||
#ifndef UNICODE_ONLY
|
||||
typedef struct _DIRECTXREGISTERAPPA {
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
LPSTR lpszApplicationName;
|
||||
LPGUID lpGUID;
|
||||
LPSTR lpszFilename;
|
||||
LPSTR lpszCommandLine;
|
||||
LPSTR lpszPath;
|
||||
LPSTR lpszCurrentDirectory;
|
||||
} DIRECTXREGISTERAPPA, *PDIRECTXREGISTERAPPA, *LPDIRECTXREGISTERAPPA;
|
||||
#endif //!UNICODE_ONLY
|
||||
#ifndef ANSI_ONLY
|
||||
typedef struct _DIRECTXREGISTERAPPW {
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
LPWSTR lpszApplicationName;
|
||||
LPGUID lpGUID;
|
||||
LPWSTR lpszFilename;
|
||||
LPWSTR lpszCommandLine;
|
||||
LPWSTR lpszPath;
|
||||
LPWSTR lpszCurrentDirectory;
|
||||
} DIRECTXREGISTERAPPW, *PDIRECTXREGISTERAPPW, *LPDIRECTXREGISTERAPPW;
|
||||
#endif //!ANSI_ONLY
|
||||
#ifdef UNICODE
|
||||
typedef DIRECTXREGISTERAPPW DIRECTXREGISTERAPP;
|
||||
typedef PDIRECTXREGISTERAPPW PDIRECTXREGISTERAPP;
|
||||
typedef LPDIRECTXREGISTERAPPW LPDIRECTXREGISTERAPP;
|
||||
#else
|
||||
typedef DIRECTXREGISTERAPPA DIRECTXREGISTERAPP;
|
||||
typedef PDIRECTXREGISTERAPPA PDIRECTXREGISTERAPP;
|
||||
typedef LPDIRECTXREGISTERAPPA LPDIRECTXREGISTERAPP;
|
||||
#endif // UNICODE
|
||||
|
||||
|
||||
//
|
||||
// API
|
||||
//
|
||||
#ifndef UNICODE_ONLY
|
||||
INT
|
||||
WINAPI
|
||||
DirectXSetupA(
|
||||
HWND hWnd,
|
||||
LPSTR lpszRootPath,
|
||||
DWORD dwFlags
|
||||
);
|
||||
#endif //!UNICODE_ONLY
|
||||
#ifndef ANSI_ONLY
|
||||
INT
|
||||
WINAPI
|
||||
DirectXSetupW(
|
||||
HWND hWnd,
|
||||
LPWSTR lpszRootPath,
|
||||
DWORD dwFlags
|
||||
);
|
||||
#endif //!ANSI_ONLY
|
||||
#ifdef UNICODE
|
||||
#define DirectXSetup DirectXSetupW
|
||||
#else
|
||||
#define DirectXSetup DirectXSetupA
|
||||
#endif // !UNICODE
|
||||
|
||||
#ifndef UNICODE_ONLY
|
||||
INT
|
||||
WINAPI
|
||||
DirectXDeviceDriverSetupA(
|
||||
HWND hWnd,
|
||||
LPSTR lpszDriverClass,
|
||||
LPSTR lpszDriverPath,
|
||||
DWORD dwFlags
|
||||
);
|
||||
#endif //!UNICODE_ONLY
|
||||
#ifndef ANSI_ONLY
|
||||
INT
|
||||
WINAPI
|
||||
DirectXDeviceDriverSetupW(
|
||||
HWND hWnd,
|
||||
LPWSTR lpszDriverClass,
|
||||
LPWSTR lpszDriverPath,
|
||||
DWORD dwFlags
|
||||
);
|
||||
#endif //!ANSI_ONLY
|
||||
#ifdef UNICODE
|
||||
#define DirectXDeviceDriverSetup DirectXDeviceDriverSetupW
|
||||
#else
|
||||
#define DirectXDeviceDriverSetup DirectXDeviceDriverSetupA
|
||||
#endif // !UNICODE
|
||||
|
||||
#ifndef UNICODE_ONLY
|
||||
INT
|
||||
WINAPI
|
||||
DirectXRegisterApplicationA(
|
||||
HWND hWnd,
|
||||
LPDIRECTXREGISTERAPPA lpDXRegApp
|
||||
);
|
||||
#endif //!UNICODE_ONLY
|
||||
#ifndef ANSI_ONLY
|
||||
INT
|
||||
WINAPI
|
||||
DirectXRegisterApplicationW(
|
||||
HWND hWnd,
|
||||
LPDIRECTXREGISTERAPPW lpDXRegApp
|
||||
);
|
||||
#endif //!ANSI_ONLY
|
||||
#ifdef UNICODE
|
||||
#define DirectXRegisterApplication DirectXRegisterApplicationW
|
||||
#else
|
||||
#define DirectXRegisterApplication DirectXRegisterApplicationA
|
||||
#endif // !UNICODE
|
||||
|
||||
INT
|
||||
WINAPI
|
||||
DirectXUnRegisterApplication(
|
||||
HWND hWnd,
|
||||
LPGUID lpGUID
|
||||
);
|
||||
|
||||
//
|
||||
// Function Pointers
|
||||
//
|
||||
#ifdef UNICODE
|
||||
typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPWSTR, DWORD);
|
||||
typedef INT (WINAPI * LPDIRECTXDEVICEDRIVERSETUP)(HWND, LPWSTR, LPSTR, DWORD);
|
||||
typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPDIRECTXREGISTERAPPW);
|
||||
#else
|
||||
typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPSTR, DWORD);
|
||||
typedef INT (WINAPI * LPDIRECTXDEVICEDRIVERSETUP)(HWND, LPSTR, LPSTR, DWORD);
|
||||
typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPDIRECTXREGISTERAPPA);
|
||||
#endif // UNICODE
|
||||
|
||||
typedef DWORD (FAR PASCAL * DSETUP_CALLBACK)(DWORD Reason,
|
||||
DWORD MsgType, /* Same as flags to MessageBox */
|
||||
LPSTR szMessage,
|
||||
LPSTR szName,
|
||||
void *pInfo);
|
||||
|
||||
INT WINAPI DirectXSetupSetCallback(DSETUP_CALLBACK Callback);
|
||||
INT WINAPI DirectXSetupGetVersion(DWORD *lpdwVersion, DWORD *lpdwMinorVersion);
|
||||
|
||||
#endif // WIN32
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
863
3rdparty/dx5/inc/dsound.h
vendored
Normal file
863
3rdparty/dx5/inc/dsound.h
vendored
Normal file
@ -0,0 +1,863 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995,1996 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: dsound.h
|
||||
* Content: DirectSound include file
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef __DSOUND_INCLUDED__
|
||||
#define __DSOUND_INCLUDED__
|
||||
|
||||
#include <d3dtypes.h>
|
||||
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <objbase.h>
|
||||
|
||||
#define _FACDS 0x878
|
||||
#define MAKE_DSHRESULT(code) MAKE_HRESULT(1, _FACDS, code)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
// Direct Sound Component GUID {47D4D946-62E8-11cf-93BC-444553540000}
|
||||
DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
|
||||
|
||||
// DirectSound Capture Component GUID {B0210780-89CD-11d0-AF08-00A0C925CD16}
|
||||
DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
|
||||
|
||||
//
|
||||
// Structures
|
||||
//
|
||||
|
||||
#ifdef __cplusplus
|
||||
// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
|
||||
struct IDirectSound;
|
||||
struct IDirectSoundBuffer;
|
||||
struct IDirectSound3DListener;
|
||||
struct IDirectSound3DBuffer;
|
||||
struct IDirectSoundCapture;
|
||||
struct IDirectSoundCaptureBuffer;
|
||||
struct IDirectSoundNotify;
|
||||
#endif // __cplusplus
|
||||
|
||||
typedef struct IDirectSound *LPDIRECTSOUND;
|
||||
typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER;
|
||||
typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER;
|
||||
typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER;
|
||||
typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE;
|
||||
typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER;
|
||||
typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY;
|
||||
|
||||
typedef struct _DSCAPS
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwMinSecondarySampleRate;
|
||||
DWORD dwMaxSecondarySampleRate;
|
||||
DWORD dwPrimaryBuffers;
|
||||
DWORD dwMaxHwMixingAllBuffers;
|
||||
DWORD dwMaxHwMixingStaticBuffers;
|
||||
DWORD dwMaxHwMixingStreamingBuffers;
|
||||
DWORD dwFreeHwMixingAllBuffers;
|
||||
DWORD dwFreeHwMixingStaticBuffers;
|
||||
DWORD dwFreeHwMixingStreamingBuffers;
|
||||
DWORD dwMaxHw3DAllBuffers;
|
||||
DWORD dwMaxHw3DStaticBuffers;
|
||||
DWORD dwMaxHw3DStreamingBuffers;
|
||||
DWORD dwFreeHw3DAllBuffers;
|
||||
DWORD dwFreeHw3DStaticBuffers;
|
||||
DWORD dwFreeHw3DStreamingBuffers;
|
||||
DWORD dwTotalHwMemBytes;
|
||||
DWORD dwFreeHwMemBytes;
|
||||
DWORD dwMaxContigFreeHwMemBytes;
|
||||
DWORD dwUnlockTransferRateHwBuffers;
|
||||
DWORD dwPlayCpuOverheadSwBuffers;
|
||||
DWORD dwReserved1;
|
||||
DWORD dwReserved2;
|
||||
} DSCAPS, *LPDSCAPS;
|
||||
|
||||
typedef const DSCAPS *LPCDSCAPS;
|
||||
|
||||
typedef struct _DSBCAPS
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwBufferBytes;
|
||||
DWORD dwUnlockTransferRate;
|
||||
DWORD dwPlayCpuOverhead;
|
||||
} DSBCAPS, *LPDSBCAPS;
|
||||
|
||||
typedef const DSBCAPS *LPCDSBCAPS;
|
||||
|
||||
typedef struct _DSBUFFERDESC
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwBufferBytes;
|
||||
DWORD dwReserved;
|
||||
LPWAVEFORMATEX lpwfxFormat;
|
||||
} DSBUFFERDESC, *LPDSBUFFERDESC;
|
||||
|
||||
typedef const DSBUFFERDESC *LPCDSBUFFERDESC;
|
||||
|
||||
typedef struct _DS3DBUFFER
|
||||
{
|
||||
DWORD dwSize;
|
||||
D3DVECTOR vPosition;
|
||||
D3DVECTOR vVelocity;
|
||||
DWORD dwInsideConeAngle;
|
||||
DWORD dwOutsideConeAngle;
|
||||
D3DVECTOR vConeOrientation;
|
||||
LONG lConeOutsideVolume;
|
||||
D3DVALUE flMinDistance;
|
||||
D3DVALUE flMaxDistance;
|
||||
DWORD dwMode;
|
||||
} DS3DBUFFER, *LPDS3DBUFFER;
|
||||
|
||||
typedef const DS3DBUFFER *LPCDS3DBUFFER;
|
||||
|
||||
typedef struct _DS3DLISTENER
|
||||
{
|
||||
DWORD dwSize;
|
||||
D3DVECTOR vPosition;
|
||||
D3DVECTOR vVelocity;
|
||||
D3DVECTOR vOrientFront;
|
||||
D3DVECTOR vOrientTop;
|
||||
D3DVALUE flDistanceFactor;
|
||||
D3DVALUE flRolloffFactor;
|
||||
D3DVALUE flDopplerFactor;
|
||||
} DS3DLISTENER, *LPDS3DLISTENER;
|
||||
|
||||
typedef const DS3DLISTENER *LPCDS3DLISTENER;
|
||||
|
||||
typedef struct _DSCCAPS
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwFormats;
|
||||
DWORD dwChannels;
|
||||
} DSCCAPS, *LPDSCCAPS;
|
||||
|
||||
typedef const DSCCAPS *LPCDSCCAPS;
|
||||
|
||||
typedef struct _DSCBUFFERDESC
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwBufferBytes;
|
||||
DWORD dwReserved;
|
||||
LPWAVEFORMATEX lpwfxFormat;
|
||||
} DSCBUFFERDESC, *LPDSCBUFFERDESC;
|
||||
|
||||
typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC;
|
||||
|
||||
typedef struct _DSCBCAPS
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwBufferBytes;
|
||||
DWORD dwReserved;
|
||||
} DSCBCAPS, *LPDSCBCAPS;
|
||||
|
||||
typedef const DSCBCAPS *LPCDSCBCAPS;
|
||||
|
||||
typedef struct _DSBPOSITIONNOTIFY
|
||||
{
|
||||
DWORD dwOffset;
|
||||
HANDLE hEventNotify;
|
||||
} DSBPOSITIONNOTIFY, *LPDSBPOSITIONNOTIFY;
|
||||
|
||||
typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
|
||||
|
||||
//
|
||||
// Compatibility typedefs
|
||||
//
|
||||
|
||||
typedef LPDIRECTSOUND *LPLPDIRECTSOUND;
|
||||
typedef LPDIRECTSOUNDBUFFER *LPLPDIRECTSOUNDBUFFER;
|
||||
typedef LPDIRECTSOUND3DLISTENER *LPLPDIRECTSOUND3DLISTENER;
|
||||
typedef LPDIRECTSOUND3DBUFFER *LPLPDIRECTSOUND3DBUFFER;
|
||||
typedef LPDIRECTSOUNDCAPTURE *LPLPDIRECTSOUNDCAPTURE;
|
||||
typedef LPDIRECTSOUNDCAPTUREBUFFER *LPLPDIRECTSOUNDCAPTUREBUFFER;
|
||||
typedef LPDIRECTSOUNDNOTIFY *LPLPDIRECTSOUNDNOTIFY;
|
||||
typedef LPVOID *LPLPVOID;
|
||||
typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
|
||||
|
||||
//
|
||||
// DirectSound API
|
||||
//
|
||||
|
||||
typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID, LPCWSTR, LPCWSTR, LPVOID);
|
||||
typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID, LPCSTR, LPCSTR, LPVOID);
|
||||
|
||||
extern HRESULT WINAPI DirectSoundCreate(LPGUID, LPDIRECTSOUND *, LPUNKNOWN);
|
||||
extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW, LPVOID);
|
||||
extern HRESULT WINAPI DirectSoundEnumerateA(LPDSENUMCALLBACKA, LPVOID);
|
||||
|
||||
extern HRESULT WINAPI DirectSoundCaptureCreate(LPGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN);
|
||||
extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW, LPVOID);
|
||||
extern HRESULT WINAPI DirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA, LPVOID);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define LPDSENUMCALLBACK LPDSENUMCALLBACKW
|
||||
#define DirectSoundEnumerate DirectSoundEnumerateW
|
||||
#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateW
|
||||
#else // UNICODE
|
||||
#define LPDSENUMCALLBACK LPDSENUMCALLBACKA
|
||||
#define DirectSoundEnumerate DirectSoundEnumerateA
|
||||
#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateA
|
||||
#endif // UNICODE
|
||||
|
||||
//
|
||||
// IDirectSound
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSound
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSound, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSound methods
|
||||
STDMETHOD(CreateSoundBuffer) (THIS_ LPCDSBUFFERDESC, LPDIRECTSOUNDBUFFER *, LPUNKNOWN) PURE;
|
||||
STDMETHOD(GetCaps) (THIS_ LPDSCAPS) PURE;
|
||||
STDMETHOD(DuplicateSoundBuffer) (THIS_ LPDIRECTSOUNDBUFFER, LPDIRECTSOUNDBUFFER *) PURE;
|
||||
STDMETHOD(SetCooperativeLevel) (THIS_ HWND, DWORD) PURE;
|
||||
STDMETHOD(Compact) (THIS) PURE;
|
||||
STDMETHOD(GetSpeakerConfig) (THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(SetSpeakerConfig) (THIS_ DWORD) PURE;
|
||||
STDMETHOD(Initialize) (THIS_ LPGUID) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSound_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSound_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
|
||||
#define IDirectSound_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
|
||||
#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
|
||||
#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
|
||||
#define IDirectSound_Compact(p) (p)->lpVtbl->Compact(p)
|
||||
#define IDirectSound_GetSpeakerConfig(p,a) (p)->lpVtbl->GetSpeakerConfig(p,a)
|
||||
#define IDirectSound_SetSpeakerConfig(p,b) (p)->lpVtbl->SetSpeakerConfig(p,b)
|
||||
#define IDirectSound_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSound_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSound_Release(p) (p)->Release()
|
||||
#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->CreateSoundBuffer(a,b,c)
|
||||
#define IDirectSound_GetCaps(p,a) (p)->GetCaps(a)
|
||||
#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
|
||||
#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
|
||||
#define IDirectSound_Compact(p) (p)->Compact()
|
||||
#define IDirectSound_GetSpeakerConfig(p,a) (p)->GetSpeakerConfig(a)
|
||||
#define IDirectSound_SetSpeakerConfig(p,b) (p)->SetSpeakerConfig(b)
|
||||
#define IDirectSound_Initialize(p,a) (p)->Initialize(a)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSoundBuffer
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSoundBuffer
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundBuffer methods
|
||||
STDMETHOD(GetCaps) (THIS_ LPDSBCAPS) PURE;
|
||||
STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD, LPDWORD) PURE;
|
||||
STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD) PURE;
|
||||
STDMETHOD(GetVolume) (THIS_ LPLONG) PURE;
|
||||
STDMETHOD(GetPan) (THIS_ LPLONG) PURE;
|
||||
STDMETHOD(GetFrequency) (THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(GetStatus) (THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECTSOUND, LPCDSBUFFERDESC) PURE;
|
||||
STDMETHOD(Lock) (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
|
||||
STDMETHOD(Play) (THIS_ DWORD, DWORD, DWORD) PURE;
|
||||
STDMETHOD(SetCurrentPosition) (THIS_ DWORD) PURE;
|
||||
STDMETHOD(SetFormat) (THIS_ LPCWAVEFORMATEX) PURE;
|
||||
STDMETHOD(SetVolume) (THIS_ LONG) PURE;
|
||||
STDMETHOD(SetPan) (THIS_ LONG) PURE;
|
||||
STDMETHOD(SetFrequency) (THIS_ DWORD) PURE;
|
||||
STDMETHOD(Stop) (THIS) PURE;
|
||||
STDMETHOD(Unlock) (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(Restore) (THIS) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSoundBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSoundBuffer_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSoundBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
|
||||
#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
|
||||
#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
|
||||
#define IDirectSoundBuffer_GetVolume(p,a) (p)->lpVtbl->GetVolume(p,a)
|
||||
#define IDirectSoundBuffer_GetPan(p,a) (p)->lpVtbl->GetPan(p,a)
|
||||
#define IDirectSoundBuffer_GetFrequency(p,a) (p)->lpVtbl->GetFrequency(p,a)
|
||||
#define IDirectSoundBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
|
||||
#define IDirectSoundBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
|
||||
#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
|
||||
#define IDirectSoundBuffer_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c)
|
||||
#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->lpVtbl->SetCurrentPosition(p,a)
|
||||
#define IDirectSoundBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a)
|
||||
#define IDirectSoundBuffer_SetVolume(p,a) (p)->lpVtbl->SetVolume(p,a)
|
||||
#define IDirectSoundBuffer_SetPan(p,a) (p)->lpVtbl->SetPan(p,a)
|
||||
#define IDirectSoundBuffer_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a)
|
||||
#define IDirectSoundBuffer_Stop(p) (p)->lpVtbl->Stop(p)
|
||||
#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
|
||||
#define IDirectSoundBuffer_Restore(p) (p)->lpVtbl->Restore(p)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSoundBuffer_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSoundBuffer_Release(p) (p)->Release()
|
||||
#define IDirectSoundBuffer_GetCaps(p,a) (p)->GetCaps(a)
|
||||
#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
|
||||
#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
|
||||
#define IDirectSoundBuffer_GetVolume(p,a) (p)->GetVolume(a)
|
||||
#define IDirectSoundBuffer_GetPan(p,a) (p)->GetPan(a)
|
||||
#define IDirectSoundBuffer_GetFrequency(p,a) (p)->GetFrequency(a)
|
||||
#define IDirectSoundBuffer_GetStatus(p,a) (p)->GetStatus(a)
|
||||
#define IDirectSoundBuffer_Initialize(p,a,b) (p)->Initialize(a,b)
|
||||
#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
|
||||
#define IDirectSoundBuffer_Play(p,a,b,c) (p)->Play(a,b,c)
|
||||
#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->SetCurrentPosition(a)
|
||||
#define IDirectSoundBuffer_SetFormat(p,a) (p)->SetFormat(a)
|
||||
#define IDirectSoundBuffer_SetVolume(p,a) (p)->SetVolume(a)
|
||||
#define IDirectSoundBuffer_SetPan(p,a) (p)->SetPan(a)
|
||||
#define IDirectSoundBuffer_SetFrequency(p,a) (p)->SetFrequency(a)
|
||||
#define IDirectSoundBuffer_Stop(p) (p)->Stop()
|
||||
#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
|
||||
#define IDirectSoundBuffer_Restore(p) (p)->Restore()
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSound3DListener
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSound3DListener
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSound3DListener, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSound3D methods
|
||||
STDMETHOD(GetAllParameters) (THIS_ LPDS3DLISTENER) PURE;
|
||||
STDMETHOD(GetDistanceFactor) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetDopplerFactor) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetOrientation) (THIS_ LPD3DVECTOR, LPD3DVECTOR) PURE;
|
||||
STDMETHOD(GetPosition) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(GetRolloffFactor) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetVelocity) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(SetAllParameters) (THIS_ LPCDS3DLISTENER, DWORD) PURE;
|
||||
STDMETHOD(SetDistanceFactor) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetDopplerFactor) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetOrientation) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetPosition) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetRolloffFactor) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetVelocity) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(CommitDeferredSettings) (THIS) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound3DListener_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSound3DListener_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSound3DListener_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSound3DListener_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
|
||||
#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->lpVtbl->GetDistanceFactor(p,a)
|
||||
#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->lpVtbl->GetDopplerFactor(p,a)
|
||||
#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->lpVtbl->GetOrientation(p,a,b)
|
||||
#define IDirectSound3DListener_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a)
|
||||
#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->lpVtbl->GetRolloffFactor(p,a)
|
||||
#define IDirectSound3DListener_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a)
|
||||
#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b)
|
||||
#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->lpVtbl->SetDistanceFactor(p,a,b)
|
||||
#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->lpVtbl->SetDopplerFactor(p,a,b)
|
||||
#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
|
||||
#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d)
|
||||
#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->lpVtbl->SetRolloffFactor(p,a,b)
|
||||
#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d)
|
||||
#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->lpVtbl->CommitDeferredSettings(p)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound3DListener_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSound3DListener_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSound3DListener_Release(p) (p)->Release()
|
||||
#define IDirectSound3DListener_GetAllParameters(p,a) (p)->GetAllParameters(a)
|
||||
#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->GetDistanceFactor(a)
|
||||
#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->GetDopplerFactor(a)
|
||||
#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->GetOrientation(a,b)
|
||||
#define IDirectSound3DListener_GetPosition(p,a) (p)->GetPosition(a)
|
||||
#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->GetRolloffFactor(a)
|
||||
#define IDirectSound3DListener_GetVelocity(p,a) (p)->GetVelocity(a)
|
||||
#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b)
|
||||
#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->SetDistanceFactor(a,b)
|
||||
#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->SetDopplerFactor(a,b)
|
||||
#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->SetOrientation(a,b,c,d,e,f,g)
|
||||
#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d)
|
||||
#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->SetRolloffFactor(a,b)
|
||||
#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d)
|
||||
#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->CommitDeferredSettings()
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSound3DBuffer
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSound3DBuffer
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSound3DBuffer, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundBuffer3D methods
|
||||
STDMETHOD(GetAllParameters) (THIS_ LPDS3DBUFFER) PURE;
|
||||
STDMETHOD(GetConeAngles) (THIS_ LPDWORD, LPDWORD) PURE;
|
||||
STDMETHOD(GetConeOrientation) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(GetConeOutsideVolume) (THIS_ LPLONG) PURE;
|
||||
STDMETHOD(GetMaxDistance) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetMinDistance) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetMode) (THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(GetPosition) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(GetVelocity) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(SetAllParameters) (THIS_ LPCDS3DBUFFER, DWORD) PURE;
|
||||
STDMETHOD(SetConeAngles) (THIS_ DWORD, DWORD, DWORD) PURE;
|
||||
STDMETHOD(SetConeOrientation) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetConeOutsideVolume) (THIS_ LONG, DWORD) PURE;
|
||||
STDMETHOD(SetMaxDistance) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetMinDistance) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetMode) (THIS_ DWORD, DWORD) PURE;
|
||||
STDMETHOD(SetPosition) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetVelocity) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound3DBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSound3DBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSound3DBuffer_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
|
||||
#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->lpVtbl->GetConeAngles(p,a,b)
|
||||
#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->lpVtbl->GetConeOrientation(p,a)
|
||||
#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->lpVtbl->GetConeOutsideVolume(p,a)
|
||||
#define IDirectSound3DBuffer_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a)
|
||||
#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->lpVtbl->GetMinDistance(p,a)
|
||||
#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->lpVtbl->GetMaxDistance(p,a)
|
||||
#define IDirectSound3DBuffer_GetMode(p,a) (p)->lpVtbl->GetMode(p,a)
|
||||
#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a)
|
||||
#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->lpVtbl->SetConeAngles(p,a,b,c)
|
||||
#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->lpVtbl->SetConeOrientation(p,a,b,c,d)
|
||||
#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)(p)->lpVtbl->SetConeOutsideVolume(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d)
|
||||
#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->lpVtbl->SetMinDistance(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->lpVtbl->SetMaxDistance(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->lpVtbl->SetMode(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound3DBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSound3DBuffer_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSound3DBuffer_Release(p) (p)->Release()
|
||||
#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->GetAllParameters(a)
|
||||
#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->GetConeAngles(a,b)
|
||||
#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->GetConeOrientation(a)
|
||||
#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->GetConeOutsideVolume(a)
|
||||
#define IDirectSound3DBuffer_GetPosition(p,a) (p)->GetPosition(a)
|
||||
#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->GetMinDistance(a)
|
||||
#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->GetMaxDistance(a)
|
||||
#define IDirectSound3DBuffer_GetMode(p,a) (p)->GetMode(a)
|
||||
#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->GetVelocity(a)
|
||||
#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b)
|
||||
#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->SetConeAngles(a,b,c)
|
||||
#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->SetConeOrientation(a,b,c,d)
|
||||
#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)(p)->SetConeOutsideVolume(a,b)
|
||||
#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d)
|
||||
#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->SetMinDistance(a,b)
|
||||
#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->SetMaxDistance(a,b)
|
||||
#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->SetMode(a,b)
|
||||
#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSoundCapture
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSoundCapture
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundCapture methods
|
||||
STDMETHOD(CreateCaptureBuffer) (THIS_ LPCDSCBUFFERDESC, LPDIRECTSOUNDCAPTUREBUFFER *, LPUNKNOWN) PURE;
|
||||
STDMETHOD(GetCaps) (THIS_ LPDSCCAPS ) PURE;
|
||||
STDMETHOD(Initialize) (THIS_ LPGUID) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundCapture_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSoundCapture_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSoundCapture_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c)
|
||||
#define IDirectSoundCapture_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
|
||||
#define IDirectSoundCapture_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundCapture_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSoundCapture_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSoundCapture_Release(p) (p)->Release()
|
||||
#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->CreateCaptureBuffer(a,b,c)
|
||||
#define IDirectSoundCapture_GetCaps(p,a) (p)->GetCaps(a)
|
||||
#define IDirectSoundCapture_Initialize(p,a) (p)->Initialize(a)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSoundCaptureBuffer
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSoundCaptureBuffer, 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSoundCaptureBuffer
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundCaptureBuffer methods
|
||||
STDMETHOD(GetCaps) (THIS_ LPDSCBCAPS ) PURE;
|
||||
STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD, LPDWORD ) PURE;
|
||||
STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD ) PURE;
|
||||
STDMETHOD(GetStatus) (THIS_ LPDWORD ) PURE;
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECTSOUNDCAPTURE, LPCDSCBUFFERDESC) PURE;
|
||||
STDMETHOD(Lock) (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
|
||||
STDMETHOD(Start) (THIS_ DWORD) PURE;
|
||||
STDMETHOD(Stop) (THIS) PURE;
|
||||
STDMETHOD(Unlock) (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSoundCaptureBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSoundCaptureBuffer_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
|
||||
#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
|
||||
#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
|
||||
#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
|
||||
#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
|
||||
#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
|
||||
#define IDirectSoundCaptureBuffer_Start(p,a) (p)->lpVtbl->Start(p,a)
|
||||
#define IDirectSoundCaptureBuffer_Stop(p) (p)->lpVtbl->Stop(p)
|
||||
#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSoundCaptureBuffer_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSoundCaptureBuffer_Release(p) (p)->Release()
|
||||
#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->GetCaps(a)
|
||||
#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
|
||||
#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
|
||||
#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->GetStatus(a)
|
||||
#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->Initialize(a,b)
|
||||
#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
|
||||
#define IDirectSoundCaptureBuffer_Start(p,a) (p)->Start(a)
|
||||
#define IDirectSoundCaptureBuffer_Stop(p) (p)->Stop()
|
||||
#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSoundNotify
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSoundNotify
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSoundNotify, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundNotify methods
|
||||
STDMETHOD(SetNotificationPositions) (THIS_ DWORD, LPCDSBPOSITIONNOTIFY) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundNotify_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSoundNotify_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSoundNotify_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundNotify_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSoundNotify_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSoundNotify_Release(p) (p)->Release()
|
||||
#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->SetNotificationPositions(a,b)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IKsPropertySet
|
||||
//
|
||||
|
||||
#ifndef _IKsPropertySet_
|
||||
#define _IKsPropertySet_
|
||||
|
||||
#ifdef __cplusplus
|
||||
// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
|
||||
struct IKsPropertySet;
|
||||
#endif // __cplusplus
|
||||
|
||||
typedef struct IKsPropertySet *LPKSPROPERTYSET;
|
||||
|
||||
#define KSPROPERTY_SUPPORT_GET 0x00000001
|
||||
#define KSPROPERTY_SUPPORT_SET 0x00000002
|
||||
|
||||
DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IKsPropertySet
|
||||
|
||||
DECLARE_INTERFACE_(IKsPropertySet, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IKsPropertySet methods
|
||||
STDMETHOD(Get) (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG, PULONG) PURE;
|
||||
STDMETHOD(Set) (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG) PURE;
|
||||
STDMETHOD(QuerySupport) (THIS_ REFGUID, ULONG, PULONG) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IKsPropertySet_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IKsPropertySet_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IKsPropertySet_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->lpVtbl->Get(p,a,b,c,d,e,f,g)
|
||||
#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->lpVtbl->Set(p,a,b,c,d,e,f)
|
||||
#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->lpVtbl->QuerySupport(p,a,b,c)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IKsPropertySet_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IKsPropertySet_AddRef(p) (p)->AddRef()
|
||||
#define IKsPropertySet_Release(p) (p)->Release()
|
||||
#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->Get(a,b,c,d,e,f,g)
|
||||
#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->Set(a,b,c,d,e,f)
|
||||
#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->QuerySupport(a,b,c)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
#endif // _IKsPropertySet_
|
||||
|
||||
//
|
||||
// Return Codes
|
||||
//
|
||||
|
||||
#define DS_OK 0
|
||||
|
||||
// The call failed because resources (such as a priority level)
|
||||
// were already being used by another caller.
|
||||
#define DSERR_ALLOCATED MAKE_DSHRESULT(10)
|
||||
|
||||
// The control (vol,pan,etc.) requested by the caller is not available.
|
||||
#define DSERR_CONTROLUNAVAIL MAKE_DSHRESULT(30)
|
||||
|
||||
// An invalid parameter was passed to the returning function
|
||||
#define DSERR_INVALIDPARAM E_INVALIDARG
|
||||
|
||||
// This call is not valid for the current state of this object
|
||||
#define DSERR_INVALIDCALL MAKE_DSHRESULT(50)
|
||||
|
||||
// An undetermined error occured inside the DirectSound subsystem
|
||||
#define DSERR_GENERIC E_FAIL
|
||||
|
||||
// The caller does not have the priority level required for the function to
|
||||
// succeed.
|
||||
#define DSERR_PRIOLEVELNEEDED MAKE_DSHRESULT(70)
|
||||
|
||||
// Not enough free memory is available to complete the operation
|
||||
#define DSERR_OUTOFMEMORY E_OUTOFMEMORY
|
||||
|
||||
// The specified WAVE format is not supported
|
||||
#define DSERR_BADFORMAT MAKE_DSHRESULT(100)
|
||||
|
||||
// The function called is not supported at this time
|
||||
#define DSERR_UNSUPPORTED E_NOTIMPL
|
||||
|
||||
// No sound driver is available for use
|
||||
#define DSERR_NODRIVER MAKE_DSHRESULT(120)
|
||||
|
||||
// This object is already initialized
|
||||
#define DSERR_ALREADYINITIALIZED MAKE_DSHRESULT(130)
|
||||
|
||||
// This object does not support aggregation
|
||||
#define DSERR_NOAGGREGATION CLASS_E_NOAGGREGATION
|
||||
|
||||
// The buffer memory has been lost, and must be restored.
|
||||
#define DSERR_BUFFERLOST MAKE_DSHRESULT(150)
|
||||
|
||||
// Another app has a higher priority level, preventing this call from
|
||||
// succeeding.
|
||||
#define DSERR_OTHERAPPHASPRIO MAKE_DSHRESULT(160)
|
||||
|
||||
// This object has not been initialized
|
||||
#define DSERR_UNINITIALIZED MAKE_DSHRESULT(170)
|
||||
|
||||
// The requested COM interface is not available
|
||||
#define DSERR_NOINTERFACE E_NOINTERFACE
|
||||
|
||||
//
|
||||
// Flags
|
||||
//
|
||||
|
||||
#define DSCAPS_PRIMARYMONO 0x00000001
|
||||
#define DSCAPS_PRIMARYSTEREO 0x00000002
|
||||
#define DSCAPS_PRIMARY8BIT 0x00000004
|
||||
#define DSCAPS_PRIMARY16BIT 0x00000008
|
||||
#define DSCAPS_CONTINUOUSRATE 0x00000010
|
||||
#define DSCAPS_EMULDRIVER 0x00000020
|
||||
#define DSCAPS_CERTIFIED 0x00000040
|
||||
#define DSCAPS_SECONDARYMONO 0x00000100
|
||||
#define DSCAPS_SECONDARYSTEREO 0x00000200
|
||||
#define DSCAPS_SECONDARY8BIT 0x00000400
|
||||
#define DSCAPS_SECONDARY16BIT 0x00000800
|
||||
|
||||
#define DSBPLAY_LOOPING 0x00000001
|
||||
|
||||
#define DSBSTATUS_PLAYING 0x00000001
|
||||
#define DSBSTATUS_BUFFERLOST 0x00000002
|
||||
#define DSBSTATUS_LOOPING 0x00000004
|
||||
|
||||
#define DSBLOCK_FROMWRITECURSOR 0x00000001
|
||||
#define DSBLOCK_ENTIREBUFFER 0x00000002
|
||||
|
||||
#define DSSCL_NORMAL 0x00000001
|
||||
#define DSSCL_PRIORITY 0x00000002
|
||||
#define DSSCL_EXCLUSIVE 0x00000003
|
||||
#define DSSCL_WRITEPRIMARY 0x00000004
|
||||
|
||||
#define DS3DMODE_NORMAL 0x00000000
|
||||
#define DS3DMODE_HEADRELATIVE 0x00000001
|
||||
#define DS3DMODE_DISABLE 0x00000002
|
||||
|
||||
#define DS3D_IMMEDIATE 0x00000000
|
||||
#define DS3D_DEFERRED 0x00000001
|
||||
|
||||
#define DS3D_MINDISTANCEFACTOR 0.0f
|
||||
#define DS3D_MAXDISTANCEFACTOR 10.0f
|
||||
#define DS3D_DEFAULTDISTANCEFACTOR 1.0f
|
||||
|
||||
#define DS3D_MINROLLOFFFACTOR 0.0f
|
||||
#define DS3D_MAXROLLOFFFACTOR 10.0f
|
||||
#define DS3D_DEFAULTROLLOFFFACTOR 1.0f
|
||||
|
||||
#define DS3D_MINDOPPLERFACTOR 0.0f
|
||||
#define DS3D_MAXDOPPLERFACTOR 10.0f
|
||||
#define DS3D_DEFAULTDOPPLERFACTOR 1.0f
|
||||
|
||||
#define DS3D_DEFAULTMINDISTANCE 1.0f
|
||||
#define DS3D_DEFAULTMAXDISTANCE 1000000000.0f
|
||||
|
||||
#define DS3D_MINCONEANGLE 0
|
||||
#define DS3D_MAXCONEANGLE 360
|
||||
#define DS3D_DEFAULTCONEANGLE 360
|
||||
|
||||
#define DS3D_DEFAULTCONEOUTSIDEVOLUME 0
|
||||
|
||||
#define DSBCAPS_PRIMARYBUFFER 0x00000001
|
||||
#define DSBCAPS_STATIC 0x00000002
|
||||
#define DSBCAPS_LOCHARDWARE 0x00000004
|
||||
#define DSBCAPS_LOCSOFTWARE 0x00000008
|
||||
#define DSBCAPS_CTRL3D 0x00000010
|
||||
#define DSBCAPS_CTRLFREQUENCY 0x00000020
|
||||
#define DSBCAPS_CTRLPAN 0x00000040
|
||||
#define DSBCAPS_CTRLVOLUME 0x00000080
|
||||
#define DSBCAPS_CTRLPOSITIONNOTIFY 0x00000100
|
||||
#define DSBCAPS_CTRLDEFAULT 0x000000E0
|
||||
#define DSBCAPS_CTRLALL 0x000001F0
|
||||
#define DSBCAPS_STICKYFOCUS 0x00004000
|
||||
#define DSBCAPS_GLOBALFOCUS 0x00008000
|
||||
#define DSBCAPS_GETCURRENTPOSITION2 0x00010000
|
||||
#define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
|
||||
|
||||
#define DSCBCAPS_WAVEMAPPED 0x80000000
|
||||
|
||||
#define DSSPEAKER_HEADPHONE 0x00000001
|
||||
#define DSSPEAKER_MONO 0x00000002
|
||||
#define DSSPEAKER_QUAD 0x00000003
|
||||
#define DSSPEAKER_STEREO 0x00000004
|
||||
#define DSSPEAKER_SURROUND 0x00000005
|
||||
|
||||
#define DSSPEAKER_GEOMETRY_MIN 0x00000005 // 5 degrees
|
||||
#define DSSPEAKER_GEOMETRY_NARROW 0x0000000A // 10 degrees
|
||||
#define DSSPEAKER_GEOMETRY_WIDE 0x00000014 // 20 degrees
|
||||
#define DSSPEAKER_GEOMETRY_MAX 0x000000B4 // 180 degrees
|
||||
|
||||
#define DSSPEAKER_COMBINED(c, g) ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
|
||||
#define DSSPEAKER_CONFIG(a) ((BYTE)(a))
|
||||
#define DSSPEAKER_GEOMETRY(a) ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
|
||||
|
||||
#define DSCCAPS_EMULDRIVER 0x00000020
|
||||
|
||||
#define DSCBLOCK_ENTIREBUFFER 0x00000001
|
||||
|
||||
#define DSCBSTATUS_CAPTURING 0x00000001
|
||||
#define DSCBSTATUS_LOOPING 0x00000002
|
||||
|
||||
#define DSCBSTART_LOOPING 0x00000001
|
||||
|
||||
#define DSBFREQUENCY_MIN 100
|
||||
#define DSBFREQUENCY_MAX 100000
|
||||
#define DSBFREQUENCY_ORIGINAL 0
|
||||
|
||||
#define DSBPAN_LEFT -10000
|
||||
#define DSBPAN_CENTER 0
|
||||
#define DSBPAN_RIGHT 10000
|
||||
|
||||
#define DSBVOLUME_MIN -10000
|
||||
#define DSBVOLUME_MAX 0
|
||||
|
||||
#define DSBSIZE_MIN 4
|
||||
#define DSBSIZE_MAX 0x0FFFFFFF
|
||||
|
||||
#define DSBPN_OFFSETSTOP 0xFFFFFFFF
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // __DSOUND_INCLUDED__
|
||||
831
3rdparty/dx5/inc/dvp.h
vendored
Normal file
831
3rdparty/dx5/inc/dvp.h
vendored
Normal file
@ -0,0 +1,831 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: dvp.h
|
||||
* Content: DirectDrawVideoPort include file
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __DVP_INCLUDED__
|
||||
#define __DVP_INCLUDED__
|
||||
#if defined( _WIN32 ) && !defined( _NO_COM )
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <objbase.h>
|
||||
#else
|
||||
#define IUnknown void
|
||||
#undef CO_E_NOTINITIALIZED
|
||||
#define CO_E_NOTINITIALIZED 0x800401F0L
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* GUIDS used by DirectDrawVideoPort objects
|
||||
*/
|
||||
#if defined( _WIN32 ) && !defined( _NO_COM )
|
||||
DEFINE_GUID( IID_IDDVideoPortContainer, 0x6C142760,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
|
||||
DEFINE_GUID( IID_IDirectDrawVideoPort, 0xB36D93E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
|
||||
|
||||
DEFINE_GUID( DDVPTYPE_E_HREFH_VREFH, 0x54F39980L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
|
||||
DEFINE_GUID( DDVPTYPE_E_HREFH_VREFL, 0x92783220L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
|
||||
DEFINE_GUID( DDVPTYPE_E_HREFL_VREFH, 0xA07A02E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
|
||||
DEFINE_GUID( DDVPTYPE_E_HREFL_VREFL, 0xE09C77E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
|
||||
DEFINE_GUID( DDVPTYPE_CCIR656, 0xFCA326A0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
|
||||
DEFINE_GUID( DDVPTYPE_BROOKTREE, 0x1352A560L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
|
||||
DEFINE_GUID( DDVPTYPE_PHILIPS, 0x332CF160L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
|
||||
|
||||
/*
|
||||
* GUIDS used to describe connections
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
/*============================================================================
|
||||
*
|
||||
* DirectDraw Structures
|
||||
*
|
||||
* Various structures used to invoke DirectDraw.
|
||||
*
|
||||
*==========================================================================*/
|
||||
|
||||
struct IDirectDraw;
|
||||
struct IDirectDrawSurface;
|
||||
struct IDirectDrawPalette;
|
||||
struct IDirectDrawClipper;
|
||||
|
||||
typedef struct IDDVideoPortContainer FAR *LPDDVIDEOPORTCONTAINER;
|
||||
typedef struct IDirectDrawVideoPort FAR *LPDIRECTDRAWVIDEOPORT;
|
||||
|
||||
typedef struct _DDVIDEOPORTCONNECT FAR *LPDDVIDEOPORTCONNECT;
|
||||
typedef struct _DDVIDEOPORTCAPS FAR *LPDDVIDEOPORTCAPS;
|
||||
typedef struct _DDVIDEOPORTDESC FAR *LPDDVIDEOPORTDESC;
|
||||
typedef struct _DDVIDEOPORTINFO FAR *LPDDVIDEOPORTINFO;
|
||||
typedef struct _DDVIDEOPORTBANDWIDTH FAR *LPDDVIDEOPORTBANDWIDTH;
|
||||
typedef struct _DDVIDEOPORTSTATUS FAR *LPDDVIDEOPORTSTATUS;
|
||||
|
||||
typedef struct IDDVideoPortContainerVtbl DDVIDEOPORTCONTAINERCALLBACKS;
|
||||
typedef struct IDirectDrawVideoPortVtbl DIRECTDRAWVIDEOPORTCALLBACKS;
|
||||
|
||||
|
||||
/*
|
||||
* API's
|
||||
*/
|
||||
typedef HRESULT (FAR PASCAL * LPDDENUMVIDEOCALLBACK)(LPDDVIDEOPORTCAPS, LPVOID);
|
||||
|
||||
|
||||
/*
|
||||
* INTERACES FOLLOW:
|
||||
* IDirectDrawVideoPort
|
||||
* IVideoPort
|
||||
*/
|
||||
|
||||
/*
|
||||
* IDirectDrawVideoPortContainer
|
||||
*/
|
||||
#if defined( _WIN32 ) && !defined( _NO_COM )
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDDVideoPortContainer
|
||||
DECLARE_INTERFACE_( IDDVideoPortContainer, IUnknown )
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
/*** IDirectDrawVideoPort methods ***/
|
||||
STDMETHOD(CreateVideoPort)(THIS_ DWORD, LPDDVIDEOPORTDESC, LPDIRECTDRAWVIDEOPORT FAR *, IUnknown FAR *) PURE;
|
||||
STDMETHOD(EnumVideoPorts)(THIS_ DWORD, LPDDVIDEOPORTCAPS, LPVOID,LPDDENUMVIDEOCALLBACK ) PURE;
|
||||
STDMETHOD(GetVideoPortConnectInfo)(THIS_ DWORD, LPDWORD, LPDDVIDEOPORTCONNECT ) PURE;
|
||||
STDMETHOD(QueryVideoPortStatus)(THIS_ DWORD, LPDDVIDEOPORTSTATUS ) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IVideoPortContainer_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IVideoPortContainer_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IVideoPortContainer_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IVideoPortContainer_CreateVideoPort(p, a, b, c, d) (p)->lpVtbl->CreateVideoPort(p, a, b, c, d)
|
||||
#define IVideoPortContainer_EnumVideoPorts(p, a, b, c, d) (p)->lpVtbl->EnumVideoPorts(p, a, b, c, d)
|
||||
#define IVideoPortContainer_GetVideoPortConnectInfo(p, a, b, c) (p)->lpVtbl->GetVideoPortConnectInfo(p, a, b, c)
|
||||
#define IVideoPortContainer_QueryVideoPortStatus(p, a, b) (p)->lpVtbl->QueryVideoPortStatus(p, a, b)
|
||||
#else
|
||||
#define IVideoPortContainer_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IVideoPortContainer_AddRef(p) (p)->AddRef()
|
||||
#define IVideoPortContainer_Release(p) (p)->Release()
|
||||
#define IVideoPortContainer_CreateVideoPort(p, a, b, c, d) (p)->CreateVideoPort(a, b, c, d)
|
||||
#define IVideoPortContainer_EnumVideoPorts(p, a, b, c, d) (p)->EnumVideoPorts(a, b, c, d)
|
||||
#define IVideoPortContainer_GetVideoPortConnectInfo(p, a, b, c) (p)->GetVideoPortConnectInfo(a, b, c)
|
||||
#define IVideoPortContainer_QueryVideoPortStatus(p, a, b) (p)->QueryVideoPortStatus(a, b)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* IDirectDrawVideoPort
|
||||
*/
|
||||
#if defined( _WIN32 ) && !defined( _NO_COM )
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectDrawVideoPort
|
||||
DECLARE_INTERFACE_( IDirectDrawVideoPort, IUnknown )
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
/*** IVideoPort methods ***/
|
||||
STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
|
||||
STDMETHOD(GetBandwidthInfo)(THIS_ LPDDPIXELFORMAT, DWORD, DWORD, DWORD, LPDDVIDEOPORTBANDWIDTH) PURE;
|
||||
STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
|
||||
STDMETHOD(GetInputFormats)(THIS_ LPDWORD, LPDDPIXELFORMAT, DWORD) PURE;
|
||||
STDMETHOD(GetOutputFormats)(THIS_ LPDDPIXELFORMAT, LPDWORD, LPDDPIXELFORMAT, DWORD) PURE;
|
||||
STDMETHOD(GetFieldPolarity)(THIS_ LPBOOL) PURE;
|
||||
STDMETHOD(GetVideoLine)(THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(GetVideoSignalStatus)(THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
|
||||
STDMETHOD(SetTargetSurface)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
|
||||
STDMETHOD(StartVideo)(THIS_ LPDDVIDEOPORTINFO) PURE;
|
||||
STDMETHOD(StopVideo)(THIS) PURE;
|
||||
STDMETHOD(UpdateVideo)(THIS_ LPDDVIDEOPORTINFO) PURE;
|
||||
STDMETHOD(WaitForSync)(THIS_ DWORD, DWORD, DWORD) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IVideoPort_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IVideoPort_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IVideoPort_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IVideoPort_SetTargetSurface(p,a,b) (p)->lpVtbl->SetTargetSurface(p,a,b)
|
||||
#define IVideoPort_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b)
|
||||
#define IVideoPort_GetBandwidthInfo(p,a,b,c,d,e) (p)->lpVtbl->GetBandwidthInfo(p,a,b,c,d,e)
|
||||
#define IVideoPort_GetColorControls(p,a) (p)->lpVtbl->GetColorControls(p,a)
|
||||
#define IVideoPort_GetInputFormats(p,a,b,c) (p)->lpVtbl->GetInputFormats(p,a,b,c)
|
||||
#define IVideoPort_GetOutputFormats(p,a,b,c,d) (p)->lpVtbl->GetOutputFormats(p,a,b,c,d)
|
||||
#define IVideoPort_GetFieldPolarity(p,a) (p)->lpVtbl->GetFieldPolarity(p,a)
|
||||
#define IVideoPort_GetVideoLine(p,a) (p)->lpVtbl->GetVideoLine(p,a)
|
||||
#define IVideoPort_GetVideoSignalStatus(p,a) (p)->lpVtbl->GetVideoSignalStatus(p,a)
|
||||
#define IVideoPort_SetColorControls(p,a) (p)->lpVtbl->SetColorControls(p,a)
|
||||
#define IVideoPort_StartVideo(p,a) (p)->lpVtbl->StartVideo(p,a)
|
||||
#define IVideoPort_StopVideo(p) (p)->lpVtbl->StopVideo(p)
|
||||
#define IVideoPort_UpdateVideo(p,a) (p)->lpVtbl->UpdateVideo(p,a)
|
||||
#define IVideoPort_WaitForSync(p,a,b,c) (p)->lpVtbl->WaitForSync(p,a,b,c)
|
||||
#else
|
||||
#define IVideoPort_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IVideoPort_AddRef(p) (p)->AddRef()
|
||||
#define IVideoPort_Release(p) (p)->Release()
|
||||
#define IVideoPort_SetTargetSurface(p,a,b) (p)->SetTargetSurface(a,b)
|
||||
#define IVideoPort_Flip(p,a,b) (p)->Flip(a,b)
|
||||
#define IVideoPort_GetBandwidthInfo(p,a,b,c,d,e) (p)->GetBandwidthInfo(a,b,c,d,e)
|
||||
#define IVideoPort_GetColorControls(p,a) (p)->GetColorControls(a)
|
||||
#define IVideoPort_GetInputFormats(p,a,b,c) (p)->GetInputFormats(a,b,c)
|
||||
#define IVideoPort_GetOutputFormats(p,a,b,c,d) (p)->GetOutputFormats(a,b,c,d)
|
||||
#define IVideoPort_GetFieldPolarity(p,a) (p)->GetFieldPolarity(a)
|
||||
#define IVideoPort_GetVideoLine(p,a) (p)->GetVideoLine(a)
|
||||
#define IVideoPort_GetVideoSignalStatus(p,a) (p)->GetVideoSignalStatus(a)
|
||||
#define IVideoPort_SetColorControls(p,a) (p)->SetColorControls(a)
|
||||
#define IVideoPort_StartVideo(p,a) (p)->StartVideo(a)
|
||||
#define IVideoPort_StopVideo(p) (p)->StopVideo()
|
||||
#define IVideoPort_UpdateVideo(p,a) (p)->UpdateVideo(a)
|
||||
#define IVideoPort_WaitForSync(p,a,b,c) (p)->WaitForSync(a,b,c)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* DDVIDEOPORTCONNECT
|
||||
*/
|
||||
typedef struct _DDVIDEOPORTCONNECT
|
||||
{
|
||||
DWORD dwSize; // size of the DDVIDEOPORTCONNECT structure
|
||||
DWORD dwPortWidth; // Width of the video port
|
||||
GUID guidTypeID; // Description of video port connection
|
||||
DWORD dwFlags; // Connection flags
|
||||
DWORD dwReserved1; // Reserved, set to zero.
|
||||
} DDVIDEOPORTCONNECT;
|
||||
|
||||
|
||||
/*
|
||||
* DDVIDEOPORTCAPS
|
||||
*/
|
||||
typedef struct _DDVIDEOPORTCAPS
|
||||
{
|
||||
DWORD dwSize; // size of the DDVIDEOPORTCAPS structure
|
||||
DWORD dwFlags; // indicates which fields contain data
|
||||
DWORD dwMaxWidth; // max width of the video port field
|
||||
DWORD dwMaxVBIWidth; // max width of the VBI data
|
||||
DWORD dwMaxHeight; // max height of the video port field
|
||||
DWORD dwVideoPortID; // Video port ID (0 - (dwMaxVideoPorts -1))
|
||||
DWORD dwCaps; // Video port capabilities
|
||||
DWORD dwFX; // More video port capabilities
|
||||
DWORD dwNumAutoFlipSurfaces; // Number of autoflippable surfaces
|
||||
DWORD dwAlignVideoPortBoundary; // Byte restriction of placement within the surface
|
||||
DWORD dwAlignVideoPortPrescaleWidth;// Byte restriction of width after prescaling
|
||||
DWORD dwAlignVideoPortCropBoundary; // Byte restriction of left cropping
|
||||
DWORD dwAlignVideoPortCropWidth; // Byte restriction of cropping width
|
||||
DWORD dwPreshrinkXStep; // Width can be shrunk in steps of 1/x
|
||||
DWORD dwPreshrinkYStep; // Height can be shrunk in steps of 1/x
|
||||
DWORD dwNumVBIAutoFlipSurfaces; // Number of VBI autoflippable surfaces
|
||||
DWORD dwReserved1; // Reserved for future use
|
||||
DWORD dwReserved2; // Reserved for future use
|
||||
} DDVIDEOPORTCAPS;
|
||||
|
||||
/*
|
||||
* The dwMaxWidth and dwMaxVBIWidth members are valid
|
||||
*/
|
||||
#define DDVPD_WIDTH 0x00000001l
|
||||
|
||||
/*
|
||||
* The dwMaxHeight member is valid
|
||||
*/
|
||||
#define DDVPD_HEIGHT 0x00000002l
|
||||
|
||||
/*
|
||||
* The dwVideoPortID member is valid
|
||||
*/
|
||||
#define DDVPD_ID 0x00000004l
|
||||
|
||||
/*
|
||||
* The dwCaps member is valid
|
||||
*/
|
||||
#define DDVPD_CAPS 0x00000008l
|
||||
|
||||
/*
|
||||
* The dwFX member is valid
|
||||
*/
|
||||
#define DDVPD_FX 0x00000010l
|
||||
|
||||
/*
|
||||
* The dwNumAutoFlipSurfaces member is valid
|
||||
*/
|
||||
#define DDVPD_AUTOFLIP 0x00000020l
|
||||
|
||||
/*
|
||||
* All of the alignment members are valid
|
||||
*/
|
||||
#define DDVPD_ALIGN 0x00000040l
|
||||
|
||||
|
||||
/*
|
||||
* DDVIDEOPORTDESC
|
||||
*/
|
||||
typedef struct _DDVIDEOPORTDESC
|
||||
{
|
||||
DWORD dwSize; // size of the DDVIDEOPORTDESC structure
|
||||
DWORD dwFieldWidth; // width of the video port field
|
||||
DWORD dwVBIWidth; // width of the VBI data
|
||||
DWORD dwFieldHeight; // height of the video port field
|
||||
DWORD dwMicrosecondsPerField; // Microseconds per video field
|
||||
DWORD dwMaxPixelsPerSecond; // Maximum pixel rate per second
|
||||
DWORD dwVideoPortID; // Video port ID (0 - (dwMaxVideoPorts -1))
|
||||
DWORD dwReserved1; // Reserved for future use - set to zero
|
||||
DDVIDEOPORTCONNECT VideoPortType; // Description of video port connection
|
||||
DWORD dwReserved2; // Reserved for future use - set to zero
|
||||
DWORD dwReserved3; // Reserved for future use - set to zero
|
||||
} DDVIDEOPORTDESC;
|
||||
|
||||
|
||||
/*
|
||||
* DDVIDEOPORTINFO
|
||||
*/
|
||||
typedef struct _DDVIDEOPORTINFO
|
||||
{
|
||||
DWORD dwSize; // Size of the structure
|
||||
DWORD dwOriginX; // Placement of the video data within the surface.
|
||||
DWORD dwOriginY; // Placement of the video data within the surface.
|
||||
DWORD dwVPFlags; // Video port options
|
||||
RECT rCrop; // Cropping rectangle (optional).
|
||||
DWORD dwPrescaleWidth; // Determines pre-scaling/zooming in the X direction (optional).
|
||||
DWORD dwPrescaleHeight; // Determines pre-scaling/zooming in the Y direction (optional).
|
||||
LPDDPIXELFORMAT lpddpfInputFormat; // Video format written to the video port
|
||||
LPDDPIXELFORMAT lpddpfVBIInputFormat; // Input format of the VBI data
|
||||
LPDDPIXELFORMAT lpddpfVBIOutputFormat;// Output format of the data
|
||||
DWORD dwVBIHeight; // Specifies the number of lines of data within the vertical blanking interval.
|
||||
DWORD dwReserved1; // Reserved for future use - set to zero
|
||||
DWORD dwReserved2; // Reserved for future use - set to zero
|
||||
} DDVIDEOPORTINFO;
|
||||
|
||||
|
||||
/*
|
||||
* DDVIDEOPORTBANDWIDTH
|
||||
*/
|
||||
typedef struct _DDVIDEOPORTBANDWIDTH
|
||||
{
|
||||
DWORD dwSize; // Size of the structure
|
||||
DWORD dwCaps;
|
||||
DWORD dwOverlay; // Zoom factor at which overlay is supported
|
||||
DWORD dwColorkey; // Zoom factor at which overlay w/ colorkey is supported
|
||||
DWORD dwYInterpolate; // Zoom factor at which overlay w/ Y interpolation is supported
|
||||
DWORD dwYInterpAndColorkey; // Zoom factor at which ovelray w/ Y interpolation and colorkeying is supported
|
||||
DWORD dwReserved1; // Reserved for future use - set to zero
|
||||
DWORD dwReserved2; // Reserved for future use - set to zero
|
||||
} DDVIDEOPORTBANDWIDTH;
|
||||
|
||||
|
||||
/*
|
||||
* DDVIDEOPORTSTATUS
|
||||
*/
|
||||
typedef struct _DDVIDEOPORTSTATUS
|
||||
{
|
||||
DWORD dwSize; // Size of the structure
|
||||
BOOL bInUse; // TRUE if video port is currently being used
|
||||
DWORD dwFlags; // Currently not used
|
||||
DWORD dwReserved1; // Reserved for future use
|
||||
DDVIDEOPORTCONNECT VideoPortType; // Information about the connection
|
||||
DWORD dwReserved2; // Reserved for future use
|
||||
DWORD dwReserved3; // Reserved for future use
|
||||
} DDVIDEOPORTSTATUS;
|
||||
|
||||
/*============================================================================
|
||||
*
|
||||
* Video Port Flags
|
||||
*
|
||||
* All flags are bit flags.
|
||||
*
|
||||
*==========================================================================*/
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* VIDEOPORT DDVIDEOPORTCONNECT FLAGS
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* When this is set by the driver and passed to the client, this
|
||||
* indicates that the video port is capable of double clocking the data.
|
||||
* When this is set by the client, this indicates that the video port
|
||||
* should enable double clocking. This flag is only valid with external
|
||||
* syncs.
|
||||
*/
|
||||
#define DDVPCONNECT_DOUBLECLOCK 0x00000001l
|
||||
|
||||
/*
|
||||
* When this is set by the driver and passed to the client, this
|
||||
* indicates that the video port is capable of using an external VACT
|
||||
* signal. When this is set by the client, this indicates that the
|
||||
* video port should use the external VACT signal.
|
||||
*/
|
||||
#define DDVPCONNECT_VACT 0x00000002l
|
||||
|
||||
/*
|
||||
* When this is set by the driver and passed to the client, this
|
||||
* indicates that the video port is capable of treating even fields
|
||||
* like odd fields and visa versa. When this is set by the client,
|
||||
* this indicates that the video port should treat even fields like odd
|
||||
* fields.
|
||||
*/
|
||||
#define DDVPCONNECT_INVERTPOLARITY 0x00000004l
|
||||
|
||||
/*
|
||||
* Indicates that any data written to the video port during the VREF
|
||||
* period will not be written into the frame buffer. This flag is read only.
|
||||
*/
|
||||
#define DDVPCONNECT_DISCARDSVREFDATA 0x00000008l
|
||||
|
||||
/*
|
||||
* Device will write half lines into the frame buffer, sometimes causing
|
||||
* the data to not be displayed correctly.
|
||||
*/
|
||||
#define DDVPCONNECT_HALFLINE 0x00000010l
|
||||
|
||||
/*
|
||||
* Indicates that the signal is interlaced. This flag is only
|
||||
* set by the client.
|
||||
*/
|
||||
#define DDVPCONNECT_INTERLACED 0x00000020l
|
||||
|
||||
/*
|
||||
* Indicates that video port is shareable and that this video port
|
||||
* will use the even fields. This flag is only set by the client.
|
||||
*/
|
||||
#define DDVPCONNECT_SHAREEVEN 0x00000040l
|
||||
|
||||
/*
|
||||
* Indicates that video port is shareable and that this video port
|
||||
* will use the odd fields. This flag is only set by the client.
|
||||
*/
|
||||
#define DDVPCONNECT_SHAREODD 0x00000080l
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* VIDEOPORT DDVIDEOPORTDESC CAPS
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Flip can be performed automatically to avoid tearing.
|
||||
*/
|
||||
#define DDVPCAPS_AUTOFLIP 0x00000001l
|
||||
|
||||
/*
|
||||
* Supports interlaced video
|
||||
*/
|
||||
#define DDVPCAPS_INTERLACED 0x00000002l
|
||||
|
||||
/*
|
||||
* Supports non-interlaced video
|
||||
*/
|
||||
#define DDVPCAPS_NONINTERLACED 0x00000004l
|
||||
|
||||
/*
|
||||
* Indicates that the device can return whether the current field
|
||||
* of an interlaced signal is even or odd.
|
||||
*/
|
||||
#define DDVPCAPS_READBACKFIELD 0x00000008l
|
||||
|
||||
/*
|
||||
* Indicates that the device can return the current line of video
|
||||
* being written into the frame buffer.
|
||||
*/
|
||||
#define DDVPCAPS_READBACKLINE 0x00000010l
|
||||
|
||||
/*
|
||||
* Allows two gen-locked video streams to share a single video port,
|
||||
* where one stream uses the even fields and the other uses the odd
|
||||
* fields. Separate parameters (including address, scaling,
|
||||
* cropping, etc.) are maintained for both fields.)
|
||||
*/
|
||||
#define DDVPCAPS_SHAREABLE 0x00000020l
|
||||
|
||||
/*
|
||||
* Even fields of video can be automatically discarded.
|
||||
*/
|
||||
#define DDVPCAPS_SKIPEVENFIELDS 0x00000040l
|
||||
|
||||
/*
|
||||
* Odd fields of video can be automatically discarded.
|
||||
*/
|
||||
#define DDVPCAPS_SKIPODDFIELDS 0x00000080l
|
||||
|
||||
/*
|
||||
* Indicates that the device is capable of driving the graphics
|
||||
* VSYNC with the video port VSYNC.
|
||||
*/
|
||||
#define DDVPCAPS_SYNCMASTER 0x00000100l
|
||||
|
||||
/*
|
||||
* Indicates that data within the vertical blanking interval can
|
||||
* be written to a different surface.
|
||||
*/
|
||||
#define DDVPCAPS_VBISURFACE 0x00000200l
|
||||
|
||||
/*
|
||||
* Indicates that the video port can perform color operations
|
||||
* on the incoming data before it is written to the frame buffer.
|
||||
*/
|
||||
#define DDVPCAPS_COLORCONTROL 0x00000400l
|
||||
|
||||
/*
|
||||
* Indicates that the video port can accept VBI data in a different
|
||||
* width or format than the regular video data.
|
||||
*/
|
||||
#define DDVPCAPS_OVERSAMPLEDVBI 0x00000800l
|
||||
|
||||
/*
|
||||
* Indicates that the video port can write data directly to system memory
|
||||
*/
|
||||
#define DDVPCAPS_SYSTEMMEMORY 0x00001000l
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* VIDEOPORT DDVIDEOPORTDESC FX
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Limited cropping is available to crop out the vertical interval data.
|
||||
*/
|
||||
#define DDVPFX_CROPTOPDATA 0x00000001l
|
||||
|
||||
/*
|
||||
* Incoming data can be cropped in the X direction before it is written
|
||||
* to the surface.
|
||||
*/
|
||||
#define DDVPFX_CROPX 0x00000002l
|
||||
|
||||
/*
|
||||
* Incoming data can be cropped in the Y direction before it is written
|
||||
* to the surface.
|
||||
*/
|
||||
#define DDVPFX_CROPY 0x00000004l
|
||||
|
||||
/*
|
||||
* Supports interleaving interlaced fields in memory.
|
||||
*/
|
||||
#define DDVPFX_INTERLEAVE 0x00000008l
|
||||
|
||||
/*
|
||||
* Supports mirroring left to right as the video data is written
|
||||
* into the frame buffer.
|
||||
*/
|
||||
#define DDVPFX_MIRRORLEFTRIGHT 0x00000010l
|
||||
|
||||
/*
|
||||
* Supports mirroring top to bottom as the video data is written
|
||||
* into the frame buffer.
|
||||
*/
|
||||
#define DDVPFX_MIRRORUPDOWN 0x00000020l
|
||||
|
||||
/*
|
||||
* Data can be arbitrarily shrunk in the X direction before it
|
||||
* is written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESHRINKX 0x00000040l
|
||||
|
||||
/*
|
||||
* Data can be arbitrarily shrunk in the Y direction before it
|
||||
* is written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESHRINKY 0x00000080l
|
||||
|
||||
/*
|
||||
* Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the X
|
||||
* direction before it is written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESHRINKXB 0x00000100l
|
||||
|
||||
/*
|
||||
* Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the Y
|
||||
* direction before it is written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESHRINKYB 0x00000200l
|
||||
|
||||
/*
|
||||
* Data can be shrunk in increments of 1/x in the X direction
|
||||
* (where X is specified in the DDVIDEOPORTCAPS.dwPreshrinkXStep)
|
||||
* before it is written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESHRINKXS 0x00000400l
|
||||
|
||||
/*
|
||||
* Data can be shrunk in increments of 1/x in the Y direction
|
||||
* (where X is specified in the DDVIDEOPORTCAPS.dwPreshrinkYStep)
|
||||
* before it is written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESHRINKYS 0x00000800l
|
||||
|
||||
/*
|
||||
* Data can be arbitrarily stretched in the X direction before
|
||||
* it is written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESTRETCHX 0x00001000l
|
||||
|
||||
/*
|
||||
* Data can be arbitrarily stretched in the Y direction before
|
||||
* it is written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESTRETCHY 0x00002000l
|
||||
|
||||
/*
|
||||
* Data can be integer stretched in the X direction before it is
|
||||
* written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESTRETCHXN 0x00004000l
|
||||
|
||||
/*
|
||||
* Data can be integer stretched in the Y direction before it is
|
||||
* written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESTRETCHYN 0x00008000l
|
||||
|
||||
/*
|
||||
* Indicates that data within the vertical blanking interval can
|
||||
* be converted independently of the remaining video data.
|
||||
*/
|
||||
#define DDVPFX_VBICONVERT 0x00010000l
|
||||
|
||||
/*
|
||||
* Indicates that scaling can be disabled for data within the
|
||||
* vertical blanking interval.
|
||||
*/
|
||||
#define DDVPFX_VBINOSCALE 0x00020000l
|
||||
|
||||
/*
|
||||
* Indicates that the video data can ignore the left and right
|
||||
* cropping coordinates when cropping oversampled VBI data.
|
||||
*/
|
||||
#define DDVPFX_IGNOREVBIXCROP 0x00040000l
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* VIDEOPORT DDVIDEOPORTINFO FLAGS
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Perform automatic flipping. Auto-flipping is performed between
|
||||
* the overlay surface that was attached to the video port using
|
||||
* IDirectDrawVideoPort::AttachSurface and the overlay surfaces that
|
||||
* are attached to the surface via the IDirectDrawSurface::AttachSurface
|
||||
* method. The flip order is the order in which the overlay surfaces
|
||||
* were. attached.
|
||||
*/
|
||||
#define DDVP_AUTOFLIP 0x00000001l
|
||||
|
||||
/*
|
||||
* Perform conversion using the ddpfOutputFormat information.
|
||||
*/
|
||||
#define DDVP_CONVERT 0x00000002l
|
||||
|
||||
/*
|
||||
* Perform cropping using the specified rectangle.
|
||||
*/
|
||||
#define DDVP_CROP 0x00000004l
|
||||
|
||||
/*
|
||||
* Indicates that interlaced fields should be interleaved in memory.
|
||||
*/
|
||||
#define DDVP_INTERLEAVE 0x00000008l
|
||||
|
||||
/*
|
||||
* Indicates that the data should be mirrored left to right as it's
|
||||
* written into the frame buffer.
|
||||
*/
|
||||
#define DDVP_MIRRORLEFTRIGHT 0x00000010l
|
||||
|
||||
/*
|
||||
* Indicates that the data should be mirrored top to bottom as it's
|
||||
* written into the frame buffer.
|
||||
*/
|
||||
#define DDVP_MIRRORUPDOWN 0x00000020l
|
||||
|
||||
/*
|
||||
* Perform pre-scaling/zooming based on the pre-scale parameters.
|
||||
*/
|
||||
#define DDVP_PRESCALE 0x00000040l
|
||||
|
||||
/*
|
||||
* Ignore input of even fields.
|
||||
*/
|
||||
#define DDVP_SKIPEVENFIELDS 0x00000080l
|
||||
|
||||
/*
|
||||
* Ignore input of odd fields.
|
||||
*/
|
||||
#define DDVP_SKIPODDFIELDS 0x00000100l
|
||||
|
||||
/*
|
||||
* Drive the graphics VSYNCs using the video port VYSNCs.
|
||||
*/
|
||||
#define DDVP_SYNCMASTER 0x00000200l
|
||||
|
||||
/*
|
||||
* The ddpfVBIOutputFormatFormat member contains data that should be used
|
||||
* to convert the data within the vertical blanking interval.
|
||||
*/
|
||||
#define DDVP_VBICONVERT 0x00000400l
|
||||
|
||||
/*
|
||||
* Indicates that data within the vertical blanking interval
|
||||
* should not be scaled.
|
||||
*/
|
||||
#define DDVP_VBINOSCALE 0x00000800l
|
||||
|
||||
/*
|
||||
* Indicates that these bob/weave decisions should not be
|
||||
* overriden by other interfaces.
|
||||
*/
|
||||
#define DDVP_OVERRIDEBOBWEAVE 0x00001000l
|
||||
|
||||
/*
|
||||
* Indicates that the video data should ignore the left and right
|
||||
* cropping coordinates when cropping the VBI data.
|
||||
*/
|
||||
#define DDVP_IGNOREVBIXCROP 0x00002000l
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DIRIRECTDRAWVIDEOPORT GETINPUTFORMAT/GETOUTPUTFORMAT FLAGS
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Return formats for the video data
|
||||
*/
|
||||
#define DDVPFORMAT_VIDEO 0x00000001l
|
||||
|
||||
/*
|
||||
* Return formats for the VBI data
|
||||
*/
|
||||
#define DDVPFORMAT_VBI 0x00000002l
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DIRIRECTDRAWVIDEOPORT SETTARGETSURFACE FLAGS
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Surface should receive video data (and VBI data if a surface
|
||||
* is not explicitly attached for that purpose)
|
||||
*/
|
||||
#define DDVPTARGET_VIDEO 0x00000001l
|
||||
|
||||
/*
|
||||
* Surface should receive VBI data
|
||||
*/
|
||||
#define DDVPTARGET_VBI 0x00000002l
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DIRIRECTDRAWVIDEOPORT WAITFORSYNC FLAGS
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Waits until the beginning of the next VSYNC
|
||||
*/
|
||||
#define DDVPWAIT_BEGIN 0x00000001l
|
||||
|
||||
/*
|
||||
* Waits until the end of the next/current VSYNC
|
||||
*/
|
||||
#define DDVPWAIT_END 0x00000002l
|
||||
|
||||
/*
|
||||
* Waits until the beginning of the specified line
|
||||
*/
|
||||
#define DDVPWAIT_LINE 0x00000003l
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DIRECTDRAWVIDEOPORT FLIP FLAGS
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Flips the normal video surface
|
||||
*/
|
||||
#define DDVPFLIP_VIDEO 0x00000001l
|
||||
|
||||
/*
|
||||
* Flips the VBI surface
|
||||
*/
|
||||
#define DDVPFLIP_VBI 0x00000002l
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DIRIRECTDRAWVIDEOPORT GETVIDEOSIGNALSTATUS VALUES
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* No video signal is present at the video port
|
||||
*/
|
||||
#define DDVPSQ_NOSIGNAL 0x00000001l
|
||||
|
||||
/*
|
||||
* A valid video signal is present at the video port
|
||||
*/
|
||||
#define DDVPSQ_SIGNALOK 0x00000002l
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* VIDEOPORTBANDWIDTH Flags
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* The specified height/width refer to the size of the video port data
|
||||
* written into memory, after prescaling has occured.
|
||||
*/
|
||||
#define DDVPB_VIDEOPORT 0x00000001l
|
||||
|
||||
/*
|
||||
* The specified height/width refer to the source size of the overlay.
|
||||
*/
|
||||
#define DDVPB_OVERLAY 0x00000002l
|
||||
|
||||
/*
|
||||
* This is a query for the device to return which caps this device requires.
|
||||
*/
|
||||
#define DDVPB_TYPE 0x00000004l
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* VIDEOPORTBANDWIDTH Caps
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* The bandwidth for this device is dependant on the overlay source size.
|
||||
*/
|
||||
#define DDVPBCAPS_SOURCE 0x00000001l
|
||||
|
||||
/*
|
||||
* The bandwidth for this device is dependant on the overlay destination
|
||||
* size.
|
||||
*/
|
||||
#define DDVPBCAPS_DESTINATION 0x00000002l
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
24
3rdparty/dx5/inc/fastfile.h
vendored
Normal file
24
3rdparty/dx5/inc/fastfile.h
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/*==========================================================================
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: fastfile.h
|
||||
* Content: Definitions for fastfile access.
|
||||
*
|
||||
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
|
||||
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
typedef LPVOID HFASTFILE;
|
||||
|
||||
extern BOOL FastFileInit( LPSTR fname, int max_handles );
|
||||
extern void FastFileFini( void );
|
||||
extern HFASTFILE FastFileOpen( LPSTR name );
|
||||
extern BOOL FastFileClose( HFASTFILE pfe );
|
||||
extern BOOL FastFileRead( HFASTFILE pfh, LPVOID ptr, int size );
|
||||
extern BOOL FastFileSeek( HFASTFILE pfe, int off, int how );
|
||||
extern long FastFileTell( HFASTFILE pfe );
|
||||
extern LPVOID FastFileLock( HFASTFILE pfe, int off, int len );
|
||||
extern BOOL FastFileUnlock( HFASTFILE pfe, int off, int len );
|
||||
BIN
3rdparty/dx5/lib/d3drm.lib
vendored
Normal file
BIN
3rdparty/dx5/lib/d3drm.lib
vendored
Normal file
Binary file not shown.
BIN
3rdparty/dx5/lib/ddraw.lbw
vendored
Normal file
BIN
3rdparty/dx5/lib/ddraw.lbw
vendored
Normal file
Binary file not shown.
BIN
3rdparty/dx5/lib/ddraw.lib
vendored
Normal file
BIN
3rdparty/dx5/lib/ddraw.lib
vendored
Normal file
Binary file not shown.
BIN
3rdparty/dx5/lib/dinput.lib
vendored
Normal file
BIN
3rdparty/dx5/lib/dinput.lib
vendored
Normal file
Binary file not shown.
BIN
3rdparty/dx5/lib/dplayx.lib
vendored
Normal file
BIN
3rdparty/dx5/lib/dplayx.lib
vendored
Normal file
Binary file not shown.
BIN
3rdparty/dx5/lib/dsetup.lib
vendored
Normal file
BIN
3rdparty/dx5/lib/dsetup.lib
vendored
Normal file
Binary file not shown.
BIN
3rdparty/dx5/lib/dsound.lbw
vendored
Normal file
BIN
3rdparty/dx5/lib/dsound.lbw
vendored
Normal file
Binary file not shown.
BIN
3rdparty/dx5/lib/dsound.lib
vendored
Normal file
BIN
3rdparty/dx5/lib/dsound.lib
vendored
Normal file
Binary file not shown.
BIN
3rdparty/dx5/lib/dxguid.lib
vendored
Normal file
BIN
3rdparty/dx5/lib/dxguid.lib
vendored
Normal file
Binary file not shown.
BIN
3rdparty/dx5/lib/fastfile.lbw
vendored
Normal file
BIN
3rdparty/dx5/lib/fastfile.lbw
vendored
Normal file
Binary file not shown.
BIN
3rdparty/dx5/lib/fastfile.lib
vendored
Normal file
BIN
3rdparty/dx5/lib/fastfile.lib
vendored
Normal file
Binary file not shown.
@ -4,6 +4,7 @@ project(isle CXX)
|
||||
|
||||
option(ISLE_BUILD_APP "Build ISLE.EXE application" ON)
|
||||
option(ISLE_USE_SMARTHEAP "Build with SmartHeap" ${MSVC})
|
||||
option(ISLE_USE_DX5 "Build with internal DirectX 5 SDK" ON)
|
||||
|
||||
add_library(lego1 SHARED
|
||||
LEGO1/act1state.cpp
|
||||
@ -45,7 +46,9 @@ add_library(lego1 SHARED
|
||||
LEGO1/jukeboxentity.cpp
|
||||
LEGO1/jukeboxstate.cpp
|
||||
LEGO1/legoact2state.cpp
|
||||
LEGO1/legoactor.cpp
|
||||
LEGO1/legoactioncontrolpresenter.cpp
|
||||
LEGO1/legoactor.cpp
|
||||
LEGO1/legoanimactor.cpp
|
||||
LEGO1/legoanimationmanager.cpp
|
||||
LEGO1/legoanimmmpresenter.cpp
|
||||
@ -101,6 +104,7 @@ add_library(lego1 SHARED
|
||||
LEGO1/mxdirectdraw.cpp
|
||||
LEGO1/mxdiskstreamcontroller.cpp
|
||||
LEGO1/mxdiskstreamprovider.cpp
|
||||
LEGO1/mxdisplaysurface.cpp
|
||||
LEGO1/mxdsaction.cpp
|
||||
LEGO1/mxdsanim.cpp
|
||||
LEGO1/mxdschunk.cpp
|
||||
@ -125,6 +129,7 @@ add_library(lego1 SHARED
|
||||
LEGO1/mxloopingflcpresenter.cpp
|
||||
LEGO1/mxloopingmidipresenter.cpp
|
||||
LEGO1/mxloopingsmkpresenter.cpp
|
||||
LEGO1/mxmatrix.cpp
|
||||
LEGO1/mxmediapresenter.cpp
|
||||
LEGO1/mxmidipresenter.cpp
|
||||
LEGO1/mxmusicpresenter.cpp
|
||||
@ -145,13 +150,15 @@ add_library(lego1 SHARED
|
||||
LEGO1/mxstillpresenter.cpp
|
||||
LEGO1/mxstreamer.cpp
|
||||
LEGO1/mxstring.cpp
|
||||
LEGO1/mxstringvariable.cpp
|
||||
LEGO1/mxthread.cpp
|
||||
LEGO1/mxticklemanager.cpp
|
||||
LEGO1/mxtimer.cpp
|
||||
LEGO1/mxtransitionmanager.cpp
|
||||
LEGO1/mxunknown100dc6b0.cpp
|
||||
LEGO1/mxunknown100dc6e0.cpp
|
||||
LEGO1/mxvariable.cpp
|
||||
LEGO1/mxvariabletable.cpp
|
||||
LEGO1/mxvector.cpp
|
||||
LEGO1/mxvideomanager.cpp
|
||||
LEGO1/mxvideoparam.cpp
|
||||
LEGO1/mxvideoparamflags.cpp
|
||||
@ -189,6 +196,12 @@ if (ISLE_USE_SMARTHEAP)
|
||||
target_link_libraries(lego1 PRIVATE SmartHeap::SmartHeap)
|
||||
endif()
|
||||
|
||||
# Use internal DirectX 5 if required
|
||||
if (ISLE_USE_DX5)
|
||||
target_include_directories(lego1 PRIVATE "${CMAKE_SOURCE_DIR}/3rdparty/dx5/inc")
|
||||
target_link_directories(lego1 PRIVATE "${CMAKE_SOURCE_DIR}/3rdparty/dx5/lib")
|
||||
endif()
|
||||
|
||||
# Link libraries
|
||||
target_link_libraries(lego1 PRIVATE ddraw dsound winmm)
|
||||
|
||||
@ -206,6 +219,12 @@ if (ISLE_BUILD_APP)
|
||||
# Include LEGO1 headers in ISLE
|
||||
target_include_directories(isle PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1")
|
||||
|
||||
# Use internal DirectX 5 if required
|
||||
if (ISLE_USE_DX5)
|
||||
target_include_directories(isle PRIVATE "${CMAKE_SOURCE_DIR}/3rdparty/dx5/inc")
|
||||
target_link_directories(isle PRIVATE "${CMAKE_SOURCE_DIR}/3rdparty/dx5/lib")
|
||||
endif()
|
||||
|
||||
if (ISLE_USE_SMARTHEAP)
|
||||
target_link_libraries(isle PRIVATE SmartHeap::SmartHeap)
|
||||
endif()
|
||||
|
||||
@ -90,7 +90,7 @@ void IsleApp::Close()
|
||||
|
||||
VideoManager()->Get3DManager()->GetLego3DView()->GetViewManager()->RemoveAll(NULL);
|
||||
|
||||
Lego()->RemoveWorld(ds.GetAtomId(), ds.GetUnknown1c());
|
||||
Lego()->RemoveWorld(ds.GetAtomId(), ds.GetObjectId());
|
||||
Lego()->vtable24(ds);
|
||||
TransitionManager()->SetWaitIndicator(NULL);
|
||||
Lego()->vtable3c();
|
||||
@ -121,7 +121,7 @@ BOOL IsleApp::SetupLegoOmni()
|
||||
BOOL failure = Lego()->Create(MxOmniCreateParam(mediaPath, (struct HWND__ *) m_windowHandle, m_videoParam, MxOmniCreateFlags())) == FAILURE;
|
||||
if (!failure) {
|
||||
VariableTable()->SetVariable("ACTOR_01", "");
|
||||
TickleManager()->vtable1c(VideoManager(), 10);
|
||||
TickleManager()->SetClientTickleInterval(VideoManager(), 10);
|
||||
result = TRUE;
|
||||
}
|
||||
|
||||
@ -357,7 +357,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
||||
case WM_DISPLAYCHANGE:
|
||||
if (g_isle && VideoManager() && g_isle->m_fullScreen && VideoManager()->m_unk74 && VideoManager()->m_unk74[0x220]) {
|
||||
if (g_isle && VideoManager() && g_isle->m_fullScreen && VideoManager()->GetDirect3D() && VideoManager()->GetDirect3D()->GetDeviceModeFinder()) {
|
||||
int targetWidth = LOWORD(lParam);
|
||||
int targetHeight = HIWORD(lParam);
|
||||
int targetDepth = wParam;
|
||||
@ -729,7 +729,7 @@ inline void IsleApp::Tick(BOOL sleepIfNotNextFrame)
|
||||
|
||||
ds.SetAtomId(stream->atom);
|
||||
ds.SetUnknown24(-1);
|
||||
ds.SetUnknown1c(0);
|
||||
ds.SetObjectId(0);
|
||||
VideoManager()->EnableFullScreenMovie(TRUE, TRUE);
|
||||
|
||||
if (Start(&ds) != SUCCESS) {
|
||||
@ -738,7 +738,7 @@ inline void IsleApp::Tick(BOOL sleepIfNotNextFrame)
|
||||
} else {
|
||||
ds.SetAtomId(stream->atom);
|
||||
ds.SetUnknown24(-1);
|
||||
ds.SetUnknown1c(0);
|
||||
ds.SetObjectId(0);
|
||||
if (Start(&ds) != SUCCESS) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -11,6 +11,9 @@
|
||||
#define COMPAT_CONST
|
||||
#endif
|
||||
|
||||
// DIsable "nonstandard extension used : 'bool'" warning spam
|
||||
#pragma warning( disable : 4237 )
|
||||
|
||||
#define MSVC420_VERSION 1020
|
||||
|
||||
// STL compatibility.
|
||||
|
||||
@ -4,6 +4,10 @@
|
||||
#define DECOMP_STATIC_ASSERT(V) namespace { typedef int foo[(V)?1:-1]; }
|
||||
#define DECOMP_SIZE_ASSERT(T, S) DECOMP_STATIC_ASSERT(sizeof(T) == S)
|
||||
|
||||
#ifndef _countof
|
||||
#define _countof(arr) sizeof(arr) / sizeof(arr[0])
|
||||
#endif
|
||||
|
||||
typedef unsigned char undefined;
|
||||
typedef unsigned short undefined2;
|
||||
typedef unsigned int undefined4;
|
||||
|
||||
@ -1 +1,4 @@
|
||||
#include "isleactor.h"
|
||||
|
||||
// NOTE: This is copied from base class LegoActor. IsleActor may in fact be larger but we don't know yet.
|
||||
DECOMP_SIZE_ASSERT(IsleActor, 0x78)
|
||||
|
||||
@ -1 +1,17 @@
|
||||
#include "islepathactor.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(IslePathActor, 0x160)
|
||||
|
||||
// OFFSET: LEGO1 0x1001a200
|
||||
IslePathActor::IslePathActor()
|
||||
{
|
||||
this->m_pLegoWorld = NULL;
|
||||
this->m_unk13c = 6.0;
|
||||
this->m_unk15c = 1.0;
|
||||
this->m_unk158 = 0;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002e10
|
||||
IslePathActor::~IslePathActor()
|
||||
{
|
||||
}
|
||||
|
||||
@ -2,12 +2,17 @@
|
||||
#define ISLEPATHACTOR_H
|
||||
|
||||
#include "legopathactor.h"
|
||||
#include "legoworld.h"
|
||||
#include "mxtypes.h"
|
||||
|
||||
// VTABLE 0x100d4398
|
||||
// SIZE >= 0x230
|
||||
// SIZE 0x160
|
||||
class IslePathActor : public LegoPathActor
|
||||
{
|
||||
public:
|
||||
public:
|
||||
IslePathActor();
|
||||
~IslePathActor();
|
||||
|
||||
// OFFSET: LEGO1 0x10002ea0
|
||||
inline virtual const char *ClassName() const override // vtable+0x0c
|
||||
{
|
||||
@ -20,6 +25,11 @@ class IslePathActor : public LegoPathActor
|
||||
{
|
||||
return !strcmp(name, IslePathActor::ClassName()) || LegoPathActor::IsA(name);
|
||||
}
|
||||
|
||||
private:
|
||||
LegoWorld* m_pLegoWorld; // 0x154
|
||||
MxFloat m_unk158;
|
||||
MxFloat m_unk15c;
|
||||
};
|
||||
|
||||
#endif // ISLEPATHACTOR_H
|
||||
|
||||
3
LEGO1/legoactor.cpp
Normal file
3
LEGO1/legoactor.cpp
Normal file
@ -0,0 +1,3 @@
|
||||
#include "legoactor.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(LegoActor, 0x78)
|
||||
@ -1,6 +1,7 @@
|
||||
#ifndef LEGOACTOR_H
|
||||
#define LEGOACTOR_H
|
||||
|
||||
#include "decomp.h"
|
||||
#include "legoentity.h"
|
||||
|
||||
// VTABLE 0x100d6d68
|
||||
@ -20,6 +21,10 @@ class LegoActor : public LegoEntity
|
||||
{
|
||||
return !strcmp(name, LegoActor::ClassName()) || LegoEntity::IsA(name);
|
||||
}
|
||||
|
||||
private:
|
||||
undefined unk68[0x10];
|
||||
|
||||
};
|
||||
|
||||
#endif // LEGOACTOR_H
|
||||
|
||||
@ -9,18 +9,18 @@ const char *g_set = "set";
|
||||
const char *g_reset = "reset";
|
||||
|
||||
// OFFSET: LEGO1 0x1003bfb0
|
||||
LegoBackgroundColor::LegoBackgroundColor(const char *p_name, const char *p_colorString)
|
||||
LegoBackgroundColor::LegoBackgroundColor(const char *p_key, const char *p_value)
|
||||
{
|
||||
m_name = p_name;
|
||||
m_name.ToUpperCase();
|
||||
SetColorString(p_colorString);
|
||||
m_key = p_key;
|
||||
m_key.ToUpperCase();
|
||||
SetValue(p_value);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1003c070
|
||||
void LegoBackgroundColor::SetColorString(const char *p_colorString)
|
||||
void LegoBackgroundColor::SetValue(const char *p_colorString)
|
||||
{
|
||||
m_string = p_colorString;
|
||||
m_string.ToLowerCase();
|
||||
m_value = p_colorString;
|
||||
m_value.ToLowerCase();
|
||||
|
||||
LegoVideoManager *videomanager = VideoManager();
|
||||
if (!videomanager || !p_colorString)
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
#ifndef LEGOBACKGROUNDCOLOR_H
|
||||
#define LEGOBACKGROUNDCOLOR_H
|
||||
|
||||
#include "mxstringvariable.h"
|
||||
#include "mxvariable.h"
|
||||
|
||||
class LegoBackgroundColor : public MxStringVariable
|
||||
class LegoBackgroundColor : public MxVariable
|
||||
{
|
||||
public:
|
||||
__declspec(dllexport) LegoBackgroundColor(const char *p_name, const char *p_colorString);
|
||||
void SetColorString(const char *p_colorString);
|
||||
__declspec(dllexport) LegoBackgroundColor(const char *p_key, const char *p_value);
|
||||
void SetValue(const char *p_colorString);
|
||||
|
||||
private:
|
||||
float h;
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
#include "legoentity.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(LegoEntity, 0x68)
|
||||
|
||||
// OFFSET: LEGO1 0x1000c290
|
||||
LegoEntity::~LegoEntity()
|
||||
{
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
#include "mxentity.h"
|
||||
|
||||
// VTABLE 0x100d4858
|
||||
// SIZE 0x68 (probably)
|
||||
class LegoEntity : public MxEntity
|
||||
{
|
||||
public:
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
#include "legopathactor.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(LegoPathActor, 0x154)
|
||||
|
||||
// OFFSET: LEGO1 0x1002d700 STUB
|
||||
LegoPathActor::LegoPathActor()
|
||||
{
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
#define LEGOPATHACTOR_H
|
||||
|
||||
#include "legoactor.h"
|
||||
#include "mxtypes.h"
|
||||
|
||||
// VTABLE 0x100d6e28
|
||||
// SIZE 0x154 (from inlined construction at 0x1000a346)
|
||||
@ -25,6 +26,10 @@ class LegoPathActor : public LegoActor
|
||||
return !strcmp(name, LegoPathActor::ClassName()) || LegoActor::IsA(name);
|
||||
}
|
||||
|
||||
// TODO: the types. Pizza needs this as public:
|
||||
undefined unk78[0xc4];
|
||||
MxS32 m_unk13c;
|
||||
undefined unk140[0x14];
|
||||
};
|
||||
|
||||
#endif // LEGOPATHACTOR_H
|
||||
|
||||
@ -2,7 +2,9 @@
|
||||
#define LEGOVIDEOMANAGER_H
|
||||
|
||||
#include "mxvideomanager.h"
|
||||
#include "mxdirect3d.h"
|
||||
#include "lego3dmanager.h"
|
||||
#include "decomp.h"
|
||||
|
||||
// VTABLE 0x100d9c88
|
||||
// SIZE 0x590
|
||||
@ -18,13 +20,16 @@ class LegoVideoManager : public MxVideoManager
|
||||
__declspec(dllexport) void MoveCursor(int x, int y);
|
||||
|
||||
inline Lego3DManager *Get3DManager() { return this->m_3dManager; }
|
||||
inline MxDirect3D *GetDirect3D() { return this->m_direct3d; }
|
||||
|
||||
void SetSkyColor(float r, float g, float b);
|
||||
|
||||
int m_unk64;
|
||||
private:
|
||||
undefined4 m_unk64;
|
||||
Lego3DManager *m_3dManager;
|
||||
int m_unk6c;
|
||||
int m_unk70;
|
||||
int *m_unk74;
|
||||
undefined4 m_unk6c;
|
||||
undefined4 m_unk70;
|
||||
MxDirect3D *m_direct3d;
|
||||
};
|
||||
|
||||
#endif // LEGOVIDEOMANAGER_H
|
||||
|
||||
@ -1,13 +1,29 @@
|
||||
#include "mxbackgroundaudiomanager.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(MxBackgroundAudioManager, 0x150)
|
||||
|
||||
// OFFSET: LEGO1 0x1007ea90
|
||||
MxBackgroundAudioManager::MxBackgroundAudioManager()
|
||||
{
|
||||
// TODO
|
||||
NotificationManager()->Register(this);
|
||||
m_unka0 = 0;
|
||||
m_unk138 = 0;
|
||||
m_unk13c = 0;
|
||||
m_unk140 = 0;
|
||||
m_unk144 = 0;
|
||||
m_unk148 = 0;
|
||||
m_musicEnabled = FALSE;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1007ec20
|
||||
MxBackgroundAudioManager::~MxBackgroundAudioManager()
|
||||
{
|
||||
// TODO
|
||||
NotificationManager()->Unregister(this);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1007f470
|
||||
void MxBackgroundAudioManager::Stop()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
@ -15,5 +31,17 @@ MxBackgroundAudioManager::~MxBackgroundAudioManager()
|
||||
// OFFSET: LEGO1 0x1007f5f0
|
||||
void MxBackgroundAudioManager::Enable(MxBool p)
|
||||
{
|
||||
// TODO
|
||||
if (this->m_musicEnabled != p) {
|
||||
this->m_musicEnabled = p;
|
||||
if (!p) {
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1007f650
|
||||
void MxBackgroundAudioManager::Init()
|
||||
{
|
||||
this->m_unka0 = 0;
|
||||
this->m_unk13c = 0;
|
||||
}
|
||||
|
||||
@ -2,6 +2,9 @@
|
||||
#define MXBACKGROUNDAUDIOMANAGER_H
|
||||
|
||||
#include "mxcore.h"
|
||||
#include "mxdsaction.h"
|
||||
#include "mxtypes.h"
|
||||
#include "mxnotificationmanager.h"
|
||||
|
||||
// VTABLE 0x100d9fe8
|
||||
// SIZE 0x150
|
||||
@ -25,6 +28,20 @@ class MxBackgroundAudioManager : public MxCore
|
||||
}
|
||||
|
||||
__declspec(dllexport) void Enable(unsigned char p);
|
||||
private:
|
||||
void Stop();
|
||||
void Init();
|
||||
|
||||
MxBool m_musicEnabled; // 0x8
|
||||
MxDSAction m_action1; // 0xc
|
||||
MxS32 m_unka0;
|
||||
MxDSAction m_action2; // 0xa4
|
||||
MxS32 m_unk138;
|
||||
MxS32 m_unk13c;
|
||||
MxS32 m_unk140;
|
||||
MxS32 m_unk144;
|
||||
MxS16 m_unk148;
|
||||
MxAtomId m_unk14c;
|
||||
};
|
||||
|
||||
#endif // MXBACKGROUNDAUDIOMANAGER_H
|
||||
|
||||
0
LEGO1/mxdirect3d.cpp
Normal file
0
LEGO1/mxdirect3d.cpp
Normal file
25
LEGO1/mxdirect3d.h
Normal file
25
LEGO1/mxdirect3d.h
Normal file
@ -0,0 +1,25 @@
|
||||
#ifndef MXDIRECT3D_H
|
||||
#define MXDIRECT3D_H
|
||||
|
||||
#include "mxdirectdraw.h"
|
||||
#include "decomp.h"
|
||||
|
||||
#include <d3d.h>
|
||||
|
||||
class MxDeviceModeFinder;
|
||||
|
||||
// SIZE 0x894
|
||||
class MxDirect3D : public MxDirectDraw
|
||||
{
|
||||
public:
|
||||
inline MxDeviceModeFinder *GetDeviceModeFinder() { return this->m_pDeviceModeFinder; };
|
||||
|
||||
private:
|
||||
MxDeviceModeFinder *m_pDeviceModeFinder;
|
||||
IDirect3D *m_pDirect3d;
|
||||
IDirect3DDevice *m_pDirect3dDevice;
|
||||
undefined4 m_unk88c;
|
||||
undefined4 m_unk890;
|
||||
};
|
||||
|
||||
#endif // MXDIRECT3D_H
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,12 +1,130 @@
|
||||
|
||||
#ifndef MXDIRECTDRAW_H
|
||||
#define MXDIRECTDRAW_H
|
||||
|
||||
#include <ddraw.h>
|
||||
#include <windows.h>
|
||||
|
||||
extern BOOL g_is_PALETTEINDEXED8;
|
||||
|
||||
// SIZE 0x880
|
||||
class MxDirectDraw
|
||||
{
|
||||
public:
|
||||
typedef void (*ErrorHandler)(const char*, HRESULT, void*);
|
||||
|
||||
//size 0x0c
|
||||
struct Mode
|
||||
{
|
||||
int width;
|
||||
int height;
|
||||
int bitsPerPixel;
|
||||
|
||||
int operator==(const Mode& rMode) const
|
||||
{
|
||||
return ((width == rMode.width) &&
|
||||
(height == rMode.height) &&
|
||||
(bitsPerPixel == rMode.bitsPerPixel));
|
||||
}
|
||||
};
|
||||
|
||||
//size 0x17c
|
||||
struct DeviceModesInfo
|
||||
{
|
||||
GUID* p_guid;
|
||||
Mode* m_mode_ARRAY;
|
||||
int count;
|
||||
DDCAPS m_ddcaps;
|
||||
void* a_178;
|
||||
|
||||
~DeviceModesInfo();
|
||||
};
|
||||
|
||||
|
||||
private:
|
||||
BOOL m_bOnlySoftRender;
|
||||
BOOL m_bFlipSurfaces;
|
||||
IDirectDraw* m_pDirectDraw;
|
||||
IDirectDrawSurface* m_pFrontBuffer;
|
||||
IDirectDrawSurface* m_pBackBuffer;
|
||||
IDirectDrawSurface* m_pZBuffer;
|
||||
IDirectDrawSurface* m_pText1Surface;
|
||||
IDirectDrawSurface* m_pText2Surface;
|
||||
IDirectDrawClipper* m_pClipper;
|
||||
IDirectDrawPalette* m_pPalette;
|
||||
PALETTEENTRY m_paletteEntries[256];
|
||||
PALETTEENTRY m_originalPaletteEntries[256];
|
||||
SIZE m_text1SizeOnSurface;
|
||||
SIZE m_text2SizeOnSurface;
|
||||
HWND m_hWndMain;
|
||||
HFONT m_hFont;
|
||||
BOOL m_bIgnoreWM_SIZE;
|
||||
BOOL m_bPrimaryPalettized;
|
||||
BOOL m_bFullScreen;
|
||||
void* a_850;
|
||||
BOOL m_bOnlySystemMemory;
|
||||
BOOL m_bIsOnPrimaryDevice;
|
||||
ErrorHandler m_pErrorHandler;
|
||||
ErrorHandler m_pFatalErrorHandler;
|
||||
void* m_pErrorHandlerArg;
|
||||
void* m_pFatalErrorHandlerArg;
|
||||
int m_pauseCount;
|
||||
DeviceModesInfo* m_pCurrentDeviceModesList;
|
||||
Mode m_currentMode;
|
||||
|
||||
public:
|
||||
__declspec(dllexport) int FlipToGDISurface();
|
||||
__declspec(dllexport) static int GetPrimaryBitDepth();
|
||||
__declspec(dllexport) int Pause(int);
|
||||
|
||||
MxDirectDraw();
|
||||
|
||||
virtual ~MxDirectDraw();
|
||||
virtual BOOL Create(
|
||||
HWND hWnd,
|
||||
BOOL fullscreen_1,
|
||||
BOOL surface_fullscreen,
|
||||
BOOL onlySystemMemory,
|
||||
int width,
|
||||
int height,
|
||||
int bpp,
|
||||
const PALETTEENTRY* pPaletteEntries,
|
||||
int paletteEntryCount);
|
||||
virtual void Destroy();
|
||||
virtual void DestroyButNotDirectDraw();
|
||||
virtual const char* ErrorToString(HRESULT error);
|
||||
|
||||
private:
|
||||
BOOL CacheOriginalPaletteEntries();
|
||||
HRESULT CreateDDSurface(
|
||||
LPDDSURFACEDESC a2,
|
||||
LPDIRECTDRAWSURFACE* a3,
|
||||
IUnknown* a4);
|
||||
BOOL CreateTextSurfaces();
|
||||
BOOL CreateZBuffer(DWORD memorytype, DWORD depth);
|
||||
BOOL DDCreateSurfaces();
|
||||
BOOL DDInit(BOOL fullscreen);
|
||||
BOOL DDSetMode(int width, int height, int bpp);
|
||||
void Error(const char* message, int error);
|
||||
|
||||
BOOL GetDDSurfaceDesc(LPDDSURFACEDESC lpDDSurfDesc, LPDIRECTDRAWSURFACE lpDDSurf);
|
||||
BOOL IsSupportedMode(int width, int height, int bpp);
|
||||
BOOL RecreateDirectDraw(GUID** a2);
|
||||
BOOL RestoreOriginalPaletteEntries();
|
||||
BOOL RestorePaletteEntries();
|
||||
BOOL RestoreSurfaces();
|
||||
BOOL SetPaletteEntries(
|
||||
const PALETTEENTRY* pPaletteEntries,
|
||||
int paletteEntryCount,
|
||||
BOOL fullscreen);
|
||||
BOOL TextToTextSurface(
|
||||
const char* text,
|
||||
IDirectDrawSurface* pSurface,
|
||||
SIZE& textSizeOnSurface);
|
||||
BOOL TextToTextSurface1(const char* text);
|
||||
BOOL TextToTextSurface2(const char* lpString);
|
||||
void FUN_1009E020();
|
||||
void FUN_1009D920();
|
||||
};
|
||||
|
||||
#endif // MXDIRECTDRAW_H
|
||||
|
||||
136
LEGO1/mxdisplaysurface.cpp
Normal file
136
LEGO1/mxdisplaysurface.cpp
Normal file
@ -0,0 +1,136 @@
|
||||
#include "mxdisplaysurface.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(MxDisplaySurface, 0xac);
|
||||
|
||||
// OFFSET: LEGO1 0x100ba500
|
||||
MxDisplaySurface::MxDisplaySurface()
|
||||
{
|
||||
this->Reset();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100ba5a0
|
||||
MxDisplaySurface::~MxDisplaySurface()
|
||||
{
|
||||
this->Clear();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100ba610
|
||||
void MxDisplaySurface::Reset()
|
||||
{
|
||||
this->m_ddSurface1 = NULL;
|
||||
this->m_ddSurface2 = NULL;
|
||||
this->m_ddClipper = NULL;
|
||||
this->m_16bitPal = NULL;
|
||||
this->m_initialized = FALSE;
|
||||
memset(&this->m_surfaceDesc, 0, sizeof(this->m_surfaceDesc));
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100ba790
|
||||
MxResult MxDisplaySurface::Init(MxVideoParam &p_videoParam, LPDIRECTDRAWSURFACE p_ddSurface1, LPDIRECTDRAWSURFACE p_ddSurface2, LPDIRECTDRAWCLIPPER p_ddClipper)
|
||||
{
|
||||
MxResult result = SUCCESS;
|
||||
|
||||
this->m_videoParam = p_videoParam;
|
||||
this->m_ddSurface1 = p_ddSurface1;
|
||||
this->m_ddSurface2 = p_ddSurface2;
|
||||
this->m_ddClipper = p_ddClipper;
|
||||
this->m_initialized = FALSE;
|
||||
|
||||
memset(&this->m_surfaceDesc, 0, sizeof(this->m_surfaceDesc));
|
||||
this->m_surfaceDesc.dwSize = sizeof(this->m_surfaceDesc);
|
||||
|
||||
if (this->m_ddSurface2->GetSurfaceDesc(&this->m_surfaceDesc))
|
||||
result = FAILURE;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100ba7f0 STUB
|
||||
MxResult MxDisplaySurface::Create(MxVideoParam *p_videoParam)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100baa90
|
||||
void MxDisplaySurface::Clear()
|
||||
{
|
||||
if (this->m_initialized) {
|
||||
if (this->m_ddSurface2)
|
||||
this->m_ddSurface2->Release();
|
||||
|
||||
if (this->m_ddSurface1)
|
||||
this->m_ddSurface1->Release();
|
||||
|
||||
if (this->m_ddClipper)
|
||||
this->m_ddClipper->Release();
|
||||
}
|
||||
|
||||
if (this->m_16bitPal)
|
||||
delete this->m_16bitPal;
|
||||
|
||||
this->Reset();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100baae0 STUB
|
||||
void MxDisplaySurface::SetPalette(MxPalette *p_palette)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100bc200 STUB
|
||||
void MxDisplaySurface::vtable24(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100bacc0 STUB
|
||||
MxBool MxDisplaySurface::vtable28(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100bc630 STUB
|
||||
MxBool MxDisplaySurface::vtable2c(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, MxBool)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100bb1d0 STUB
|
||||
MxBool MxDisplaySurface::vtable30(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, MxBool)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100bb850 STUB
|
||||
undefined4 MxDisplaySurface::vtable34(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100bba50 STUB
|
||||
void MxDisplaySurface::Display(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100bbc10
|
||||
void MxDisplaySurface::GetDC(HDC *p_hdc)
|
||||
{
|
||||
if (this->m_ddSurface2 && !this->m_ddSurface2->GetDC(p_hdc))
|
||||
return;
|
||||
|
||||
*p_hdc = NULL;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100bbc40
|
||||
void MxDisplaySurface::ReleaseDC(HDC p_hdc)
|
||||
{
|
||||
if (this->m_ddSurface2 && p_hdc)
|
||||
this->m_ddSurface2->ReleaseDC(p_hdc);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100bbc60 STUB
|
||||
undefined4 MxDisplaySurface::vtable44(undefined4, undefined4*, undefined4, undefined4)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
46
LEGO1/mxdisplaysurface.h
Normal file
46
LEGO1/mxdisplaysurface.h
Normal file
@ -0,0 +1,46 @@
|
||||
#ifndef MXDISPLAYSURFACE_H
|
||||
#define MXDISPLAYSURFACE_H
|
||||
|
||||
#include <ddraw.h>
|
||||
|
||||
#include "mxcore.h"
|
||||
#include "mxpalette.h"
|
||||
#include "mxvideoparam.h"
|
||||
|
||||
#include "decomp.h"
|
||||
|
||||
// VTABLE 0x100dc768
|
||||
// SIZE 0xac
|
||||
class MxDisplaySurface : public MxCore
|
||||
{
|
||||
public:
|
||||
MxDisplaySurface();
|
||||
virtual ~MxDisplaySurface() override;
|
||||
|
||||
void Reset();
|
||||
|
||||
virtual MxResult Init(MxVideoParam &p_videoParam, LPDIRECTDRAWSURFACE p_ddSurface1, LPDIRECTDRAWSURFACE p_ddSurface2, LPDIRECTDRAWCLIPPER p_ddClipper);
|
||||
virtual MxResult Create(MxVideoParam *p_videoParam);
|
||||
virtual void Clear();
|
||||
virtual void SetPalette(MxPalette *p_palette);
|
||||
virtual void vtable24(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
|
||||
virtual MxBool vtable28(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
|
||||
virtual MxBool vtable2c(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, MxBool);
|
||||
virtual MxBool vtable30(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, MxBool);
|
||||
virtual undefined4 vtable34(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
|
||||
virtual void Display(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
|
||||
virtual void GetDC(HDC *p_hdc);
|
||||
virtual void ReleaseDC(HDC p_hdc);
|
||||
virtual undefined4 vtable44(undefined4, undefined4*, undefined4, undefined4);
|
||||
|
||||
private:
|
||||
MxVideoParam m_videoParam;
|
||||
LPDIRECTDRAWSURFACE m_ddSurface1;
|
||||
LPDIRECTDRAWSURFACE m_ddSurface2;
|
||||
LPDIRECTDRAWCLIPPER m_ddClipper;
|
||||
MxBool m_initialized;
|
||||
DDSURFACEDESC m_surfaceDesc;
|
||||
MxU16 *m_16bitPal;
|
||||
};
|
||||
|
||||
#endif // MXDISPLAYSURFACE_H
|
||||
@ -1,16 +1,250 @@
|
||||
#include "mxdsaction.h"
|
||||
|
||||
#include <float.h>
|
||||
#include <limits.h>
|
||||
|
||||
DECOMP_SIZE_ASSERT(MxDSAction, 0x94)
|
||||
|
||||
// GLOBAL OFFSET: LEGO1 0x10101410
|
||||
MxU16 g_unkSep = TWOCC(',', ' ');
|
||||
|
||||
// OFFSET: LEGO1 0x100ad810
|
||||
MxDSAction::MxDSAction()
|
||||
{
|
||||
// TODO
|
||||
this->m_flags = 32;
|
||||
this->m_startTime = INT_MIN;
|
||||
this->m_unkData = NULL;
|
||||
this->m_unkLength = 0;
|
||||
this->m_duration = INT_MIN;
|
||||
this->m_loopCount = -1;
|
||||
|
||||
this->SetType(MxDSType_Action);
|
||||
|
||||
{
|
||||
float value = FLT_MAX;
|
||||
this->m_location.EqualsScalar(&value);
|
||||
}
|
||||
|
||||
{
|
||||
float value = FLT_MAX;
|
||||
this->m_direction.EqualsScalar(&value);
|
||||
}
|
||||
|
||||
{
|
||||
float value = FLT_MAX;
|
||||
this->m_up.EqualsScalar(&value);
|
||||
}
|
||||
|
||||
this->m_unk84 = 0;
|
||||
this->m_unk88 = 0;
|
||||
this->m_omni = NULL;
|
||||
this->m_someTimingField = -0x80000000;
|
||||
this->m_someTimingField = INT_MIN;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100ada80
|
||||
MxDSAction::~MxDSAction()
|
||||
{
|
||||
delete this->m_unk7c;
|
||||
}
|
||||
delete[] this->m_unkData;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100adaf0
|
||||
void MxDSAction::CopyFrom(MxDSAction &p_dsAction)
|
||||
{
|
||||
this->SetObjectId(p_dsAction.GetObjectId());
|
||||
this->m_flags = p_dsAction.m_flags;
|
||||
this->m_startTime = p_dsAction.m_startTime;
|
||||
this->m_duration = p_dsAction.m_duration;
|
||||
this->m_loopCount = p_dsAction.m_loopCount;
|
||||
|
||||
this->m_location.CopyFrom(p_dsAction.m_location);
|
||||
this->m_direction.CopyFrom(p_dsAction.m_direction);
|
||||
this->m_up.CopyFrom(p_dsAction.m_up);
|
||||
|
||||
AppendData(p_dsAction.m_unkLength, p_dsAction.m_unkData);
|
||||
this->m_unk84 = p_dsAction.m_unk84;
|
||||
this->m_unk88 = p_dsAction.m_unk88;
|
||||
this->m_omni = p_dsAction.m_omni;
|
||||
this->m_someTimingField = p_dsAction.m_someTimingField;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100adc10
|
||||
MxDSAction &MxDSAction::operator=(MxDSAction &p_dsAction)
|
||||
{
|
||||
if (this == &p_dsAction)
|
||||
return *this;
|
||||
|
||||
MxDSObject::operator=(p_dsAction);
|
||||
this->CopyFrom(p_dsAction);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100adbe0
|
||||
MxU32 MxDSAction::GetSizeOnDisk()
|
||||
{
|
||||
MxU32 totalSizeOnDisk;
|
||||
|
||||
totalSizeOnDisk = MxDSObject::GetSizeOnDisk() + 90 + this->m_unkLength;
|
||||
this->m_sizeOnDisk = totalSizeOnDisk - MxDSObject::GetSizeOnDisk();
|
||||
|
||||
return totalSizeOnDisk;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100adf70
|
||||
void MxDSAction::Deserialize(char **p_source, MxS16 p_unk24)
|
||||
{
|
||||
MxDSObject::Deserialize(p_source, p_unk24);
|
||||
|
||||
this->m_flags = *(DWORD*) *p_source;
|
||||
*p_source += sizeof(DWORD);
|
||||
this->m_startTime = *(DWORD*) *p_source;
|
||||
*p_source += sizeof(DWORD);
|
||||
this->m_duration = *(MxLong*) *p_source;
|
||||
*p_source += sizeof(MxLong);
|
||||
this->m_loopCount = *(MxS32*) *p_source;
|
||||
*p_source += sizeof(MxS32);
|
||||
this->m_location[0] = *(double*) *p_source;
|
||||
*p_source += sizeof(double);
|
||||
this->m_location[1] = *(double*) *p_source;
|
||||
*p_source += sizeof(double);
|
||||
this->m_location[2] = *(double*) *p_source;
|
||||
*p_source += sizeof(double);
|
||||
this->m_direction[0] = *(double*) *p_source;
|
||||
*p_source += sizeof(double);
|
||||
this->m_direction[1] = *(double*) *p_source;
|
||||
*p_source += sizeof(double);
|
||||
this->m_direction[2] = *(double*) *p_source;
|
||||
*p_source += sizeof(double);
|
||||
this->m_up[0] = *(double*) *p_source;
|
||||
*p_source += sizeof(double);
|
||||
this->m_up[1] = *(double*) *p_source;
|
||||
*p_source += sizeof(double);
|
||||
this->m_up[2] = *(double*) *p_source;
|
||||
*p_source += sizeof(double);
|
||||
|
||||
MxU16 unkLength = *(MxU16*) *p_source;
|
||||
*p_source += sizeof(MxU16);
|
||||
if (unkLength) {
|
||||
AppendData(unkLength, *p_source);
|
||||
*p_source += unkLength;
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100ad940
|
||||
MxLong MxDSAction::GetDuration()
|
||||
{
|
||||
return this->m_duration;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100ad950
|
||||
void MxDSAction::SetDuration(MxLong p_duration)
|
||||
{
|
||||
this->m_duration = p_duration;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100adc40
|
||||
MxDSAction *MxDSAction::Clone()
|
||||
{
|
||||
MxDSAction *clone = new MxDSAction();
|
||||
|
||||
if (clone)
|
||||
*clone = *this;
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100add00
|
||||
void MxDSAction::MergeFrom(MxDSAction &p_dsAction)
|
||||
{
|
||||
if (p_dsAction.m_startTime != INT_MIN)
|
||||
this->m_startTime = p_dsAction.m_startTime;
|
||||
|
||||
if (p_dsAction.GetDuration() != INT_MIN)
|
||||
this->m_duration = p_dsAction.GetDuration();
|
||||
|
||||
if (p_dsAction.m_loopCount != -1)
|
||||
this->m_loopCount = p_dsAction.m_loopCount;
|
||||
|
||||
if (p_dsAction.m_location[0] != FLT_MAX)
|
||||
this->m_location[0] = p_dsAction.m_location[0];
|
||||
if (p_dsAction.m_location[1] != FLT_MAX)
|
||||
this->m_location[1] = p_dsAction.m_location[1];
|
||||
if (p_dsAction.m_location[2] != FLT_MAX)
|
||||
this->m_location[2] = p_dsAction.m_location[2];
|
||||
|
||||
if (p_dsAction.m_direction[0] != FLT_MAX)
|
||||
this->m_direction[0] = p_dsAction.m_direction[0];
|
||||
if (p_dsAction.m_direction[1] != FLT_MAX)
|
||||
this->m_direction[1] = p_dsAction.m_direction[1];
|
||||
if (p_dsAction.m_direction[2] != FLT_MAX)
|
||||
this->m_direction[2] = p_dsAction.m_direction[2];
|
||||
|
||||
if (p_dsAction.m_up[0] != FLT_MAX)
|
||||
this->m_up[0] = p_dsAction.m_up[0];
|
||||
if (p_dsAction.m_up[1] != FLT_MAX)
|
||||
this->m_up[1] = p_dsAction.m_up[1];
|
||||
if (p_dsAction.m_up[2] != FLT_MAX)
|
||||
this->m_up[2] = p_dsAction.m_up[2];
|
||||
|
||||
// TODO
|
||||
MxU16 unkLength = p_dsAction.m_unkLength;
|
||||
char *unkData = p_dsAction.m_unkData;
|
||||
if (unkLength && unkData) {
|
||||
if (!this->m_unkData || !strncmp("XXX", this->m_unkData, 3)) {
|
||||
delete[] this->m_unkData;
|
||||
this->m_unkLength = 0;
|
||||
AppendData(unkLength, unkData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100ad960
|
||||
MxBool MxDSAction::HasId(MxU32 p_objectId)
|
||||
{
|
||||
return this->GetObjectId() == p_objectId;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100ada40
|
||||
void MxDSAction::SetSomeTimingField(MxLong p_someTimingField)
|
||||
{
|
||||
this->m_someTimingField = p_someTimingField;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100ada50
|
||||
MxLong MxDSAction::GetSomeTimingField()
|
||||
{
|
||||
return this->m_someTimingField;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100adcd0
|
||||
MxLong MxDSAction::GetCurrentTime()
|
||||
{
|
||||
return Timer()->GetTime() - this->m_someTimingField;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100ade60
|
||||
void MxDSAction::AppendData(MxU16 p_unkLength, const char *p_unkData)
|
||||
{
|
||||
if (this->m_unkData == p_unkData || !p_unkData)
|
||||
return;
|
||||
|
||||
if (this->m_unkLength) {
|
||||
char *concat = new char[p_unkLength + this->m_unkLength + sizeof(g_unkSep)];
|
||||
memcpy(concat, this->m_unkData, this->m_unkLength);
|
||||
|
||||
*(MxU16*) &concat[this->m_unkLength] = g_unkSep;
|
||||
memcpy(&concat[this->m_unkLength + sizeof(g_unkSep)], p_unkData, p_unkLength);
|
||||
|
||||
this->m_unkLength += p_unkLength + sizeof(g_unkSep);
|
||||
delete[] this->m_unkData;
|
||||
this->m_unkData = concat;
|
||||
}
|
||||
else {
|
||||
char *copy = new char[p_unkLength];
|
||||
this->m_unkData = copy;
|
||||
|
||||
if (copy) {
|
||||
this->m_unkLength = p_unkLength;
|
||||
memcpy(copy, p_unkData, p_unkLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
#define MXDSACTION_H
|
||||
|
||||
#include "mxdsobject.h"
|
||||
#include "mxvector.h"
|
||||
#include "mxomni.h"
|
||||
|
||||
// VTABLE 0x100dc098
|
||||
@ -12,6 +13,9 @@ class MxDSAction : public MxDSObject
|
||||
__declspec(dllexport) MxDSAction();
|
||||
__declspec(dllexport) virtual ~MxDSAction();
|
||||
|
||||
void CopyFrom(MxDSAction &p_dsAction);
|
||||
MxDSAction &operator=(MxDSAction &p_dsAction);
|
||||
|
||||
// OFFSET: LEGO1 0x100ad980
|
||||
inline virtual const char *ClassName() const override // vtable+0x0c
|
||||
{
|
||||
@ -24,33 +28,35 @@ class MxDSAction : public MxDSObject
|
||||
{
|
||||
return !strcmp(name, MxDSAction::ClassName()) || MxDSObject::IsA(name);
|
||||
}
|
||||
|
||||
virtual MxU32 GetSizeOnDisk(); // vtable+18;
|
||||
virtual void Deserialize(char **p_source, MxS16 p_unk24); // vtable+1c;
|
||||
virtual MxLong GetDuration(); // vtable+24;
|
||||
virtual void SetDuration(LONG p_duration); // vtable+28;
|
||||
virtual MxDSAction *Clone(); // vtable+2c;
|
||||
virtual void MergeFrom(MxDSAction &p_dsAction); // vtable+30;
|
||||
virtual MxBool HasId(MxU32 p_objectId); // vtable+34;
|
||||
virtual void SetSomeTimingField(MxLong p_someTimingField); // vtable+38;
|
||||
virtual MxLong GetSomeTimingField(); // vtable+3c;
|
||||
virtual MxLong GetCurrentTime(); // vtable+40;
|
||||
|
||||
void AppendData(MxU16 p_unkLength, const char *p_unkData);
|
||||
|
||||
private:
|
||||
MxLong m_unk2c;
|
||||
MxLong m_unk30;
|
||||
MxLong m_unk34;
|
||||
MxLong* m_unk38;
|
||||
MxLong m_unk3c;
|
||||
MxLong m_unk40;
|
||||
MxLong m_unk44;
|
||||
MxLong m_unk48;
|
||||
MxLong m_unk4c;
|
||||
MxLong m_unk50;
|
||||
MxLong m_unk54;
|
||||
MxLong m_unk58;
|
||||
MxLong m_unk5c;
|
||||
MxLong m_unk60;
|
||||
MxLong m_unk64;
|
||||
MxLong m_unk68;
|
||||
MxLong m_unk6c;
|
||||
MxLong m_unk70;
|
||||
MxLong m_unk74;
|
||||
MxLong m_unk78;
|
||||
MxLong* m_unk7c;
|
||||
MxLong m_unk80;
|
||||
MxLong m_unk84;
|
||||
MxLong m_unk88;
|
||||
MxOmni* m_omni; // 0x8c
|
||||
MxS32 m_someTimingField; // 0x90
|
||||
MxU32 m_sizeOnDisk;
|
||||
DWORD m_flags;
|
||||
DWORD m_startTime;
|
||||
MxLong m_duration;
|
||||
MxS32 m_loopCount;
|
||||
MxVector3Data m_location;
|
||||
MxVector3Data m_direction;
|
||||
MxVector3Data m_up;
|
||||
char *m_unkData;
|
||||
MxU16 m_unkLength;
|
||||
undefined4 m_unk84;
|
||||
undefined4 m_unk88;
|
||||
MxOmni *m_omni; // 0x8c
|
||||
MxLong m_someTimingField; // 0x90
|
||||
};
|
||||
|
||||
#endif // MXDSACTION_H
|
||||
|
||||
@ -5,8 +5,6 @@
|
||||
#define SI_MAJOR_VERSION 2
|
||||
#define SI_MINOR_VERSION 2
|
||||
|
||||
#define FOURCC(a, b, c, d) (((a) << 0) | ((b) << 8) | ((c) << 16) | ((d) << 24))
|
||||
|
||||
// OFFSET: LEGO1 0x100cc4b0
|
||||
MxDSFile::MxDSFile(const char *filename, MxULong skipReadingChunks)
|
||||
{
|
||||
|
||||
@ -1,21 +1,103 @@
|
||||
#include "mxdsmediaaction.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(MxDSMediaAction, 0xb8)
|
||||
|
||||
// OFFSET: LEGO1 0x100c8b40
|
||||
MxDSMediaAction::MxDSMediaAction()
|
||||
{
|
||||
this->m_unk98 = 0;
|
||||
this->m_mediaSrcPath = NULL;
|
||||
this->m_unk9c = 0;
|
||||
this->m_unka0 = 0;
|
||||
this->m_unka4 = 0;
|
||||
this->m_unka8 = 0;
|
||||
this->m_unkac = 1;
|
||||
this->m_unkb4 = 0xffffffff;
|
||||
this->m_unkb0 = 0;
|
||||
this->m_framesPerSecond = 0;
|
||||
this->m_mediaFormat = 0;
|
||||
this->m_paletteManagement = 1;
|
||||
this->m_unkb4 = -1;
|
||||
this->m_sustainTime = 0;
|
||||
this->SetType(MxDSType_MediaAction);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100c8cf0
|
||||
MxDSMediaAction::~MxDSMediaAction()
|
||||
{
|
||||
delete this->m_unk98;
|
||||
delete[] this->m_mediaSrcPath;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100c8d60
|
||||
void MxDSMediaAction::CopyFrom(MxDSMediaAction &p_dsMediaAction)
|
||||
{
|
||||
CopyMediaSrcPath(p_dsMediaAction.m_mediaSrcPath);
|
||||
|
||||
// TODO
|
||||
this->m_unk9c = p_dsMediaAction.m_unk9c;
|
||||
this->m_unka0 = p_dsMediaAction.m_unka0;
|
||||
|
||||
this->m_framesPerSecond = p_dsMediaAction.m_framesPerSecond;
|
||||
this->m_mediaFormat = p_dsMediaAction.m_mediaFormat;
|
||||
this->m_paletteManagement = p_dsMediaAction.m_paletteManagement;
|
||||
this->m_sustainTime = p_dsMediaAction.m_sustainTime;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100c8dc0
|
||||
MxDSMediaAction &MxDSMediaAction::operator=(MxDSMediaAction &p_dsMediaAction)
|
||||
{
|
||||
if (this == &p_dsMediaAction)
|
||||
return *this;
|
||||
|
||||
MxDSAction::operator=(p_dsMediaAction);
|
||||
this->CopyFrom(p_dsMediaAction);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100c8f10
|
||||
MxU32 MxDSMediaAction::GetSizeOnDisk()
|
||||
{
|
||||
MxU32 totalSizeOnDisk = MxDSAction::GetSizeOnDisk();
|
||||
|
||||
if (this->m_mediaSrcPath)
|
||||
totalSizeOnDisk += strlen(this->m_mediaSrcPath) + 1;
|
||||
else
|
||||
totalSizeOnDisk++;
|
||||
|
||||
totalSizeOnDisk += 24;
|
||||
this->m_sizeOnDisk = totalSizeOnDisk - MxDSAction::GetSizeOnDisk();
|
||||
return totalSizeOnDisk;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100c8f60
|
||||
void MxDSMediaAction::Deserialize(char **p_source, MxS16 p_unk24)
|
||||
{
|
||||
MxDSAction::Deserialize(p_source, p_unk24);
|
||||
|
||||
CopyMediaSrcPath(*p_source);
|
||||
*p_source += strlen(this->m_mediaSrcPath) + 1;
|
||||
|
||||
this->m_unk9c = *(undefined4*) *p_source;
|
||||
*p_source += sizeof(undefined4);
|
||||
this->m_unka0 = *(undefined4*) *p_source;
|
||||
*p_source += sizeof(undefined4);
|
||||
this->m_framesPerSecond = *(MxS32*) *p_source;
|
||||
*p_source += sizeof(MxS32);
|
||||
this->m_mediaFormat = *(MxS32*) *p_source;
|
||||
*p_source += sizeof(MxS32);
|
||||
this->m_paletteManagement = *(MxS32*) *p_source;
|
||||
*p_source += sizeof(MxS32);
|
||||
this->m_sustainTime = *(MxLong*) *p_source;
|
||||
*p_source += sizeof(MxLong);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100c8e80
|
||||
void MxDSMediaAction::CopyMediaSrcPath(const char *p_mediaSrcPath)
|
||||
{
|
||||
if (this->m_mediaSrcPath == p_mediaSrcPath)
|
||||
return;
|
||||
|
||||
delete[] this->m_mediaSrcPath;
|
||||
|
||||
if (p_mediaSrcPath) {
|
||||
this->m_mediaSrcPath = new char[strlen(p_mediaSrcPath) + 1];
|
||||
if (this->m_mediaSrcPath)
|
||||
strcpy(this->m_mediaSrcPath, p_mediaSrcPath);
|
||||
}
|
||||
else
|
||||
this->m_mediaSrcPath = NULL;
|
||||
}
|
||||
@ -12,6 +12,9 @@ class MxDSMediaAction : public MxDSAction
|
||||
MxDSMediaAction();
|
||||
virtual ~MxDSMediaAction() override;
|
||||
|
||||
void CopyFrom(MxDSMediaAction &p_dsMediaAction);
|
||||
MxDSMediaAction &operator=(MxDSMediaAction &p_dsMediaAction);
|
||||
|
||||
// OFFSET: LEGO1 0x100c8be0
|
||||
inline virtual const char *ClassName() const override // vtable+0x0c
|
||||
{
|
||||
@ -24,16 +27,21 @@ class MxDSMediaAction : public MxDSAction
|
||||
{
|
||||
return !strcmp(name, MxDSMediaAction::ClassName()) || MxDSAction::IsA(name);
|
||||
}
|
||||
|
||||
virtual MxU32 GetSizeOnDisk(); // vtable+18;
|
||||
virtual void Deserialize(char **p_source, MxS16 p_unk24); // vtable+1c;
|
||||
|
||||
void CopyMediaSrcPath(const char *p_mediaSrcPath);
|
||||
private:
|
||||
MxS32* m_unk94;
|
||||
MxS32* m_unk98;
|
||||
MxS32* m_unk9c;
|
||||
MxS32* m_unka0;
|
||||
MxS32* m_unka4;
|
||||
MxS32* m_unka8;
|
||||
MxS32 m_unkac;
|
||||
MxS32* m_unkb0;
|
||||
MxS32 m_unkb4;
|
||||
MxU32 m_sizeOnDisk;
|
||||
char *m_mediaSrcPath;
|
||||
undefined4 m_unk9c;
|
||||
undefined4 m_unka0;
|
||||
MxS32 m_framesPerSecond;
|
||||
MxS32 m_mediaFormat;
|
||||
MxS32 m_paletteManagement;
|
||||
MxLong m_sustainTime;
|
||||
undefined4 m_unkb4;
|
||||
};
|
||||
|
||||
#endif // MXDSMEDIAACTION_H
|
||||
|
||||
@ -13,7 +13,7 @@ MxDSObject::MxDSObject()
|
||||
this->m_unk14 = 0;
|
||||
this->m_objectName = NULL;
|
||||
this->m_unk24 = -1;
|
||||
this->m_unk1c = -1;
|
||||
this->m_objectId = -1;
|
||||
this->m_unk28 = 0;
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ void MxDSObject::CopyFrom(MxDSObject &p_dsObject)
|
||||
this->SetSourceName(p_dsObject.m_sourceName);
|
||||
this->m_unk14 = p_dsObject.m_unk14;
|
||||
this->SetObjectName(p_dsObject.m_objectName);
|
||||
this->m_unk1c = p_dsObject.m_unk1c;
|
||||
this->m_objectId = p_dsObject.m_objectId;
|
||||
this->m_unk24 = p_dsObject.m_unk24;
|
||||
this->m_atomId = p_dsObject.m_atomId;
|
||||
this->m_unk28 = p_dsObject.m_unk28;
|
||||
@ -91,39 +91,39 @@ undefined4 MxDSObject::unk14()
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100bf9d0
|
||||
MxU32 MxDSObject::CalculateUnk08()
|
||||
MxU32 MxDSObject::GetSizeOnDisk()
|
||||
{
|
||||
MxU32 unk08;
|
||||
MxU32 sizeOnDisk;
|
||||
|
||||
if (this->m_sourceName)
|
||||
unk08 = strlen(this->m_sourceName) + 3;
|
||||
sizeOnDisk = strlen(this->m_sourceName) + 3;
|
||||
else
|
||||
unk08 = 3;
|
||||
sizeOnDisk = 3;
|
||||
|
||||
unk08 += 4;
|
||||
sizeOnDisk += 4;
|
||||
|
||||
if (this->m_objectName)
|
||||
unk08 += strlen(this->m_objectName) + 1;
|
||||
sizeOnDisk += strlen(this->m_objectName) + 1;
|
||||
else
|
||||
unk08++;
|
||||
sizeOnDisk++;
|
||||
|
||||
unk08 += 4;
|
||||
this->m_unk08 = unk08;
|
||||
return unk08;
|
||||
sizeOnDisk += 4;
|
||||
this->m_sizeOnDisk = sizeOnDisk;
|
||||
return sizeOnDisk;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100bfa20
|
||||
void MxDSObject::Parse(char **p_source, MxS16 p_unk24)
|
||||
void MxDSObject::Deserialize(char **p_source, MxS16 p_unk24)
|
||||
{
|
||||
this->SetSourceName(*p_source);
|
||||
*p_source += strlen(this->m_sourceName) + 1;
|
||||
this->m_unk14 = *(undefined4*) *p_source;
|
||||
*p_source += 4;
|
||||
*p_source += sizeof(undefined4);
|
||||
|
||||
this->SetObjectName(*p_source);
|
||||
*p_source += strlen(this->m_objectName) + 1;
|
||||
this->m_unk1c = *(undefined4*) *p_source;
|
||||
*p_source += 4;
|
||||
this->m_objectId = *(MxU32*) *p_source;
|
||||
*p_source += sizeof(MxU32);
|
||||
|
||||
this->m_unk24 = p_unk24;
|
||||
}
|
||||
|
||||
@ -28,29 +28,28 @@ class MxDSObject : public MxCore
|
||||
inline virtual MxBool IsA(const char *name) const override { return !strcmp(name, MxDSObject::ClassName()) || MxCore::IsA(name); }; // vtable+10;
|
||||
|
||||
virtual undefined4 unk14(); // vtable+14;
|
||||
virtual MxU32 CalculateUnk08(); // vtable+18;
|
||||
virtual void Parse(char **p_source, MxS16 p_unk24); // vtable+1c;
|
||||
|
||||
inline const MxAtomId& GetAtomId() { return this->m_atomId; }
|
||||
inline undefined4 GetUnknown1c() { return this->m_unk1c; }
|
||||
|
||||
inline void SetUnknown1c(undefined4 p_unk1c) { this->m_unk1c = p_unk1c; }
|
||||
inline void SetUnknown24(MxS16 p_unk24) { this->m_unk24 = p_unk24; }
|
||||
|
||||
virtual MxU32 GetSizeOnDisk(); // vtable+18;
|
||||
virtual void Deserialize(char **p_source, MxS16 p_unk24); // vtable+1c;
|
||||
// OFFSET: ISLE 0x401c40
|
||||
// OFFSET: LEGO1 0x10005530
|
||||
inline void SetAtomId(MxAtomId p_atomId) { this->m_atomId = p_atomId; }
|
||||
inline virtual void SetAtomId(MxAtomId p_atomId) { this->m_atomId = p_atomId; } // vtable+20;
|
||||
|
||||
inline const MxAtomId& GetAtomId() { return this->m_atomId; }
|
||||
inline MxU32 GetObjectId() { return this->m_objectId; }
|
||||
|
||||
inline void SetObjectId(MxU32 p_objectId) { this->m_objectId = p_objectId; }
|
||||
inline void SetUnknown24(MxS16 p_unk24) { this->m_unk24 = p_unk24; }
|
||||
|
||||
protected:
|
||||
inline void SetType(MxDSType p_type) { this->m_type = p_type; }
|
||||
|
||||
private:
|
||||
MxU32 m_unk08;
|
||||
MxU32 m_sizeOnDisk;
|
||||
MxU16 m_type;
|
||||
char* m_sourceName;
|
||||
undefined4 m_unk14;
|
||||
char *m_objectName;
|
||||
undefined4 m_unk1c;
|
||||
MxU32 m_objectId;
|
||||
MxAtomId m_atomId;
|
||||
MxS16 m_unk24;
|
||||
undefined4 m_unk28;
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
#include "mxentity.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(MxEntity, 0x68)
|
||||
|
||||
// OFFSET: LEGO1 0x1001d190
|
||||
MxEntity::MxEntity()
|
||||
{
|
||||
@ -9,4 +11,12 @@ MxEntity::MxEntity()
|
||||
// OFFSET: LEGO1 0x1000c110
|
||||
MxEntity::~MxEntity()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10001070
|
||||
MxResult MxEntity::SetEntityId(MxS32 p_id, const MxAtomId &p_atom)
|
||||
{
|
||||
this->m_mxEntityId = p_id;
|
||||
this->m_atom = p_atom;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
#ifndef MXENTITY_H
|
||||
#define MXENTITY_H
|
||||
|
||||
#include "decomp.h"
|
||||
#include "mxatomid.h"
|
||||
#include "mxcore.h"
|
||||
#include "mxtypes.h"
|
||||
|
||||
// VTABLE 0x100d5390
|
||||
// SIZE 0x68 or less
|
||||
class MxEntity : public MxCore
|
||||
{
|
||||
public:
|
||||
@ -24,9 +26,12 @@ class MxEntity : public MxCore
|
||||
{
|
||||
return !strcmp(name, MxEntity::ClassName()) || MxCore::IsA(name);
|
||||
}
|
||||
|
||||
virtual MxResult SetEntityId(MxS32 p_id, const MxAtomId &p_atom); // vtable+0x14
|
||||
private:
|
||||
MxS32 m_mxEntityId; // 0x8
|
||||
MxAtomId m_atom; // 0xc
|
||||
undefined m_unk10[0x58];
|
||||
};
|
||||
|
||||
#endif // MXENTITY_H
|
||||
|
||||
@ -1,13 +1,18 @@
|
||||
#include "mxeventmanager.h"
|
||||
|
||||
// OFFSET: LEGO1 0x100c0360 STUB
|
||||
// OFFSET: LEGO1 0x100c0360
|
||||
MxEventManager::MxEventManager()
|
||||
{
|
||||
// TODO
|
||||
Init();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100c03f0 STUB
|
||||
// OFFSET: LEGO1 0x100c03f0
|
||||
MxEventManager::~MxEventManager()
|
||||
{
|
||||
// TODO
|
||||
// TODO: MxMediaManager::TerminateThread call
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100c0450
|
||||
void MxEventManager::Init()
|
||||
{
|
||||
}
|
||||
@ -11,6 +11,8 @@ class MxEventManager : public MxUnknown100dc6b0
|
||||
MxEventManager();
|
||||
virtual ~MxEventManager() override;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
};
|
||||
|
||||
#endif // MXEVENTMANAGER_H
|
||||
|
||||
241
LEGO1/mxhashtable.h
Normal file
241
LEGO1/mxhashtable.h
Normal file
@ -0,0 +1,241 @@
|
||||
#ifndef MXHASHTABLE_H
|
||||
#define MXHASHTABLE_H
|
||||
|
||||
#include "mxtypes.h"
|
||||
#include "mxcore.h"
|
||||
|
||||
#define HASH_TABLE_INIT_SIZE 128
|
||||
#define HASH_TABLE_OPT_NO_EXPAND 0
|
||||
#define HASH_TABLE_OPT_EXPAND_ADD 1
|
||||
#define HASH_TABLE_OPT_EXPAND_MULTIPLY 2
|
||||
|
||||
template <class T>
|
||||
class MxHashTableNode
|
||||
{
|
||||
public:
|
||||
MxHashTableNode<T>() {}
|
||||
MxHashTableNode<T>(T *p_obj, MxU32 p_hash)
|
||||
{
|
||||
m_obj = p_obj;
|
||||
m_hash = p_hash;
|
||||
m_prev = NULL;
|
||||
m_next = NULL;
|
||||
}
|
||||
|
||||
//private:
|
||||
T* m_obj;
|
||||
MxU32 m_hash;
|
||||
MxHashTableNode *m_prev;
|
||||
MxHashTableNode *m_next;
|
||||
};
|
||||
|
||||
// See MxOmni::Create
|
||||
// VTABLE 0x100dc1b0
|
||||
template <class T>
|
||||
class HashTableParent : public MxCore
|
||||
{
|
||||
public:
|
||||
HashTableParent() {
|
||||
m_numKeys = 0;
|
||||
m_customDestructor = Destroy;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100afd30
|
||||
static void Destroy(T*) {};
|
||||
|
||||
// OFFSET: LEGO1 0x100afcd0
|
||||
virtual MxS8 Compare(T*, T*) = 0;
|
||||
|
||||
protected:
|
||||
MxU32 m_numKeys; // +0x8
|
||||
void (*m_customDestructor)(T*); // +0xc
|
||||
};
|
||||
|
||||
// VTABLE 0x100dc1e8
|
||||
template <class T>
|
||||
class MxHashTable : protected HashTableParent<T>
|
||||
{
|
||||
public:
|
||||
MxHashTable()
|
||||
{
|
||||
m_numSlots = HASH_TABLE_INIT_SIZE;
|
||||
m_slots = new MxHashTableNode<T>*[HASH_TABLE_INIT_SIZE];
|
||||
memset(m_slots, 0, sizeof(MxHashTableNode<T> *) * m_numSlots);
|
||||
m_resizeOption = HASH_TABLE_OPT_NO_EXPAND;
|
||||
}
|
||||
|
||||
virtual ~MxHashTable();
|
||||
|
||||
void Resize();
|
||||
void MxHashTable::Add(T* );
|
||||
|
||||
virtual MxS8 Compare(T*, T*) = 0;
|
||||
|
||||
// OFFSET: LEGO1 0x100afdc0
|
||||
virtual MxU32 Hash(T*) = 0;
|
||||
|
||||
// FIXME: use of friend here?
|
||||
friend class MxHashTableCursor<T>;
|
||||
|
||||
protected:
|
||||
void _NodeInsert(MxHashTableNode<T> *);
|
||||
|
||||
MxHashTableNode<T> **m_slots; // +0x10
|
||||
MxU32 m_numSlots; // +0x14
|
||||
MxU32 m_autoResizeRatio;
|
||||
int m_resizeOption; // +0x1c
|
||||
// FIXME: or FIXME? This qword is used as an integer or double depending
|
||||
// on the value of m_resizeOption. Hard to say whether this is how the devs
|
||||
// did it, but a simple cast in either direction doesn't match.
|
||||
union {
|
||||
MxU32 m_increaseAmount;
|
||||
double m_increaseFactor;
|
||||
};
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class MxHashTableCursor : public MxCore
|
||||
{
|
||||
public:
|
||||
MxHashTableCursor(MxHashTable<T> *p_hashTable)
|
||||
{
|
||||
m_table = p_hashTable;
|
||||
m_match = NULL;
|
||||
}
|
||||
|
||||
MxBool Find(T *p_obj)
|
||||
{
|
||||
MxU32 hash = m_table->Hash(p_obj);
|
||||
int bucket = hash % m_table->m_numSlots;
|
||||
|
||||
MxHashTableNode<T> *t = m_table->m_slots[bucket];
|
||||
|
||||
while (t) {
|
||||
if (t->m_hash == hash && !m_table->Compare(t->m_obj, p_obj))
|
||||
m_match = t;
|
||||
t = t->m_next;
|
||||
}
|
||||
|
||||
return m_match != NULL;
|
||||
}
|
||||
|
||||
void GetMatch(T*& p_obj)
|
||||
{
|
||||
if (m_match) {
|
||||
p_obj = m_match->m_obj;
|
||||
}
|
||||
}
|
||||
|
||||
void DeleteMatch()
|
||||
{
|
||||
// Cut the matching node out of the linked list
|
||||
// by updating pointer references.
|
||||
|
||||
if (m_match->m_prev) {
|
||||
m_match->m_prev->m_next = m_match->m_next;
|
||||
} else {
|
||||
// No "prev" node, so move "next" to the head of the list.
|
||||
int bucket = m_match->m_hash % m_table->m_numSlots;
|
||||
m_table->m_slots[bucket] = m_match->m_next;
|
||||
}
|
||||
|
||||
if (m_match->m_next)
|
||||
m_match->m_next->m_prev = m_match->m_prev;
|
||||
|
||||
m_table->m_customDestructor(m_match->m_obj);
|
||||
delete m_match;
|
||||
m_table->m_numKeys--;
|
||||
}
|
||||
|
||||
private:
|
||||
MxHashTable<T> *m_table;
|
||||
MxHashTableNode<T> *m_match;
|
||||
};
|
||||
|
||||
|
||||
template <class T>
|
||||
// OFFSET: LEGO1 0x100b0bd0
|
||||
MxHashTable<T>::~MxHashTable()
|
||||
{
|
||||
for (int i = 0; i < m_numSlots; i++) {
|
||||
MxHashTableNode<T> *t = m_slots[i];
|
||||
|
||||
while (t) {
|
||||
MxHashTableNode<T> *next = t->m_next;
|
||||
m_customDestructor(t->m_obj);
|
||||
delete t;
|
||||
t = next;
|
||||
}
|
||||
}
|
||||
|
||||
m_numKeys = 0;
|
||||
memset(m_slots, 0, sizeof(MxHashTableNode<T> *) * m_numSlots);
|
||||
|
||||
delete[] m_slots;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
// OFFSET: LEGO1 0x100b7ab0
|
||||
inline void MxHashTable<T>::Resize()
|
||||
{
|
||||
// Save a reference to the current table
|
||||
// so we can walk nodes and re-insert
|
||||
MxU32 old_size = m_numSlots;
|
||||
MxHashTableNode<T> **old_table = m_slots;
|
||||
|
||||
switch (m_resizeOption) {
|
||||
case HASH_TABLE_OPT_EXPAND_ADD:
|
||||
m_numSlots = old_size + m_increaseAmount;
|
||||
break;
|
||||
case HASH_TABLE_OPT_EXPAND_MULTIPLY:
|
||||
m_numSlots = old_size * m_increaseFactor;
|
||||
break;
|
||||
}
|
||||
|
||||
MxHashTableNode<T> **new_table = new MxHashTableNode<T>*[m_numSlots];
|
||||
// FIXME: order? m_numKeys set after `rep stosd`
|
||||
m_slots = new_table;
|
||||
memset(m_slots, 0, sizeof(MxHashTableNode<T> *) * m_numSlots);
|
||||
m_numKeys = 0;
|
||||
|
||||
for (int i = 0; i != old_size; i++) {
|
||||
MxHashTableNode<T> *t = old_table[i];
|
||||
|
||||
while (t) {
|
||||
MxHashTableNode<T> *next = t->m_next;
|
||||
_NodeInsert(t);
|
||||
t = next;
|
||||
}
|
||||
}
|
||||
|
||||
delete[] old_table;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
// OFFSET: LEGO1 0x100b7b80
|
||||
inline void MxHashTable<T>::_NodeInsert(MxHashTableNode<T> *p_node)
|
||||
{
|
||||
int bucket = p_node->m_hash % m_numSlots;
|
||||
|
||||
p_node->m_next = m_slots[bucket];
|
||||
|
||||
if (m_slots[bucket])
|
||||
m_slots[bucket]->m_prev = p_node;
|
||||
|
||||
m_slots[bucket] = p_node;
|
||||
m_numKeys++;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline void MxHashTable<T>::Add(T* p_newobj)
|
||||
{
|
||||
if (m_resizeOption && ((m_numKeys + 1) / m_numSlots) > m_autoResizeRatio)
|
||||
MxHashTable<T>::Resize();
|
||||
|
||||
MxU32 hash = Hash(p_newobj);
|
||||
MxHashTableNode<T> *node = new MxHashTableNode<T>(p_newobj, hash);
|
||||
|
||||
MxHashTable<T>::_NodeInsert(node);
|
||||
}
|
||||
|
||||
#endif // MXHASHTABLE_H
|
||||
@ -1,9 +1,15 @@
|
||||
#include "mxioinfo.h"
|
||||
#include "decomp.h"
|
||||
|
||||
// This class should be 72 bytes in size, same as the MMIOINFO struct.
|
||||
// The current implementation has MMIOINFO as the only member of the class,
|
||||
// but this assert will enforce the size if we decide to change that.
|
||||
DECOMP_SIZE_ASSERT(MXIOINFO, sizeof(MMIOINFO));
|
||||
|
||||
// OFFSET: LEGO1 0x100cc800
|
||||
MXIOINFO::MXIOINFO()
|
||||
{
|
||||
memset(&m_info, 0, sizeof(MMIOINFO));
|
||||
memset(&m_info, 0, sizeof(m_info));
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100cc820
|
||||
@ -13,37 +19,427 @@ MXIOINFO::~MXIOINFO()
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100cc830
|
||||
MxU16 MXIOINFO::Open(const char *filename, DWORD fdwOpen)
|
||||
MxU16 MXIOINFO::Open(const char *p_filename, MxULong p_flags)
|
||||
{
|
||||
return 0;
|
||||
OFSTRUCT _unused;
|
||||
MxU16 result = 0;
|
||||
|
||||
m_info.lBufOffset = 0;
|
||||
m_info.lDiskOffset = 0;
|
||||
|
||||
// Cast of p_flags to u16 forces the `movzx` instruction
|
||||
m_info.hmmio = (HMMIO)OpenFile(p_filename, &_unused, (MxU16)p_flags);
|
||||
|
||||
if ((HFILE)m_info.hmmio != HFILE_ERROR) {
|
||||
m_info.dwFlags = p_flags;
|
||||
if (p_flags & MMIO_ALLOCBUF) {
|
||||
|
||||
// Default buffer length of 8k if none specified
|
||||
int len = m_info.cchBuffer ? m_info.cchBuffer : 8192;
|
||||
HPSTR buf = new char[len];
|
||||
|
||||
if (!buf) {
|
||||
result = MMIOERR_OUTOFMEMORY;
|
||||
m_info.cchBuffer = 0;
|
||||
m_info.dwFlags &= ~MMIO_ALLOCBUF;
|
||||
m_info.pchBuffer = 0;
|
||||
} else {
|
||||
m_info.pchBuffer = buf;
|
||||
m_info.cchBuffer = len;
|
||||
}
|
||||
|
||||
m_info.pchEndRead = m_info.pchBuffer;
|
||||
m_info.pchNext = m_info.pchBuffer;
|
||||
m_info.pchEndWrite = m_info.pchBuffer + m_info.cchBuffer;
|
||||
}
|
||||
} else {
|
||||
result = MMIOERR_CANNOTOPEN;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100cc8e0
|
||||
void MXIOINFO::Close(MxLong arg)
|
||||
MxU16 MXIOINFO::Close(MxLong p_unused)
|
||||
{
|
||||
|
||||
MxU16 result = 0;
|
||||
|
||||
if (m_info.hmmio) {
|
||||
result = Flush(0);
|
||||
_lclose((HFILE)m_info.hmmio);
|
||||
m_info.hmmio = 0;
|
||||
|
||||
if (m_info.dwFlags & MMIO_ALLOCBUF)
|
||||
delete[] m_info.pchBuffer;
|
||||
|
||||
m_info.pchEndWrite = 0;
|
||||
m_info.pchEndRead = 0;
|
||||
m_info.pchBuffer = 0;
|
||||
m_info.dwFlags = 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100cc930
|
||||
MxULong MXIOINFO::Read(HPSTR pch, LONG cch)
|
||||
MxLong MXIOINFO::Read(void *p_buf, MxLong p_len)
|
||||
{
|
||||
return 0;
|
||||
MxLong bytes_read = 0;
|
||||
|
||||
if (m_info.pchBuffer) {
|
||||
|
||||
int bytes_left = m_info.pchEndRead - m_info.pchNext;
|
||||
while (p_len > 0) {
|
||||
|
||||
if (bytes_left > 0) {
|
||||
if (p_len < bytes_left)
|
||||
bytes_left = p_len;
|
||||
|
||||
memcpy(p_buf, m_info.pchNext, bytes_left);
|
||||
p_len -= bytes_left;
|
||||
|
||||
m_info.pchNext += bytes_left;
|
||||
bytes_read += bytes_left;
|
||||
}
|
||||
|
||||
if (p_len <= 0 || Advance(0))
|
||||
break;
|
||||
|
||||
bytes_left = m_info.pchEndRead - m_info.pchNext;
|
||||
if (bytes_left <= 0)
|
||||
break;
|
||||
}
|
||||
} else if (m_info.hmmio && p_len > 0) {
|
||||
bytes_read = _hread((HFILE)m_info.hmmio, p_buf, p_len);
|
||||
|
||||
if (bytes_read == -1) {
|
||||
bytes_read = 0;
|
||||
m_info.lDiskOffset = _llseek((HFILE)m_info.hmmio, 0, SEEK_CUR);
|
||||
} else {
|
||||
m_info.lDiskOffset += bytes_read;
|
||||
}
|
||||
}
|
||||
|
||||
return bytes_read;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100cca00
|
||||
LONG MXIOINFO::Seek(LONG lOffset, int iOrigin)
|
||||
MxLong MXIOINFO::Seek(MxLong p_offset, int p_origin)
|
||||
{
|
||||
return 0;
|
||||
MxLong result = -1;
|
||||
|
||||
// If buffered I/O
|
||||
if (m_info.pchBuffer) {
|
||||
if (p_origin == SEEK_CUR) {
|
||||
if (!p_offset) {
|
||||
// don't seek at all and just return where we are.
|
||||
return m_info.lBufOffset + (m_info.pchNext - m_info.pchBuffer);
|
||||
} else {
|
||||
// With SEEK_CUR, p_offset is a relative offset.
|
||||
// Get the absolute position instead and use SEEK_SET.
|
||||
p_offset += m_info.lBufOffset + (m_info.pchNext - m_info.pchBuffer);
|
||||
p_origin = SEEK_SET;
|
||||
}
|
||||
} else if (p_origin == SEEK_END) {
|
||||
// not possible with buffered I/O
|
||||
return -1;
|
||||
}
|
||||
|
||||
// else p_origin == SEEK_SET.
|
||||
|
||||
// is p_offset between the start and end of the buffer?
|
||||
// i.e. can we do the seek without reading more from disk?
|
||||
if (p_offset >= m_info.lBufOffset && p_offset < m_info.lBufOffset + m_info.cchBuffer) {
|
||||
m_info.pchNext = m_info.pchBuffer + (p_offset - m_info.lBufOffset);
|
||||
result = p_offset;
|
||||
} else {
|
||||
// we have to read another chunk from disk.
|
||||
if (m_info.hmmio && !Flush(0)) {
|
||||
m_info.lDiskOffset = _llseek((HFILE)m_info.hmmio, p_offset, p_origin);
|
||||
|
||||
if (m_info.lDiskOffset == -1) {
|
||||
m_info.lDiskOffset = _llseek((HFILE)m_info.hmmio, 0, SEEK_CUR);
|
||||
} else {
|
||||
|
||||
// align offset to buffer size
|
||||
int new_offset = p_offset - (p_offset % m_info.cchBuffer);
|
||||
m_info.lBufOffset = new_offset;
|
||||
|
||||
// do we need to seek again?
|
||||
// (i.e. are we already aligned to buffer size?)
|
||||
if (p_offset != new_offset) {
|
||||
m_info.lDiskOffset = _llseek((HFILE)m_info.hmmio, new_offset, SEEK_SET);
|
||||
|
||||
if (m_info.lDiskOffset == -1) {
|
||||
m_info.lDiskOffset = _llseek((HFILE)m_info.hmmio, 0, SEEK_CUR);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_info.lBufOffset == m_info.lDiskOffset) {
|
||||
// is the file open for writing only?
|
||||
if ((m_info.dwFlags & MMIO_RWMODE) &&
|
||||
((m_info.dwFlags & MMIO_RWMODE) != MMIO_READWRITE)) {
|
||||
|
||||
m_info.pchNext = m_info.pchBuffer - m_info.lBufOffset + p_offset;
|
||||
|
||||
result = p_offset;
|
||||
} else {
|
||||
// We can read from the file. Fill the buffer.
|
||||
int bytes_read = _hread((HFILE)m_info.hmmio, m_info.pchBuffer, m_info.cchBuffer);
|
||||
|
||||
if (bytes_read == -1) {
|
||||
m_info.lDiskOffset = _llseek((HFILE)m_info.hmmio, 0, SEEK_CUR);
|
||||
} else {
|
||||
m_info.lDiskOffset += bytes_read;
|
||||
m_info.pchNext = p_offset - m_info.lBufOffset + m_info.pchBuffer;
|
||||
m_info.pchEndRead = m_info.pchBuffer + bytes_read;
|
||||
|
||||
if (m_info.pchNext < m_info.pchEndRead) {
|
||||
result = p_offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// No buffer so just seek the file directly (if we have a valid handle)
|
||||
if (m_info.hmmio) {
|
||||
// i.e. if we just want to get the current file position
|
||||
if (p_origin == SEEK_CUR && p_offset == 0) {
|
||||
return m_info.lDiskOffset;
|
||||
} else {
|
||||
m_info.lDiskOffset = _llseek((HFILE)m_info.hmmio, p_offset, p_origin);
|
||||
|
||||
result = m_info.lDiskOffset;
|
||||
|
||||
if (result == -1) {
|
||||
m_info.lDiskOffset = _llseek((HFILE)m_info.hmmio, 0, SEEK_CUR);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100ccbc0
|
||||
void MXIOINFO::SetBuffer(LPSTR pchBuffer, LONG cchBuffer, LONG unk)
|
||||
MxU16 MXIOINFO::SetBuffer(char *p_buf, MxLong p_len, MxLong p_unused)
|
||||
{
|
||||
|
||||
MxU16 result = Flush(0);
|
||||
|
||||
if (m_info.dwFlags & MMIO_ALLOCBUF) {
|
||||
m_info.dwFlags &= ~MMIO_ALLOCBUF;
|
||||
delete[] m_info.pchBuffer;
|
||||
}
|
||||
|
||||
m_info.pchBuffer = p_buf;
|
||||
m_info.cchBuffer = p_len;
|
||||
m_info.pchEndWrite = m_info.pchBuffer + m_info.cchBuffer;
|
||||
m_info.pchEndRead = m_info.pchBuffer;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100ccc10
|
||||
MxU16 MXIOINFO::Flush(MxU16 p_unused)
|
||||
{
|
||||
MxU16 result = 0;
|
||||
|
||||
// if buffer is dirty
|
||||
if (m_info.dwFlags & MMIO_DIRTY) {
|
||||
// if we have allocated an IO buffer
|
||||
if (m_info.pchBuffer) {
|
||||
// if we have a file open for writing
|
||||
if (m_info.hmmio && (m_info.dwFlags & MMIO_RWMODE)) {
|
||||
// (pulling this value out into a variable forces it into EBX)
|
||||
MxLong cchBuffer = m_info.cchBuffer;
|
||||
if (cchBuffer > 0) {
|
||||
if (m_info.lBufOffset != m_info.lDiskOffset) {
|
||||
m_info.lDiskOffset = _llseek((HFILE)m_info.hmmio, m_info.lBufOffset, SEEK_SET);
|
||||
}
|
||||
|
||||
// Was the previous seek (if required) successful?
|
||||
if (m_info.lBufOffset != m_info.lDiskOffset) {
|
||||
result = MMIOERR_CANNOTSEEK;
|
||||
m_info.lDiskOffset = _llseek((HFILE)m_info.hmmio, 0, SEEK_CUR);
|
||||
} else {
|
||||
MxLong bytes_written = _hwrite((HFILE)m_info.hmmio, m_info.pchBuffer, cchBuffer);
|
||||
|
||||
if (bytes_written != -1 && bytes_written == cchBuffer) {
|
||||
m_info.lDiskOffset += bytes_written;
|
||||
m_info.pchNext = m_info.pchBuffer;
|
||||
m_info.dwFlags &= ~MMIO_DIRTY;
|
||||
} else {
|
||||
result = MMIOERR_CANNOTWRITE;
|
||||
m_info.lDiskOffset = _llseek((HFILE)m_info.hmmio, 0, SEEK_CUR);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result = MMIOERR_CANNOTWRITE;
|
||||
}
|
||||
} else {
|
||||
result = MMIOERR_UNBUFFERED;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100ccd00
|
||||
MxU16 MXIOINFO::Advance(MxU16 p_option)
|
||||
{
|
||||
MxU16 result = 0;
|
||||
MxULong rwmode = m_info.dwFlags & MMIO_RWMODE;
|
||||
|
||||
if (m_info.pchBuffer) {
|
||||
MxLong cch = m_info.cchBuffer;
|
||||
|
||||
// If we can and should write to the file,
|
||||
// if we are being asked to write to the file,
|
||||
// and if there is a buffer *to* write:
|
||||
if ((rwmode == MMIO_WRITE || rwmode == MMIO_READWRITE) &&
|
||||
(m_info.dwFlags & MMIO_DIRTY) &&
|
||||
((p_option & MMIO_WRITE) || (rwmode == MMIO_READWRITE)) &&
|
||||
cch > 0) {
|
||||
|
||||
if (m_info.lBufOffset != m_info.lDiskOffset) {
|
||||
m_info.lDiskOffset = _llseek((HFILE)m_info.hmmio, m_info.lBufOffset, SEEK_SET);
|
||||
}
|
||||
|
||||
if (m_info.lBufOffset != m_info.lDiskOffset) {
|
||||
result = MMIOERR_CANNOTSEEK;
|
||||
} else {
|
||||
MxLong bytes_written = _hwrite((HFILE)m_info.hmmio, m_info.pchBuffer, cch);
|
||||
|
||||
if (bytes_written != -1 && bytes_written == cch) {
|
||||
m_info.lDiskOffset += bytes_written;
|
||||
m_info.pchNext = m_info.pchBuffer;
|
||||
m_info.pchEndRead = m_info.pchBuffer;
|
||||
m_info.dwFlags &= ~MMIO_DIRTY;
|
||||
} else {
|
||||
result = MMIOERR_CANNOTWRITE;
|
||||
}
|
||||
}
|
||||
|
||||
m_info.lDiskOffset = _llseek((HFILE)m_info.hmmio, 0, SEEK_CUR);
|
||||
|
||||
}
|
||||
|
||||
m_info.lBufOffset += cch;
|
||||
if ((!rwmode || rwmode == MMIO_READWRITE) && cch > 0) {
|
||||
if (m_info.lBufOffset != m_info.lDiskOffset) {
|
||||
m_info.lDiskOffset = _llseek((HFILE)m_info.hmmio, m_info.lBufOffset, SEEK_SET);
|
||||
}
|
||||
|
||||
// if previous seek failed
|
||||
if (m_info.lBufOffset != m_info.lDiskOffset) {
|
||||
result = MMIOERR_CANNOTSEEK;
|
||||
m_info.lDiskOffset = _llseek((HFILE)m_info.hmmio, 0, SEEK_CUR);
|
||||
} else {
|
||||
int bytes_read = _hread((HFILE)m_info.hmmio, m_info.pchBuffer, cch);
|
||||
|
||||
if (bytes_read == -1) {
|
||||
result = MMIOERR_CANNOTREAD;
|
||||
m_info.lDiskOffset = _llseek((HFILE)m_info.hmmio, 0, SEEK_CUR);
|
||||
} else {
|
||||
m_info.lDiskOffset += bytes_read;
|
||||
m_info.pchNext = m_info.pchBuffer;
|
||||
m_info.pchEndRead = m_info.pchBuffer + bytes_read;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result = MMIOERR_UNBUFFERED;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100cce60
|
||||
MxU16 MXIOINFO::Descend(LPMMCKINFO pmmcki, const MMCKINFO *pmmckiParent, UINT fuDescend)
|
||||
MxU16 MXIOINFO::Descend(MMCKINFO *p_chunkInfo, const MMCKINFO *p_parentInfo, MxU16 p_descend)
|
||||
{
|
||||
return 0;
|
||||
MxU16 result = 0;
|
||||
|
||||
if (!p_chunkInfo)
|
||||
return MMIOERR_BASE; // ?
|
||||
|
||||
if (!p_descend) {
|
||||
p_chunkInfo->dwFlags = 0;
|
||||
if (Read(p_chunkInfo, 8) != 8) {
|
||||
result = MMIOERR_CANNOTREAD;
|
||||
} else {
|
||||
if (m_info.pchBuffer) {
|
||||
p_chunkInfo->dwDataOffset = m_info.pchNext - m_info.pchBuffer + m_info.lBufOffset;
|
||||
} else {
|
||||
p_chunkInfo->dwDataOffset = m_info.lDiskOffset;
|
||||
}
|
||||
|
||||
if (p_chunkInfo->ckid == FOURCC_RIFF || p_chunkInfo->ckid == FOURCC_LIST) {
|
||||
if (Read(&p_chunkInfo->fccType, 4) != 4) {
|
||||
result = MMIOERR_CANNOTREAD;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
MxULong ofs = MAXLONG;
|
||||
|
||||
if (p_parentInfo)
|
||||
ofs = p_parentInfo->cksize + p_parentInfo->dwDataOffset;
|
||||
|
||||
BOOL running = TRUE;
|
||||
BOOL read_ok = FALSE;
|
||||
MMCKINFO tmp;
|
||||
tmp.dwFlags = 0;
|
||||
|
||||
// This loop is... something
|
||||
do {
|
||||
if (Read(&tmp, 8) != 8) {
|
||||
// If the first read fails, report read error. Else EOF.
|
||||
result = read_ok ? MMIOERR_CHUNKNOTFOUND : MMIOERR_CANNOTREAD;
|
||||
running = FALSE;
|
||||
} else {
|
||||
read_ok = TRUE;
|
||||
if (m_info.pchBuffer) {
|
||||
tmp.dwDataOffset = m_info.pchNext - m_info.pchBuffer + m_info.lBufOffset;
|
||||
} else {
|
||||
tmp.dwDataOffset = m_info.lDiskOffset;
|
||||
}
|
||||
|
||||
if (ofs < tmp.dwDataOffset) {
|
||||
result = MMIOERR_CHUNKNOTFOUND;
|
||||
running = FALSE;
|
||||
} else {
|
||||
if ((p_descend == MMIO_FINDLIST && tmp.ckid == FOURCC_LIST) ||
|
||||
(p_descend == MMIO_FINDRIFF && tmp.ckid == FOURCC_RIFF)) {
|
||||
if (Read(&tmp.fccType, 4) != 4) {
|
||||
result = MMIOERR_CANNOTREAD;
|
||||
} else {
|
||||
if (p_chunkInfo->fccType != tmp.fccType)
|
||||
continue;
|
||||
}
|
||||
running = FALSE;
|
||||
} else {
|
||||
if (p_chunkInfo->ckid != tmp.ckid) {
|
||||
if (Seek((tmp.cksize&1)+tmp.cksize, SEEK_CUR) != -1) {
|
||||
continue;
|
||||
} else {
|
||||
result = MMIOERR_CANNOTSEEK;
|
||||
}
|
||||
}
|
||||
running = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} while (running);
|
||||
|
||||
if (!result)
|
||||
memcpy(p_chunkInfo, &tmp, sizeof(MMCKINFO));
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -12,13 +12,17 @@ class MXIOINFO
|
||||
MXIOINFO();
|
||||
__declspec(dllexport) ~MXIOINFO();
|
||||
|
||||
MxU16 Open(const char *filename, DWORD fdwOpen);
|
||||
void Close(MxLong arg);
|
||||
LONG Seek(LONG lOffset, int iOrigin);
|
||||
MxULong Read(HPSTR pch, LONG cch);
|
||||
void SetBuffer(LPSTR pchBuffer, LONG cchBuffer, LONG unk);
|
||||
MxU16 Descend(LPMMCKINFO pmmcki, const MMCKINFO *pmmckiParent, UINT fuDescend);
|
||||
MxU16 Open(const char *, MxULong);
|
||||
MxU16 Close(MxLong);
|
||||
MxLong Read(void *, MxLong);
|
||||
MxLong Seek(MxLong, int);
|
||||
MxU16 SetBuffer(char *, MxLong, MxLong);
|
||||
MxU16 Flush(MxU16);
|
||||
MxU16 Advance(MxU16);
|
||||
MxU16 Descend(MMCKINFO *, const MMCKINFO *, MxU16);
|
||||
|
||||
// NOTE: In MXIOINFO, the `hmmio` member of MMIOINFO is used like
|
||||
// an HFILE (int) instead of an HMMIO (WORD).
|
||||
MMIOINFO m_info;
|
||||
};
|
||||
|
||||
|
||||
188
LEGO1/mxmatrix.cpp
Normal file
188
LEGO1/mxmatrix.cpp
Normal file
@ -0,0 +1,188 @@
|
||||
|
||||
#include "mxmatrix.h"
|
||||
|
||||
#include <memory.h>
|
||||
#include "math.h"
|
||||
|
||||
#include "decomp.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(MxMatrix, 0x8);
|
||||
DECOMP_SIZE_ASSERT(MxMatrixData, 0x48);
|
||||
|
||||
// OFFSET: LEGO1 0x10002340
|
||||
void MxMatrix::EqualsMxMatrix(const MxMatrix *p_other)
|
||||
{
|
||||
memcpy(m_data, p_other->m_data, 16 * sizeof(float));
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002320
|
||||
void MxMatrix::EqualsMatrixData(const float *p_matrix)
|
||||
{
|
||||
memcpy(m_data, p_matrix, 16 * sizeof(float));
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002370
|
||||
void MxMatrix::SetData(float *p_data)
|
||||
{
|
||||
m_data = p_data;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002360
|
||||
void MxMatrix::AnotherSetData(float *p_data)
|
||||
{
|
||||
m_data = p_data;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002390
|
||||
float *MxMatrix::GetData()
|
||||
{
|
||||
return m_data;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002380
|
||||
const float *MxMatrix::GetData() const
|
||||
{
|
||||
return m_data;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100023c0
|
||||
float *MxMatrix::Element(int p_row, int p_col)
|
||||
{
|
||||
return &m_data[p_row * 4 + p_col];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100023a0
|
||||
const float *MxMatrix::Element(int p_row, int p_col) const
|
||||
{
|
||||
return &m_data[p_row * 4 + p_col];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100023e0
|
||||
void MxMatrix::Clear()
|
||||
{
|
||||
memset(m_data, 0, 16 * sizeof(float));
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100023f0
|
||||
void MxMatrix::SetIdentity()
|
||||
{
|
||||
Clear();
|
||||
m_data[0] = 1.0f;
|
||||
m_data[5] = 1.0f;
|
||||
m_data[10] = 1.0f;
|
||||
m_data[15] = 1.0f;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002850
|
||||
void MxMatrix::operator=(const MxMatrix& p_other)
|
||||
{
|
||||
EqualsMxMatrix(&p_other);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002430
|
||||
MxMatrix* MxMatrix::operator+=(const float *p_matrix)
|
||||
{
|
||||
for (int i = 0; i < 16; ++i)
|
||||
m_data[i] += p_matrix[i];
|
||||
return this;
|
||||
}
|
||||
|
||||
// Matches but instructions are significantly out of order. Probably not wrong
|
||||
// code given that the very similar SetTranslation does match.
|
||||
// OFFSET: LEGO1 0x10002460
|
||||
void MxMatrix::TranslateBy(const float *p_x, const float *p_y, const float *p_z)
|
||||
{
|
||||
m_data[12] += *p_x;
|
||||
m_data[13] += *p_y;
|
||||
m_data[14] += *p_z;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100024a0
|
||||
void MxMatrix::SetTranslation(const float *p_x, const float *p_y, const float *p_z)
|
||||
{
|
||||
m_data[12] = *p_x;
|
||||
m_data[13] = *p_y;
|
||||
m_data[14] = *p_z;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002530
|
||||
void MxMatrix::EqualsMxProduct(const MxMatrix *p_a, const MxMatrix *p_b)
|
||||
{
|
||||
EqualsDataProduct(p_a->m_data, p_b->m_data);
|
||||
}
|
||||
|
||||
// Just a placeholder matrix multiply implementation. I think the decomp will
|
||||
// look roughly like this but it's not close to matching and won't be until
|
||||
// an exact match is found given it's all loop and float crunching.
|
||||
// OFFSET: LEGO1 0x100024d0 STUB
|
||||
void MxMatrix::EqualsDataProduct(const float *p_a, const float *p_b)
|
||||
{
|
||||
for (int row = 0; row < 4; ++row)
|
||||
{
|
||||
for (int col = 0; col < 4; ++col)
|
||||
{
|
||||
m_data[row * 4 + col] = 0.0f;
|
||||
for (int k = 0; k < 4; ++k)
|
||||
{
|
||||
m_data[row * 4 + col] += p_a[row * 4 + k] * p_b[k * 4 + col];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Not close, Ghidra struggles understinging this method so it will have to
|
||||
// be manually worked out. Included since I at least figured out what it was
|
||||
// doing with rotateIndex and what overall operation it's trying to do.
|
||||
// OFFSET: LEGO1 0x10002550 STUB
|
||||
void MxMatrix::ToQuaternion(MxVector4 *p_outQuat)
|
||||
{
|
||||
float trace = m_data[0] + m_data[5] + m_data[10];
|
||||
if (trace > 0)
|
||||
{
|
||||
trace = sqrt(trace + 1.0);
|
||||
p_outQuat->GetData()[3] = trace * 0.5f;
|
||||
p_outQuat->GetData()[0] = (m_data[9] - m_data[6]) * trace;
|
||||
p_outQuat->GetData()[1] = (m_data[2] - m_data[8]) * trace;
|
||||
p_outQuat->GetData()[2] = (m_data[4] - m_data[1]) * trace;
|
||||
return;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100d4090
|
||||
static int rotateIndex[] = {1, 2, 0};
|
||||
|
||||
// Largest element along the trace
|
||||
int largest = m_data[0] < m_data[5];
|
||||
if (*Element(largest, largest) < m_data[10])
|
||||
largest = 2;
|
||||
|
||||
int next = rotateIndex[largest];
|
||||
int nextNext = rotateIndex[next];
|
||||
float valueA = *Element(nextNext, nextNext);
|
||||
float valueB = *Element(next, next);
|
||||
float valueC = *Element(largest, largest);
|
||||
|
||||
// Above is somewhat decomped, below is pure speculation since the automatic
|
||||
// decomp becomes very garbled.
|
||||
float traceValue = sqrt(valueA - valueB - valueC + 1.0);
|
||||
|
||||
p_outQuat->GetData()[largest] = traceValue * 0.5f;
|
||||
traceValue = 0.5f / traceValue;
|
||||
|
||||
p_outQuat->GetData()[3] = (m_data[next + 4 * nextNext] - m_data[nextNext + 4 * next]) * traceValue;
|
||||
p_outQuat->GetData()[next] = (m_data[next + 4 * largest] + m_data[largest + 4 * next]) * traceValue;
|
||||
p_outQuat->GetData()[nextNext] = (m_data[nextNext + 4 * largest] + m_data[largest + 4 * nextNext]) * traceValue;
|
||||
}
|
||||
|
||||
// No idea what this function is doing and it will be hard to tell until
|
||||
// we have a confirmed usage site.
|
||||
// OFFSET: LEGO1 0x10002710 STUB
|
||||
MxResult MxMatrix::DoSomethingWithLength(const MxVector3 *p_vec)
|
||||
{
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002860
|
||||
void MxMatrixData::operator=(const MxMatrixData& p_other)
|
||||
{
|
||||
EqualsMxMatrix(&p_other);
|
||||
}
|
||||
70
LEGO1/mxmatrix.h
Normal file
70
LEGO1/mxmatrix.h
Normal file
@ -0,0 +1,70 @@
|
||||
#ifndef MXMATRIX_H
|
||||
#define MXMATRIX_H
|
||||
|
||||
#include "mxvector.h"
|
||||
|
||||
// VTABLE 0x100d4350
|
||||
// SIZE 0x8
|
||||
class MxMatrix
|
||||
{
|
||||
public:
|
||||
inline MxMatrix(float *p_data) : m_data(p_data) {}
|
||||
|
||||
// vtable + 0x00
|
||||
virtual void EqualsMxMatrix(const MxMatrix *p_other);
|
||||
virtual void EqualsMatrixData(const float *p_matrix);
|
||||
virtual void SetData(float *p_data);
|
||||
virtual void AnotherSetData(float *p_data);
|
||||
|
||||
// vtable + 0x10
|
||||
virtual float *GetData();
|
||||
virtual const float *GetData() const;
|
||||
virtual float *Element(int p_row, int p_col);
|
||||
virtual const float *Element(int p_row, int p_col) const;
|
||||
|
||||
// vtable + 0x20
|
||||
virtual void Clear();
|
||||
virtual void SetIdentity();
|
||||
virtual void operator=(const MxMatrix& p_other);
|
||||
virtual MxMatrix *operator+=(const float *p_matrix);
|
||||
|
||||
// vtable + 0x30
|
||||
virtual void TranslateBy(const float *p_x, const float *p_y, const float *p_z);
|
||||
virtual void SetTranslation(const float *p_x, const float *p_y, const float *p_z);
|
||||
virtual void EqualsMxProduct(const MxMatrix *p_a, const MxMatrix *p_b);
|
||||
virtual void EqualsDataProduct(const float *p_a, const float *p_b);
|
||||
|
||||
// vtable + 0x40
|
||||
virtual void ToQuaternion(MxVector4 *p_resultQuat);
|
||||
virtual MxResult DoSomethingWithLength(const MxVector3 *p_vec);
|
||||
|
||||
private:
|
||||
float *m_data;
|
||||
};
|
||||
|
||||
// VTABLE 0x100d4300
|
||||
// SIZE 0x48
|
||||
class MxMatrixData : public MxMatrix
|
||||
{
|
||||
public:
|
||||
inline MxMatrixData() : MxMatrix(e) {}
|
||||
|
||||
// No idea why there's another equals. Maybe to some other type like the
|
||||
// DirectX Retained Mode Matrix type which is also a float* alias?
|
||||
// vtable + 0x44
|
||||
virtual void operator=(const MxMatrixData& p_other);
|
||||
|
||||
// Alias an easy way to access the translation part of the matrix, because
|
||||
// various members / other functions benefit from the clarity.
|
||||
union
|
||||
{
|
||||
float e[16];
|
||||
struct
|
||||
{
|
||||
float _[12];
|
||||
float x, y, z, w;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#endif // MXMATRIX_H
|
||||
@ -41,7 +41,7 @@ MxNotificationManager::~MxNotificationManager()
|
||||
delete m_queue;
|
||||
m_queue = NULL;
|
||||
|
||||
TickleManager()->Unregister(this);
|
||||
TickleManager()->UnregisterClient(this);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100ac800
|
||||
@ -80,7 +80,7 @@ MxResult MxNotificationManager::Create(MxS32 p_unk1, MxS32 p_unk2)
|
||||
result = FAILURE;
|
||||
}
|
||||
else {
|
||||
TickleManager()->Register(this, 10);
|
||||
TickleManager()->RegisterClient(this, 10);
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -111,10 +111,52 @@ void MxNotificationManager::Unregister(MxCore *p_listener)
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100ac990 STUB
|
||||
// OFFSET: LEGO1 0x100ac990
|
||||
void MxNotificationManager::FlushPending(MxCore *p_listener)
|
||||
{
|
||||
// TODO
|
||||
MxNotificationPtrList pending;
|
||||
MxNotification *notif;
|
||||
|
||||
{
|
||||
MxAutoLocker lock(&m_lock);
|
||||
|
||||
// Find all notifications from, and addressed to, p_listener.
|
||||
if (m_sendList != NULL) {
|
||||
MxNotificationPtrList::iterator it = m_sendList->begin();
|
||||
while (it != m_sendList->end()) {
|
||||
notif = *it;
|
||||
if ((notif->GetTarget()->GetId() == p_listener->GetId()) ||
|
||||
(notif->GetParam()->GetSender()) && (notif->GetParam()->GetSender()->GetId() == p_listener->GetId())) {
|
||||
m_sendList->erase(it++);
|
||||
pending.push_back(notif);
|
||||
}
|
||||
else {
|
||||
it++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MxNotificationPtrList::iterator it = m_queue->begin();
|
||||
while (it != m_queue->end()) {
|
||||
notif = *it;
|
||||
if ((notif->GetTarget()->GetId() == p_listener->GetId()) ||
|
||||
(notif->GetParam()->GetSender()) && (notif->GetParam()->GetSender()->GetId() == p_listener->GetId())) {
|
||||
m_queue->erase(it++);
|
||||
pending.push_back(notif);
|
||||
}
|
||||
else {
|
||||
it++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Deliver those notifications.
|
||||
while (pending.size() != 0) {
|
||||
notif = pending.front();
|
||||
pending.pop_front();
|
||||
notif->GetTarget()->Notify(*notif->GetParam());
|
||||
delete notif;
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100ac6c0
|
||||
|
||||
@ -104,6 +104,15 @@ void MxOmni::SetInstance(MxOmni *instance)
|
||||
// OFFSET: LEGO1 0x100af0c0
|
||||
MxResult MxOmni::Create(MxOmniCreateParam &p)
|
||||
{
|
||||
if (p.CreateFlags().CreateVariableTable())
|
||||
{
|
||||
MxVariableTable *variableTable = new MxVariableTable();
|
||||
this->m_variableTable = variableTable;
|
||||
|
||||
if (variableTable == NULL)
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (p.CreateFlags().CreateTimer())
|
||||
{
|
||||
MxTimer *timer = new MxTimer();
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
#include "mxstringvariable.h"
|
||||
#include "mxstring.h"
|
||||
|
||||
|
||||
// OFFSET: LEGO1 0x1003bea0
|
||||
MxString *MxStringVariable::GetString()
|
||||
{
|
||||
return &m_string;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1003beb0
|
||||
void MxStringVariable::SetString(const char *colorString)
|
||||
{
|
||||
m_string = colorString;
|
||||
}
|
||||
|
||||
//FIXME: Figure out what exactly this class is used for. It is used in LegoGameState::LegoGameState when loading the background color, and for loading the "fsmovie" variable
|
||||
// OFFSET: LEGO1 0x1003bec0
|
||||
void MxStringVariable::Destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
#ifndef MXSTRINGVARIABLE_H
|
||||
#define MXSTRINGVARIABLE_H
|
||||
#include "mxstring.h"
|
||||
#include "mxcore.h"
|
||||
//VTABLE: 0x100d74a8
|
||||
class MxStringVariable
|
||||
{
|
||||
public:
|
||||
__declspec(dllexport) MxStringVariable(const char *, const char *);
|
||||
MxStringVariable() {}
|
||||
virtual MxString *GetString();
|
||||
virtual void SetString(const char *colorString);
|
||||
virtual void Destroy();
|
||||
|
||||
protected:
|
||||
MxString m_name;
|
||||
MxString m_string;
|
||||
};
|
||||
|
||||
#endif // MXSTRINGVARIABLE_H
|
||||
113
LEGO1/mxticklemanager.cpp
Normal file
113
LEGO1/mxticklemanager.cpp
Normal file
@ -0,0 +1,113 @@
|
||||
#include "mxomni.h"
|
||||
#include "mxticklemanager.h"
|
||||
#include "mxtimer.h"
|
||||
#include "mxtypes.h"
|
||||
|
||||
#include "decomp.h"
|
||||
|
||||
#define TICKLE_MANAGER_FLAG_DESTROY 0x1
|
||||
|
||||
DECOMP_SIZE_ASSERT(MxTickleClient, 0x10);
|
||||
DECOMP_SIZE_ASSERT(MxTickleManager, 0x14);
|
||||
|
||||
// OFFSET: LEGO1 0x100bdd10
|
||||
MxTickleClient::MxTickleClient(MxCore *p_client, MxTime p_interval)
|
||||
{
|
||||
m_flags = 0;
|
||||
m_client = p_client;
|
||||
m_interval = p_interval;
|
||||
m_lastUpdateTime = -m_interval;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100bdd30
|
||||
MxTickleManager::~MxTickleManager()
|
||||
{
|
||||
while (m_clients.size() != 0) {
|
||||
MxTickleClient *client = m_clients.front();
|
||||
m_clients.pop_front();
|
||||
delete client;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Match.
|
||||
// OFFSET: LEGO1 0x100bdde0
|
||||
MxResult MxTickleManager::Tickle()
|
||||
{
|
||||
MxTime time = Timer()->GetTime();
|
||||
|
||||
MxTickleClientPtrList::iterator it = m_clients.begin();
|
||||
|
||||
while (it != m_clients.end()) {
|
||||
MxTickleClient *client = *it;
|
||||
if ((client->GetFlags() & TICKLE_MANAGER_FLAG_DESTROY) == 0) {
|
||||
if (client->GetLastUpdateTime() >= time)
|
||||
client->SetLastUpdateTime(-client->GetTickleInterval());
|
||||
|
||||
if ((client->GetTickleInterval() + client->GetLastUpdateTime()) < time) {
|
||||
client->GetClient()->Tickle();
|
||||
client->SetLastUpdateTime(time);
|
||||
}
|
||||
|
||||
it++;
|
||||
}
|
||||
else {
|
||||
m_clients.erase(it++);
|
||||
delete client;
|
||||
}
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100bde80
|
||||
void MxTickleManager::RegisterClient(MxCore *p_client, MxTime p_interval)
|
||||
{
|
||||
MxTime interval = GetClientTickleInterval(p_client);
|
||||
if (interval == TICKLE_MANAGER_NOT_FOUND) {
|
||||
MxTickleClient *client = new MxTickleClient(p_client, p_interval);
|
||||
if (client != NULL)
|
||||
m_clients.push_back(client);
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100bdf60
|
||||
void MxTickleManager::UnregisterClient(MxCore *p_client)
|
||||
{
|
||||
MxTickleClientPtrList::iterator it = m_clients.begin();
|
||||
while (it != m_clients.end()) {
|
||||
MxTickleClient *client = *it;
|
||||
if (client->GetClient() == p_client) {
|
||||
client->SetFlags(client->GetFlags() | TICKLE_MANAGER_FLAG_DESTROY);
|
||||
return;
|
||||
}
|
||||
|
||||
it++;
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100bdfa0
|
||||
void MxTickleManager::SetClientTickleInterval(MxCore *p_client, MxTime p_interval)
|
||||
{
|
||||
for (MxTickleClientPtrList::iterator it = m_clients.begin(); it != m_clients.end(); it++) {
|
||||
MxTickleClient *client = *it;
|
||||
if ((client->GetClient() == p_client) && ((client->GetFlags() & TICKLE_MANAGER_FLAG_DESTROY) == 0)) {
|
||||
client->SetTickleInterval(p_interval);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100be000
|
||||
MxTime MxTickleManager::GetClientTickleInterval(MxCore *p_client)
|
||||
{
|
||||
MxTickleClientPtrList::iterator it = m_clients.begin();
|
||||
while (it != m_clients.end()) {
|
||||
MxTickleClient *client = *it;
|
||||
if ((client->GetClient() == p_client) && ((client->GetFlags() & TICKLE_MANAGER_FLAG_DESTROY) == 0))
|
||||
return client->GetTickleInterval();
|
||||
|
||||
it++;
|
||||
}
|
||||
|
||||
return TICKLE_MANAGER_NOT_FOUND;
|
||||
}
|
||||
@ -2,20 +2,77 @@
|
||||
#define MXTICKLEMANAGER_H
|
||||
|
||||
#include "mxcore.h"
|
||||
#include "mxtypes.h"
|
||||
|
||||
#include "compat.h"
|
||||
|
||||
class MxTickleClient
|
||||
{
|
||||
public:
|
||||
MxTickleClient(MxCore *p_client, MxTime p_interval);
|
||||
|
||||
inline MxCore *GetClient() const
|
||||
{
|
||||
return m_client;
|
||||
}
|
||||
|
||||
inline MxTime GetTickleInterval() const
|
||||
{
|
||||
return m_interval;
|
||||
}
|
||||
|
||||
inline MxTime GetLastUpdateTime() const
|
||||
{
|
||||
return m_lastUpdateTime;
|
||||
}
|
||||
|
||||
inline MxU16 GetFlags() const
|
||||
{
|
||||
return m_flags;
|
||||
}
|
||||
|
||||
inline void SetTickleInterval(MxTime p_interval)
|
||||
{
|
||||
m_interval = p_interval;
|
||||
}
|
||||
|
||||
inline void SetLastUpdateTime(MxTime p_lastUpdateTime)
|
||||
{
|
||||
m_lastUpdateTime = p_lastUpdateTime;
|
||||
}
|
||||
|
||||
inline void SetFlags(MxU16 flags)
|
||||
{
|
||||
m_flags = flags;
|
||||
}
|
||||
|
||||
private:
|
||||
MxCore *m_client; // 0x0
|
||||
MxTime m_interval; // 0x4
|
||||
MxTime m_lastUpdateTime; // 0x8
|
||||
MxU16 m_flags; // 0xc
|
||||
};
|
||||
|
||||
class MxTickleClientPtrList : public List<MxTickleClient *>
|
||||
{};
|
||||
|
||||
// VTABLE 0x100d86d8
|
||||
class MxTickleManager : public MxCore
|
||||
{
|
||||
public:
|
||||
virtual ~MxTickleManager();
|
||||
inline MxTickleManager() : MxCore(), m_clients() {}
|
||||
virtual ~MxTickleManager(); // vtable+0x0 (scalar deleting destructor)
|
||||
|
||||
virtual MxLong Tickle();
|
||||
virtual const char *ClassName() const;
|
||||
virtual MxBool IsA(const char *name) const;
|
||||
virtual void Register(MxCore *p_listener, int p_milliseconds);
|
||||
virtual void Unregister(MxCore *p_listener);
|
||||
virtual void vtable1c(void *v, int p);
|
||||
virtual void vtable20();
|
||||
virtual MxResult Tickle(); // vtable+0x8
|
||||
virtual void RegisterClient(MxCore *p_client, MxTime p_interval); // vtable+0x14
|
||||
virtual void UnregisterClient(MxCore *p_client); // vtable+0x18
|
||||
virtual void SetClientTickleInterval(MxCore *p_client, MxTime p_interval); // vtable+0x1c
|
||||
virtual MxTime GetClientTickleInterval(MxCore *p_client); // vtable+0x20
|
||||
|
||||
private:
|
||||
MxTickleClientPtrList m_clients; // 0x8
|
||||
};
|
||||
|
||||
#define TICKLE_MANAGER_NOT_FOUND 0x80000000
|
||||
|
||||
#endif // MXTICKLEMANAGER_H
|
||||
|
||||
@ -25,6 +25,8 @@ typedef int MxLong;
|
||||
typedef unsigned int MxULong;
|
||||
#endif
|
||||
|
||||
typedef MxS32 MxTime;
|
||||
|
||||
typedef MxLong MxResult;
|
||||
const MxResult SUCCESS = 0;
|
||||
const MxResult FAILURE = -1;
|
||||
@ -39,4 +41,7 @@ typedef MxU8 MxBool;
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#define TWOCC(a, b) (((a) << 0) | ((b) << 8))
|
||||
#define FOURCC(a, b, c, d) (((a) << 0) | ((b) << 8) | ((c) << 16) | ((d) << 24))
|
||||
|
||||
#endif // MXTYPE_H
|
||||
|
||||
20
LEGO1/mxvariable.cpp
Normal file
20
LEGO1/mxvariable.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include "mxvariable.h"
|
||||
#include "mxstring.h"
|
||||
|
||||
// OFFSET: LEGO1 0x1003bea0
|
||||
MxString *MxVariable::GetValue()
|
||||
{
|
||||
return &m_value;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1003beb0
|
||||
void MxVariable::SetValue(const char *value)
|
||||
{
|
||||
m_value = value;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1003bec0
|
||||
void MxVariable::Destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
34
LEGO1/mxvariable.h
Normal file
34
LEGO1/mxvariable.h
Normal file
@ -0,0 +1,34 @@
|
||||
#ifndef MXVARIABLE_H
|
||||
#define MXVARIABLE_H
|
||||
|
||||
#include "mxstring.h"
|
||||
#include "mxcore.h"
|
||||
|
||||
//VTABLE: 0x100d74a8
|
||||
class MxVariable
|
||||
{
|
||||
public:
|
||||
MxVariable() {}
|
||||
MxVariable(const char *p_key)
|
||||
{
|
||||
m_key = p_key;
|
||||
m_key.ToUpperCase();
|
||||
}
|
||||
MxVariable(const char *p_key, const char *p_value)
|
||||
{
|
||||
m_key = p_key;
|
||||
m_key.ToUpperCase();
|
||||
m_value = p_value;
|
||||
}
|
||||
virtual MxString *GetValue();
|
||||
virtual void SetValue(const char *);
|
||||
virtual void Destroy();
|
||||
|
||||
inline const MxString *GetKey() const { return &m_key; }
|
||||
|
||||
protected:
|
||||
MxString m_key;
|
||||
MxString m_value;
|
||||
};
|
||||
|
||||
#endif // MXVARIABLE_H
|
||||
@ -1,20 +1,66 @@
|
||||
#include "mxvariabletable.h"
|
||||
|
||||
// OFFSET: LEGO1 0x100b73a0
|
||||
void MxVariableTable::SetVariable(const char *key, const char *value)
|
||||
// OFFSET: LEGO1 0x100b7330
|
||||
MxS8 MxVariableTable::Compare(MxVariable *p_var0, MxVariable *p_var1)
|
||||
{
|
||||
// TODO
|
||||
return strcmp(p_var0->GetKey()->GetData(),
|
||||
p_var1->GetKey()->GetData());
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100b7370
|
||||
MxU32 MxVariableTable::Hash(MxVariable *p_var)
|
||||
{
|
||||
const char *str = p_var->GetKey()->GetData();
|
||||
MxU32 value = 0;
|
||||
|
||||
for (int i = 0; str[i]; i++) {
|
||||
value += str[i];
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100b73a0
|
||||
void MxVariableTable::SetVariable(const char *p_key, const char *p_value)
|
||||
{
|
||||
MxHashTableCursor<MxVariable> cursor(this);
|
||||
MxVariable *var = new MxVariable(p_key, p_value);
|
||||
|
||||
if (cursor.Find(var)) {
|
||||
delete var;
|
||||
cursor.GetMatch(var);
|
||||
var->SetValue(p_value);
|
||||
} else {
|
||||
MxHashTable<MxVariable>::Add(var);
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100b7740
|
||||
void MxVariableTable::SetVariable(MxVariable *var)
|
||||
{
|
||||
// TODO
|
||||
MxHashTableCursor<MxVariable> cursor(this);
|
||||
MxBool found = cursor.Find(var);
|
||||
|
||||
if (found)
|
||||
cursor.DeleteMatch();
|
||||
|
||||
MxHashTable<MxVariable>::Add(var);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100b78f0
|
||||
const char *MxVariableTable::GetVariable(const char *key)
|
||||
const char *MxVariableTable::GetVariable(const char *p_key)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
const char *value = "";
|
||||
MxHashTableCursor<MxVariable> cursor(this);
|
||||
MxVariable *var = new MxVariable(p_key);
|
||||
|
||||
MxBool found = cursor.Find(var);
|
||||
delete var;
|
||||
|
||||
if (found) {
|
||||
cursor.GetMatch(var);
|
||||
value = var->GetValue()->GetData();
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
@ -1,16 +1,28 @@
|
||||
#ifndef MXVARIABLETABLE_H
|
||||
#define MXVARIABLETABLE_H
|
||||
|
||||
class MxVariable;
|
||||
#include "mxtypes.h"
|
||||
#include "mxhashtable.h"
|
||||
#include "mxvariable.h"
|
||||
|
||||
|
||||
// VTABLE 0x100dc1c8
|
||||
// SIZE 0x28
|
||||
class MxVariableTable
|
||||
class MxVariableTable : public MxHashTable<MxVariable>
|
||||
{
|
||||
public:
|
||||
__declspec(dllexport) const char * GetVariable(const char *key);
|
||||
__declspec(dllexport) void SetVariable(MxVariable *var);
|
||||
MxVariableTable() {
|
||||
m_customDestructor = Destroy;
|
||||
}
|
||||
__declspec(dllexport) void SetVariable(const char *key, const char *value);
|
||||
__declspec(dllexport) void SetVariable(MxVariable *var);
|
||||
__declspec(dllexport) const char * GetVariable(const char *key);
|
||||
|
||||
// OFFSET: LEGO1 0x100afdb0
|
||||
static void Destroy(MxVariable *p_obj) { p_obj->Destroy(); }
|
||||
|
||||
virtual MxS8 Compare(MxVariable *, MxVariable *); // +0x14
|
||||
virtual MxU32 Hash(MxVariable *); // +0x18
|
||||
};
|
||||
|
||||
#endif // MXVARIABLETABLE_H
|
||||
|
||||
460
LEGO1/mxvector.cpp
Normal file
460
LEGO1/mxvector.cpp
Normal file
@ -0,0 +1,460 @@
|
||||
|
||||
#include "mxvector.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <memory.h>
|
||||
|
||||
#include "decomp.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(MxVector2, 0x8);
|
||||
DECOMP_SIZE_ASSERT(MxVector3, 0x8);
|
||||
DECOMP_SIZE_ASSERT(MxVector4, 0x8);
|
||||
DECOMP_SIZE_ASSERT(MxVector3Data, 0x14);
|
||||
DECOMP_SIZE_ASSERT(MxVector4Data, 0x18);
|
||||
|
||||
// OFFSET: LEGO1 0x100020a0
|
||||
const float *MxVector2::GetData() const
|
||||
{
|
||||
return m_data;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002090
|
||||
float *MxVector2::GetData()
|
||||
{
|
||||
return m_data;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002130
|
||||
float MxVector2::Dot(MxVector2 *p_a, float *p_b) const
|
||||
{
|
||||
return DotImpl(p_a->m_data, p_b);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002110
|
||||
float MxVector2::Dot(float *p_a, MxVector2 *p_b) const
|
||||
{
|
||||
return DotImpl(p_a, p_b->m_data);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100020f0
|
||||
float MxVector2::Dot(MxVector2 *p_a, MxVector2 *p_b) const
|
||||
{
|
||||
return DotImpl(p_a->m_data, p_b->m_data);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100020d0
|
||||
float MxVector2::Dot(float *p_a, float *p_b) const
|
||||
{
|
||||
return DotImpl(p_a, p_b);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002160
|
||||
MxResult MxVector2::Unitize()
|
||||
{
|
||||
float sq = LenSquared();
|
||||
if (sq > 0.0f)
|
||||
{
|
||||
float root = sqrt(sq);
|
||||
if (root > 0)
|
||||
{
|
||||
DivScalarImpl(&root);
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100021e0
|
||||
void MxVector2::AddVector(MxVector2 *p_other)
|
||||
{
|
||||
AddVectorImpl(p_other->m_data);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100021d0
|
||||
void MxVector2::AddVector(float *p_other)
|
||||
{
|
||||
AddVectorImpl(p_other);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100021c0
|
||||
void MxVector2::AddScalar(float p_value)
|
||||
{
|
||||
AddScalarImpl(p_value);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002200
|
||||
void MxVector2::SubVector(MxVector2 *p_other)
|
||||
{
|
||||
SubVectorImpl(p_other->m_data);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100021f0
|
||||
void MxVector2::SubVector(float *p_other)
|
||||
{
|
||||
SubVectorImpl(p_other);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002230
|
||||
void MxVector2::MullScalar(float *p_value)
|
||||
{
|
||||
MullScalarImpl(p_value);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002220
|
||||
void MxVector2::MullVector(MxVector2 *p_other)
|
||||
{
|
||||
MullVectorImpl(p_other->m_data);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002210
|
||||
void MxVector2::MullVector(float *p_other)
|
||||
{
|
||||
MullVectorImpl(p_other);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002240
|
||||
void MxVector2::DivScalar(float *p_value)
|
||||
{
|
||||
DivScalarImpl(p_value);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002260
|
||||
void MxVector2::SetVector(MxVector2 *p_other)
|
||||
{
|
||||
EqualsImpl(p_other->m_data);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002250
|
||||
void MxVector2::SetVector(float *p_other)
|
||||
{
|
||||
EqualsImpl(p_other);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10001fa0
|
||||
void MxVector2::AddScalarImpl(float p_value)
|
||||
{
|
||||
m_data[0] += p_value;
|
||||
m_data[1] += p_value;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10001f80
|
||||
void MxVector2::AddVectorImpl(float *p_value)
|
||||
{
|
||||
m_data[0] += p_value[0];
|
||||
m_data[1] += p_value[1];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10001fc0
|
||||
void MxVector2::SubVectorImpl(float *p_value)
|
||||
{
|
||||
m_data[0] -= p_value[0];
|
||||
m_data[1] -= p_value[1];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002000
|
||||
void MxVector2::MullScalarImpl(float *p_value)
|
||||
{
|
||||
m_data[0] *= *p_value;
|
||||
m_data[1] *= *p_value;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10001fe0
|
||||
void MxVector2::MullVectorImpl(float *p_value)
|
||||
{
|
||||
m_data[0] *= p_value[0];
|
||||
m_data[1] *= p_value[1];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002020
|
||||
void MxVector2::DivScalarImpl(float *p_value)
|
||||
{
|
||||
m_data[0] /= *p_value;
|
||||
m_data[1] /= *p_value;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002040
|
||||
float MxVector2::DotImpl(float *p_a, float *p_b) const
|
||||
{
|
||||
return p_b[0] * p_a[0] + p_b[1] * p_a[1];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002070
|
||||
void MxVector2::EqualsImpl(float *p_data)
|
||||
{
|
||||
float *vec = m_data;
|
||||
vec[0] = p_data[0];
|
||||
vec[1] = p_data[1];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100020b0
|
||||
void MxVector2::Clear()
|
||||
{
|
||||
float *vec = m_data;
|
||||
vec[0] = 0.0f;
|
||||
vec[1] = 0.0f;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002150
|
||||
float MxVector2::LenSquared() const
|
||||
{
|
||||
return m_data[0] * m_data[0] + m_data[1] * m_data[1];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10003a90
|
||||
void MxVector3::AddScalarImpl(float p_value)
|
||||
{
|
||||
m_data[0] += p_value;
|
||||
m_data[1] += p_value;
|
||||
m_data[2] += p_value;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10003a60
|
||||
void MxVector3::AddVectorImpl(float *p_value)
|
||||
{
|
||||
m_data[0] += p_value[0];
|
||||
m_data[1] += p_value[1];
|
||||
m_data[2] += p_value[2];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10003ac0
|
||||
void MxVector3::SubVectorImpl(float *p_value)
|
||||
{
|
||||
m_data[0] -= p_value[0];
|
||||
m_data[1] -= p_value[1];
|
||||
m_data[2] -= p_value[2];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10003b20
|
||||
void MxVector3::MullScalarImpl(float *p_value)
|
||||
{
|
||||
m_data[0] *= *p_value;
|
||||
m_data[1] *= *p_value;
|
||||
m_data[2] *= *p_value;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10003af0
|
||||
void MxVector3::MullVectorImpl(float *p_value)
|
||||
{
|
||||
m_data[0] *= p_value[0];
|
||||
m_data[1] *= p_value[1];
|
||||
m_data[2] *= p_value[2];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10003b50
|
||||
void MxVector3::DivScalarImpl(float *p_value)
|
||||
{
|
||||
m_data[0] /= *p_value;
|
||||
m_data[1] /= *p_value;
|
||||
m_data[2] /= *p_value;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10003b80
|
||||
float MxVector3::DotImpl(float *p_a, float *p_b) const
|
||||
{
|
||||
return p_a[0] * p_b[0] + p_a[2] * p_b[2] + p_a[1] * p_b[1];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10003ba0
|
||||
void MxVector3::EqualsImpl(float *p_data)
|
||||
{
|
||||
float *vec = m_data;
|
||||
vec[0] = p_data[0];
|
||||
vec[1] = p_data[1];
|
||||
vec[2] = p_data[2];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10003bc0
|
||||
void MxVector3::Clear()
|
||||
{
|
||||
float *vec = m_data;
|
||||
vec[0] = 0.0f;
|
||||
vec[1] = 0.0f;
|
||||
vec[2] = 0.0f;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10003bd0
|
||||
float MxVector3::LenSquared() const
|
||||
{
|
||||
return m_data[1] * m_data[1] + m_data[0] * m_data[0] + m_data[2] * m_data[2];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002270
|
||||
void MxVector3::EqualsCrossImpl(float* p_a, float* p_b)
|
||||
{
|
||||
m_data[0] = p_a[1] * p_b[2] - p_a[2] * p_b[1];
|
||||
m_data[1] = p_a[2] * p_b[0] - p_a[0] * p_b[2];
|
||||
m_data[2] = p_a[0] * p_b[1] - p_a[1] * p_b[0];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002300
|
||||
void MxVector3::EqualsCross(float *p_a, MxVector3 *p_b)
|
||||
{
|
||||
EqualsCrossImpl(p_a, p_b->m_data);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100022e0
|
||||
void MxVector3::EqualsCross(MxVector3 *p_a, float *p_b)
|
||||
{
|
||||
EqualsCrossImpl(p_a->m_data, p_b);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100022c0
|
||||
void MxVector3::EqualsCross(MxVector3 *p_a, MxVector3 *p_b)
|
||||
{
|
||||
EqualsCrossImpl(p_a->m_data, p_b->m_data);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10003bf0
|
||||
void MxVector3::EqualsScalar(float *p_value)
|
||||
{
|
||||
m_data[0] = *p_value;
|
||||
m_data[1] = *p_value;
|
||||
m_data[2] = *p_value;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100028b0
|
||||
void MxVector4::AddScalarImpl(float p_value)
|
||||
{
|
||||
m_data[0] += p_value;
|
||||
m_data[1] += p_value;
|
||||
m_data[2] += p_value;
|
||||
m_data[3] += p_value;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002870
|
||||
void MxVector4::AddVectorImpl(float *p_value)
|
||||
{
|
||||
m_data[0] += p_value[0];
|
||||
m_data[1] += p_value[1];
|
||||
m_data[2] += p_value[2];
|
||||
m_data[3] += p_value[3];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100028f0
|
||||
void MxVector4::SubVectorImpl(float *p_value)
|
||||
{
|
||||
m_data[0] -= p_value[0];
|
||||
m_data[1] -= p_value[1];
|
||||
m_data[2] -= p_value[2];
|
||||
m_data[3] -= p_value[3];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002970
|
||||
void MxVector4::MullScalarImpl(float *p_value)
|
||||
{
|
||||
m_data[0] *= *p_value;
|
||||
m_data[1] *= *p_value;
|
||||
m_data[2] *= *p_value;
|
||||
m_data[3] *= *p_value;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002930
|
||||
void MxVector4::MullVectorImpl(float *p_value)
|
||||
{
|
||||
m_data[0] *= p_value[0];
|
||||
m_data[1] *= p_value[1];
|
||||
m_data[2] *= p_value[2];
|
||||
m_data[3] *= p_value[3];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100029b0
|
||||
void MxVector4::DivScalarImpl(float *p_value)
|
||||
{
|
||||
m_data[0] /= *p_value;
|
||||
m_data[1] /= *p_value;
|
||||
m_data[2] /= *p_value;
|
||||
m_data[3] /= *p_value;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100029f0
|
||||
float MxVector4::DotImpl(float *p_a, float *p_b) const
|
||||
{
|
||||
return
|
||||
p_a[0] * p_b[0] + p_a[2] * p_b[2] +
|
||||
p_a[1] * p_b[1] + p_a[3] * p_b[3];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002a20
|
||||
void MxVector4::EqualsImpl(float *p_data)
|
||||
{
|
||||
float *vec = m_data;
|
||||
vec[0] = p_data[0];
|
||||
vec[1] = p_data[1];
|
||||
vec[2] = p_data[2];
|
||||
vec[3] = p_data[3];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002b00
|
||||
void MxVector4::Clear()
|
||||
{
|
||||
float *vec = m_data;
|
||||
vec[0] = 0.0f;
|
||||
vec[1] = 0.0f;
|
||||
vec[2] = 0.0f;
|
||||
vec[3] = 0.0f;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002b20
|
||||
float MxVector4::LenSquared() const
|
||||
{
|
||||
return m_data[1] * m_data[1] + m_data[0] * m_data[0] +
|
||||
m_data[2] * m_data[2] + m_data[3] * m_data[3];
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002b40
|
||||
void MxVector4::EqualsScalar(float *p_value)
|
||||
{
|
||||
m_data[0] = *p_value;
|
||||
m_data[1] = *p_value;
|
||||
m_data[2] = *p_value;
|
||||
m_data[3] = *p_value;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002ae0 STUB
|
||||
void MxVector4::unk1(MxVector4 *p_a, float *p_b)
|
||||
{
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002a40
|
||||
void MxVector4::SetMatrixProduct(float *p_vec, float *p_mat)
|
||||
{
|
||||
m_data[0] =
|
||||
p_vec[0] * p_mat[0] + p_vec[1] * p_mat[4] +
|
||||
p_vec[2] * p_mat[8] + p_vec[3] * p_mat[12];
|
||||
m_data[1] =
|
||||
p_vec[0] * p_mat[1] + p_vec[1] * p_mat[5] +
|
||||
p_vec[2] * p_mat[9] + p_vec[4] * p_mat[13];
|
||||
m_data[2] =
|
||||
p_vec[0] * p_mat[2] + p_vec[1] * p_mat[6] +
|
||||
p_vec[2] * p_mat[10] + p_vec[4] * p_mat[14];
|
||||
m_data[3] =
|
||||
p_vec[0] * p_mat[3] + p_vec[1] * p_mat[7] +
|
||||
p_vec[2] * p_mat[11] + p_vec[4] * p_mat[15];
|
||||
}
|
||||
|
||||
// Note close yet, included because I'm at least confident I know what operation
|
||||
// it's trying to do.
|
||||
// OFFSET: LEGO1 0x10002b70 STUB
|
||||
MxResult MxVector4::NormalizeQuaternion()
|
||||
{
|
||||
float *v = m_data;
|
||||
float magnitude = v[1] * v[1] + v[2] * v[2] + v[0] * v[0];
|
||||
if (magnitude > 0.0f)
|
||||
{
|
||||
float theta = v[3] * 0.5f;
|
||||
v[3] = cos(theta);
|
||||
float frac = sin(theta);
|
||||
magnitude = frac / sqrt(magnitude);
|
||||
v[0] *= magnitude;
|
||||
v[1] *= magnitude;
|
||||
v[2] *= magnitude;
|
||||
return SUCCESS;
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10002bf0 STUB
|
||||
void MxVector4::UnknownQuaternionOp(MxVector4 *p_a, MxVector4 *p_b)
|
||||
{
|
||||
|
||||
}
|
||||
179
LEGO1/mxvector.h
Normal file
179
LEGO1/mxvector.h
Normal file
@ -0,0 +1,179 @@
|
||||
#ifndef MXVECTOR_H
|
||||
#define MXVECTOR_H
|
||||
|
||||
#include "mxtypes.h"
|
||||
|
||||
// VTABLE 0x100d4288
|
||||
// SIZE 0x8
|
||||
class MxVector2
|
||||
{
|
||||
public:
|
||||
// OFFSET: LEGO1 0x1000c0f0
|
||||
inline MxVector2(float* p_data) { this->SetData(p_data); }
|
||||
|
||||
// vtable + 0x00 (no virtual destructor)
|
||||
virtual void AddScalarImpl(float p_value) = 0;
|
||||
virtual void AddVectorImpl(float *p_value) = 0;
|
||||
virtual void SubVectorImpl(float *p_value) = 0;
|
||||
virtual void MullScalarImpl(float *p_value) = 0;
|
||||
|
||||
// vtable + 0x10
|
||||
virtual void MullVectorImpl(float *p_value) = 0;
|
||||
virtual void DivScalarImpl(float *p_value) = 0;
|
||||
virtual float DotImpl(float *p_a, float *p_b) const = 0;
|
||||
|
||||
// OFFSET: LEGO1 0x10002060
|
||||
virtual void SetData(float *p_data) { this->m_data = p_data; }
|
||||
|
||||
// vtable + 0x20
|
||||
virtual void EqualsImpl(float *p_data) = 0;
|
||||
virtual const float *GetData() const;
|
||||
virtual float *GetData();
|
||||
virtual void Clear() = 0;
|
||||
|
||||
// vtable + 0x30
|
||||
virtual float Dot(MxVector2 *p_a, float *p_b) const;
|
||||
virtual float Dot(float *p_a, MxVector2 *p_b) const;
|
||||
virtual float Dot(MxVector2 *p_a, MxVector2 *p_b) const;
|
||||
virtual float Dot(float *p_a, float *p_b) const;
|
||||
|
||||
// vtable + 0x40
|
||||
virtual float LenSquared() const = 0;
|
||||
virtual MxResult Unitize();
|
||||
|
||||
// vtable + 0x48
|
||||
virtual void AddVector(MxVector2 *p_other);
|
||||
virtual void AddVector(float *p_other);
|
||||
virtual void AddScalar(float p_value);
|
||||
|
||||
// vtable + 0x54
|
||||
virtual void SubVector(MxVector2 *p_other);
|
||||
virtual void SubVector(float *p_other);
|
||||
|
||||
// vtable + 0x5C
|
||||
virtual void MullScalar(float *p_value);
|
||||
virtual void MullVector(MxVector2 *p_other);
|
||||
virtual void MullVector(float *p_other);
|
||||
virtual void DivScalar(float *p_value);
|
||||
|
||||
// vtable + 0x6C
|
||||
virtual void SetVector(MxVector2 *p_other);
|
||||
virtual void SetVector(float *p_other);
|
||||
|
||||
inline float& operator[](size_t idx) { return m_data[idx]; }
|
||||
inline const float operator[](size_t idx) const { return m_data[idx]; }
|
||||
protected:
|
||||
float *m_data;
|
||||
};
|
||||
|
||||
// VTABLE 0x100d4518
|
||||
// SIZE 0x8
|
||||
class MxVector3 : public MxVector2
|
||||
{
|
||||
public:
|
||||
inline MxVector3(float* p_data) : MxVector2(p_data) {}
|
||||
|
||||
void AddScalarImpl(float p_value);
|
||||
|
||||
void AddVectorImpl(float *p_value);
|
||||
|
||||
void SubVectorImpl(float *p_value);
|
||||
void MullScalarImpl(float *p_value);
|
||||
void MullVectorImpl(float *p_value);
|
||||
void DivScalarImpl(float *p_value);
|
||||
float DotImpl(float *p_a, float *p_b) const;
|
||||
|
||||
void EqualsImpl(float *p_data);
|
||||
|
||||
void Clear();
|
||||
|
||||
float LenSquared() const;
|
||||
|
||||
// vtable + 0x74
|
||||
virtual void EqualsCrossImpl(float* p_a, float* p_b);
|
||||
virtual void EqualsCross(float *p_a, MxVector3 *p_b);
|
||||
virtual void EqualsCross(MxVector3 *p_a, float *p_b);
|
||||
virtual void EqualsCross(MxVector3 *p_a, MxVector3 *p_b);
|
||||
virtual void EqualsScalar(float *p_value);
|
||||
};
|
||||
|
||||
// VTABLE 0x100d45a0
|
||||
// SIZE 0x8
|
||||
class MxVector4 : public MxVector3
|
||||
{
|
||||
public:
|
||||
inline MxVector4(float* p_data) : MxVector3(p_data) {}
|
||||
|
||||
void AddScalarImpl(float p_value);
|
||||
|
||||
void AddVectorImpl(float *p_value);
|
||||
|
||||
void SubVectorImpl(float *p_value);
|
||||
void MullScalarImpl(float *p_value);
|
||||
void MullVectorImpl(float *p_value);
|
||||
void DivScalarImpl(float *p_value);
|
||||
float DotImpl(float *p_a, float *p_b) const;
|
||||
|
||||
void EqualsImpl(float *p_data);
|
||||
|
||||
void Clear();
|
||||
|
||||
float LenSquared() const;
|
||||
|
||||
void EqualsScalar(float *p_value);
|
||||
|
||||
// vtable + 0x84
|
||||
virtual void unk1(MxVector4 *p_a, float *p_b);
|
||||
virtual void SetMatrixProduct(float *p_vec, float *p_mat);
|
||||
virtual MxResult NormalizeQuaternion();
|
||||
virtual void UnknownQuaternionOp(MxVector4 *p_a, MxVector4 *p_b);
|
||||
};
|
||||
|
||||
// VTABLE 0x100d4488
|
||||
// SIZE 0x14
|
||||
class MxVector3Data : public MxVector3
|
||||
{
|
||||
public:
|
||||
inline MxVector3Data() : MxVector3(storage) {}
|
||||
inline MxVector3Data(float p_x, float p_y, float p_z)
|
||||
: MxVector3(storage)
|
||||
, x(p_x), y(p_y), z(p_z)
|
||||
{}
|
||||
|
||||
union {
|
||||
float storage[3];
|
||||
struct {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
};
|
||||
};
|
||||
|
||||
void CopyFrom(MxVector3Data &p_other) {
|
||||
EqualsImpl(p_other.m_data);
|
||||
|
||||
float *dest = this->storage;
|
||||
float *src = p_other.storage;
|
||||
for (size_t i = sizeof(storage) / sizeof(float); i > 0; --i)
|
||||
*dest++ = *src++;
|
||||
}
|
||||
};
|
||||
|
||||
// VTABLE 0x100d41e8
|
||||
// SIZE 0x18
|
||||
class MxVector4Data : public MxVector4
|
||||
{
|
||||
public:
|
||||
inline MxVector4Data() : MxVector4(storage) {}
|
||||
union {
|
||||
float storage[4];
|
||||
struct {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
float w;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#endif // MXVECTOR_H
|
||||
@ -25,7 +25,7 @@ int MxVideoManager::Init()
|
||||
{
|
||||
this->m_pDirectDraw = NULL;
|
||||
this->m_unk54 = NULL;
|
||||
this->m_unk58 = NULL;
|
||||
this->m_displaySurface = NULL;
|
||||
this->m_unk5c = 0;
|
||||
this->m_videoParam.SetPalette(NULL);
|
||||
this->m_unk60 = FALSE;
|
||||
@ -45,10 +45,10 @@ MxLong MxVideoManager::RealizePalette(MxPalette *p_palette)
|
||||
|
||||
this->m_criticalSection.Enter();
|
||||
|
||||
if (p_palette && this->m_videoParam.GetPalette())
|
||||
{
|
||||
if (p_palette && this->m_videoParam.GetPalette()) {
|
||||
p_palette->GetEntries(paletteEntries);
|
||||
// TODO
|
||||
this->m_videoParam.GetPalette()->SetEntries(paletteEntries);
|
||||
this->m_displaySurface->SetPalette(this->m_videoParam.GetPalette());
|
||||
}
|
||||
|
||||
this->m_criticalSection.Leave();
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
#define MXVIDEOMANAGER_H
|
||||
|
||||
#include "mxunknown100dc6b0.h"
|
||||
#include "mxdisplaysurface.h"
|
||||
#include "mxvideoparam.h"
|
||||
|
||||
// VTABLE 0x100dc810
|
||||
@ -26,7 +27,7 @@ class MxVideoManager : public MxUnknown100dc6b0
|
||||
MxVideoParam m_videoParam;
|
||||
LPDIRECTDRAW m_pDirectDraw;
|
||||
LPDIRECTDRAWSURFACE m_unk54;
|
||||
void* m_unk58;
|
||||
MxDisplaySurface *m_displaySurface;
|
||||
int m_unk5c;
|
||||
MxBool m_unk60;
|
||||
};
|
||||
|
||||
@ -1,13 +1,30 @@
|
||||
#include "pizza.h"
|
||||
|
||||
// OFFSET: LEGO1 0x10037ef0 STUB
|
||||
#include "decomp.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(Pizza, 0x9c);
|
||||
|
||||
// OFFSET: LEGO1 0x10037ef0
|
||||
Pizza::Pizza()
|
||||
{
|
||||
// TODO
|
||||
// FIXME: This inherits from LegoActor, probably why this isn't matching
|
||||
this->m_unk80 = 0;
|
||||
this->m_unk84 = 0;
|
||||
this->m_unk88 = 0;
|
||||
this->m_unk8c = -1;
|
||||
this->m_unk98 = 0;
|
||||
this->m_unk90 = 0x80000000;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10038100 STUB
|
||||
// OFFSET: LEGO1 0x10038100
|
||||
Pizza::~Pizza()
|
||||
{
|
||||
// TODO
|
||||
TickleManager()->UnregisterClient(this);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100388a0
|
||||
MxResult Pizza::Tickle()
|
||||
{
|
||||
// TODO
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@ -2,6 +2,10 @@
|
||||
#define PIZZA_H
|
||||
|
||||
#include "isleactor.h"
|
||||
#include "mxcore.h"
|
||||
#include "mxomni.h"
|
||||
#include "mxticklemanager.h"
|
||||
#include "mxtypes.h"
|
||||
|
||||
// VTABLE 0x100d7380
|
||||
// SIZE 0x9c
|
||||
@ -11,6 +15,30 @@ class Pizza : public IsleActor
|
||||
Pizza();
|
||||
virtual ~Pizza() override;
|
||||
|
||||
virtual MxResult Tickle() override; // vtable+08
|
||||
|
||||
// OFFSET: LEGO1 0x10037f90
|
||||
inline const char *ClassName() const //vtable+0c
|
||||
{
|
||||
// 0x100f038c
|
||||
return "Pizza";
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10037fa0
|
||||
inline MxBool Pizza::IsA(const char *name) const override //vtable+10
|
||||
{
|
||||
return !strcmp(name, Pizza::ClassName()) || IsleActor::IsA(name);
|
||||
}
|
||||
private:
|
||||
MxS32 m_unk78;
|
||||
MxS32 m_unk7c;
|
||||
MxS32 m_unk80;
|
||||
MxS32 m_unk84;
|
||||
MxS32 m_unk88;
|
||||
MxS32 m_unk8c;
|
||||
MxU32 m_unk90;
|
||||
MxS32 m_unk94;
|
||||
MxS32 m_unk98;
|
||||
};
|
||||
|
||||
#endif // PIZZA_H
|
||||
|
||||
@ -24,10 +24,9 @@ These instructions will outline how to compile this repository into an accurate
|
||||
You will need the following software installed:
|
||||
|
||||
- Microsoft Visual C++ 4.2. This can be found on many abandonware sites, but the installer can be a little iffy on modern versions of Windows. For convenience, I made a [portable version](https://github.com/itsmattkc/msvc420) that can be downloaded and used quickly instead.
|
||||
- DirectX 5 SDK. Similarly, this can be found on many abandonware sites.
|
||||
- [CMake](https://cmake.org/). A copy is often included with the "Desktop development with C++" workload in newer versions of Visual Studio, however it can also be installed as a standalone app.
|
||||
|
||||
#### Compiling From Command Line
|
||||
#### Compiling
|
||||
|
||||
1. Open a Command Prompt (`cmd`).
|
||||
1. From Visual C++ 4.2, run `BIN/VCVARS32.BAT x86` to populate the path and other environment variables for compiling with MSVC.
|
||||
@ -37,6 +36,7 @@ You will need the following software installed:
|
||||
```
|
||||
cmake <path-to-source> -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
```
|
||||
- **Visual C++ 4.2 has issues with paths containing spaces**. If you get configure or build errors, make sure neither CMake, the repository, nor Visual C++ 4.2 is in a path that contains spaces.
|
||||
- Replace `<path-to-source>` with the source repository. Can be `..` if your build folder is inside the source repository.
|
||||
- `RelWithDebInfo` is recommended because it will produce debug symbols useful for further decompilation work. However, you can change this to `Release` if you don't need them. `Debug` builds are not recommended because they are unlikely to be compatible with the retail `LEGO1.DLL`, which is currently the only way to really use this decomp.
|
||||
- `NMake Makefiles` is most recommended because it will be immediately compatible with Visual C++ 4.2. For faster builds, you can use `Ninja` (if you have it installed), however due to limitations in Visual C++ 4.2, you can only build `Release` builds this way (debug symbols cannot be generated with `Ninja`).
|
||||
|
||||
@ -1,34 +0,0 @@
|
||||
[InstallShield Silent]
|
||||
Version=v5.00.000
|
||||
File=Response File
|
||||
[DlgOrder]
|
||||
Dlg0=SdWelcome-0
|
||||
Count=7
|
||||
Dlg1=SdLicense-0
|
||||
Dlg2=SdSetupTypeEx-0
|
||||
Dlg3=SdAskDestPath-0
|
||||
Dlg4=SdSelectFolder-0
|
||||
Dlg5=SdStartCopy-0
|
||||
Dlg6=SdFinish-0
|
||||
[SdWelcome-0]
|
||||
Result=1
|
||||
[SdLicense-0]
|
||||
Result=1
|
||||
[SdSetupTypeEx-0]
|
||||
Result=Compact
|
||||
[SdAskDestPath-0]
|
||||
szDir=C:\dxsdk
|
||||
Result=1
|
||||
[SdSelectFolder-0]
|
||||
szFolder=Microsoft DirectX 5 SDK
|
||||
Result=1
|
||||
[SdStartCopy-0]
|
||||
Result=1
|
||||
[Application]
|
||||
Name=the Microsoft DirectX 5 SDK
|
||||
Version=5
|
||||
Company=Microsoft
|
||||
[SdFinish-0]
|
||||
Result=1
|
||||
bOpt1=0
|
||||
bOpt2=0
|
||||
@ -343,14 +343,15 @@ def replace_register(lines: list[str], start_line: int, reg: str, replacement: s
|
||||
|
||||
# Is it possible to make new_asm the same as original_asm by swapping registers?
|
||||
def can_resolve_register_differences(original_asm, new_asm):
|
||||
# Split the ASM on spaces to get more granularity, and so
|
||||
# that we don't modify the original arrays passed in.
|
||||
original_asm = [part for line in original_asm for part in line.split()]
|
||||
new_asm = [part for line in new_asm for part in line.split()]
|
||||
|
||||
# Swapping ain't gonna help if the lengths are different
|
||||
if len(original_asm) != len(new_asm):
|
||||
return False
|
||||
|
||||
# Make copies so we don't modify the original
|
||||
original_asm = original_asm.copy()
|
||||
new_asm = new_asm.copy()
|
||||
|
||||
# Look for the mismatching lines
|
||||
for i in range(len(original_asm)):
|
||||
new_line = new_asm[i]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user