1
0
mirror of https://github.com/DxWnd/DxWnd.reloaded synced 2024-12-30 09:25:35 +01:00

v2_02_63_src

Former-commit-id: 0f68bfb462aca829816388c0326ff5b68a2c0583
This commit is contained in:
gho tik 2014-03-15 12:38:56 -04:00 committed by Refael ACkermann
parent 0075eb9b13
commit 330f3e8013
41 changed files with 263 additions and 7312 deletions

View File

@ -123,7 +123,7 @@
#define DISABLEFOGGING 0x00000080 // Disable D3D fogging
#define NOPOWER2FIX 0x00000100 // Handle textures whose size is not a power of 2 (32, 64, 128 ...)
#define NOPERFCOUNTER 0x00000200 // Disables the GetPerfCounter performance metrics API,as if it was not supported....
#define ADDPROXYLIBS 0x00000400 // Add proxy libs to otherwise hook-resilient system libraries (e.g. d3d9.dll)
//#define ADDPROXYLIBS 0x00000400 // Add proxy libs to otherwise hook-resilient system libraries (e.g. d3d9.dll)
#define INTERCEPTRDTSC 0x00000800 // Intercapts RDTSC opcodes to hook at assembly level
#define LIMITSCREENRES 0x00001000 // Limit available screen resolution up to defined maximum
#define NOFILLRECT 0x00002000 // Suppress FillRect calls
@ -131,6 +131,7 @@
#define HIDEDESKTOP 0x00008000 // Hide desktop background
#define STRETCHTIMERS 0x00010000 // Enables timers stretching when TIMESTRETCH is on
#define NOFLIPEMULATION 0x00020000 // Compensate the effect of Flip-ping through Blt operations
#define NOTEXTURES 0x00040000 // Disabled (whitened) textures
// logging Tflags DWORD:
#define OUTTRACE 0x00000001 // enables tracing to dxwnd.log in general

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2886c8ffed47b9881f488c1ff15fac4653f83576d77cb1f4462caf7ebe2ded94
size 556544

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d99c6a80bd9c8ad4d82a995f662236e7a452ad2317a55eda538c7d2ea4ed3bb6
size 463872
oid sha256:61f2f3aab11ece5bb74593c0728de708356a37ad7b7bc1e45b03ae361c87419c
size 464896

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9eab6b03785ebc8bf84e56c3a16897517ad0b7b5f77bdba87630c6157b63dba6
oid sha256:7fb261f28e57f5293398249aa0f1f27910f581d0cd30c6fb2108160f5da36f01
size 535552

File diff suppressed because it is too large Load Diff

View File

@ -1,15 +1,15 @@
[target]
title0=Black Thorn
path0=D:\Games\Red Storm Entertainment\Rogue Spear\BlackThorn.exe
path0=D:\Games\Black Thorn\BlackThorn.exe
module0=
opengllib0=
ver0=0
coord0=0
flag0=939540517
flag0=687882276
flagg0=134217728
flagh0=20
flagi0=36
tflag0=6470
flagi0=131076
tflag0=6210
initx0=0
inity0=0
minx0=0

View File

@ -0,0 +1,26 @@
[target]
title0=Jumpgate Classic
path0=D:\Games\Jumpgate\Jumpgate\jumpgate.exe
module0=
opengllib0=
ver0=0
coord0=0
flag0=134234656
flagg0=1207959568
flagh0=84
flagi0=2
tflag0=6146
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1

View File

@ -412,5 +412,9 @@ v2.02.62
fixed d3d7 CreateDevice hook and d3d7 rendering options (wireframe, disablefogging, zbufferalways)
fixed doublebuffer emulation - avoid returning the backbuffer when zbuffer is requested. Fixes rendering problems of many games!
v2.02.63
fixed d3d hooking for Reset and GetDirect3D methods: now Jumpgate works at any available resolution, and the "Add proxy libs" option is no longer necessary
fixed "Compensate Flip emulation" option for non emulated surface mode: fixes mouse artifacts for "Rogue Spear Black Thorn"
added preliminary handling for "Disable Textures" option

File diff suppressed because it is too large Load Diff

View File

@ -1,71 +0,0 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx9.h
// Content: D3DX utility library
//
//////////////////////////////////////////////////////////////////////////////
#ifdef __D3DX_INTERNAL__
#error Incorrect D3DX header used
#endif
#ifndef __D3DX9_H__
#define __D3DX9_H__
// Defines
#include <limits.h>
#define D3DX_DEFAULT ((UINT) -1)
#define D3DX_DEFAULT_NONPOW2 ((UINT) -2)
#define D3DX_DEFAULT_FLOAT FLT_MAX
#ifndef D3DXINLINE
#ifdef _MSC_VER
#if (_MSC_VER >= 1200)
#define D3DXINLINE __forceinline
#else
#define D3DXINLINE __inline
#endif
#else
#ifdef __cplusplus
#define D3DXINLINE inline
#else
#define D3DXINLINE
#endif
#endif
#endif
// Includes
#include "d3d9.h"
#include "d3dx9math.h"
#include "d3dx9core.h"
#include "d3dx9mesh.h"
#include "d3dx9tex.h"
#include "d3dx9shader.h"
#include "d3dx9effect.h"
#include "d3dx9shape.h"
#include "d3dx9anim.h"
// Errors
#define _FACDD 0x876
#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
enum _D3DXERR {
D3DXERR_CANNOTMODIFYINDEXBUFFER = MAKE_DDHRESULT(2900),
D3DXERR_INVALIDMESH = MAKE_DDHRESULT(2901),
D3DXERR_CANNOTATTRSORT = MAKE_DDHRESULT(2902),
D3DXERR_SKINNINGNOTSUPPORTED = MAKE_DDHRESULT(2903),
D3DXERR_TOOMANYINFLUENCES = MAKE_DDHRESULT(2904),
D3DXERR_INVALIDDATA = MAKE_DDHRESULT(2905),
D3DXERR_LOADEDMESHASNODATA = MAKE_DDHRESULT(2906),
D3DXERR_DUPLICATENAMEDFRAGMENT = MAKE_DDHRESULT(2907),
};
#endif //__D3DX9_H__

Binary file not shown.

View File

@ -1,154 +0,0 @@
// myIDirect3D9.cpp
#include "StdAfx.h"
#include "stdio.h"
#define trace if(log) fprintf
extern FILE *log;
myIDirect3D9::myIDirect3D9(IDirect3D9 *pOriginal)
{
m_pIDirect3D9 = pOriginal;
}
myIDirect3D9::~myIDirect3D9(void)
{
}
HRESULT __stdcall myIDirect3D9::QueryInterface(REFIID riid, void** ppvObj)
{
*ppvObj = NULL;
// call this to increase AddRef at original object
// and to check if such an interface is there
HRESULT hRes = m_pIDirect3D9->QueryInterface(riid, ppvObj);
if (hRes == NOERROR) // if OK, send our "fake" address
{
*ppvObj = this;
}
return hRes;
}
ULONG __stdcall myIDirect3D9::AddRef(void)
{
return(m_pIDirect3D9->AddRef());
}
ULONG __stdcall myIDirect3D9::Release(void)
{
extern myIDirect3D9* gl_pmyIDirect3D9;
// call original routine
ULONG count = m_pIDirect3D9->Release();
// in case no further Ref is there, the Original Object has deleted itself
// so do we here
if (count == 0){
gl_pmyIDirect3D9 = NULL;
delete(this);
}
return(count);
}
HRESULT __stdcall myIDirect3D9::RegisterSoftwareDevice(void* pInitializeFunction)
{
trace(log, "IDirect3D9::RegisterSoftwareDevice\n");
return(m_pIDirect3D9->RegisterSoftwareDevice(pInitializeFunction));
}
UINT __stdcall myIDirect3D9::GetAdapterCount(void)
{
trace(log, "IDirect3D9::GetAdapterCount\n");
return(m_pIDirect3D9->GetAdapterCount());
}
HRESULT __stdcall myIDirect3D9::GetAdapterIdentifier(UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier)
{
trace(log, "IDirect3D9::GetAdapterIdentifier\n");
return(m_pIDirect3D9->GetAdapterIdentifier(Adapter,Flags,pIdentifier));
}
UINT __stdcall myIDirect3D9::GetAdapterModeCount(UINT Adapter, D3DFORMAT Format)
{
trace(log, "IDirect3D9::GetAdapterModeCount\n");
return(m_pIDirect3D9->GetAdapterModeCount(Adapter, Format));
}
HRESULT __stdcall myIDirect3D9::EnumAdapterModes(UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode)
{
trace(log, "IDirect3D9::EnumAdapterModes\n");
return(m_pIDirect3D9->EnumAdapterModes(Adapter,Format,Mode,pMode));
}
HRESULT __stdcall myIDirect3D9::GetAdapterDisplayMode( UINT Adapter,D3DDISPLAYMODE* pMode)
{
trace(log, "IDirect3D9::GetAdapterDisplayMode\n");
return(m_pIDirect3D9->GetAdapterDisplayMode(Adapter,pMode));
}
HRESULT __stdcall myIDirect3D9::CheckDeviceType(UINT iAdapter,D3DDEVTYPE DevType,D3DFORMAT DisplayFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed)
{
trace(log, "IDirect3D9::CheckDeviceType\n");
return(m_pIDirect3D9->CheckDeviceType(iAdapter,DevType,DisplayFormat,BackBufferFormat,bWindowed));
}
HRESULT __stdcall myIDirect3D9::CheckDeviceFormat(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat)
{
trace(log, "IDirect3D9::CheckDeviceFormat\n");
return(m_pIDirect3D9->CheckDeviceFormat(Adapter,DeviceType,AdapterFormat,Usage,RType,CheckFormat));
}
HRESULT __stdcall myIDirect3D9::CheckDeviceMultiSampleType(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels)
{
trace(log, "IDirect3D9::CheckDeviceMultiSampleType\n");
return(m_pIDirect3D9->CheckDeviceMultiSampleType(Adapter,DeviceType,SurfaceFormat,Windowed,MultiSampleType,pQualityLevels));
}
HRESULT __stdcall myIDirect3D9::CheckDepthStencilMatch(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat)
{
trace(log, "IDirect3D9::CheckDepthStencilMatch\n");
return(m_pIDirect3D9->CheckDepthStencilMatch(Adapter,DeviceType,AdapterFormat,RenderTargetFormat,DepthStencilFormat));
}
HRESULT __stdcall myIDirect3D9::CheckDeviceFormatConversion(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SourceFormat,D3DFORMAT TargetFormat)
{
trace(log, "IDirect3D9::CheckDeviceFormatConversion\n");
return(m_pIDirect3D9->CheckDeviceFormatConversion(Adapter,DeviceType,SourceFormat,TargetFormat));
}
HRESULT __stdcall myIDirect3D9::GetDeviceCaps(UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps)
{
trace(log, "IDirect3D9::GetDeviceCaps\n");
return(m_pIDirect3D9->GetDeviceCaps(Adapter,DeviceType,pCaps));
}
HMONITOR __stdcall myIDirect3D9::GetAdapterMonitor(UINT Adapter)
{
trace(log, "IDirect3D9::GetAdapterMonitor\n");
return(m_pIDirect3D9->GetAdapterMonitor(Adapter));
}
HRESULT __stdcall myIDirect3D9::CreateDevice(UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface)
{
trace(log, "IDirect3D9::CreateDevice\n");
// global var
extern myIDirect3DDevice9* gl_pmyIDirect3DDevice9;
// we intercept this call and provide our own "fake" Device Object
HRESULT hres = m_pIDirect3D9->CreateDevice( Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, ppReturnedDeviceInterface);
// Create our own Device object and store it in global pointer
// note: the object will delete itself once Ref count is zero (similar to COM objects)
gl_pmyIDirect3DDevice9 = new myIDirect3DDevice9(*ppReturnedDeviceInterface);
// store our pointer (the fake one) for returning it to the calling progam
*ppReturnedDeviceInterface = gl_pmyIDirect3DDevice9;
return(hres);
}

View File

@ -1,31 +0,0 @@
#pragma once
class myIDirect3D9 : public IDirect3D9
{
public:
myIDirect3D9(IDirect3D9 *pOriginal);
virtual ~myIDirect3D9(void);
// The original DX9 function definitions
HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj);
ULONG __stdcall AddRef(void);
ULONG __stdcall Release(void);
HRESULT __stdcall RegisterSoftwareDevice(void* pInitializeFunction);
UINT __stdcall GetAdapterCount(void);
HRESULT __stdcall GetAdapterIdentifier(UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier) ;
UINT __stdcall GetAdapterModeCount(UINT Adapter, D3DFORMAT Format);
HRESULT __stdcall EnumAdapterModes(UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode) ;
HRESULT __stdcall GetAdapterDisplayMode( UINT Adapter,D3DDISPLAYMODE* pMode) ;
HRESULT __stdcall CheckDeviceType(UINT iAdapter,D3DDEVTYPE DevType,D3DFORMAT DisplayFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed) ;
HRESULT __stdcall CheckDeviceFormat(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) ;
HRESULT __stdcall CheckDeviceMultiSampleType(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels) ;
HRESULT __stdcall CheckDepthStencilMatch(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) ;
HRESULT __stdcall CheckDeviceFormatConversion(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SourceFormat,D3DFORMAT TargetFormat);
HRESULT __stdcall GetDeviceCaps(UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps) ;
HMONITOR __stdcall GetAdapterMonitor(UINT Adapter) ;
HRESULT __stdcall CreateDevice(UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface) ;
// The original DX9 function definitions
private:
IDirect3D9 *m_pIDirect3D9;
};

View File

@ -1,776 +0,0 @@
#include "StdAfx.h"
#include "myIDirect3DDevice9.h"
#include "stdio.h"
#define trace if(log) fprintf
extern FILE *log;
myIDirect3DDevice9::myIDirect3DDevice9(IDirect3DDevice9* pOriginal)
{
m_pIDirect3DDevice9 = pOriginal; // store the pointer to original object
}
myIDirect3DDevice9::~myIDirect3DDevice9(void)
{
}
HRESULT myIDirect3DDevice9::QueryInterface (REFIID riid, void** ppvObj)
{
trace(log, "IDirect3DDevice9::QueryInterface\n");
// check if original dll can provide interface. then send *our* address
*ppvObj = NULL;
HRESULT hRes = m_pIDirect3DDevice9->QueryInterface(riid, ppvObj);
if (hRes == NOERROR)
{
*ppvObj = this;
}
return hRes;
}
ULONG myIDirect3DDevice9::AddRef(void)
{
trace(log, "IDirect3DDevice9::AddRef\n");
return(m_pIDirect3DDevice9->AddRef());
}
ULONG myIDirect3DDevice9::Release(void)
{
trace(log, "IDirect3DDevice9::Release\n");
// ATTENTION: This is a booby-trap ! Watch out !
// If we create our own sprites, surfaces, etc. (thus increasing the ref counter
// by external action), we need to delete that objects before calling the original
// Release function
// global var
extern myIDirect3DDevice9* gl_pmyIDirect3DDevice9;
// release/delete own objects
// .....
// Calling original function now
ULONG count = m_pIDirect3DDevice9->Release();
// now, the Original Object has deleted itself, so do we here
if(count == 0){
gl_pmyIDirect3DDevice9 = NULL;
delete(this); // destructor will be called automatically
}
return (count);
}
HRESULT myIDirect3DDevice9::TestCooperativeLevel(void)
{
trace(log, "IDirect3DDevice9::TestCooperativeLevel\n");
return(m_pIDirect3DDevice9->TestCooperativeLevel());
}
UINT myIDirect3DDevice9::GetAvailableTextureMem(void)
{
trace(log, "IDirect3DDevice9::GetAvailableTextureMem\n");
return(m_pIDirect3DDevice9->GetAvailableTextureMem());
}
HRESULT myIDirect3DDevice9::EvictManagedResources(void)
{
trace(log, "IDirect3DDevice9::EvictManagedResources\n");
return(m_pIDirect3DDevice9->EvictManagedResources());
}
HRESULT myIDirect3DDevice9::GetDirect3D(IDirect3D9** ppD3D9)
{
trace(log, "IDirect3DDevice9::GetDirect3D\n");
return(m_pIDirect3DDevice9->GetDirect3D(ppD3D9));
}
HRESULT myIDirect3DDevice9::GetDeviceCaps(D3DCAPS9* pCaps)
{
trace(log, "IDirect3DDevice9::GetDeviceCaps\n");
return(m_pIDirect3DDevice9->GetDeviceCaps(pCaps));
}
HRESULT myIDirect3DDevice9::GetDisplayMode(UINT iSwapChain,D3DDISPLAYMODE* pMode)
{
trace(log, "IDirect3DDevice9::GetDisplayMode\n");
return(m_pIDirect3DDevice9->GetDisplayMode(iSwapChain, pMode));
}
HRESULT myIDirect3DDevice9::GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *pParameters)
{
trace(log, "IDirect3DDevice9::GetCreationParameters\n");
return(m_pIDirect3DDevice9->GetCreationParameters(pParameters));
}
HRESULT myIDirect3DDevice9::SetCursorProperties(UINT XHotSpot,UINT YHotSpot,IDirect3DSurface9* pCursorBitmap)
{
trace(log, "IDirect3DDevice9::SetCursorProperties\n");
return(m_pIDirect3DDevice9->SetCursorProperties(XHotSpot,YHotSpot,pCursorBitmap));
}
void myIDirect3DDevice9::SetCursorPosition(int X,int Y,DWORD Flags)
{
trace(log, "IDirect3DDevice9::SetCursorPosition\n");
return(m_pIDirect3DDevice9->SetCursorPosition(X,Y,Flags));
}
BOOL myIDirect3DDevice9::ShowCursor(BOOL bShow)
{
trace(log, "IDirect3DDevice9::ShowCursor\n");
return(m_pIDirect3DDevice9->ShowCursor(bShow));
}
HRESULT myIDirect3DDevice9::CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain9** pSwapChain)
{
trace(log, "IDirect3DDevice9::CreateAdditionalSwapChain\n");
return(m_pIDirect3DDevice9->CreateAdditionalSwapChain(pPresentationParameters,pSwapChain));
}
HRESULT myIDirect3DDevice9::GetSwapChain(UINT iSwapChain,IDirect3DSwapChain9** pSwapChain)
{
trace(log, "IDirect3DDevice9::GetSwapChain\n");
return(m_pIDirect3DDevice9->GetSwapChain(iSwapChain,pSwapChain));
}
UINT myIDirect3DDevice9::GetNumberOfSwapChains(void)
{
trace(log, "IDirect3DDevice9::GetNumberOfSwapChains\n");
return(m_pIDirect3DDevice9->GetNumberOfSwapChains());
}
HRESULT myIDirect3DDevice9::Reset(D3DPRESENT_PARAMETERS* pPresentationParameters)
{
trace(log, "IDirect3DDevice9::Reset\n");
return(m_pIDirect3DDevice9->Reset(pPresentationParameters));
}
HRESULT myIDirect3DDevice9::Present(CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion)
{
trace(log, "IDirect3DDevice9::Present\n");
// we may want to draw own things here before flipping surfaces
// ... draw own stuff ...
// this->ShowWeAreHere();
// call original routine
HRESULT hres = m_pIDirect3DDevice9->Present( pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
return (hres);
}
HRESULT myIDirect3DDevice9::GetBackBuffer(UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer)
{
trace(log, "IDirect3DDevice9::GetBackBuffer\n");
return(m_pIDirect3DDevice9->GetBackBuffer(iSwapChain,iBackBuffer,Type,ppBackBuffer));
}
HRESULT myIDirect3DDevice9::GetRasterStatus(UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus)
{
trace(log, "IDirect3DDevice9::GetRasterStatus\n");
return(m_pIDirect3DDevice9->GetRasterStatus(iSwapChain,pRasterStatus));
}
HRESULT myIDirect3DDevice9::SetDialogBoxMode(BOOL bEnableDialogs)
{
trace(log, "IDirect3DDevice9::SetDialogBoxMode\n");
return(m_pIDirect3DDevice9->SetDialogBoxMode(bEnableDialogs));
}
void myIDirect3DDevice9::SetGammaRamp(UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp)
{
trace(log, "IDirect3DDevice9::SetGammaRamp\n");
return(m_pIDirect3DDevice9->SetGammaRamp(iSwapChain,Flags,pRamp));
}
void myIDirect3DDevice9::GetGammaRamp(UINT iSwapChain,D3DGAMMARAMP* pRamp)
{
trace(log, "IDirect3DDevice9::GetGammaRamp\n");
return(m_pIDirect3DDevice9->GetGammaRamp(iSwapChain,pRamp));
}
HRESULT myIDirect3DDevice9::CreateTexture(UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle)
{
trace(log, "IDirect3DDevice9::CreateTexture\n");
return(m_pIDirect3DDevice9->CreateTexture(Width,Height,Levels,Usage,Format,Pool,ppTexture,pSharedHandle));
}
HRESULT myIDirect3DDevice9::CreateVolumeTexture(UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle)
{
trace(log, "IDirect3DDevice9::CreateVolumeTexture\n");
return(m_pIDirect3DDevice9->CreateVolumeTexture(Width,Height,Depth,Levels,Usage,Format,Pool,ppVolumeTexture,pSharedHandle));
}
HRESULT myIDirect3DDevice9::CreateCubeTexture(UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle)
{
trace(log, "IDirect3DDevice9::CreateCubeTexture\n");
return(m_pIDirect3DDevice9->CreateCubeTexture(EdgeLength,Levels,Usage,Format,Pool,ppCubeTexture,pSharedHandle));
}
HRESULT myIDirect3DDevice9::CreateVertexBuffer(UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle)
{
trace(log, "IDirect3DDevice9::CreateVertexBuffer\n");
return(m_pIDirect3DDevice9->CreateVertexBuffer(Length,Usage,FVF,Pool,ppVertexBuffer,pSharedHandle));
}
HRESULT myIDirect3DDevice9::CreateIndexBuffer(UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle)
{
trace(log, "IDirect3DDevice9::CreateIndexBuffer\n");
return(m_pIDirect3DDevice9->CreateIndexBuffer(Length,Usage,Format,Pool,ppIndexBuffer,pSharedHandle));
}
HRESULT myIDirect3DDevice9::CreateRenderTarget(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle)
{
trace(log, "IDirect3DDevice9::CreateRenderTarget\n");
return(m_pIDirect3DDevice9->CreateRenderTarget(Width,Height,Format,MultiSample,MultisampleQuality,Lockable,ppSurface,pSharedHandle));
}
HRESULT myIDirect3DDevice9::CreateDepthStencilSurface(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle)
{
trace(log, "IDirect3DDevice9::CreateDepthStencilSurface\n");
return(m_pIDirect3DDevice9->CreateDepthStencilSurface(Width,Height,Format,MultiSample,MultisampleQuality,Discard,ppSurface,pSharedHandle));
}
HRESULT myIDirect3DDevice9::UpdateSurface(IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint)
{
trace(log, "IDirect3DDevice9::UpdateSurface\n");
return(m_pIDirect3DDevice9->UpdateSurface(pSourceSurface,pSourceRect,pDestinationSurface,pDestPoint));
}
HRESULT myIDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9* pSourceTexture,IDirect3DBaseTexture9* pDestinationTexture)
{
trace(log, "IDirect3DDevice9::UpdateTexture\n");
return(m_pIDirect3DDevice9->UpdateTexture(pSourceTexture,pDestinationTexture));
}
HRESULT myIDirect3DDevice9::GetRenderTargetData(IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface)
{
trace(log, "IDirect3DDevice9::GetRenderTargetData\n");
return(m_pIDirect3DDevice9->GetRenderTargetData(pRenderTarget,pDestSurface));
}
HRESULT myIDirect3DDevice9::GetFrontBufferData(UINT iSwapChain,IDirect3DSurface9* pDestSurface)
{
trace(log, "IDirect3DDevice9::GetFrontBufferData\n");
return(m_pIDirect3DDevice9->GetFrontBufferData(iSwapChain,pDestSurface));
}
HRESULT myIDirect3DDevice9::StretchRect(IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter)
{
trace(log, "IDirect3DDevice9::StretchRect\n");
return(m_pIDirect3DDevice9->StretchRect(pSourceSurface,pSourceRect,pDestSurface,pDestRect,Filter));
}
HRESULT myIDirect3DDevice9::ColorFill(IDirect3DSurface9* pSurface,CONST RECT* pRect,D3DCOLOR color)
{
trace(log, "IDirect3DDevice9::ColorFill\n");
return(m_pIDirect3DDevice9->ColorFill(pSurface,pRect,color));
}
HRESULT myIDirect3DDevice9::CreateOffscreenPlainSurface(UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle)
{
trace(log, "IDirect3DDevice9::CreateOffscreenPlainSurface\n");
return(m_pIDirect3DDevice9->CreateOffscreenPlainSurface(Width,Height,Format,Pool,ppSurface,pSharedHandle));
}
HRESULT myIDirect3DDevice9::SetRenderTarget(DWORD RenderTargetIndex,IDirect3DSurface9* pRenderTarget)
{
trace(log, "IDirect3DDevice9::SetRenderTarget\n");
return(m_pIDirect3DDevice9->SetRenderTarget(RenderTargetIndex,pRenderTarget));
}
HRESULT myIDirect3DDevice9::GetRenderTarget(DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget)
{
trace(log, "IDirect3DDevice9::GetRenderTarget\n");
return(m_pIDirect3DDevice9->GetRenderTarget(RenderTargetIndex,ppRenderTarget));
}
HRESULT myIDirect3DDevice9::SetDepthStencilSurface(IDirect3DSurface9* pNewZStencil)
{
trace(log, "IDirect3DDevice9::SetDepthStencilSurface\n");
return(m_pIDirect3DDevice9->SetDepthStencilSurface(pNewZStencil));
}
HRESULT myIDirect3DDevice9::GetDepthStencilSurface(IDirect3DSurface9** ppZStencilSurface)
{
trace(log, "IDirect3DDevice9::GetDepthStencilSurface\n");
return(m_pIDirect3DDevice9->GetDepthStencilSurface(ppZStencilSurface));
}
HRESULT myIDirect3DDevice9::BeginScene(void)
{
trace(log, "IDirect3DDevice9::BeginScene\n");
return(m_pIDirect3DDevice9->BeginScene());
}
HRESULT myIDirect3DDevice9::EndScene(void)
{
trace(log, "IDirect3DDevice9::EndScene\n");
return(m_pIDirect3DDevice9->EndScene());
}
HRESULT myIDirect3DDevice9::Clear(DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil)
{
trace(log, "IDirect3DDevice9::Clear\n");
return(m_pIDirect3DDevice9->Clear(Count,pRects,Flags,Color,Z,Stencil));
}
HRESULT myIDirect3DDevice9::SetTransform(D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix)
{
trace(log, "IDirect3DDevice9::SetTransform\n");
return(m_pIDirect3DDevice9->SetTransform(State,pMatrix));
}
HRESULT myIDirect3DDevice9::GetTransform(D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix)
{
trace(log, "IDirect3DDevice9::GetTransform\n");
return(m_pIDirect3DDevice9->GetTransform(State,pMatrix));
}
HRESULT myIDirect3DDevice9::MultiplyTransform(D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix)
{
trace(log, "IDirect3DDevice9::MultiplyTransform\n");
return(m_pIDirect3DDevice9->MultiplyTransform(State,pMatrix));
}
HRESULT myIDirect3DDevice9::SetViewport(CONST D3DVIEWPORT9* pViewport)
{
trace(log, "IDirect3DDevice9::SetViewport\n");
return(m_pIDirect3DDevice9->SetViewport(pViewport));
}
HRESULT myIDirect3DDevice9::GetViewport(D3DVIEWPORT9* pViewport)
{
trace(log, "IDirect3DDevice9::GetViewport\n");
return(m_pIDirect3DDevice9->GetViewport(pViewport));
}
HRESULT myIDirect3DDevice9::SetMaterial(CONST D3DMATERIAL9* pMaterial)
{
trace(log, "IDirect3DDevice9::SetMaterial\n");
return(m_pIDirect3DDevice9->SetMaterial(pMaterial));
}
HRESULT myIDirect3DDevice9::GetMaterial(D3DMATERIAL9* pMaterial)
{
trace(log, "IDirect3DDevice9::GetMaterial\n");
return(m_pIDirect3DDevice9->GetMaterial(pMaterial));
}
HRESULT myIDirect3DDevice9::SetLight(DWORD Index,CONST D3DLIGHT9* pLight)
{
trace(log, "IDirect3DDevice9::SetLight\n");
return(m_pIDirect3DDevice9->SetLight(Index,pLight));
}
HRESULT myIDirect3DDevice9::GetLight(DWORD Index,D3DLIGHT9* pLight)
{
trace(log, "IDirect3DDevice9::GetLight\n");
return(m_pIDirect3DDevice9->GetLight(Index,pLight));
}
HRESULT myIDirect3DDevice9::LightEnable(DWORD Index,BOOL Enable)
{
trace(log, "IDirect3DDevice9::LightEnable\n");
return(m_pIDirect3DDevice9->LightEnable(Index,Enable));
}
HRESULT myIDirect3DDevice9::GetLightEnable(DWORD Index,BOOL* pEnable)
{
trace(log, "IDirect3DDevice9::GetLightEnable\n");
return(m_pIDirect3DDevice9->GetLightEnable(Index, pEnable));
}
HRESULT myIDirect3DDevice9::SetClipPlane(DWORD Index,CONST float* pPlane)
{
trace(log, "IDirect3DDevice9::SetClipPlane\n");
return(m_pIDirect3DDevice9->SetClipPlane(Index, pPlane));
}
HRESULT myIDirect3DDevice9::GetClipPlane(DWORD Index,float* pPlane)
{
trace(log, "IDirect3DDevice9::GetClipPlane\n");
return(m_pIDirect3DDevice9->GetClipPlane(Index,pPlane));
}
HRESULT myIDirect3DDevice9::SetRenderState(D3DRENDERSTATETYPE State,DWORD Value)
{
//trace(log, "IDirect3DDevice9::SetRenderState\n");
return(m_pIDirect3DDevice9->SetRenderState(State, Value));
}
HRESULT myIDirect3DDevice9::GetRenderState(D3DRENDERSTATETYPE State,DWORD* pValue)
{
trace(log, "IDirect3DDevice9::GetRenderState\n");
return(m_pIDirect3DDevice9->GetRenderState(State, pValue));
}
HRESULT myIDirect3DDevice9::CreateStateBlock(D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB)
{
trace(log, "IDirect3DDevice9::CreateStateBlock\n");
return(m_pIDirect3DDevice9->CreateStateBlock(Type,ppSB));
}
HRESULT myIDirect3DDevice9::BeginStateBlock(void)
{
trace(log, "IDirect3DDevice9::BeginStateBlock\n");
return(m_pIDirect3DDevice9->BeginStateBlock());
}
HRESULT myIDirect3DDevice9::EndStateBlock(IDirect3DStateBlock9** ppSB)
{
trace(log, "IDirect3DDevice9::EndStateBlock\n");
return(m_pIDirect3DDevice9->EndStateBlock(ppSB));
}
HRESULT myIDirect3DDevice9::SetClipStatus(CONST D3DCLIPSTATUS9* pClipStatus)
{
trace(log, "IDirect3DDevice9::SetClipStatus\n");
return(m_pIDirect3DDevice9->SetClipStatus(pClipStatus));
}
HRESULT myIDirect3DDevice9::GetClipStatus(D3DCLIPSTATUS9* pClipStatus)
{
trace(log, "IDirect3DDevice9::GetClipStatus\n");
return(m_pIDirect3DDevice9->GetClipStatus( pClipStatus));
}
HRESULT myIDirect3DDevice9::GetTexture(DWORD Stage,IDirect3DBaseTexture9** ppTexture)
{
trace(log, "IDirect3DDevice9::GetTexture\n");
return(m_pIDirect3DDevice9->GetTexture(Stage,ppTexture));
}
HRESULT myIDirect3DDevice9::SetTexture(DWORD Stage,IDirect3DBaseTexture9* pTexture)
{
trace(log, "IDirect3DDevice9::SetTexture\n");
return(m_pIDirect3DDevice9->SetTexture(Stage,pTexture));
}
HRESULT myIDirect3DDevice9::GetTextureStageState(DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue)
{
trace(log, "IDirect3DDevice9::GetTextureStageState\n");
return(m_pIDirect3DDevice9->GetTextureStageState(Stage,Type, pValue));
}
HRESULT myIDirect3DDevice9::SetTextureStageState(DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value)
{
trace(log, "IDirect3DDevice9::SetTextureStageState\n");
return(m_pIDirect3DDevice9->SetTextureStageState(Stage,Type,Value));
}
HRESULT myIDirect3DDevice9::GetSamplerState(DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue)
{
trace(log, "IDirect3DDevice9::GetSamplerState\n");
return(m_pIDirect3DDevice9->GetSamplerState(Sampler,Type, pValue));
}
HRESULT myIDirect3DDevice9::SetSamplerState(DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value)
{
trace(log, "IDirect3DDevice9::SetSamplerState\n");
return(m_pIDirect3DDevice9->SetSamplerState(Sampler,Type,Value));
}
HRESULT myIDirect3DDevice9::ValidateDevice(DWORD* pNumPasses)
{
trace(log, "IDirect3DDevice9::ValidateDevice\n");
return(m_pIDirect3DDevice9->ValidateDevice( pNumPasses));
}
HRESULT myIDirect3DDevice9::SetPaletteEntries(UINT PaletteNumber,CONST PALETTEENTRY* pEntries)
{
trace(log, "IDirect3DDevice9::SetPaletteEntries\n");
return(m_pIDirect3DDevice9->SetPaletteEntries(PaletteNumber, pEntries));
}
HRESULT myIDirect3DDevice9::GetPaletteEntries(UINT PaletteNumber,PALETTEENTRY* pEntries)
{
trace(log, "IDirect3DDevice9::GetPaletteEntries\n");
return(m_pIDirect3DDevice9->GetPaletteEntries(PaletteNumber, pEntries));
}
HRESULT myIDirect3DDevice9::SetCurrentTexturePalette(UINT PaletteNumber)
{
trace(log, "IDirect3DDevice9::SetCurrentTexturePalette\n");
return(m_pIDirect3DDevice9->SetCurrentTexturePalette(PaletteNumber));
}
HRESULT myIDirect3DDevice9::GetCurrentTexturePalette(UINT *PaletteNumber)
{
trace(log, "IDirect3DDevice9::GetCurrentTexturePalette\n");
return(m_pIDirect3DDevice9->GetCurrentTexturePalette(PaletteNumber));
}
HRESULT myIDirect3DDevice9::SetScissorRect(CONST RECT* pRect)
{
trace(log, "IDirect3DDevice9::SetScissorRect\n");
return(m_pIDirect3DDevice9->SetScissorRect( pRect));
}
HRESULT myIDirect3DDevice9::GetScissorRect( RECT* pRect)
{
trace(log, "IDirect3DDevice9::GetScissorRect\n");
return(m_pIDirect3DDevice9->GetScissorRect( pRect));
}
HRESULT myIDirect3DDevice9::SetSoftwareVertexProcessing(BOOL bSoftware)
{
trace(log, "IDirect3DDevice9::SetSoftwareVertexProcessing\n");
return(m_pIDirect3DDevice9->SetSoftwareVertexProcessing(bSoftware));
}
BOOL myIDirect3DDevice9::GetSoftwareVertexProcessing(void)
{
trace(log, "IDirect3DDevice9::GetSoftwareVertexProcessing\n");
return(m_pIDirect3DDevice9->GetSoftwareVertexProcessing());
}
HRESULT myIDirect3DDevice9::SetNPatchMode(float nSegments)
{
trace(log, "IDirect3DDevice9::SetNPatchMode\n");
return(m_pIDirect3DDevice9->SetNPatchMode(nSegments));
}
float myIDirect3DDevice9::GetNPatchMode(void)
{
trace(log, "IDirect3DDevice9::GetNPatchMode\n");
return(m_pIDirect3DDevice9->GetNPatchMode());
}
HRESULT myIDirect3DDevice9::DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount)
{
trace(log, "IDirect3DDevice9::DrawPrimitive\n");
return(m_pIDirect3DDevice9->DrawPrimitive(PrimitiveType,StartVertex,PrimitiveCount));
}
HRESULT myIDirect3DDevice9::DrawIndexedPrimitive(D3DPRIMITIVETYPE PrimitiveType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount)
{
trace(log, "IDirect3DDevice9::DrawIndexedPrimitive\n");
return(m_pIDirect3DDevice9->DrawIndexedPrimitive(PrimitiveType,BaseVertexIndex,MinVertexIndex,NumVertices,startIndex,primCount));
}
HRESULT myIDirect3DDevice9::DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride)
{
trace(log, "IDirect3DDevice9::DrawPrimitiveUP\n");
return(m_pIDirect3DDevice9->DrawPrimitiveUP(PrimitiveType,PrimitiveCount,pVertexStreamZeroData,VertexStreamZeroStride));
}
HRESULT myIDirect3DDevice9::DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride)
{
trace(log, "IDirect3DDevice9::DrawIndexedPrimitiveUP\n");
return(m_pIDirect3DDevice9->DrawIndexedPrimitiveUP(PrimitiveType,MinVertexIndex,NumVertices,PrimitiveCount, pIndexData, IndexDataFormat, pVertexStreamZeroData,VertexStreamZeroStride));
}
HRESULT myIDirect3DDevice9::ProcessVertices(UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags)
{
trace(log, "IDirect3DDevice9::ProcessVertices\n");
return(m_pIDirect3DDevice9->ProcessVertices( SrcStartIndex, DestIndex, VertexCount, pDestBuffer, pVertexDecl, Flags));
}
HRESULT myIDirect3DDevice9::CreateVertexDeclaration(CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl)
{
trace(log, "IDirect3DDevice9::CreateVertexDeclaration\n");
return(m_pIDirect3DDevice9->CreateVertexDeclaration( pVertexElements,ppDecl));
}
HRESULT myIDirect3DDevice9::SetVertexDeclaration(IDirect3DVertexDeclaration9* pDecl)
{
trace(log, "IDirect3DDevice9::SetVertexDeclaration\n");
return(m_pIDirect3DDevice9->SetVertexDeclaration(pDecl));
}
HRESULT myIDirect3DDevice9::GetVertexDeclaration(IDirect3DVertexDeclaration9** ppDecl)
{
trace(log, "IDirect3DDevice9::GetVertexDeclaration\n");
return(m_pIDirect3DDevice9->GetVertexDeclaration(ppDecl));
}
HRESULT myIDirect3DDevice9::SetFVF(DWORD FVF)
{
trace(log, "IDirect3DDevice9::SetFVF\n");
return(m_pIDirect3DDevice9->SetFVF(FVF));
}
HRESULT myIDirect3DDevice9::GetFVF(DWORD* pFVF)
{
trace(log, "IDirect3DDevice9::GetFVF\n");
return(m_pIDirect3DDevice9->GetFVF(pFVF));
}
HRESULT myIDirect3DDevice9::CreateVertexShader(CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader)
{
trace(log, "IDirect3DDevice9::CreateVertexShader\n");
return(m_pIDirect3DDevice9->CreateVertexShader(pFunction,ppShader));
}
HRESULT myIDirect3DDevice9::SetVertexShader(IDirect3DVertexShader9* pShader)
{
trace(log, "IDirect3DDevice9::SetVertexShader\n");
return(m_pIDirect3DDevice9->SetVertexShader(pShader));
}
HRESULT myIDirect3DDevice9::GetVertexShader(IDirect3DVertexShader9** ppShader)
{
trace(log, "IDirect3DDevice9::GetVertexShader\n");
return(m_pIDirect3DDevice9->GetVertexShader(ppShader));
}
HRESULT myIDirect3DDevice9::SetVertexShaderConstantF(UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount)
{
trace(log, "IDirect3DDevice9::SetVertexShaderConstantF\n");
return(m_pIDirect3DDevice9->SetVertexShaderConstantF(StartRegister,pConstantData, Vector4fCount));
}
HRESULT myIDirect3DDevice9::GetVertexShaderConstantF(UINT StartRegister,float* pConstantData,UINT Vector4fCount)
{
trace(log, "IDirect3DDevice9::GetVertexShaderConstantF\n");
return(m_pIDirect3DDevice9->GetVertexShaderConstantF(StartRegister,pConstantData,Vector4fCount));
}
HRESULT myIDirect3DDevice9::SetVertexShaderConstantI(UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount)
{
trace(log, "IDirect3DDevice9::SetVertexShaderConstantI\n");
return(m_pIDirect3DDevice9->SetVertexShaderConstantI(StartRegister,pConstantData,Vector4iCount));
}
HRESULT myIDirect3DDevice9::GetVertexShaderConstantI(UINT StartRegister,int* pConstantData,UINT Vector4iCount)
{
trace(log, "IDirect3DDevice9::GetVertexShaderConstantI\n");
return(m_pIDirect3DDevice9->GetVertexShaderConstantI(StartRegister,pConstantData,Vector4iCount));
}
HRESULT myIDirect3DDevice9::SetVertexShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount)
{
trace(log, "IDirect3DDevice9::SetVertexShaderConstantB\n");
return(m_pIDirect3DDevice9->SetVertexShaderConstantB(StartRegister,pConstantData,BoolCount));
}
HRESULT myIDirect3DDevice9::GetVertexShaderConstantB(UINT StartRegister,BOOL* pConstantData,UINT BoolCount)
{
trace(log, "IDirect3DDevice9::GetVertexShaderConstantB\n");
return(m_pIDirect3DDevice9->GetVertexShaderConstantB(StartRegister,pConstantData,BoolCount));
}
HRESULT myIDirect3DDevice9::SetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride)
{
trace(log, "IDirect3DDevice9::SetStreamSource\n");
return(m_pIDirect3DDevice9->SetStreamSource(StreamNumber,pStreamData,OffsetInBytes,Stride));
}
HRESULT myIDirect3DDevice9::GetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* OffsetInBytes,UINT* pStride)
{
trace(log, "IDirect3DDevice9::GetStreamSource\n");
return(m_pIDirect3DDevice9->GetStreamSource(StreamNumber,ppStreamData,OffsetInBytes,pStride));
}
HRESULT myIDirect3DDevice9::SetStreamSourceFreq(UINT StreamNumber,UINT Divider)
{
trace(log, "IDirect3DDevice9::SetStreamSourceFreq\n");
return(m_pIDirect3DDevice9->SetStreamSourceFreq(StreamNumber,Divider));
}
HRESULT myIDirect3DDevice9::GetStreamSourceFreq(UINT StreamNumber,UINT* Divider)
{
trace(log, "IDirect3DDevice9::GetStreamSourceFreq\n");
return(m_pIDirect3DDevice9->GetStreamSourceFreq(StreamNumber,Divider));
}
HRESULT myIDirect3DDevice9::SetIndices(IDirect3DIndexBuffer9* pIndexData)
{
trace(log, "IDirect3DDevice9::SetIndices\n");
return(m_pIDirect3DDevice9->SetIndices(pIndexData));
}
HRESULT myIDirect3DDevice9::GetIndices(IDirect3DIndexBuffer9** ppIndexData)
{
trace(log, "IDirect3DDevice9::GetIndices\n");
return(m_pIDirect3DDevice9->GetIndices(ppIndexData));
}
HRESULT myIDirect3DDevice9::CreatePixelShader(CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader)
{
trace(log, "IDirect3DDevice9::CreatePixelShader\n");
return(m_pIDirect3DDevice9->CreatePixelShader(pFunction,ppShader));
}
HRESULT myIDirect3DDevice9::SetPixelShader(IDirect3DPixelShader9* pShader)
{
trace(log, "IDirect3DDevice9::SetPixelShader\n");
return(m_pIDirect3DDevice9->SetPixelShader(pShader));
}
HRESULT myIDirect3DDevice9::GetPixelShader(IDirect3DPixelShader9** ppShader)
{
trace(log, "IDirect3DDevice9::GetPixelShader\n");
return(m_pIDirect3DDevice9->GetPixelShader(ppShader));
}
HRESULT myIDirect3DDevice9::SetPixelShaderConstantF(UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount)
{
trace(log, "IDirect3DDevice9::SetPixelShaderConstantF\n");
return(m_pIDirect3DDevice9->SetPixelShaderConstantF(StartRegister,pConstantData,Vector4fCount));
}
HRESULT myIDirect3DDevice9::GetPixelShaderConstantF(UINT StartRegister,float* pConstantData,UINT Vector4fCount)
{
trace(log, "IDirect3DDevice9::GetPixelShaderConstantF\n");
return(m_pIDirect3DDevice9->GetPixelShaderConstantF(StartRegister,pConstantData,Vector4fCount));
}
HRESULT myIDirect3DDevice9::SetPixelShaderConstantI(UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount)
{
trace(log, "IDirect3DDevice9::SetPixelShaderConstantI\n");
return(m_pIDirect3DDevice9->SetPixelShaderConstantI(StartRegister,pConstantData,Vector4iCount));
}
HRESULT myIDirect3DDevice9::GetPixelShaderConstantI(UINT StartRegister,int* pConstantData,UINT Vector4iCount)
{
trace(log, "IDirect3DDevice9::GetPixelShaderConstantI\n");
return(m_pIDirect3DDevice9->GetPixelShaderConstantI(StartRegister,pConstantData,Vector4iCount));
}
HRESULT myIDirect3DDevice9::SetPixelShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount)
{
trace(log, "IDirect3DDevice9::SetPixelShaderConstantB\n");
return(m_pIDirect3DDevice9->SetPixelShaderConstantB(StartRegister,pConstantData,BoolCount));
}
HRESULT myIDirect3DDevice9::GetPixelShaderConstantB(UINT StartRegister,BOOL* pConstantData,UINT BoolCount)
{
trace(log, "IDirect3DDevice9::GetPixelShaderConstantB\n");
return(m_pIDirect3DDevice9->GetPixelShaderConstantB(StartRegister,pConstantData,BoolCount));
}
HRESULT myIDirect3DDevice9::DrawRectPatch(UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo)
{
trace(log, "IDirect3DDevice9::DrawRectPatch\n");
return(m_pIDirect3DDevice9->DrawRectPatch(Handle,pNumSegs, pRectPatchInfo));
}
HRESULT myIDirect3DDevice9::DrawTriPatch(UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo)
{
trace(log, "IDirect3DDevice9::DrawTriPatch\n");
return(m_pIDirect3DDevice9->DrawTriPatch(Handle, pNumSegs, pTriPatchInfo));
}
HRESULT myIDirect3DDevice9::DeletePatch(UINT Handle)
{
trace(log, "IDirect3DDevice9::DeletePatch\n");
return(m_pIDirect3DDevice9->DeletePatch(Handle));
}
HRESULT myIDirect3DDevice9::CreateQuery(D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery)
{
trace(log, "IDirect3DDevice9::CreateQuery\n");
return(m_pIDirect3DDevice9->CreateQuery(Type,ppQuery));
}
// This is our test function
void myIDirect3DDevice9::ShowWeAreHere(void)
{
D3DRECT rec = {1,1,50,50};
m_pIDirect3DDevice9->Clear(1, &rec, D3DCLEAR_TARGET, D3DCOLOR_ARGB(255,255,255,0),0 ,0);
}

View File

@ -1,136 +0,0 @@
#pragma once
class myIDirect3DDevice9 : public IDirect3DDevice9
{
public:
myIDirect3DDevice9(IDirect3DDevice9* pOriginal);
virtual ~myIDirect3DDevice9(void);
// START: The original DX9 function definitions
HRESULT __stdcall QueryInterface (REFIID riid, void** ppvObj);
ULONG __stdcall AddRef(void);
ULONG __stdcall Release(void);
HRESULT __stdcall TestCooperativeLevel(void);
UINT __stdcall GetAvailableTextureMem(void);
HRESULT __stdcall EvictManagedResources(void);
HRESULT __stdcall GetDirect3D(IDirect3D9** ppD3D9);
HRESULT __stdcall GetDeviceCaps(D3DCAPS9* pCaps);
HRESULT __stdcall GetDisplayMode(UINT iSwapChain,D3DDISPLAYMODE* pMode);
HRESULT __stdcall GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *pParameters);
HRESULT __stdcall SetCursorProperties(UINT XHotSpot,UINT YHotSpot,IDirect3DSurface9* pCursorBitmap);
void __stdcall SetCursorPosition(int X,int Y,DWORD Flags);
BOOL __stdcall ShowCursor(BOOL bShow);
HRESULT __stdcall CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain9** pSwapChain) ;
HRESULT __stdcall GetSwapChain(UINT iSwapChain,IDirect3DSwapChain9** pSwapChain);
UINT __stdcall GetNumberOfSwapChains(void);
HRESULT __stdcall Reset(D3DPRESENT_PARAMETERS* pPresentationParameters);
HRESULT __stdcall Present(CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion);
HRESULT __stdcall GetBackBuffer(UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer);
HRESULT __stdcall GetRasterStatus(UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus);
HRESULT __stdcall SetDialogBoxMode(BOOL bEnableDialogs);
void __stdcall SetGammaRamp(UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp);
void __stdcall GetGammaRamp(UINT iSwapChain,D3DGAMMARAMP* pRamp);
HRESULT __stdcall CreateTexture(UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle);
HRESULT __stdcall CreateVolumeTexture(UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle);
HRESULT __stdcall CreateCubeTexture(UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle);
HRESULT __stdcall CreateVertexBuffer(UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle);
HRESULT __stdcall CreateIndexBuffer(UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle);
HRESULT __stdcall CreateRenderTarget(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle);
HRESULT __stdcall CreateDepthStencilSurface(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle);
HRESULT __stdcall UpdateSurface(IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint);
HRESULT __stdcall UpdateTexture(IDirect3DBaseTexture9* pSourceTexture,IDirect3DBaseTexture9* pDestinationTexture);
HRESULT __stdcall GetRenderTargetData(IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface);
HRESULT __stdcall GetFrontBufferData(UINT iSwapChain,IDirect3DSurface9* pDestSurface);
HRESULT __stdcall StretchRect(IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter);
HRESULT __stdcall ColorFill(IDirect3DSurface9* pSurface,CONST RECT* pRect,D3DCOLOR color);
HRESULT __stdcall CreateOffscreenPlainSurface(UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle);
HRESULT __stdcall SetRenderTarget(DWORD RenderTargetIndex,IDirect3DSurface9* pRenderTarget);
HRESULT __stdcall GetRenderTarget(DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget);
HRESULT __stdcall SetDepthStencilSurface(IDirect3DSurface9* pNewZStencil);
HRESULT __stdcall GetDepthStencilSurface(IDirect3DSurface9** ppZStencilSurface);
HRESULT __stdcall BeginScene(void);
HRESULT __stdcall EndScene(void);
HRESULT __stdcall Clear(DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil);
HRESULT __stdcall SetTransform(D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix);
HRESULT __stdcall GetTransform(D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix);
HRESULT __stdcall MultiplyTransform(D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix);
HRESULT __stdcall SetViewport(CONST D3DVIEWPORT9* pViewport);
HRESULT __stdcall GetViewport(D3DVIEWPORT9* pViewport);
HRESULT __stdcall SetMaterial(CONST D3DMATERIAL9* pMaterial);
HRESULT __stdcall GetMaterial(D3DMATERIAL9* pMaterial);
HRESULT __stdcall SetLight(DWORD Index,CONST D3DLIGHT9* pLight);
HRESULT __stdcall GetLight(DWORD Index,D3DLIGHT9* pLight);
HRESULT __stdcall LightEnable(DWORD Index,BOOL Enable);
HRESULT __stdcall GetLightEnable(DWORD Index,BOOL* pEnable);
HRESULT __stdcall SetClipPlane(DWORD Index,CONST float* pPlane);
HRESULT __stdcall GetClipPlane(DWORD Index,float* pPlane);
HRESULT __stdcall SetRenderState(D3DRENDERSTATETYPE State,DWORD Value);
HRESULT __stdcall GetRenderState(D3DRENDERSTATETYPE State,DWORD* pValue);
HRESULT __stdcall CreateStateBlock(D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB);
HRESULT __stdcall BeginStateBlock(void);
HRESULT __stdcall EndStateBlock(IDirect3DStateBlock9** ppSB);
HRESULT __stdcall SetClipStatus(CONST D3DCLIPSTATUS9* pClipStatus);
HRESULT __stdcall GetClipStatus(D3DCLIPSTATUS9* pClipStatus);
HRESULT __stdcall GetTexture(DWORD Stage,IDirect3DBaseTexture9** ppTexture);
HRESULT __stdcall SetTexture(DWORD Stage,IDirect3DBaseTexture9* pTexture);
HRESULT __stdcall GetTextureStageState(DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue);
HRESULT __stdcall SetTextureStageState(DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value);
HRESULT __stdcall GetSamplerState(DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue);
HRESULT __stdcall SetSamplerState(DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value);
HRESULT __stdcall ValidateDevice(DWORD* pNumPasses);
HRESULT __stdcall SetPaletteEntries(UINT PaletteNumber,CONST PALETTEENTRY* pEntries);
HRESULT __stdcall GetPaletteEntries(UINT PaletteNumber,PALETTEENTRY* pEntries);
HRESULT __stdcall SetCurrentTexturePalette(UINT PaletteNumber);
HRESULT __stdcall GetCurrentTexturePalette(UINT *PaletteNumber);
HRESULT __stdcall SetScissorRect(CONST RECT* pRect);
HRESULT __stdcall GetScissorRect( RECT* pRect);
HRESULT __stdcall SetSoftwareVertexProcessing(BOOL bSoftware);
BOOL __stdcall GetSoftwareVertexProcessing(void);
HRESULT __stdcall SetNPatchMode(float nSegments);
float __stdcall GetNPatchMode(void);
HRESULT __stdcall DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount);
HRESULT __stdcall DrawIndexedPrimitive(D3DPRIMITIVETYPE PrimitiveType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount);
HRESULT __stdcall DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride);
HRESULT __stdcall DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride);
HRESULT __stdcall ProcessVertices(UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags);
HRESULT __stdcall CreateVertexDeclaration(CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl);
HRESULT __stdcall SetVertexDeclaration(IDirect3DVertexDeclaration9* pDecl);
HRESULT __stdcall GetVertexDeclaration(IDirect3DVertexDeclaration9** ppDecl);
HRESULT __stdcall SetFVF(DWORD FVF);
HRESULT __stdcall GetFVF(DWORD* pFVF);
HRESULT __stdcall CreateVertexShader(CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader);
HRESULT __stdcall SetVertexShader(IDirect3DVertexShader9* pShader);
HRESULT __stdcall GetVertexShader(IDirect3DVertexShader9** ppShader);
HRESULT __stdcall SetVertexShaderConstantF(UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount);
HRESULT __stdcall GetVertexShaderConstantF(UINT StartRegister,float* pConstantData,UINT Vector4fCount);
HRESULT __stdcall SetVertexShaderConstantI(UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount);
HRESULT __stdcall GetVertexShaderConstantI(UINT StartRegister,int* pConstantData,UINT Vector4iCount);
HRESULT __stdcall SetVertexShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount);
HRESULT __stdcall GetVertexShaderConstantB(UINT StartRegister,BOOL* pConstantData,UINT BoolCount);
HRESULT __stdcall SetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride);
HRESULT __stdcall GetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* OffsetInBytes,UINT* pStride);
HRESULT __stdcall SetStreamSourceFreq(UINT StreamNumber,UINT Divider);
HRESULT __stdcall GetStreamSourceFreq(UINT StreamNumber,UINT* Divider);
HRESULT __stdcall SetIndices(IDirect3DIndexBuffer9* pIndexData);
HRESULT __stdcall GetIndices(IDirect3DIndexBuffer9** ppIndexData);
HRESULT __stdcall CreatePixelShader(CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader);
HRESULT __stdcall SetPixelShader(IDirect3DPixelShader9* pShader);
HRESULT __stdcall GetPixelShader(IDirect3DPixelShader9** ppShader);
HRESULT __stdcall SetPixelShaderConstantF(UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount);
HRESULT __stdcall GetPixelShaderConstantF(UINT StartRegister,float* pConstantData,UINT Vector4fCount);
HRESULT __stdcall SetPixelShaderConstantI(UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount);
HRESULT __stdcall GetPixelShaderConstantI(UINT StartRegister,int* pConstantData,UINT Vector4iCount);
HRESULT __stdcall SetPixelShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount);
HRESULT __stdcall GetPixelShaderConstantB(UINT StartRegister,BOOL* pConstantData,UINT BoolCount);
HRESULT __stdcall DrawRectPatch(UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo);
HRESULT __stdcall DrawTriPatch(UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo);
HRESULT __stdcall DeletePatch(UINT Handle);
HRESULT __stdcall CreateQuery(D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery);
// END: The original DX9 function definitions
private:
IDirect3DDevice9 *m_pIDirect3DDevice9;
// This is our test function
void ShowWeAreHere(void);
};

View File

@ -1,116 +0,0 @@
// proxydll.cpp
#include "stdafx.h"
#include "proxydll.h"
#include "stdio.h"
// global variables
#pragma data_seg (".d3d9_shared")
myIDirect3DDevice9* gl_pmyIDirect3DDevice9;
myIDirect3D9* gl_pmyIDirect3D9;
HINSTANCE gl_hOriginalDll;
HINSTANCE gl_hThisInstance;
FILE *log;
#pragma data_seg ()
#define trace if(log) fprintf
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
// to avoid compiler lvl4 warnings
LPVOID lpDummy = lpReserved;
lpDummy = NULL;
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH: InitInstance(hModule); break;
case DLL_PROCESS_DETACH: ExitInstance(); break;
case DLL_THREAD_ATTACH: break;
case DLL_THREAD_DETACH: break;
}
return TRUE;
}
// Exported function (faking d3d9.dll's one-and-only export)
IDirect3D9* WINAPI Direct3DCreate9(UINT SDKVersion)
{
trace(log, "Direct3DCreate9\n");
if (!gl_hOriginalDll) LoadOriginalDll(); // looking for the "right d3d9.dll"
// Hooking IDirect3D Object from Original Library
typedef IDirect3D9 *(WINAPI* D3D9_Type)(UINT SDKVersion);
D3D9_Type D3DCreate9_fn = (D3D9_Type) GetProcAddress( gl_hOriginalDll, "Direct3DCreate9");
// Debug
if (!D3DCreate9_fn)
{
OutputDebugString("PROXYDLL: Pointer to original D3DCreate9 function not received ERROR ****\r\n");
::ExitProcess(0); // exit the hard way
}
// Request pointer from Original Dll.
IDirect3D9 *pIDirect3D9_orig = D3DCreate9_fn(SDKVersion);
// Create my IDirect3D8 object and store pointer to original object there.
// note: the object will delete itself once Ref count is zero (similar to COM objects)
gl_pmyIDirect3D9 = new myIDirect3D9(pIDirect3D9_orig);
// Return pointer to hooking Object instead of "real one"
return (gl_pmyIDirect3D9);
}
void InitInstance(HANDLE hModule)
{
char *logpath;
OutputDebugString("PROXYDLL: InitInstance called.\r\n");
// Initialisation
gl_hOriginalDll = NULL;
gl_hThisInstance = NULL;
gl_pmyIDirect3D9 = NULL;
gl_pmyIDirect3DDevice9 = NULL;
// Storing Instance handle into global var
gl_hThisInstance = (HINSTANCE) hModule;
log=NULL;
logpath=getenv("d3d9log");
if(logpath) log=fopen(logpath, "a+");
}
void LoadOriginalDll(void)
{
char buffer[MAX_PATH];
// Getting path to system dir and to d3d8.dll
::GetSystemDirectory(buffer,MAX_PATH);
// Append dll name
strcat(buffer,"\\d3d9.dll");
// try to load the system's d3d9.dll, if pointer empty
if (!gl_hOriginalDll) gl_hOriginalDll = ::LoadLibrary(buffer);
// Debug
if (!gl_hOriginalDll)
{
OutputDebugString("PROXYDLL: Original d3d9.dll not loaded ERROR ****\r\n");
::ExitProcess(0); // exit the hard way
}
}
void ExitInstance()
{
OutputDebugString("PROXYDLL: ExitInstance called.\r\n");
// Release the system's d3d9.dll
if (gl_hOriginalDll)
{
::FreeLibrary(gl_hOriginalDll);
gl_hOriginalDll = NULL;
}
fclose(log);
}

View File

@ -1,4 +0,0 @@
LIBRARY "d3d9"
EXPORTS
Direct3DCreate9 @1

View File

@ -1,10 +0,0 @@
// proxydll.h
#pragma once
// Exported function
IDirect3D9* WINAPI Direct3DCreate9 (UINT SDKVersion);
// regular functions
void InitInstance(HANDLE hModule);
void ExitInstance(void);
void LoadOriginalDll(void);

Binary file not shown.

Binary file not shown.

View File

@ -1,20 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "proxydll", "proxydll.vs2008.vcproj", "{02EB97D5-B1C5-411E-8274-83A95985DE6F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{02EB97D5-B1C5-411E-8274-83A95985DE6F}.Debug|Win32.ActiveCfg = Debug|Win32
{02EB97D5-B1C5-411E-8274-83A95985DE6F}.Debug|Win32.Build.0 = Debug|Win32
{02EB97D5-B1C5-411E-8274-83A95985DE6F}.Release|Win32.ActiveCfg = Release|Win32
{02EB97D5-B1C5-411E-8274-83A95985DE6F}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Binary file not shown.

View File

@ -1,253 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="proxydll"
ProjectGUID="{02EB97D5-B1C5-411E-8274-83A95985DE6F}"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PROXYDLL_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Winmm.lib d3dx9.lib"
OutputFile="../Release/d3d9.dll"
LinkIncremental="2"
ModuleDefinitionFile="proxydll.def"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/proxydll.pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(OutDir)/proxydll.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PROXYDLL_EXPORTS"
RuntimeLibrary="0"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Winmm.lib d3dx9.lib"
OutputFile="../Release/d3d9.dll"
LinkIncremental="1"
ModuleDefinitionFile="proxydll.def"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(OutDir)/proxydll.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="source"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\myIDirect3D9.cpp"
>
</File>
<File
RelativePath=".\myIDirect3DDevice9.cpp"
>
</File>
<File
RelativePath=".\proxydll.cpp"
>
</File>
<File
RelativePath=".\proxydll.def"
>
</File>
<File
RelativePath=".\stdafx.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="include"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\myIDirect3D9.h"
>
</File>
<File
RelativePath=".\myIDirect3DDevice9.h"
>
</File>
<File
RelativePath=".\proxydll.h"
>
</File>
<File
RelativePath=".\stdafx.h"
>
</File>
</Filter>
<Filter
Name="resources"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,2 +0,0 @@
// stdafx.cpp
#include "stdafx.h"

View File

@ -1,10 +0,0 @@
// stdafx.h
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "d3d9.h"
#include "myIDirect3D9.h"
#include "myIDirect3DDevice9.h"

View File

@ -3264,8 +3264,21 @@ HRESULT WINAPI extFlip(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWSURFACE lpddssrc,
//DumpSurfaceAttributes((LPDDSURFACEDESC)&ddsd, "[temp]" , __LINE__);
res=(*pCreateSurfaceMethod(lpdds))(lpPrimaryDD, &ddsd, &lpddsTmp, NULL);
if(res) OutTraceE("CreateSurface: ERROR %x(%s) at %d\n", res, ExplainDDError(res), __LINE__);
OutTrace("DEBUG: copied surface size=(%dx%d)\n", ddsd.dwWidth, ddsd.dwHeight);
// copy front buffer
res= (*pBlt)(lpddsTmp, NULL, lpdds, NULL, DDBLT_WAIT, NULL);
if(dxw.dwFlags1 & EMULATESURFACE){
// in emulated mode, the primary surface is virtual and you can pick it all
// needed for "Gruntz"
res= (*pBlt)(lpddsTmp, NULL, lpdds, NULL, DDBLT_WAIT, NULL);
}
else {
// in no-emulated mode, the primary surface is the whole screen, so you have to pick...
// needed for "Black Thorn"
RECT clip;
clip=dxw.GetUnmappedScreenRect();
res= (*pBlt)(lpddsTmp, NULL, lpdds, &clip, DDBLT_WAIT, NULL);
}
if(res) OutTraceE("Blt: ERROR %x(%s) at %d", res, ExplainDDError(res), __LINE__);
}

View File

@ -72,7 +72,7 @@ static char *Flag4Names[32]={
"ZBUFFERCLEAN", "ZBUFFER0CLEAN", "ZBUFFERALWAYS", "DISABLEFOGGING",
"NOPOWER2FIX", "NOPERFCOUNTER", "ADDPROXYLIBS", "INTERCEPTRDTSC",
"LIMITSCREENRES", "NOFILLRECT", "HOOKGLIDE", "HIDEDESKTOP",
"STRETCHTIMERS", "NOFLIPEMULATION", "", "",
"STRETCHTIMERS", "NOFLIPEMULATION", "NOTEXTURES", "",
"", "", "", "",
"", "", "", "",
"", "", "", "",

View File

@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "dxwnd.h"
#include "dxwcore.hpp"
#define VERSION "2.02.62"
#define VERSION "2.02.63"
#define DDTHREADLOCK 1
@ -154,7 +154,7 @@ LRESULT CALLBACK HookProc(int ncode, WPARAM wparam, LPARAM lparam)
// take care here: if anything stops or delays the execution logic, the whole
// operating system hangs, since it can't activate new windows!
// could use WM_NCCREATE insteas of WM_CREATE. Are there differences?
// could use WM_NCCREATE instead of WM_CREATE. Are there differences?
hwnd = ((CWPSTRUCT *)lparam)->hwnd;
if(((CWPSTRUCT *)lparam)->message == WM_CREATE){
GetModuleFileName(0, name, MAX_PATH);

Binary file not shown.

View File

@ -33,13 +33,16 @@ typedef HRESULT (WINAPI *Present_Type)(void *, CONST RECT *, CONST RECT *, HWND,
typedef HRESULT (WINAPI *SetRenderState_Type)(void *, D3DRENDERSTATETYPE, DWORD);
typedef HRESULT (WINAPI *GetRenderState_Type)(void *, D3DRENDERSTATETYPE, DWORD );
typedef HRESULT (WINAPI *CreateAdditionalSwapChain_Type)(void *, D3DPRESENT_PARAMETERS *, IDirect3DSwapChain9 **);
typedef HRESULT (WINAPI *GetDirect3D_Type)(void *, IDirect3D9 **);
typedef HRESULT (WINAPI *GetDirect3D8_Type)(void *, void **);
typedef HRESULT (WINAPI *GetDirect3D9_Type)(void *, void **);
typedef HRESULT (WINAPI *GetViewport_Type)(void *, D3DVIEWPORT9 *);
typedef HRESULT (WINAPI *SetViewport_Type)(void *, D3DVIEWPORT9 *);
typedef void (WINAPI *SetGammaRamp_Type)(void *, UINT, DWORD, D3DGAMMARAMP *);
typedef void (WINAPI *GetGammaRamp_Type)(void *, UINT, D3DGAMMARAMP *);
typedef void (WINAPI *SetCursorPosition9_Type)(void *, int, int, DWORD);
typedef void (WINAPI *SetCursorPosition8_Type)(void *, int, int, DWORD);
typedef HRESULT (WINAPI *SetTexture8_Type)(void *, DWORD, void *);
typedef HRESULT (WINAPI *SetTexture9_Type)(void *, DWORD, void *);
//typedef ULONG (WINAPI *CreateRenderTarget8_Type)(void *, UINT, UINT, D3DFORMAT, D3DMULTISAMPLE_TYPE, BOOL, IDirect3DSurface8**);
typedef ULONG (WINAPI *CreateRenderTarget8_Type)(void *, UINT, UINT, D3DFORMAT, D3DMULTISAMPLE_TYPE, BOOL, void**);
@ -55,12 +58,14 @@ typedef HRESULT (WINAPI *D3D11CreateDeviceAndSwapChain_Type)(IDXGIAdapter *, D3D
typedef void (WINAPI *RSSetViewports_Type)(void *, UINT, D3D11_VIEWPORT *);
typedef ULONG (WINAPI *AddRef_Type)(void *);
typedef ULONG (WINAPI *Release_Type)(void *);
typedef HRESULT (WINAPI *Reset_Type)(void *, D3DPRESENT_PARAMETERS*);
HRESULT WINAPI extQueryInterfaceD3D8(void *, REFIID, void** );
HRESULT WINAPI extQueryInterfaceDev8(void *, REFIID, void** );
HRESULT WINAPI extQueryInterfaceD3D9(void *, REFIID, void** );
HRESULT WINAPI extQueryInterfaceDev9(void *, REFIID, void** );
HRESULT WINAPI extGetDirect3D(void *, IDirect3D9 **);
HRESULT WINAPI extGetDirect3D8(void *, void **);
HRESULT WINAPI extGetDirect3D9(void *, void **);
void* WINAPI extDirect3DCreate8(UINT);
void* WINAPI extDirect3DCreate9(UINT);
@ -100,7 +105,8 @@ ULONG WINAPI extBeginScene8(void *);
ULONG WINAPI extEndScene8(void *);
ULONG WINAPI extBeginScene9(void *);
ULONG WINAPI extEndScene9(void *);
ULONG WINAPI extSetTexture8(void *, DWORD, void *);
ULONG WINAPI extSetTexture9(void *, DWORD, void *);
HRESULT WINAPI extD3D10CreateDevice(IDXGIAdapter *, D3D10_DRIVER_TYPE, HMODULE, UINT, UINT, ID3D10Device **);
@ -118,7 +124,8 @@ QueryInterface_Type pQueryInterfaceDev8 = 0;
QueryInterface_Type pQueryInterfaceD3D9 = 0;
QueryInterface_Type pQueryInterfaceDev9 = 0;
GetDirect3D_Type pGetDirect3D = 0;
GetDirect3D8_Type pGetDirect3D8 = 0;
GetDirect3D9_Type pGetDirect3D9 = 0;
Direct3DCreate8_Type pDirect3DCreate8 = 0;
Direct3DCreate9_Type pDirect3DCreate9 = 0;
Direct3DCreate9Ex_Type pDirect3DCreate9Ex = 0;
@ -153,6 +160,9 @@ BeginScene_Type pBeginScene8 = 0;
EndScene_Type pEndScene8 = 0;
BeginScene_Type pBeginScene9 = 0;
EndScene_Type pEndScene9 = 0;
Reset_Type pReset = 0;
SetTexture8_Type pSetTexture8 = 0;
SetTexture9_Type pSetTexture9 = 0;
D3D10CreateDevice_Type pD3D10CreateDevice = 0;
D3D10CreateDeviceAndSwapChain_Type pD3D10CreateDeviceAndSwapChain = 0;
@ -167,27 +177,6 @@ Release_Type pRelease9 = 0;
DWORD dwD3DVersion;
void dxwCopyProxyLib9()
{
#define MAX_FILE_PATH 512
DWORD dwAttrib;
char sSourcePath[MAX_FILE_PATH+1];
char *p;
// don't do this more than once per process activation
static BOOL DoOnce=FALSE;
if(DoOnce) return;
DoOnce=TRUE;
dwAttrib = GetFileAttributes("dxwnd.dll");
if (dwAttrib != INVALID_FILE_ATTRIBUTES && !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY)) return;
GetModuleFileName(GetModuleHandle("dxwnd"), sSourcePath, MAX_FILE_PATH);
p=&sSourcePath[strlen(sSourcePath)-strlen("dxwnd.dll")];
strcpy(p, "d3d9.dll");
OutTraceD3D("HookInit: copy %s -> d3d9.dll\n", sSourcePath);
CopyFile(sSourcePath, "d3d9.dll", FALSE);
}
FARPROC Remap_d3d8_ProcAddress(LPCSTR proc, HMODULE hModule)
{
if (!strcmp(proc,"Direct3DCreate8") && !pDirect3DCreate8){
@ -223,10 +212,6 @@ BOOL WINAPI voidDisableD3DSpy(void)
FARPROC Remap_d3d9_ProcAddress(LPCSTR proc, HMODULE hModule)
{
// NULL -> keep the original call address
// (FARPROC)-1 -> returns NULL
if(dxw.dwFlags4 & ADDPROXYLIBS) dxwCopyProxyLib9();
if (!strcmp(proc,"Direct3DCreate9") && !pDirect3DCreate9){
pDirect3DCreate9=(Direct3DCreate9_Type)(*pGetProcAddress)(hModule, proc);
OutTraceDW("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pDirect3DCreate9);
@ -323,8 +308,6 @@ int HookDirect3D(HMODULE module, int version){
switch(version){
case 0:
// D3D8
if(dxw.dwFlags4 & ADDPROXYLIBS) dxwCopyProxyLib9();
tmp = HookAPI(module, "d3d8.dll", NULL, "Direct3DCreate8", extDirect3DCreate8);
if(tmp) pDirect3DCreate8 = (Direct3DCreate8_Type)tmp;
// D3D9
@ -362,7 +345,6 @@ int HookDirect3D(HMODULE module, int version){
}
break;
case 9:
if(dxw.dwFlags4 & ADDPROXYLIBS) dxwCopyProxyLib9();
hinst = (*pLoadLibraryA)("d3d9.dll");
pDirect3DCreate9 =
(Direct3DCreate9_Type)(*pGetProcAddress)(hinst, "Direct3DCreate9");
@ -473,11 +455,9 @@ int HookDirect3D(HMODULE module, int version){
void HookD3DDevice8(void** ppD3Ddev8)
{
void *pReset;
OutTraceDW("Device hook for IID_IDirect3DDevice8 interface\n");
pReset=NULL; // to avoid assert condition
SetHook((void *)(**(DWORD **)ppD3Ddev8 + 0), extQueryInterfaceDev8, (void **)&pQueryInterfaceDev8, "QueryInterface(D8)");
SetHook((void *)(**(DWORD **)ppD3Ddev8 + 24), extGetDirect3D, (void **)&pGetDirect3D, "GetDirect3D(D8)");
SetHook((void *)(**(DWORD **)ppD3Ddev8 + 24), extGetDirect3D8, (void **)&pGetDirect3D8, "GetDirect3D(D8)");
SetHook((void *)(**(DWORD **)ppD3Ddev8 + 32), extGetDisplayMode8, (void **)&pGetDisplayMode8, "GetDisplayMode(D8)");
SetHook((void *)(**(DWORD **)ppD3Ddev8 + 44), extSetCursorPosition8, (void **)&pSetCursorPosition8, "SetCursorPosition(D8)");
SetHook((void *)(**(DWORD **)ppD3Ddev8 + 52), extCreateAdditionalSwapChain, (void **)&pCreateAdditionalSwapChain, "CreateAdditionalSwapChain(D8)");
@ -497,8 +477,8 @@ void HookD3DDevice8(void** ppD3Ddev8)
if(dxw.dwFlags4 & DISABLEFOGGING) (*pSetRenderState)((void *)*ppD3Ddev8, D3DRS_FOGENABLE, FALSE);
if(dxw.dwFlags4 & ZBUFFERALWAYS) (*pSetRenderState)((void *)*ppD3Ddev8, D3DRS_ZFUNC, D3DCMP_ALWAYS);
//if(1) (*pSetRenderState)((void *)*ppD3Ddev8, D3DRS_SPECULARENABLE, TRUE);
//if(1) (*pSetRenderState)((void *)*ppD3Ddev8, D3DRS_ZFUNC, D3DCMP_LESSEQUAL);
}
if (dxw.dwFlags4 & NOTEXTURES) SetHook((void *)(**(DWORD **)ppD3Ddev8 + 244), extSetTexture8, (void **)&pSetTexture8, "SetTexture(D8)");
//if (!(dxw.dwTFlags & OUTPROXYTRACE)) return;
//SetHook((void *)(**(DWORD **)ppD3Ddev8 + 4), extAddRef8, (void **)&pAddRef8, "AddRef(D8)");
//SetHook((void *)(**(DWORD **)ppD3Ddev8 + 8), extRelease8, (void **)&pRelease8, "Release(D8)");
@ -506,11 +486,9 @@ void HookD3DDevice8(void** ppD3Ddev8)
void HookD3DDevice9(void** ppD3Ddev9)
{
void *pReset;
OutTraceDW("Device hook for IID_IDirect3DDevice9 interface\n");
pReset=NULL; // to avoid assert condition
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 0), extQueryInterfaceDev9, (void **)&pQueryInterfaceDev9, "QueryInterface(D9)");
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 24), extGetDirect3D, (void **)&pGetDirect3D, "GetDirect3D(D9)");
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 24), extGetDirect3D9, (void **)&pGetDirect3D9, "GetDirect3D(D9)");
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 32), extGetDisplayMode9, (void **)&pGetDisplayMode9, "GetDisplayMode(D9)");
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 44), extSetCursorPosition9, (void **)&pSetCursorPosition9, "SetCursorPosition(D9)");
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 52), extCreateAdditionalSwapChain, (void **)&pCreateAdditionalSwapChain, "CreateAdditionalSwapChain(D9)");
@ -531,13 +509,22 @@ void HookD3DDevice9(void** ppD3Ddev9)
if(dxw.dwFlags4 & DISABLEFOGGING) (*pSetRenderState)((void *)*ppD3Ddev9, D3DRS_FOGENABLE, FALSE);
if(dxw.dwFlags4 & ZBUFFERALWAYS) (*pSetRenderState)((void *)*ppD3Ddev9, D3DRS_ZFUNC, D3DCMP_ALWAYS);
//if(1) (*pSetRenderState)((void *)*ppD3Ddev9, D3DRS_SPECULARENABLE, TRUE);
//if(1) (*pSetRenderState)((void *)*ppD3Ddev9, D3DRS_ZFUNC, D3DCMP_LESSEQUAL);
}
if (dxw.dwFlags4 & NOTEXTURES) SetHook((void *)(**(DWORD **)ppD3Ddev9 + 260), extSetTexture9, (void **)&pSetTexture9, "SetTexture(D9)");
if (!(dxw.dwTFlags & OUTPROXYTRACE)) return;
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 4), extAddRef9, (void **)&pAddRef9, "AddRef(D9)");
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 8), extRelease9, (void **)&pRelease9, "Release(D9)");
}
void HookDirect3D8(void *lpd3d)
{
SetHook((void *)(*(DWORD *)lpd3d + 0), extQueryInterfaceD3D8, (void **)&pQueryInterfaceD3D8, "QueryInterface(D8)");
SetHook((void *)(*(DWORD *)lpd3d + 16), extGetAdapterCount8, (void **)&pGetAdapterCount8, "GetAdapterCount(D8)");
SetHook((void *)(*(DWORD *)lpd3d + 20), extGetAdapterIdentifier8, (void **)&pGetAdapterIdentifier8, "GetAdapterIdentifier(D8)");
SetHook((void *)(*(DWORD *)lpd3d + 28), extEnumAdapterModes8, (void **)&pEnumAdapterModes8, "EnumAdapterModes(D8)");
SetHook((void *)(*(DWORD *)lpd3d + 32), extGetAdapterDisplayMode8, (void **)&pGetAdapterDisplayMode8, "GetAdapterDisplayMode(D8)");
SetHook((void *)(*(DWORD *)lpd3d + 60), extCreateDevice, (void **)&pCreateDevice8, "CreateDevice(D8)");
}
void* WINAPI extDirect3DCreate8(UINT sdkversion)
{
@ -550,17 +537,23 @@ void* WINAPI extDirect3DCreate8(UINT sdkversion)
return 0;
}
dwD3DVersion = 8;
SetHook((void *)(*(DWORD *)lpd3d + 0), extQueryInterfaceD3D8, (void **)&pQueryInterfaceD3D8, "QueryInterface(D8)");
SetHook((void *)(*(DWORD *)lpd3d + 16), extGetAdapterCount8, (void **)&pGetAdapterCount8, "GetAdapterCount(D8)");
SetHook((void *)(*(DWORD *)lpd3d + 20), extGetAdapterIdentifier8, (void **)&pGetAdapterIdentifier8, "GetAdapterIdentifier(D8)");
SetHook((void *)(*(DWORD *)lpd3d + 28), extEnumAdapterModes8, (void **)&pEnumAdapterModes8, "EnumAdapterModes(D8)");
SetHook((void *)(*(DWORD *)lpd3d + 32), extGetAdapterDisplayMode8, (void **)&pGetAdapterDisplayMode8, "GetAdapterDisplayMode(D8)");
SetHook((void *)(*(DWORD *)lpd3d + 60), extCreateDevice, (void **)&pCreateDevice8, "CreateDevice(D8)");
HookDirect3D8(lpd3d);
OutTraceD3D("Direct3DCreate8: d3d=%x\n", lpd3d);
return lpd3d;
}
void HookDirect3D9(void *lpd3d, BOOL ex)
{
SetHook((void *)(*(DWORD *)lpd3d + 0), extQueryInterfaceD3D9, (void **)&pQueryInterfaceD3D9, "QueryInterface(D9)");
SetHook((void *)(*(DWORD *)lpd3d + 16), extGetAdapterCount9, (void **)&pGetAdapterCount9, "GetAdapterCount(D9)");
SetHook((void *)(*(DWORD *)lpd3d + 20), extGetAdapterIdentifier9, (void **)&pGetAdapterIdentifier9, "GetAdapterIdentifier(D9)");
SetHook((void *)(*(DWORD *)lpd3d + 28), extEnumAdapterModes9, (void **)&pEnumAdapterModes9, "EnumAdapterModes(D9)");
SetHook((void *)(*(DWORD *)lpd3d + 32), extGetAdapterDisplayMode9, (void **)&pGetAdapterDisplayMode9, "GetAdapterDisplayMode(D9)");
SetHook((void *)(*(DWORD *)lpd3d + 64), extCreateDevice, (void **)&pCreateDevice9, "CreateDevice(D9)");
if(ex) SetHook((void *)(*(DWORD *)lpd3d + 80), extCreateDeviceEx, (void **)&pCreateDeviceEx, "CreateDeviceEx(D9)");
}
void* WINAPI extDirect3DCreate9(UINT sdkversion)
{
void *lpd3d;
@ -573,12 +566,7 @@ void* WINAPI extDirect3DCreate9(UINT sdkversion)
}
dwD3DVersion = 9;
SetHook((void *)(*(DWORD *)lpd3d + 0), extQueryInterfaceD3D9, (void **)&pQueryInterfaceD3D9, "QueryInterface(D9)");
SetHook((void *)(*(DWORD *)lpd3d + 16), extGetAdapterCount9, (void **)&pGetAdapterCount9, "GetAdapterCount(D9)");
SetHook((void *)(*(DWORD *)lpd3d + 20), extGetAdapterIdentifier9, (void **)&pGetAdapterIdentifier9, "GetAdapterIdentifier(D9)");
SetHook((void *)(*(DWORD *)lpd3d + 28), extEnumAdapterModes9, (void **)&pEnumAdapterModes9, "EnumAdapterModes(D9)");
SetHook((void *)(*(DWORD *)lpd3d + 32), extGetAdapterDisplayMode9, (void **)&pGetAdapterDisplayMode9, "GetAdapterDisplayMode(D9)");
SetHook((void *)(*(DWORD *)lpd3d + 64), extCreateDevice, (void **)&pCreateDevice9, "CreateDevice(D9)");
HookDirect3D9(lpd3d, FALSE);
OutTraceD3D("Direct3DCreate9: d3d=%x\n", lpd3d);
return lpd3d;
@ -597,13 +585,7 @@ HRESULT WINAPI extDirect3DCreate9Ex(UINT sdkversion, IDirect3D9Ex **ppD3D)
}
dwD3DVersion = 9;
lpd3d = *ppD3D;
SetHook((void *)(*(DWORD *)lpd3d + 0), extQueryInterfaceD3D9, (void **)&pQueryInterfaceD3D9, "QueryInterface(D9)");
SetHook((void *)(*(DWORD *)lpd3d + 16), extGetAdapterCount9, (void **)&pGetAdapterCount9, "GetAdapterCount(D9)");
SetHook((void *)(*(DWORD *)lpd3d + 20), extGetAdapterIdentifier9, (void **)&pGetAdapterIdentifier9, "GetAdapterIdentifier(D9)");
SetHook((void *)(*(DWORD *)lpd3d + 28), extEnumAdapterModes9, (void **)&pEnumAdapterModes9, "EnumAdapterModes(D9)");
SetHook((void *)(*(DWORD *)lpd3d + 32), extGetAdapterDisplayMode9, (void **)&pGetAdapterDisplayMode9, "GetAdapterDisplayMode(D9)");
SetHook((void *)(*(DWORD *)lpd3d + 64), extCreateDevice, (void **)&pCreateDevice9, "CreateDevice(D9)");
SetHook((void *)(*(DWORD *)lpd3d + 80), extCreateDeviceEx, (void **)&pCreateDeviceEx, "CreateDeviceEx(D9)");
HookDirect3D9(lpd3d, TRUE);
OutTraceD3D("Direct3DCreate9Ex: d3d=%x\n", lpd3d);
return res;
}
@ -650,9 +632,105 @@ HRESULT WINAPI extGetAdapterIdentifier9(void *pd3dd, UINT Adapter, DWORD Flags,
return res;
}
HRESULT WINAPI extReset(void *pd3dd, D3DPRESENT_PARAMETERS* pPresentationParameters)
HRESULT WINAPI extReset(void *pd3dd, D3DPRESENT_PARAMETERS* pPresParam)
{
OutTraceDW("Reset: SUPPRESSED\n");
HRESULT res;
DWORD param[64], *tmp;
D3DDISPLAYMODE mode;
int Windowed;
void *pD3D;
memcpy(param, pPresParam, (dwD3DVersion == 9)?56:52);
if(IsTraceDW){
tmp = param;
OutTrace("D3D%d::Reset\n", dwD3DVersion);
OutTrace(" BackBufferWidth = %i\n", *(tmp ++));
OutTrace(" BackBufferHeight = %i\n", *(tmp ++));
OutTrace(" BackBufferFormat = %i\n", *(tmp ++));
OutTrace(" BackBufferCount = %i\n", *(tmp ++));
OutTrace(" MultiSampleType = %i\n", *(tmp ++));
if(dwD3DVersion == 9) OutTrace(" MultiSampleQuality = %i\n", *(tmp ++));
OutTrace(" SwapEffect = 0x%x\n", *(tmp ++));
OutTrace(" hDeviceWindow = 0x%x\n", *(tmp ++));
OutTrace(" Windowed = %i\n", (Windowed=*(tmp ++)));
OutTrace(" EnableAutoDepthStencil = %i\n", *(tmp ++));
OutTrace(" AutoDepthStencilFormat = %i\n", *(tmp ++));
OutTrace(" Flags = 0x%x\n", *(tmp ++));
OutTrace(" FullScreen_RefreshRateInHz = %i\n", *(tmp ++));
OutTrace(" PresentationInterval = 0x%x\n", *(tmp ++));
}
if(Windowed) {
// do not attempt to reset when returning to windowed mode: it is useless (you are windowed already)
// and the code below (GetDirect3D, ...) doesn't work.
OutTraceDW("SKIPPED!\n");
return DD_OK;
}
if (dwD3DVersion == 9){
res=(*pGetDirect3D9)(pd3dd, &pD3D);
if(res) {
OutTraceDW("GetDirect3D FAILED! %x\n", res);
return(DD_OK);
}
OutTraceDW("GetDirect3D pd3d=%x\n", pD3D);
res=(*pGetAdapterDisplayMode9)(pD3D, 0, &mode);
if(res) {
OutTraceDW("GetAdapterDisplayMode FAILED! %x\n", res);
return(DD_OK);
}
param[2] = mode.Format;
param[7] = 0; //hDeviceWindow
dxw.SetFullScreen(~param[8]?TRUE:FALSE);
param[8] = 1; //Windowed
//param[11] = D3DPRESENTFLAG_DEVICECLIP; //Flags;
param[12] = 0; //FullScreen_RefreshRateInHz;
param[13] = D3DPRESENT_INTERVAL_DEFAULT; //PresentationInterval
}
else{
res=(*pGetDirect3D8)(pd3dd, &pD3D);
if(res) {
OutTraceDW("GetDirect3D FAILED! %x\n", res);
return(DD_OK);
}
OutTraceDW("GetDirect3D pd3d=%x\n", pD3D);
res=(*pGetAdapterDisplayMode8)(pD3D, 0, &mode);
if(res) {
OutTraceDW("GetAdapterDisplayMode FAILED! %x\n", res);
return(DD_OK);
}
param[2] = mode.Format;
param[6] = 0; //hDeviceWindow
dxw.SetFullScreen(~param[7]?TRUE:FALSE);
param[7] = 1; //Windowed
//param[10] = D3DPRESENTFLAG_DEVICECLIP; //Flags;
param[11] = 0; //FullScreen_RefreshRateInHz;
param[12] = D3DPRESENT_INTERVAL_DEFAULT; //PresentationInterval
}
res = (*pReset)(pd3dd, (D3DPRESENT_PARAMETERS *)param);
if(res){
OutTraceDW("FAILED! %x\n", res);
return res;
}
OutTraceDW("SUCCESS!\n");
if(dwD3DVersion == 8){
HookD3DDevice8(&pd3dd);
}
else {
HookD3DDevice9(&pd3dd);
}
dxw.SetScreenSize(pPresParam->BackBufferWidth, pPresParam->BackBufferHeight);
GetHookInfo()->IsFullScreen = dxw.IsFullScreen();
GetHookInfo()->DXVersion=(short)dwD3DVersion;
GetHookInfo()->Height=(short)dxw.GetScreenHeight();
GetHookInfo()->Width=(short)dxw.GetScreenWidth();
GetHookInfo()->ColorDepth=(short)dxw.VirtualPixelFormat.dwRGBBitCount;
return D3D_OK;
}
@ -1044,7 +1122,6 @@ HRESULT WINAPI extCreateAdditionalSwapChain(void *lpd3d, D3DPRESENT_PARAMETERS *
OutTrace(" PresentationInterval = 0x%x\n", *(tmp ++));
}
//((LPDIRECT3D9)lpd3d)->GetAdapterDisplayMode(0, &mode);
if (dwD3DVersion == 9)
(*pGetAdapterDisplayMode9)(lpd3d, 0, &mode);
else
@ -1291,10 +1368,33 @@ HRESULT WINAPI extQueryInterfaceDev9(void *obj, REFIID riid, void** ppvObj)
return res;
}
HRESULT WINAPI extGetDirect3D(void *lpdd3dd, IDirect3D9 **ppD3D9)
HRESULT WINAPI extGetDirect3D8(void *lpdd3dd, void **ppD3D8)
{
HRESULT res;
OutTraceD3D("Device::GetDirect3D(8): d3dd=%x\n", lpdd3dd);
res=(*pGetDirect3D8)(lpdd3dd, ppD3D8);
if(res)
OutTraceE("Device::GetDirect3D ERROR: d3dd=%x ret=%x\n", lpdd3dd, res);
else{
OutTraceD3D("Device::GetDirect3D: d3dd=%x d3d=%x\n", lpdd3dd, *ppD3D8);
HookDirect3D8(*ppD3D8);
}
return res;
}
HRESULT WINAPI extGetDirect3D9(void *lpdd3dd, void **ppD3D9)
{
HRESULT res;
OutTraceD3D("Device::GetDirect3D(9): d3dd=%x\n", lpdd3dd);
return (*pGetDirect3D)(lpdd3dd, ppD3D9);
res=(*pGetDirect3D9)(lpdd3dd, ppD3D9);
if(res)
OutTraceE("Device::GetDirect3D ERROR: d3dd=%x ret=%x\n", lpdd3dd, res);
else{
OutTraceD3D("Device::GetDirect3D: d3dd=%x d3d=%x\n", lpdd3dd, *ppD3D9);
// re-hook d3d session: neeeded for Need for Speed Underground
HookDirect3D9(*ppD3D9, FALSE);
}
return res;
}
HRESULT WINAPI extCheckFullScreen(void)
@ -1393,3 +1493,17 @@ ULONG WINAPI extEndScene9(void *lpdd3dd)
if (res) OutTraceE("Device::EndScene(9) ERROR: err=%x\n", res);
return res;
}
ULONG WINAPI extSetTexture8(void *lpd3dd, DWORD Stage, void* pTexture)
{
(*pSetTexture8)(lpd3dd, Stage, NULL);
OutTraceD3D("Device::SetTexture(8): d3dd=%x stage=%x\n", lpd3dd, Stage);
return DD_OK;
}
ULONG WINAPI extSetTexture9(void *lpd3dd, DWORD Stage, void* pTexture)
{
(*pSetTexture9)(lpd3dd, Stage, NULL);
OutTraceD3D("Device::SetTexture(9): d3dd=%x stage=%x\n", lpd3dd, Stage);
return DD_OK;
}

View File

@ -67,6 +67,8 @@ typedef HRESULT (WINAPI *GetCurrentViewport2_Type)(void *, LPDIRECT3DVIEWPORT2 *
typedef HRESULT (WINAPI *SetCurrentViewport2_Type)(void *, LPDIRECT3DVIEWPORT2);
typedef HRESULT (WINAPI *GetCurrentViewport3_Type)(void *, LPDIRECT3DVIEWPORT3 *);
typedef HRESULT (WINAPI *SetCurrentViewport3_Type)(void *, LPDIRECT3DVIEWPORT3);
typedef HRESULT (WINAPI *SetTexture3_Type)(void *, DWORD, LPDIRECT3DTEXTURE2);
typedef HRESULT (WINAPI *SetTexture7_Type)(void *, DWORD, LPDIRECTDRAWSURFACE7);
D3DInitialize_Type pD3DInitialize = NULL;
D3DGetCaps_Type pD3DGetCaps = NULL;
@ -92,6 +94,8 @@ GetCurrentViewport2_Type pGetCurrentViewport2 = NULL;
SetCurrentViewport2_Type pSetCurrentViewport2 = NULL;
GetCurrentViewport3_Type pGetCurrentViewport3 = NULL;
SetCurrentViewport3_Type pSetCurrentViewport3 = NULL;
SetTexture3_Type pSetTexture3 = NULL;
SetTexture7_Type pSetTexture7 = NULL;
// IDirect3DViewport-n interfaces
@ -124,8 +128,6 @@ DeleteViewport2_Type pDeleteViewport2 = NULL;
NextViewport2_Type pNextViewport2 = NULL;
HRESULT WINAPI extInitialize(void *);
HRESULT WINAPI extEnumDevices(void *, LPD3DENUMDEVICESCALLBACK, LPVOID);
HRESULT WINAPI extEnumDevices7(void *, LPD3DENUMDEVICESCALLBACK7, LPVOID);
@ -179,6 +181,8 @@ HRESULT WINAPI extSetCurrentViewport3(void *, LPDIRECT3DVIEWPORT3);
HRESULT WINAPI extGetCurrentViewport3(void *, LPDIRECT3DVIEWPORT3 *);
HRESULT WINAPI extSetViewport7(void *, LPD3DVIEWPORT7);
HRESULT WINAPI extGetViewport7(void *, LPD3DVIEWPORT7);
HRESULT WINAPI extSetTexture3(void *, DWORD, LPDIRECT3DTEXTURE2);
HRESULT WINAPI extSetTexture7(void *, DWORD, LPDIRECTDRAWSURFACE7);
extern char *ExplainDDError(DWORD);
@ -308,7 +312,6 @@ void HookDirect3DDevice(void **lpd3ddev, int d3dversion)
if(dxw.dwFlags2 & WIREFRAME)(*pSetRenderState2)(*lpd3ddev, D3DRENDERSTATE_FILLMODE, D3DFILL_WIREFRAME);
if(dxw.dwFlags4 & DISABLEFOGGING) (*pSetRenderState2)(*lpd3ddev, D3DRENDERSTATE_FOGENABLE, FALSE);
if(dxw.dwFlags4 & ZBUFFERALWAYS) (*pSetRenderState2)(*lpd3ddev, D3DRENDERSTATE_ZFUNC, D3DCMP_ALWAYS);
//if(1) (*pSetRenderState2)(*lpd3ddev, D3DRENDERSTATE_ZFUNC, D3DCMP_LESSEQUAL);
}
break;
case 3:
@ -320,11 +323,11 @@ void HookDirect3DDevice(void **lpd3ddev, int d3dversion)
SetHook((void *)(**(DWORD **)lpd3ddev + 52), extGetCurrentViewport3, (void **)&pGetCurrentViewport3, "GetCurrentViewport(3)");
SetHook((void *)(**(DWORD **)lpd3ddev + 88), extSetRenderState3, (void **)&pSetRenderState3, "SetRenderState(3)");
SetHook((void *)(**(DWORD **)lpd3ddev + 96), extSetLightState3, (void **)&pSetLightState3, "SetLightState(3)");
if (dxw.dwFlags4 & NOTEXTURES) SetHook((void *)(**(DWORD **)lpd3ddev + 152), extSetTexture3, (void **)&pSetTexture3, "SetTexture(D3)");
if(pSetRenderState3){
if(dxw.dwFlags2 & WIREFRAME)(*pSetRenderState3)(*lpd3ddev, D3DRENDERSTATE_FILLMODE, D3DFILL_WIREFRAME);
if(dxw.dwFlags4 & DISABLEFOGGING) (*pSetRenderState3)(*lpd3ddev, D3DRENDERSTATE_FOGENABLE, FALSE);
if(dxw.dwFlags4 & ZBUFFERALWAYS) (*pSetRenderState3)(*lpd3ddev, D3DRENDERSTATE_ZFUNC, D3DCMP_ALWAYS);
//if(1) (*pSetRenderState3)(*lpd3ddev, D3DRENDERSTATE_ZFUNC, D3DCMP_LESSEQUAL);
}
break;
case 7:
@ -333,11 +336,11 @@ void HookDirect3DDevice(void **lpd3ddev, int d3dversion)
SetHook((void *)(**(DWORD **)lpd3ddev + 52), extSetViewport7, (void **)&pSetViewport7, "SetViewport(7)");
SetHook((void *)(**(DWORD **)lpd3ddev + 60), extGetViewport7, (void **)&pGetViewport7, "GetViewport(7)");
SetHook((void *)(**(DWORD **)lpd3ddev + 80), extSetRenderState7, (void **)&pSetRenderState7, "SetRenderState(7)");
if (dxw.dwFlags4 & NOTEXTURES) SetHook((void *)(**(DWORD **)lpd3ddev + 140), extSetTexture7, (void **)&pSetTexture7, "SetTexture(D7)");
if(pSetRenderState7){
if(dxw.dwFlags2 & WIREFRAME)(*pSetRenderState7)(*lpd3ddev, D3DRENDERSTATE_FILLMODE, D3DFILL_WIREFRAME);
if(dxw.dwFlags4 & DISABLEFOGGING) (*pSetRenderState7)(*lpd3ddev, D3DRENDERSTATE_FOGENABLE, FALSE);
if(dxw.dwFlags4 & ZBUFFERALWAYS) (*pSetRenderState7)(*lpd3ddev, D3DRENDERSTATE_ZFUNC, D3DCMP_ALWAYS);
//if(1) (*pSetRenderState7)(*lpd3ddev, D3DRENDERSTATE_ZFUNC, D3DCMP_LESSEQUAL);
}
break;
}
@ -1199,3 +1202,13 @@ HRESULT WINAPI extNextViewport2(void *d3dd, LPDIRECT3DVIEWPORT2 lpd3dvp, LPDIREC
else OutTraceD3D("NextViewport(D3DD2): next=%x\n", *vpnext);
return res;
}
HRESULT WINAPI extSetTexture3(void *, DWORD, LPDIRECT3DTEXTURE2)
{
return DD_OK;
}
HRESULT WINAPI extSetTexture7(void *, DWORD, LPDIRECTDRAWSURFACE7)
{
return DD_OK;
}

View File

@ -205,6 +205,7 @@
#define IDC_HIDEDESKTOP 1163
#define IDC_STRETCHTIMERS 1164
#define IDC_NOFLIPEMULATION 1165
#define IDC_NOTEXTURES 1166
#define ID_MODIFY 32771
#define ID_DELETE 32772
#define ID_ADD 32773

View File

@ -43,9 +43,7 @@ void CTabDirectX::DoDataExchange(CDataExchange* pDX)
DDX_Check(pDX, IDC_NOPIXELFORMAT, cTarget->m_NoPixelFormat);
DDX_Check(pDX, IDC_NOALPHACHANNEL, cTarget->m_NoAlphaChannel);
DDX_Check(pDX, IDC_FIXREFCOUNTER, cTarget->m_FixRefCounter);
DDX_Check(pDX, IDC_ADDPROXYLIBS, cTarget->m_AddProxyLibs);
DDX_Check(pDX, IDC_NOFLIPEMULATION, cTarget->m_NoFlipEmulation);
//DDX_Check(pDX, IDC_SAVECAPS, cTarget->m_SaveCaps);
}
BEGIN_MESSAGE_MAP(CTabDirectX, CDialog)

View File

@ -60,6 +60,7 @@ void CTabWindow::DoDataExchange(CDataExchange* pDX)
DDX_LBIndex(pDX, IDC_LISTRES, cTarget->m_MaxScreenRes);
// 3D management
DDX_Check(pDX, IDC_NOTEXTURES, cTarget->m_NoTextures);
DDX_Check(pDX, IDC_WIREFRAME, cTarget->m_WireFrame);
DDX_Check(pDX, IDC_DISABLEFOGGING, cTarget->m_DisableFogging);
}

View File

@ -63,7 +63,6 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
m_DisableFogging = FALSE;
m_NoPower2Fix = FALSE;
m_NoPerfCounter = FALSE;
m_AddProxyLibs = FALSE;
m_UnNotify = FALSE;
m_Windowize = TRUE; // default true !!
m_HookDLLs = TRUE; // default true !!
@ -139,6 +138,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
m_AnalyticMode = FALSE;
m_NoPaletteUpdate = FALSE;
m_WireFrame = FALSE;
m_NoTextures = FALSE;
m_BlackWhite = FALSE;
m_InitX = 0;
m_InitY = 0;

View File

@ -128,7 +128,6 @@ public:
BOOL m_ZBufferAlways;
BOOL m_NoPower2Fix;
BOOL m_NoPerfCounter;
BOOL m_AddProxyLibs;
BOOL m_DisableFogging;
BOOL m_SuppressIME;
BOOL m_SetCompatibility;
@ -144,6 +143,7 @@ public:
BOOL m_SaveCaps;
BOOL m_SingleProcAffinity;
BOOL m_WireFrame;
BOOL m_NoTextures;
BOOL m_BlackWhite;
BOOL m_SuppressD3DExt;
BOOL m_Force16BPP;

Binary file not shown.

View File

@ -347,7 +347,7 @@ BEGIN
CONTROL "by default set no ALPHACHANNEL",IDC_NOALPHACHANNEL,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,160,123,12
CONTROL "Fix ddraw ref counter",IDC_FIXREFCOUNTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,172,123,12
CONTROL "Add proxy libs",IDC_ADDPROXYLIBS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,184,123,12
CONTROL "Add proxy libs",IDC_ADDPROXYLIBS,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_DISABLED | WS_TABSTOP,15,200,123,12
CONTROL "Compensate Flip emulation",IDC_NOFLIPEMULATION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,76,119,10
END
@ -435,12 +435,13 @@ BEGIN
CONTROL "Simulate BW monitor",IDC_BLACKWHITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,52,96,10
CONTROL "Set 16BPP RGB565 encoding",IDC_USERGB565,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,64,126,9
CONTROL "Lock Sys Colors",IDC_LOCKSYSCOLORS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,76,126,9
GROUPBOX "3D effects",IDC_STATIC,149,191,144,43
CONTROL "Disable Fogging",IDC_DISABLEFOGGING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,217,96,10
GROUPBOX "Screen resolution",IDC_STATIC,149,123,144,64
GROUPBOX "3D effects",IDC_STATIC,149,175,144,59
CONTROL "Disable Fogging",IDC_DISABLEFOGGING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,218,96,10
GROUPBOX "Screen resolution",IDC_STATIC,149,123,144,46
CONTROL "Limit resolution:",IDC_LIMITSCREENRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,136,63,10
LISTBOX IDC_LISTRES,226,133,57,26,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
CONTROL "Hide desktop background",IDC_HIDEDESKTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,184,125,10
CONTROL "Disable Textures",IDC_NOTEXTURES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,160,194,96,10
END
IDD_TAB_EMPTY DIALOGEX 0, 0, 300, 240

Binary file not shown.

View File

@ -166,7 +166,6 @@ static void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
if(dlg->m_ZBufferAlways) t->flags4 |= ZBUFFERALWAYS;
if(dlg->m_NoPower2Fix) t->flags4 |= NOPOWER2FIX;
if(dlg->m_NoPerfCounter) t->flags4 |= NOPERFCOUNTER;
if(dlg->m_AddProxyLibs) t->flags4 |= ADDPROXYLIBS;
if(dlg->m_DisableFogging) t->flags4 |= DISABLEFOGGING;
if(dlg->m_SuppressIME) t->flags2 |= SUPPRESSIME;
if(dlg->m_SuppressD3DExt) t->flags3 |= SUPPRESSD3DEXT;
@ -238,6 +237,7 @@ static void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
if(dlg->m_HookOpenGL) t->flags2 |= HOOKOPENGL;
if(dlg->m_ForceHookOpenGL) t->flags3 |= FORCEHOOKOPENGL;
if(dlg->m_WireFrame) t->flags2 |= WIREFRAME;
if(dlg->m_NoTextures) t->flags4 |= NOTEXTURES;
if(dlg->m_BlackWhite) t->flags3 |= BLACKWHITE;
if(dlg->m_FakeVersion) t->flags2 |= FAKEVERSION;
if(dlg->m_FullRectBlt) t->flags2 |= FULLRECTBLT;
@ -340,7 +340,6 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
dlg->m_ZBufferAlways = t->flags4 & ZBUFFERALWAYS ? 1 : 0;
dlg->m_NoPower2Fix = t->flags4 & NOPOWER2FIX ? 1 : 0;
dlg->m_NoPerfCounter = t->flags4 & NOPERFCOUNTER ? 1 : 0;
dlg->m_AddProxyLibs = t->flags4 & ADDPROXYLIBS ? 1 : 0;
dlg->m_DisableFogging = t->flags4 & DISABLEFOGGING ? 1 : 0;
dlg->m_SaveLoad = t->flags & SAVELOAD ? 1 : 0;
dlg->m_SlowDown = t->flags & SLOWDOWN ? 1 : 0;
@ -395,6 +394,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
dlg->m_HookOpenGL = t->flags2 & HOOKOPENGL ? 1 : 0;
dlg->m_ForceHookOpenGL = t->flags3 & FORCEHOOKOPENGL ? 1 : 0;
dlg->m_WireFrame = t->flags2 & WIREFRAME ? 1 : 0;
dlg->m_NoTextures = t->flags4 & NOTEXTURES ? 1 : 0;
dlg->m_BlackWhite = t->flags3 & BLACKWHITE ? 1 : 0;
dlg->m_FakeVersion = t->flags2 & FAKEVERSION ? 1 : 0;
dlg->m_FullRectBlt = t->flags2 & FULLRECTBLT ? 1 : 0;

View File

@ -1,37 +0,0 @@
int WINAPI D3DPERF_BeginEvent(D3DCOLOR col, LPCWSTR wszName)
{
if (!gl_hOriginalDll) LoadOriginalDll(); // looking for the "right d3d9.dll"
typedef int (WINAPI* D3DPERF_BE)(D3DCOLOR,LPCWSTR);
D3DPERF_BE D3DPERF_BeginEvent_fn = (D3DPERF_BE) GetProcAddress( gl_hOriginalDll, "D3DPERF_BeginEvent");
return D3DPERF_BeginEvent_fn(col, wszName);
}
int WINAPI D3DPERF_EndEvent()
{
if (!gl_hOriginalDll) LoadOriginalDll(); // looking for the "right d3d9.dll"
typedef int (WINAPI* D3DPERF_EE)(void);
D3DPERF_EE D3DPERF_EndEvent_fn = (D3DPERF_EE) GetProcAddress( gl_hOriginalDll, "D3DPERF_EndEvent");
return D3DPERF_EndEvent_fn();
}
void WINAPI D3DPERF_SetMarker(D3DCOLOR col, LPCWSTR wszName)
{
if (!gl_hOriginalDll) LoadOriginalDll(); // looking for the "right d3d9.dll"
typedef void (WINAPI* D3DPERF_SM)(D3DCOLOR,LPCWSTR);
D3DPERF_SM D3DPERF_SetMarker_fn = (D3DPERF_SM) GetProcAddress( gl_hOriginalDll, "D3DPERF_SetMarker");
D3DPERF_SetMarker_fn(col, wszName);
}
LIBRARY "d3d9"
EXPORTS
Direct3DCreate9 @1
D3DPERF_BeginEvent @2
D3DPERF_EndEvent @3
D3DPERF_SetMarker @4