diff --git a/libmupen64plus/D3D8Interceptor/Direct3D8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3D8Functions.cpp index 8ceb211342..507bed1a83 100644 --- a/libmupen64plus/D3D8Interceptor/Direct3D8Functions.cpp +++ b/libmupen64plus/D3D8Interceptor/Direct3D8Functions.cpp @@ -8,12 +8,14 @@ extern "C" D3D8Wrapper::IDirect3D8::IDirect3D8(D3D8Base::IDirect3D8* real) : D3D8Wrapper::IDirect3DUnknown((IUnknown*) real) { + LOG("IDirect3D8::IDirect3D8( " << real << " )\n"); m_pD3D = real; } // Tries to find the real object in the pointer set, or creates a new wrapped object D3D8Wrapper::IDirect3D8* D3D8Wrapper::IDirect3D8::GetDirect3D(D3D8Base::IDirect3D8* pD3D) { + LOG("IDirect3D8::GetDirect3D( " << pD3D << " )\n"); D3D8Wrapper::IDirect3D8* p = (D3D8Wrapper::IDirect3D8*) m_List.GetDataPtr(pD3D); if( p == NULL ) { @@ -28,6 +30,7 @@ extern "C" STDMETHODIMP_(ULONG) D3D8Wrapper::IDirect3D8::Release(THIS) { + LOG("IDirect3D8::Release( " << this << " )\n"); m_pUnk->Release(); ULONG ulRef = --m_ulRef; @@ -42,113 +45,106 @@ extern "C" } + /*** IDirect3D8 methods ***/ STDMETHODIMP D3D8Wrapper::IDirect3D8::GetAdapterDisplayMode(THIS_ UINT Adapter,D3D8Base::D3DDISPLAYMODE* pMode) { - LOG("IDirect3D8::GetAdapterDisplayMode"); + LOG("IDirect3D8::GetAdapterDisplayMode( " << Adapter << " , " << pMode << " )\n"); return m_pD3D->GetAdapterDisplayMode(Adapter, pMode); } - - /*** IDirect3D8 methods ***/ - STDMETHODIMP D3D8Wrapper::IDirect3D8::RegisterSoftwareDevice(void* pInitializeFunction) { - LOG("IDirect3D8::RegisterSoftwareDevice"); + LOG("IDirect3D8::RegisterSoftwareDevice( " << pInitializeFunction << " )\n"); return m_pD3D->RegisterSoftwareDevice(pInitializeFunction); } STDMETHODIMP_(UINT) D3D8Wrapper::IDirect3D8::GetAdapterCount(THIS) { - LOG("IDirect3D8::GetAdapterCount"); + LOG("IDirect3D8::GetAdapterCount()\n"); return m_pD3D->GetAdapterCount(); } - STDMETHODIMP D3D8Wrapper::IDirect3D8::GetAdapterIdentifier(UINT Adapter,DWORD Flags,D3D8Base::D3DADAPTER_IDENTIFIER8* pIdentifier) { - LOG("IDirect3D8::GetAdapterIdentifier"); + LOG("IDirect3D8::GetAdapterIdentifier( " << Adapter << " , " << Flags << " , " << pIdentifier << " )\n"); return m_pD3D->GetAdapterIdentifier(Adapter,Flags,pIdentifier); } - STDMETHODIMP_(UINT) D3D8Wrapper::IDirect3D8::GetAdapterModeCount(UINT Adapter) { - LOG("IDirect3D8::GetAdapterModeCount"); + LOG("IDirect3D8::GetAdapterModeCount( " << Adapter << " )\n"); return m_pD3D->GetAdapterModeCount(Adapter); } STDMETHODIMP D3D8Wrapper::IDirect3D8::EnumAdapterModes(UINT Adapter,UINT Mode,D3D8Base::D3DDISPLAYMODE* pMode) { - LOG("IDirect3D8::EnumAdapterModes"); + LOG("IDirect3D8::EnumAdapterModes( " << Adapter << " , " << Mode << " , " << pMode << " )\n"); return m_pD3D->EnumAdapterModes(Adapter,Mode,pMode); } - STDMETHODIMP D3D8Wrapper::IDirect3D8::CheckDeviceType(UINT Adapter,D3D8Base::D3DDEVTYPE CheckType,D3D8Base::D3DFORMAT DisplayFormat,D3D8Base::D3DFORMAT BackBufferFormat,BOOL Windowed) { - LOG("IDirect3D8::CheckDeviceType"); + LOG("IDirect3D8::CheckDeviceType( " << Adapter << " , " << CheckType << " , " << DisplayFormat << " , " << BackBufferFormat << " , " << Windowed << " )\n"); return m_pD3D->CheckDeviceType(Adapter,CheckType,DisplayFormat,BackBufferFormat,Windowed); } - STDMETHODIMP D3D8Wrapper::IDirect3D8::CheckDeviceFormat(UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,D3D8Base::D3DFORMAT AdapterFormat,DWORD Usage,D3D8Base::D3DRESOURCETYPE RType,D3D8Base::D3DFORMAT CheckFormat) { - LOG("IDirect3D8::CheckDeviceFormat"); + LOG("IDirect3D8::CheckDeviceFormat( " << Adapter << " , " << DeviceType << " , " << AdapterFormat << " , " << Usage << " , " << RType << " , " << CheckFormat << " )\n"); return m_pD3D->CheckDeviceFormat(Adapter,DeviceType,AdapterFormat,Usage,RType,CheckFormat); } - STDMETHODIMP D3D8Wrapper::IDirect3D8::CheckDeviceMultiSampleType(UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,D3D8Base::D3DFORMAT SurfaceFormat,BOOL Windowed,D3D8Base::D3DMULTISAMPLE_TYPE MultiSampleType) { - LOG("IDirect3D8::CheckDeviceMultiSampleType"); + LOG("IDirect3D8::CheckDeviceMultiSampleType( " << Adapter << " , " << DeviceType << " , " << SurfaceFormat << " , " << Windowed << " , " << MultiSampleType << " )\n"); return m_pD3D->CheckDeviceMultiSampleType(Adapter,DeviceType,SurfaceFormat,Windowed,MultiSampleType); } - STDMETHODIMP D3D8Wrapper::IDirect3D8::CheckDepthStencilMatch(UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,D3D8Base::D3DFORMAT AdapterFormat,D3D8Base::D3DFORMAT RenderTargetFormat,D3D8Base::D3DFORMAT DepthStencilFormat) { - LOG("IDirect3D8::CheckDepthStencilMatch"); + LOG("IDirect3D8::CheckDepthStencilMatch( " << Adapter << " , " << DeviceType << " , " << AdapterFormat << " , " << RenderTargetFormat << " , " << DepthStencilFormat << " )\n"); return m_pD3D->CheckDepthStencilMatch(Adapter,DeviceType,AdapterFormat,RenderTargetFormat,DepthStencilFormat); } STDMETHODIMP D3D8Wrapper::IDirect3D8::GetDeviceCaps(UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,D3D8Base::D3DCAPS8* pCaps) { - LOG("IDirect3D8::GetDeviceCaps"); + LOG("IDirect3D8::GetDeviceCaps( " << Adapter << " , " << DeviceType << " , " << pCaps << " )\n"); return m_pD3D->GetDeviceCaps(Adapter,DeviceType,pCaps); } STDMETHODIMP_(HMONITOR) D3D8Wrapper::IDirect3D8::GetAdapterMonitor(UINT Adapter) { - LOG("IDirect3D8::GetAdapterMonitor"); + LOG("IDirect3D8::GetAdapterMonitor( " << Adapter << " )\n"); return m_pD3D->GetAdapterMonitor(Adapter); } - STDMETHODIMP D3D8Wrapper::IDirect3D8::CreateDevice(UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3D8Base::D3DPRESENT_PARAMETERS* pPresentationParameters,D3D8Wrapper::IDirect3DDevice8** ppReturnedDeviceInterface) { - LOG("IDirect3D8::CreateDevice"); - D3D8Base::IDirect3DDevice8* base_device = NULL; + LOG("IDirect3D8::CreateDevice( " << Adapter << " , " << DeviceType << " , " << hFocusWindow << " , " << BehaviorFlags << " , " << pPresentationParameters << " , " << ppReturnedDeviceInterface << " )\n"); + D3D8Base::IDirect3DDevice8* realDevice = NULL; - HRESULT hr = m_pD3D->CreateDevice(Adapter,DeviceType,hFocusWindow,BehaviorFlags,pPresentationParameters,&base_device); + HRESULT hr = m_pD3D->CreateDevice(Adapter,DeviceType,hFocusWindow,BehaviorFlags,pPresentationParameters,&realDevice); if(FAILED(hr)) { return hr; } // Wrap the real object - D3D8Wrapper::IDirect3DDevice8* f = D3D8Wrapper::IDirect3DDevice8::GetDirect3DDevice(base_device); + D3D8Wrapper::IDirect3DDevice8* wrappedDevice = D3D8Wrapper::IDirect3DDevice8::GetDirect3DDevice(realDevice); - last_device = f; + // Store this wrapped pointer for grabbing the screen later + last_device = wrappedDevice; - D3D8Base::IDirect3DSurface8 *f2 = NULL; + // Create a new render target + D3D8Base::IDirect3DSurface8 *realSurface = NULL; + HRESULT hr2 = realDevice->CreateRenderTarget(pPresentationParameters->BackBufferWidth,pPresentationParameters->BackBufferHeight,D3D8Base::D3DFMT_X8R8G8B8,pPresentationParameters->MultiSampleType,FALSE,&realSurface); - // make a new render target - HRESULT hr2 = base_device->CreateRenderTarget(pPresentationParameters->BackBufferWidth,pPresentationParameters->BackBufferHeight,D3D8Base::D3DFMT_X8R8G8B8,pPresentationParameters->MultiSampleType,FALSE,&f2); - render_surface = D3D8Wrapper::IDirect3DSurface8::GetSurface(f2); + // Store a wrapped pointer to it for grabbing the screen + render_surface = D3D8Wrapper::IDirect3DSurface8::GetSurface(realSurface); // Return our wrapped object - *ppReturnedDeviceInterface = f; + *ppReturnedDeviceInterface = wrappedDevice; return hr; } diff --git a/libmupen64plus/D3D8Interceptor/Direct3DBaseTexture8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DBaseTexture8Functions.cpp index 437a547f8b..ffd1176e41 100644 --- a/libmupen64plus/D3D8Interceptor/Direct3DBaseTexture8Functions.cpp +++ b/libmupen64plus/D3D8Interceptor/Direct3DBaseTexture8Functions.cpp @@ -6,28 +6,28 @@ extern "C" { D3D8Wrapper::IDirect3DBaseTexture8::IDirect3DBaseTexture8(D3D8Base::IDirect3DBaseTexture8* pTexture) : IDirect3DResource8((D3D8Base::IDirect3DResource8*) pTexture) { - LOG("IDirect3DBaseTexture8"); + LOG("IDirect3DBaseTexture8::IDirect3DBaseTexture8( " << pTexture << " )\n"); m_pD3D = pTexture; } /*STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE;*/ STDMETHODIMP_(DWORD) D3D8Wrapper::IDirect3DBaseTexture8::SetLOD(DWORD LODNew) { - LOG("IDirect3DBaseTexture8::SetLOD"); + LOG("IDirect3DBaseTexture8::SetLOD( " << LODNew << " )\n"); return m_pD3D->SetLOD(LODNew); } /*STDMETHOD_(DWORD, GetLOD)(THIS) PURE;*/ STDMETHODIMP_(DWORD) D3D8Wrapper::IDirect3DBaseTexture8::GetLOD() { - LOG("IDirect3DBaseTexture8::GetLOD"); + LOG("IDirect3DBaseTexture8::GetLOD()\n"); return m_pD3D->GetLOD(); } /*STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE;*/ STDMETHODIMP_(DWORD) D3D8Wrapper::IDirect3DBaseTexture8::GetLevelCount() { - LOG("IDirect3DBaseTexture8::GetLevelCount"); + LOG("IDirect3DBaseTexture8::GetLevelCount()\n"); return m_pD3D->GetLevelCount(); } } diff --git a/libmupen64plus/D3D8Interceptor/Direct3DCubeTexture8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DCubeTexture8Functions.cpp index f1bd52b2d5..3280d5ebfd 100644 --- a/libmupen64plus/D3D8Interceptor/Direct3DCubeTexture8Functions.cpp +++ b/libmupen64plus/D3D8Interceptor/Direct3DCubeTexture8Functions.cpp @@ -6,14 +6,14 @@ extern "C" { D3D8Wrapper::IDirect3DCubeTexture8::IDirect3DCubeTexture8(D3D8Base::IDirect3DCubeTexture8* pTexture) : IDirect3DBaseTexture8((D3D8Base::IDirect3DBaseTexture8*) pTexture) { - LOG("IDirect3DCubeTexture8"); + LOG("IDirect3DCubeTexture8( " << pTexture << " )\n"); m_pD3D = pTexture; } /*STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3D8Base::D3DSURFACE_DESC *pDesc) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DCubeTexture8::GetLevelDesc(UINT Level,D3D8Base::D3DSURFACE_DESC *pDesc) { - LOG("IDirect3DCubeTexture8::GetLevelDesc"); + LOG("IDirect3DCubeTexture8::GetLevelDesc( " << pDesc << " )\n"); HRESULT hr = m_pD3D->GetLevelDesc(Level,pDesc); return hr; @@ -22,7 +22,7 @@ extern "C" /*STDMETHOD(GetCubeMapSurface)(THIS_ D3D8Base::D3DCUBEMAP_FACES FaceType,UINT Level,D3D8Wrapper::IDirect3DSurface8** ppCubeMapSurface) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DCubeTexture8::GetCubeMapSurface(D3D8Base::D3DCUBEMAP_FACES FaceType,UINT Level,D3D8Wrapper::IDirect3DSurface8** ppCubeMapSurface) { - LOG("IDirect3DCubeTexture8::GetCubeMapSurface"); + LOG("IDirect3DCubeTexture8::GetCubeMapSurface( " << FaceType << " , " << Level << " , " << ppCubeMapSurface << " )\n"); D3D8Base::IDirect3DSurface8* fd = NULL; @@ -38,7 +38,7 @@ extern "C" /*STDMETHOD(LockRect)(THIS_ D3D8Base::D3DCUBEMAP_FACES FaceType,UINT Level,D3D8Base::D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DCubeTexture8::LockRect(D3D8Base::D3DCUBEMAP_FACES FaceType,UINT Level,D3D8Base::D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) { - LOG("IDirect3DCubeTexture8::LockRect"); + LOG("IDirect3DCubeTexture8::LockRect( " << FaceType << " , " << Level << " , " << pLockedRect << " , " << pRect << " , " << Flags << " )\n"); HRESULT hr = m_pD3D->LockRect(FaceType,Level,pLockedRect,pRect,Flags); return hr; @@ -47,7 +47,7 @@ extern "C" /*STDMETHOD(UnlockRect)(THIS_ D3D8Base::D3DCUBEMAP_FACES FaceType,UINT Level) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DCubeTexture8::UnlockRect(D3D8Base::D3DCUBEMAP_FACES FaceType,UINT Level) { - LOG("IDirect3DCubeTexture8::UnlockRect"); + LOG("IDirect3DCubeTexture8::UnlockRect( " << FaceType << " , " << Level << " )\n"); HRESULT hr = m_pD3D->UnlockRect(FaceType,Level); return hr; @@ -56,7 +56,7 @@ extern "C" /*STDMETHOD(AddDirtyRect)(THIS_ D3D8Base::D3DCUBEMAP_FACES FaceType,CONST RECT* pDirtyRect) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DCubeTexture8::AddDirtyRect(D3D8Base::D3DCUBEMAP_FACES FaceType,CONST RECT* pDirtyRect) { - LOG("IDirect3DCubeTexture8::AddDirtyRect"); + LOG("IDirect3DCubeTexture8::AddDirtyRect( " << FaceType << " , " << pDirtyRect << " )\n"); HRESULT hr = m_pD3D->AddDirtyRect(FaceType,pDirtyRect); return hr; diff --git a/libmupen64plus/D3D8Interceptor/Direct3DDevice8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DDevice8Functions.cpp index 2a3311d487..6ec0c08dc4 100644 --- a/libmupen64plus/D3D8Interceptor/Direct3DDevice8Functions.cpp +++ b/libmupen64plus/D3D8Interceptor/Direct3DDevice8Functions.cpp @@ -6,15 +6,13 @@ extern "C" { D3D8Wrapper::IDirect3DDevice8::IDirect3DDevice8(D3D8Base::IDirect3DDevice8* pDevice) : IDirect3DUnknown((IUnknown*) pDevice) { - LOG("IDirect3DDevice8"); + LOG("IDirect3DDevice8::IDirect3DDevice8( " << pDevice << " )\n"); m_pDevice = pDevice; - rTarget = NULL; - zStencil = NULL; } D3D8Wrapper::IDirect3DDevice8* D3D8Wrapper::IDirect3DDevice8::GetDirect3DDevice(D3D8Base::IDirect3DDevice8* pDevice) { - + LOG("IDirect3DDevice8::GetDirect3DDevice( " << pDevice << " )\n"); D3D8Wrapper::IDirect3DDevice8* p = (D3D8Wrapper::IDirect3DDevice8*) m_List.GetDataPtr(pDevice); if(p == NULL) { @@ -29,6 +27,7 @@ extern "C" STDMETHODIMP_(ULONG) D3D8Wrapper::IDirect3DDevice8::Release(THIS) { + LOG("IDirect3DDevice8::Release " << this << "\n"); m_pUnk->Release(); ULONG ulRef = --m_ulRef; @@ -43,358 +42,295 @@ extern "C" } - /*STDMETHOD(TestCooperativeLevel)(THIS) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::TestCooperativeLevel() { - LOG("TestCooperativeLevel"); - HRESULT hr = m_pDevice->TestCooperativeLevel(); - - return hr; + LOG("IDirect3DDevice8::TestCooperativeLevel()\n"); + return m_pDevice->TestCooperativeLevel(); } - /*STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE;*/ STDMETHODIMP_(UINT) D3D8Wrapper::IDirect3DDevice8::GetAvailableTextureMem() { - LOG("GetAvailableTextureMem"); - HRESULT hr = m_pDevice->GetAvailableTextureMem(); - - return hr; + LOG("IDirect3DDevice8::GetAvailableTextureMem()\n"); + return m_pDevice->GetAvailableTextureMem(); } - /*STDMETHOD(ResourceManagerDiscardBytes)(THIS_ DWORD Bytes) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::ResourceManagerDiscardBytes(DWORD Bytes) { - LOG("ResourceManagerDiscardBytes"); - HRESULT hr = m_pDevice->ResourceManagerDiscardBytes(Bytes); - - return hr; + LOG("IDirect3DDevice8::ResourceManagerDiscardBytes( " << Bytes << " )\n"); + return m_pDevice->ResourceManagerDiscardBytes(Bytes); } - /*STDMETHOD(GetDirect3D)(THIS_ IDirect3D8** ppD3D8) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetDirect3D(D3D8Wrapper::IDirect3D8** ppD3D8) { - LOG("GetDirect3D"); + LOG("IDirect3DDevice8::GetDirect3D( " << ppD3D8 << " )\n"); - D3D8Base::IDirect3D8* fd = NULL; + // Run the function and wrap the result before returning it + D3D8Base::IDirect3D8* realD3D = NULL; - HRESULT hr = m_pDevice->GetDirect3D(&fd);//ppD3D8); + HRESULT hr = m_pDevice->GetDirect3D(&realD3D); - D3D8Wrapper::IDirect3D8* f = D3D8Wrapper::IDirect3D8::GetDirect3D(fd); + D3D8Wrapper::IDirect3D8* wrappedD3D = D3D8Wrapper::IDirect3D8::GetDirect3D(realD3D); - *ppD3D8 = f; + *ppD3D8 = wrappedD3D; return hr; } - /*STDMETHOD(GetDeviceCaps)(THIS_ D3D8Base::D3DCAPS8* pCaps) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetDeviceCaps(D3D8Base::D3DCAPS8* pCaps) { - LOG("GetDeviceCaps"); - HRESULT hr = m_pDevice->GetDeviceCaps(pCaps); - - return hr; + LOG("IDirect3DDevice8::GetDeviceCaps( " << pCaps << " )\n"); + return m_pDevice->GetDeviceCaps(pCaps); } - /*STDMETHOD(GetDisplayMode)(THIS_ D3D8Base::D3DDISPLAYMODE* pMode) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetDisplayMode(D3D8Base::D3DDISPLAYMODE* pMode) { - LOG("GetDisplayMode"); - HRESULT hr = m_pDevice->GetDisplayMode(pMode); - - return hr; + LOG("IDirect3DDevice8::GetDisplayMode( " << pMode << " )\n"); + return m_pDevice->GetDisplayMode(pMode); } - /*STDMETHOD(GetCreationParameters)(THIS_ D3D8Base::D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetCreationParameters(D3D8Base::D3DDEVICE_CREATION_PARAMETERS *pParameters) { - LOG("GetCreationParameters"); - HRESULT hr = m_pDevice->GetCreationParameters(pParameters); - - return hr; + LOG("IDirect3DDevice8::GetCreationParameters( " << pParameters << " )\n"); + return m_pDevice->GetCreationParameters(pParameters); } - /*STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot,UINT YHotSpot,D3D8Base::IDirect3DSurface8* pCursorBitmap) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetCursorProperties(UINT XHotSpot,UINT YHotSpot,D3D8Wrapper::IDirect3DSurface8* pCursorBitmap) { - LOG("SetCursorProperties"); - HRESULT hr = m_pDevice->SetCursorProperties(XHotSpot,YHotSpot,pCursorBitmap->GetSurface()); - - return hr; + LOG("IDirect3DDevice8::SetCursorProperties( " << XHotSpot << " , " << YHotSpot << " , " << pCursorBitmap << " )\n"); + return m_pDevice->SetCursorProperties(XHotSpot,YHotSpot,pCursorBitmap->GetSurface()); } - /*STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y,DWORD Flags) PURE;*/ STDMETHODIMP_(void) D3D8Wrapper::IDirect3DDevice8::SetCursorPosition(int X,int Y,DWORD Flags) { - LOG("SetCursorPosition"); + LOG("IDirect3DDevice8::SetCursorPosition( " << X << " , " << Y << " , " << Flags << " )\n"); m_pDevice->SetCursorPosition(X,Y,Flags); } - /*STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE;*/ STDMETHODIMP_(BOOL) D3D8Wrapper::IDirect3DDevice8::ShowCursor(BOOL bShow) { - LOG("ShowCursor"); - HRESULT hr = m_pDevice->ShowCursor(bShow); - - return hr; + LOG("IDirect3DDevice8::ShowCursor( " << bShow << " )\n"); + return m_pDevice->ShowCursor(bShow); } - /*STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3D8Base::D3DPRESENT_PARAMETERS* pPresentationParameters,D3D8Base::IDirect3DSwapChain8** pSwapChain) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateAdditionalSwapChain(D3D8Base::D3DPRESENT_PARAMETERS* pPresentationParameters,D3D8Wrapper::IDirect3DSwapChain8** pSwapChain) { - LOG("CreateAdditionalSwapChain"); - D3D8Base::IDirect3DSwapChain8* fd = NULL; + LOG("IDirect3DDevice8::CreateAdditionalSwapChain( " << pPresentationParameters << " , " << pSwapChain << " )\n"); + D3D8Base::IDirect3DSwapChain8* realD3D = NULL; - HRESULT hr = m_pDevice->CreateAdditionalSwapChain(pPresentationParameters,&fd);//pSwapChain); + HRESULT hr = m_pDevice->CreateAdditionalSwapChain(pPresentationParameters,&realD3D); - D3D8Wrapper::IDirect3DSwapChain8* f = new D3D8Wrapper::IDirect3DSwapChain8(fd); - *pSwapChain = f; + D3D8Wrapper::IDirect3DSwapChain8* wrappedD3D = new D3D8Wrapper::IDirect3DSwapChain8(realD3D); + + *pSwapChain = wrappedD3D; return hr; } - /*STDMETHOD(Reset)(THIS_ D3D8Base::D3DPRESENT_PARAMETERS* pPresentationParameters) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::Reset(D3D8Base::D3DPRESENT_PARAMETERS* pPresentationParameters) { - LOG("Reset"); - HRESULT hr = m_pDevice->Reset(pPresentationParameters); - - return hr; + LOG("IDirect3DDevice8::Reset( " << pPresentationParameters << " )\n"); + return m_pDevice->Reset(pPresentationParameters); } - int present_count = 0; - /*STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::Present(CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) { - LOG("Present"); - LOG(present_count); - LOG(pSourceRect); +#ifdef LOGGING + LOG("IDirect3DDevice8::Present( " << pSourceRect); if (pSourceRect != NULL) { - LOG(pSourceRect->left); - LOG(pSourceRect->top); - LOG(pSourceRect->right); - LOG(pSourceRect->bottom); + LOG("{ " << pSourceRect->left << " , " << pSourceRect->top << " , " << pSourceRect->right << " , " << pSourceRect->bottom << " }"); } - LOG(pDestRect); + LOG(" , " << pDestRect); if (pSourceRect != NULL) { - LOG(pDestRect->left); - LOG(pDestRect->top); - LOG(pDestRect->right); - LOG(pDestRect->bottom); + LOG("{ " << pDestRect->left << " , " << pDestRect->top << " , " << pDestRect->right << " , " << pDestRect->bottom << " }"); } - - LOG(hDestWindowOverride); - LOG(pDirtyRegion); + LOG(" , " << hDestWindowOverride << " , " << pDirtyRegion << " )\n"); +#endif + // Force the result to OK HRESULT hr = D3D_OK; - rendering_callback(0); - + // Don't call the real present //hr = m_pDevice->Present(pSourceRect,pDestRect,hDestWindowOverride,pDirtyRegion); - LOG(hr); + // Let bizhawk know the frame is ready + rendering_callback(0); + return hr; } - /*STDMETHOD(GetBackBuffer)(THIS_ UINT BackBuffer,D3D8Base::D3DBACKBUFFER_TYPE Type,D3D8Base::IDirect3DSurface8** ppBackBuffer) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetBackBuffer(UINT BackBuffer,D3D8Base::D3DBACKBUFFER_TYPE Type,D3D8Wrapper::IDirect3DSurface8** ppBackBuffer) { - LOG("GetBackBuffer"); + LOG("IDirect3DDevice8::GetBackBuffer( " << BackBuffer << " , " << Type << " , " << ppBackBuffer << " )\n"); - D3D8Base::IDirect3DSurface8* fd = NULL; + D3D8Base::IDirect3DSurface8* realD3D = NULL; - HRESULT hr = m_pDevice->GetBackBuffer(BackBuffer,Type,&fd);//ppBackBuffer); + HRESULT hr = m_pDevice->GetBackBuffer(BackBuffer,Type,&realD3D); - D3D8Wrapper::IDirect3DSurface8* f = D3D8Wrapper::IDirect3DSurface8::GetSurface(fd); + D3D8Wrapper::IDirect3DSurface8* wrappedD3D = D3D8Wrapper::IDirect3DSurface8::GetSurface(realD3D); - *ppBackBuffer = f; + *ppBackBuffer = wrappedD3D; return hr; } - /*STDMETHOD(GetRasterStatus)(THIS_ D3D8Base::D3DRASTER_STATUS* pRasterStatus) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetRasterStatus(D3D8Base::D3DRASTER_STATUS* pRasterStatus) { - LOG("GetRasterStatus"); - HRESULT hr = m_pDevice->GetRasterStatus(pRasterStatus); - - return hr; + LOG("IDirect3DDevice8::GetRasterStatus( " << pRasterStatus << " )\n"); + return m_pDevice->GetRasterStatus(pRasterStatus); } - /*STDMETHOD_(void, SetGammaRamp)(THIS_ DWORD Flags,CONST D3D8Base::D3DGAMMARAMP* pRamp) PURE;*/ STDMETHODIMP_(void) D3D8Wrapper::IDirect3DDevice8::SetGammaRamp(DWORD Flags,CONST D3D8Base::D3DGAMMARAMP* pRamp) { - LOG("SetGammaRamp"); + LOG("IDirect3DDevice8::SetGammaRamp( " << Flags << " , " << pRamp << " )\n"); m_pDevice->SetGammaRamp(Flags,pRamp); } - /*STDMETHOD_(void, GetGammaRamp)(THIS_ D3D8Base::D3DGAMMARAMP* pRamp) PURE;*/ STDMETHODIMP_(void) D3D8Wrapper::IDirect3DDevice8::GetGammaRamp(D3D8Base::D3DGAMMARAMP* pRamp) { - LOG("GetGammaRamp"); + LOG("IDirect3DDevice8::GetGammaRamp( " << pRamp << " )\n"); m_pDevice->GetGammaRamp(pRamp); } - /*STDMETHOD(CreateTexture)(THIS_ UINT Width,UINT Height,UINT Levels,DWORD Usage,D3D8Base::D3DFORMAT Format,D3D8Base::D3DPOOL Pool,D3D8Base::IDirect3DTexture8** ppTexture) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateTexture(UINT Width,UINT Height,UINT Levels,DWORD Usage,D3D8Base::D3DFORMAT Format,D3D8Base::D3DPOOL Pool,D3D8Wrapper::IDirect3DTexture8** ppTexture) { - LOG("CreateTexture"); + LOG("IDirect3DDevice8::CreateTexture( " << Width << " , " << Height << " , " << Levels << " , " << Usage << " , " << Format << " , " << Pool << " , " << ppTexture << " )\n"); - D3D8Base::IDirect3DTexture8* fd = NULL; + D3D8Base::IDirect3DTexture8* realD3D = NULL; - HRESULT hr = m_pDevice->CreateTexture(Width,Height,Levels,Usage,Format,Pool,&fd);//ppTexture); + HRESULT hr = m_pDevice->CreateTexture(Width,Height,Levels,Usage,Format,Pool,&realD3D); - D3D8Wrapper::IDirect3DTexture8* f = D3D8Wrapper::IDirect3DTexture8::GetTexture(fd); + D3D8Wrapper::IDirect3DTexture8* wrappedD3D = D3D8Wrapper::IDirect3DTexture8::GetTexture(realD3D); - *ppTexture = f; + *ppTexture = wrappedD3D; return hr; } - /*STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3D8Base::D3DFORMAT Format,D3D8Base::D3DPOOL Pool,D3D8Base::IDirect3DVolumeTexture8** ppVolumeTexture) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateVolumeTexture(UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3D8Base::D3DFORMAT Format,D3D8Base::D3DPOOL Pool,D3D8Wrapper::IDirect3DVolumeTexture8** ppVolumeTexture) { - LOG("CreateVolumeTexture"); + LOG("IDirect3DDevice8::CreateVolumeTexture( " << Width << " , " << Height << " , " << Levels << " , " << Usage << " , " << Format << " , " << Pool << " , " << ppVolumeTexture << " )\n"); - D3D8Base::IDirect3DVolumeTexture8* fd = NULL; + D3D8Base::IDirect3DVolumeTexture8* realD3D = NULL; - HRESULT hr = m_pDevice->CreateVolumeTexture(Width,Height,Depth,Levels,Usage,Format,Pool,&fd);//ppVolumeTexture); + HRESULT hr = m_pDevice->CreateVolumeTexture(Width,Height,Depth,Levels,Usage,Format,Pool,&realD3D); - D3D8Wrapper::IDirect3DVolumeTexture8* f = new D3D8Wrapper::IDirect3DVolumeTexture8(fd); + D3D8Wrapper::IDirect3DVolumeTexture8* wrappedD3D = new D3D8Wrapper::IDirect3DVolumeTexture8(realD3D); - *ppVolumeTexture = f; + *ppVolumeTexture = wrappedD3D; return hr; } - /*STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength,UINT Levels,DWORD Usage,D3D8Base::D3DFORMAT Format,D3D8Base::D3DPOOL Pool,D3D8Base::IDirect3DCubeTexture8** ppCubeTexture) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateCubeTexture(UINT EdgeLength,UINT Levels,DWORD Usage,D3D8Base::D3DFORMAT Format,D3D8Base::D3DPOOL Pool,D3D8Wrapper::IDirect3DCubeTexture8** ppCubeTexture) { - LOG("CreateCubeTexture"); + LOG("IDirect3DDevice8::CreateCubeTexture( " << EdgeLength << " , " << Levels << " , " << Usage << " , " << Format << " , " << Pool << " , " << ppCubeTexture << " )\n"); - D3D8Base::IDirect3DCubeTexture8* fd = NULL; + D3D8Base::IDirect3DCubeTexture8* realD3D = NULL; - HRESULT hr = m_pDevice->CreateCubeTexture(EdgeLength,Levels, Usage,Format,Pool,&fd);//ppCubeTexture); + HRESULT hr = m_pDevice->CreateCubeTexture(EdgeLength,Levels, Usage,Format,Pool,&realD3D); - D3D8Wrapper::IDirect3DCubeTexture8* f = new D3D8Wrapper::IDirect3DCubeTexture8(fd); + D3D8Wrapper::IDirect3DCubeTexture8* wrappedD3D = new D3D8Wrapper::IDirect3DCubeTexture8(realD3D); - *ppCubeTexture = f; + *ppCubeTexture = wrappedD3D; return hr; } - /*STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,D3D8Base::D3DPOOL Pool,D3D8Base::IDirect3DVertexBuffer8** ppVertexBuffer) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateVertexBuffer(UINT Length,DWORD Usage,DWORD FVF,D3D8Base::D3DPOOL Pool,D3D8Wrapper::IDirect3DVertexBuffer8** ppVertexBuffer) { - LOG("CreateVertexBuffer"); + LOG("IDirect3DDevice8::CreateVertexBuffer( " << Length << " , " << Usage << " , " << FVF << " , " << Pool << " , " << ppVertexBuffer << " )\n"); - D3D8Base::IDirect3DVertexBuffer8* fd = NULL; + D3D8Base::IDirect3DVertexBuffer8* realD3D = NULL; - HRESULT hr = m_pDevice->CreateVertexBuffer(Length,Usage,FVF,Pool,&fd);//ppVertexBuffer); + HRESULT hr = m_pDevice->CreateVertexBuffer(Length,Usage,FVF,Pool,&realD3D); - D3D8Wrapper::IDirect3DVertexBuffer8* f = new D3D8Wrapper::IDirect3DVertexBuffer8(fd); + D3D8Wrapper::IDirect3DVertexBuffer8* wrappedD3D = new D3D8Wrapper::IDirect3DVertexBuffer8(realD3D); - *ppVertexBuffer = f; + *ppVertexBuffer = wrappedD3D; return hr; } - /*STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length,DWORD Usage,D3D8Base::D3DFORMAT Format,D3D8Base::D3DPOOL Pool,D3D8Base::IDirect3DIndexBuffer8** ppIndexBuffer) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateIndexBuffer(UINT Length,DWORD Usage,D3D8Base::D3DFORMAT Format,D3D8Base::D3DPOOL Pool,D3D8Wrapper::IDirect3DIndexBuffer8** ppIndexBuffer) { - LOG("CreateIndexBuffer"); + LOG("IDirect3DDevice8::CreateIndexBuffer( " << Length << " , " << Usage << " , " << Format << " , " << Pool << " , " << ppIndexBuffer << " )\n"); - D3D8Base::IDirect3DIndexBuffer8* fd = NULL; + D3D8Base::IDirect3DIndexBuffer8* realD3D = NULL; - HRESULT hr = m_pDevice->CreateIndexBuffer(Length,Usage,Format,Pool,&fd);//ppIndexBuffer); + HRESULT hr = m_pDevice->CreateIndexBuffer(Length,Usage,Format,Pool,&realD3D); - D3D8Wrapper::IDirect3DIndexBuffer8* f = new D3D8Wrapper::IDirect3DIndexBuffer8(fd); + D3D8Wrapper::IDirect3DIndexBuffer8* wrappedD3D = new D3D8Wrapper::IDirect3DIndexBuffer8(realD3D); - *ppIndexBuffer = f; + *ppIndexBuffer = wrappedD3D; return hr; } - /*STDMETHOD(CreateRenderTarget)(THIS_ UINT Width,UINT Height,D3D8Base::D3DFORMAT Format,D3D8Base::D3DMULTISAMPLE_TYPE MultiSample,BOOL Lockable,D3D8Base::IDirect3DSurface8** ppSurface) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateRenderTarget(UINT Width,UINT Height,D3D8Base::D3DFORMAT Format,D3D8Base::D3DMULTISAMPLE_TYPE MultiSample,BOOL Lockable,D3D8Wrapper::IDirect3DSurface8** ppSurface) { - LOG("CreateRenderTarget"); + LOG("IDirect3DDevice8::CreateRenderTarget( " << Width << " , " << Height << " , " << Format << " , " << MultiSample << " , " << Lockable << " , " << ppSurface << " )\n"); - D3D8Base::IDirect3DSurface8* fd = NULL; + D3D8Base::IDirect3DSurface8* realD3D = NULL; - HRESULT hr = m_pDevice->CreateRenderTarget(Width,Height,Format,MultiSample,Lockable,&fd);//ppSurface); + HRESULT hr = m_pDevice->CreateRenderTarget(Width,Height,Format,MultiSample,Lockable,&realD3D); - D3D8Wrapper::IDirect3DSurface8* f = D3D8Wrapper::IDirect3DSurface8::GetSurface(fd); + D3D8Wrapper::IDirect3DSurface8* wrappedD3D = D3D8Wrapper::IDirect3DSurface8::GetSurface(realD3D); - *ppSurface = f; + *ppSurface = wrappedD3D; return hr; } - /*STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width,UINT Height,D3D8Base::D3DFORMAT Format,D3D8Base::D3DMULTISAMPLE_TYPE MultiSample,D3D8Base::IDirect3DSurface8** ppSurface) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateDepthStencilSurface(UINT Width,UINT Height,D3D8Base::D3DFORMAT Format,D3D8Base::D3DMULTISAMPLE_TYPE MultiSample,D3D8Wrapper::IDirect3DSurface8** ppSurface) { - LOG("CreateDepthStencilSurface"); + LOG("IDirect3DDevice8::CreateDepthStencilSurface( " << Width << " , " << Height << " , " << Format << " , " << MultiSample << " , " << ppSurface << " )\n"); - D3D8Base::IDirect3DSurface8* fd = NULL; + D3D8Base::IDirect3DSurface8* realD3D = NULL; - HRESULT hr = m_pDevice->CreateDepthStencilSurface(Width,Height,Format,MultiSample,&fd);//ppSurface); + HRESULT hr = m_pDevice->CreateDepthStencilSurface(Width,Height,Format,MultiSample,&realD3D); - D3D8Wrapper::IDirect3DSurface8* f = D3D8Wrapper::IDirect3DSurface8::GetSurface(fd); + D3D8Wrapper::IDirect3DSurface8* wrappedD3D = D3D8Wrapper::IDirect3DSurface8::GetSurface(realD3D); - *ppSurface = f; + *ppSurface = wrappedD3D; return hr; } - /*STDMETHOD(CreateImageSurface)(THIS_ UINT Width,UINT Height,D3D8Base::D3DFORMAT Format,D3D8Base::IDirect3DSurface8** ppSurface) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateImageSurface(UINT Width,UINT Height,D3D8Base::D3DFORMAT Format,D3D8Wrapper::IDirect3DSurface8** ppSurface) { - LOG("CreateImageSurface"); + LOG("IDirect3DDevice8::CreateImageSurface( " << Width << " , " << Height << " , " << Format << " , " << ppSurface << " )\n"); - D3D8Base::IDirect3DSurface8* fd = NULL; + D3D8Base::IDirect3DSurface8* realD3D = NULL; - HRESULT hr = m_pDevice->CreateImageSurface(Width,Height,Format,&fd);//ppSurface); + HRESULT hr = m_pDevice->CreateImageSurface(Width,Height,Format,&realD3D); - D3D8Wrapper::IDirect3DSurface8* f = D3D8Wrapper::IDirect3DSurface8::GetSurface(fd); + D3D8Wrapper::IDirect3DSurface8* wrappedD3D = D3D8Wrapper::IDirect3DSurface8::GetSurface(realD3D); - *ppSurface = f; + *ppSurface = wrappedD3D; return hr; } - /*STDMETHOD(CopyRects)(THIS_ D3D8Base::IDirect3DSurface8* pSourceSurface,CONST RECT* pSourceRectsArray,UINT cRects,D3D8Base::IDirect3DSurface8* pDestinationSurface,CONST POINT* pDestPointsArray) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CopyRects(D3D8Wrapper::IDirect3DSurface8* pSourceSurface,CONST RECT* pSourceRectsArray,UINT cRects,D3D8Wrapper::IDirect3DSurface8* pDestinationSurface,CONST POINT* pDestPointsArray) { - LOG("CopyRects"); - LOG(pSourceSurface); - LOG(pSourceSurface->GetSurface()); - LOG(pDestinationSurface); - LOG(pDestinationSurface->GetSurface()); - + LOG("IDirect3DDevice8::CopyRects( " << pSourceSurface << " , " << pSourceRectsArray << " , " << cRects << " , " << pDestinationSurface << " , " << pDestPointsArray << " )\n"); + if (pSourceSurface->m_ulRef == 0 || (pSourceSurface->GetSurface()) == (pDestinationSurface->GetSurface())) { - LOG("WTF"); + LOG("WTF\n"); return D3DERR_INVALIDCALL; } HRESULT hr = m_pDevice->CopyRects(pSourceSurface->GetSurface(),pSourceRectsArray,cRects,pDestinationSurface->GetSurface(),pDestPointsArray); - LOG("Back??"); - - LOG(hr); - - LOG(pSourceSurface); - LOG(pSourceSurface->GetSurface()); - LOG(pDestinationSurface); - LOG(pDestinationSurface->GetSurface()); return hr; } /*STDMETHOD(UpdateTexture)(THIS_ D3D8Base::IDirect3DBaseTexture8* pSourceTexture,D3D8Base::IDirect3DBaseTexture8* pDestinationTexture) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::UpdateTexture(D3D8Wrapper::IDirect3DBaseTexture8* pSourceTexture,D3D8Wrapper::IDirect3DBaseTexture8* pDestinationTexture) { - LOG("UpdateTexture"); + LOG("IDirect3DDevice8::UpdateTexture( " << pSourceTexture << " , " << pDestinationTexture << " )\n"); HRESULT hr = m_pDevice->UpdateTexture(pSourceTexture->GetBaseTexture(),pDestinationTexture->GetBaseTexture()); return hr; @@ -403,7 +339,7 @@ extern "C" /*STDMETHOD(GetFrontBuffer)(THIS_ D3D8Base::IDirect3DSurface8* pDestSurface) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetFrontBuffer(D3D8Wrapper::IDirect3DSurface8* pDestSurface) { - LOG("GetFrontBuffer"); + LOG("IDirect3DDevice8::GetFrontBuffer( " << pDestSurface << " )\n"); HRESULT hr = m_pDevice->GetFrontBuffer(pDestSurface->GetSurface()); return hr; @@ -412,28 +348,13 @@ extern "C" /*STDMETHOD(SetRenderTarget)(THIS_ D3D8Base::IDirect3DSurface8* pRenderTarget,D3D8Base::IDirect3DSurface8* pNewZStencil) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetRenderTarget(D3D8Wrapper::IDirect3DSurface8* pRenderTarget,D3D8Wrapper::IDirect3DSurface8* pNewZStencil) { - LOG("SetRenderTarget"); - LOG(pRenderTarget); - LOG(pNewZStencil); + LOG("IDirect3DDevice8::SetRenderTarget( " << pRenderTarget << " , " << pNewZStencil << " )\n"); + //HRESULT hr = m_pDevice->SetRenderTarget(pRenderTarget->GetSurface(),pNewZStencil->GetSurface()); HRESULT hr = m_pDevice->SetRenderTarget(render_surface->GetSurface(),pNewZStencil->GetSurface()); - /*if (this->rTarget != NULL) - { - this->rTarget->Release(); - } - if (this->zStencil != NULL) - { - this->zStencil->Release(); - }*/ - - this->rTarget = pRenderTarget; - this->zStencil = pNewZStencil; - - this->rTarget->m_ulRef++; - this->zStencil->m_ulRef++; - - + pRenderTarget->m_ulRef++; + pNewZStencil->m_ulRef++; return hr; } @@ -441,7 +362,7 @@ extern "C" /*STDMETHOD(GetRenderTarget)(THIS_ D3D8Base::IDirect3DSurface8** ppRenderTarget) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetRenderTarget(D3D8Wrapper::IDirect3DSurface8** ppRenderTarget) { - LOG("GetRenderTarget"); + LOG("IDirect3DDevice8::GetRenderTarget( " << ppRenderTarget << " )\n"); D3D8Base::IDirect3DSurface8* fd = NULL; @@ -457,7 +378,7 @@ extern "C" /*STDMETHOD(GetDepthStencilSurface)(THIS_ D3D8Base::IDirect3DSurface8** ppZStencilSurface) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetDepthStencilSurface(D3D8Wrapper::IDirect3DSurface8** ppZStencilSurface) { - LOG("GetDepthStencilSurface"); + LOG("IDirect3DDevice8::GetDepthStencilSurface( " << ppZStencilSurface << " )\n"); D3D8Base::IDirect3DSurface8* fd = NULL; @@ -473,7 +394,7 @@ extern "C" /*STDMETHOD(BeginScene)(THIS) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::BeginScene() { - LOG("BeginScene"); + LOG("IDirect3DDevice8::BeginScene()\n"); HRESULT hr = m_pDevice->BeginScene(); return hr; @@ -482,7 +403,7 @@ extern "C" /*STDMETHOD(EndScene)(THIS) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::EndScene() { - LOG("EndScene"); + LOG("IDirect3DDevice8::EndScene()\n"); HRESULT hr = m_pDevice->EndScene(); return hr; @@ -491,20 +412,14 @@ extern "C" /*STDMETHOD(Clear)(THIS_ DWORD Count,CONST D3D8Base::D3DRECT* pRects,DWORD Flags,D3D8Base::D3DCOLOR Color,float Z,DWORD Stencil) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::Clear(DWORD Count,CONST D3D8Base::D3DRECT* pRects,DWORD Flags,D3D8Base::D3DCOLOR Color,float Z,DWORD Stencil) { - LOG("Clear"); - LOG(Count); - LOG(pRects); +#ifdef LOGGING + LOG("IDirect3DDevice8::Clear( " << Count << " , " << pRects); if (pRects != NULL) { - LOG(" " << pRects->x1); - LOG(" " << pRects->y1); - LOG(" " << pRects->x2); - LOG(" " << pRects->y2); + LOG("{ " << pRects->x1 << " , " << pRects->y1 << " , " << pRects->x2 << " , " << pRects->y2 << " }") } - LOG(Flags); - LOG(Color); - LOG(Z); - LOG(Stencil); + LOG(" , " << Flags << " , " << Color << " , " << Z << " , " << Stencil << " )\n"); +#endif HRESULT hr = m_pDevice->Clear(Count,pRects,Flags,Color,Z,Stencil); @@ -514,7 +429,7 @@ extern "C" /*STDMETHOD(SetTransform)(THIS_ D3D8Base::D3DTRANSFORMSTATETYPE State,CONST D3D8Base::D3DMATRIX* pMatrix) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetTransform(D3D8Base::D3DTRANSFORMSTATETYPE State,CONST D3D8Base::D3DMATRIX* pMatrix) { - LOG("SetTransform"); + LOG("IDirect3DDevice8::SetTransform( " << State << " , " << pMatrix << " )\n"); HRESULT hr = m_pDevice->SetTransform(State,pMatrix); return hr; @@ -523,7 +438,7 @@ extern "C" /*STDMETHOD(GetTransform)(THIS_ D3D8Base::D3DTRANSFORMSTATETYPE State,D3D8Base::D3DMATRIX* pMatrix) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetTransform(D3D8Base::D3DTRANSFORMSTATETYPE State,D3D8Base::D3DMATRIX* pMatrix) { - LOG("GetTransform"); + LOG("IDirect3DDevice8::GetTransform( " << State << " , " << pMatrix << " )\n"); HRESULT hr = m_pDevice->GetTransform(State,pMatrix); return hr; @@ -532,7 +447,7 @@ extern "C" /*STDMETHOD(MultiplyTransform)(THIS_ D3D8Base::D3DTRANSFORMSTATETYPE,CONST D3D8Base::D3DMATRIX*) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::MultiplyTransform(D3D8Base::D3DTRANSFORMSTATETYPE foo,CONST D3D8Base::D3DMATRIX* bar) { - LOG("MultiplyTransform"); + LOG("IDirect3DDevice8::MultiplyTransform( " << foo << " , " << bar << " )\n"); HRESULT hr = m_pDevice->MultiplyTransform(foo, bar); return hr; @@ -541,36 +456,32 @@ extern "C" /*STDMETHOD(SetViewport)(THIS_ CONST D3D8Base::D3DVIEWPORT8* pViewport) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetViewport(CONST D3D8Base::D3DVIEWPORT8* pViewport) { - LOG("SetViewport"); + LOG("IDirect3DDevice8::SetViewport( " << pViewport << " )\n"); HRESULT hr = m_pDevice->SetViewport(pViewport); - LOG(hr); return hr; } /*STDMETHOD(GetViewport)(THIS_ D3D8Base::D3DVIEWPORT8* pViewport) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetViewport(D3D8Base::D3DVIEWPORT8* pViewport) { - LOG("GetViewport"); - HRESULT hr = m_pDevice->GetViewport(pViewport); - LOG(pViewport); +#ifdef LOGGING + LOG("IDirect3DDevice8::GetViewport( " << pViewport); if (pViewport != NULL) { - LOG(pViewport->X); - LOG(pViewport->Y); - LOG(pViewport->Width); - LOG(pViewport->Height); - LOG(pViewport->MinZ); - LOG(pViewport->MaxZ); + LOG("{ " << pViewport->X << " , " << pViewport->Y << " , " << pViewport->Width << " , " << pViewport->Height << " , " << pViewport->MinZ << " , " << pViewport->MaxZ << " }"); } - LOG(hr); + LOG(" )\n"); +#endif + HRESULT hr = m_pDevice->GetViewport(pViewport); + return hr; } /*STDMETHOD(SetMaterial)(THIS_ CONST D3D8Base::D3DMATERIAL8* pMaterial) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetMaterial(CONST D3D8Base::D3DMATERIAL8* pMaterial) { - LOG("SetMaterial"); + LOG("IDirect3DDevice8::SetMaterial( " << pMaterial << " )\n"); HRESULT hr = m_pDevice->SetMaterial(pMaterial); return hr; @@ -579,7 +490,7 @@ extern "C" /*STDMETHOD(GetMaterial)(THIS_ D3D8Base::D3DMATERIAL8* pMaterial) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetMaterial(D3D8Base::D3DMATERIAL8* pMaterial) { - LOG("GetMaterial"); + LOG("IDirect3DDevice8::GetMaterial( " << pMaterial << " )\n"); HRESULT hr = m_pDevice->GetMaterial(pMaterial); return hr; @@ -588,7 +499,7 @@ extern "C" /*STDMETHOD(SetLight)(THIS_ DWORD Index,CONST D3D8Base::D3DLIGHT8*) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetLight(DWORD Index,CONST D3D8Base::D3DLIGHT8* foo) { - LOG("SetLight"); + LOG("IDirect3DDevice8::SetLight( " << Index << " , " << foo << " )\n"); HRESULT hr = m_pDevice->SetLight(Index,foo); return hr; @@ -597,7 +508,7 @@ extern "C" /*STDMETHOD(GetLight)(THIS_ DWORD Index,D3D8Base::D3DLIGHT8*) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetLight(DWORD Index,D3D8Base::D3DLIGHT8* foo) { - LOG("GetLight"); + LOG("IDirect3DDevice8::GetLight( " << Index << " , " << foo << " )\n"); HRESULT hr = m_pDevice->GetLight(Index,foo); return hr; @@ -606,7 +517,7 @@ extern "C" /*STDMETHOD(LightEnable)(THIS_ DWORD Index,BOOL Enable) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::LightEnable(DWORD Index,BOOL Enable) { - LOG("LightEnable"); + LOG("IDirect3DDevice8::LightEnable( " << Index << " , " << Enable << " )\n"); HRESULT hr = m_pDevice->LightEnable(Index,Enable); return hr; @@ -615,7 +526,7 @@ extern "C" /*STDMETHOD(GetLightEnable)(THIS_ DWORD Index,BOOL* pEnable) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetLightEnable(DWORD Index,BOOL* pEnable) { - LOG("GetLightEnable"); + LOG("IDirect3DDevice8::GetLightEnable( " << Index << " , " << pEnable << " )\n"); HRESULT hr = m_pDevice->GetLightEnable(Index,pEnable); return hr; @@ -624,7 +535,7 @@ extern "C" /*STDMETHOD(SetClipPlane)(THIS_ DWORD Index,CONST float* pPlane) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetClipPlane(DWORD Index,CONST float* pPlane) { - LOG("SetClipPlane"); + LOG("IDirect3DDevice8::SetClipPlane( " << Index << " , " << pPlane << " )\n"); HRESULT hr = m_pDevice->SetClipPlane(Index,pPlane); return hr; @@ -633,7 +544,7 @@ extern "C" /*STDMETHOD(GetClipPlane)(THIS_ DWORD Index,float* pPlane) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetClipPlane(DWORD Index,float* pPlane) { - LOG("GetClipPlane"); + LOG("IDirect3DDevice8::GetClipPlane( " << Index << " , " << pPlane << " )\n"); HRESULT hr = m_pDevice->GetClipPlane(Index,pPlane); return hr; @@ -642,9 +553,7 @@ extern "C" /*STDMETHOD(SetRenderState)(THIS_ D3D8Base::D3DRENDERSTATETYPE State,DWORD Value) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetRenderState(D3D8Base::D3DRENDERSTATETYPE State,DWORD Value) { - LOG("SetRenderState"); - LOG(State); - LOG(Value); + LOG("IDirect3DDevice8::SetRenderState( " << State << " , " << Value << " )\n"); HRESULT hr = m_pDevice->SetRenderState(State,Value); @@ -654,7 +563,7 @@ extern "C" /*STDMETHOD(GetRenderState)(THIS_ D3D8Base::D3DRENDERSTATETYPE State,DWORD* pValue) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetRenderState(D3D8Base::D3DRENDERSTATETYPE State,DWORD* pValue) { - LOG("GetRenderState"); + LOG("IDirect3DDevice8::GetRenderState( " << State << " , " << pValue << " )\n"); HRESULT hr = m_pDevice->GetRenderState(State,pValue); return hr; @@ -663,7 +572,7 @@ extern "C" /*STDMETHOD(BeginStateBlock)(THIS) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::BeginStateBlock() { - LOG("BeginStateBlock"); + LOG("IDirect3DDevice8::BeginStateBlock()\n"); HRESULT hr = m_pDevice->BeginStateBlock(); return hr; @@ -672,7 +581,7 @@ extern "C" /*STDMETHOD(EndStateBlock)(THIS_ DWORD* pToken) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::EndStateBlock(DWORD* pToken) { - LOG("EndStateBlock"); + LOG("IDirect3DDevice8::EndStateBlock( " << pToken << " )\n"); HRESULT hr = m_pDevice->EndStateBlock(pToken); return hr; @@ -681,7 +590,7 @@ extern "C" /*STDMETHOD(ApplyStateBlock)(THIS_ DWORD Token) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::ApplyStateBlock(DWORD Token) { - LOG("ApplyStateBlock"); + LOG("IDirect3DDevice8::ApplyStateBlock( " << Token << " )\n"); HRESULT hr = m_pDevice->ApplyStateBlock(Token); return hr; @@ -690,7 +599,7 @@ extern "C" /*STDMETHOD(CaptureStateBlock)(THIS_ DWORD Token) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CaptureStateBlock(DWORD Token) { - LOG("CaptureStateBlock"); + LOG("IDirect3DDevice8::CaptureStateBlock( " << Token << " )\n"); HRESULT hr = m_pDevice->CaptureStateBlock(Token); return hr; @@ -699,7 +608,7 @@ extern "C" /*STDMETHOD(DeleteStateBlock)(THIS_ DWORD Token) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DeleteStateBlock(DWORD Token) { - LOG("DeleteStateBlock"); + LOG("IDirect3DDevice8::DeleteStateBlock( " << Token << " )\n"); HRESULT hr = m_pDevice->DeleteStateBlock(Token); return hr; @@ -708,7 +617,7 @@ extern "C" /*STDMETHOD(CreateStateBlock)(THIS_ D3D8Base::D3DSTATEBLOCKTYPE Type,DWORD* pToken) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateStateBlock(D3D8Base::D3DSTATEBLOCKTYPE Type,DWORD* pToken) { - LOG("CreateStateBlock"); + LOG("IDirect3DDevice8::CreateStateBlock( " << Type << " , " << pToken << " )\n"); HRESULT hr = m_pDevice->CreateStateBlock(Type,pToken); return hr; @@ -717,7 +626,7 @@ extern "C" /*STDMETHOD(SetClipStatus)(THIS_ CONST D3D8Base::D3DCLIPSTATUS8* pClipStatus) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetClipStatus(CONST D3D8Base::D3DCLIPSTATUS8* pClipStatus) { - LOG("SetClipStatus"); + LOG("IDirect3DDevice8::SetClipStatus( " << pClipStatus << " )\n"); HRESULT hr = m_pDevice->SetClipStatus(pClipStatus); return hr; @@ -726,7 +635,7 @@ extern "C" /*STDMETHOD(GetClipStatus)(THIS_ D3D8Base::D3DCLIPSTATUS8* pClipStatus) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetClipStatus(D3D8Base::D3DCLIPSTATUS8* pClipStatus) { - LOG("GetClipStatus"); + LOG("IDirect3DDevice8::GetClipStatus( " << pClipStatus << " )\n"); HRESULT hr = m_pDevice->GetClipStatus(pClipStatus); return hr; @@ -735,7 +644,7 @@ extern "C" /*STDMETHOD(GetTexture)(THIS_ DWORD Stage,D3D8Base::IDirect3DBaseTexture8** ppTexture) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetTexture(DWORD Stage,D3D8Wrapper::IDirect3DBaseTexture8** ppTexture) { - LOG("GetTexture"); + LOG("IDirect3DDevice8::GetTexture( " << Stage << " , " << ppTexture << " )\n"); D3D8Base::IDirect3DBaseTexture8* fd = NULL; @@ -751,8 +660,7 @@ extern "C" /*STDMETHOD(SetTexture)(THIS_ DWORD Stage,D3D8Base::IDirect3DBaseTexture8* pTexture) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetTexture(DWORD Stage,D3D8Wrapper::IDirect3DBaseTexture8* pTexture) { - LOG("SetTexture"); - LOG("pTexture: " << pTexture); + LOG("IDirect3DDevice8::SetTexture( " << Stage << " , " << pTexture << " )\n"); if (pTexture == NULL) { @@ -760,8 +668,8 @@ extern "C" } else { - LOG(pTexture->GetResource()); - LOG(pTexture->GetBaseTexture()); + //LOG(pTexture->GetResource() << "\n"); + //LOG(pTexture->GetBaseTexture() << "\n"); HRESULT hr = m_pDevice->SetTexture(Stage,pTexture->GetBaseTexture()); return hr; @@ -771,7 +679,7 @@ extern "C" /*STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3D8Base::D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetTextureStageState(DWORD Stage,D3D8Base::D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) { - LOG("GetTextureStageState"); + LOG("IDirect3DDevice8::GetTextureStageState( " << Stage << " , " << Type << " , " << pValue << " )\n"); HRESULT hr = m_pDevice->GetTextureStageState(Stage,Type,pValue); return hr; @@ -780,7 +688,7 @@ extern "C" /*STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3D8Base::D3DTEXTURESTAGESTATETYPE Type,DWORD Value) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetTextureStageState(DWORD Stage,D3D8Base::D3DTEXTURESTAGESTATETYPE Type,DWORD Value) { - LOG("SetTextureStageState"); + LOG("IDirect3DDevice8::SetTextureStageState( " << Stage << " , " << Type << " , " << Value << " )\n"); HRESULT hr = m_pDevice->SetTextureStageState(Stage,Type,Value); return hr; @@ -789,7 +697,7 @@ extern "C" /*STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::ValidateDevice(DWORD* pNumPasses) { - LOG("ValidateDevice"); + LOG("IDirect3DDevice8::ValidateDevice( " << pNumPasses << " )\n"); HRESULT hr = m_pDevice->ValidateDevice(pNumPasses); return hr; @@ -798,7 +706,7 @@ extern "C" /*STDMETHOD(GetInfo)(THIS_ DWORD DevInfoID,void* pDevInfoStruct,DWORD DevInfoStructSize) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetInfo(DWORD DevInfoID,void* pDevInfoStruct,DWORD DevInfoStructSize) { - LOG("GetInfo"); + LOG("IDirect3DDevice8::GetInfo( " << DevInfoID << " , " << pDevInfoStruct << " , " << DevInfoStructSize << " )\n"); HRESULT hr = m_pDevice->GetInfo(DevInfoID,pDevInfoStruct,DevInfoStructSize); return hr; @@ -807,7 +715,7 @@ extern "C" /*STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber,CONST PALETTEENTRY* pEntries) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetPaletteEntries(UINT PaletteNumber,CONST PALETTEENTRY* pEntries) { - LOG("SetPaletteEntries"); + LOG("IDirect3DDevice8::SetPaletteEntries( " << PaletteNumber << " , " << pEntries << " )\n"); HRESULT hr = m_pDevice->SetPaletteEntries(PaletteNumber,pEntries); return hr; @@ -816,7 +724,7 @@ extern "C" /*STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetPaletteEntries(UINT PaletteNumber,PALETTEENTRY* pEntries) { - LOG("GetPaletteEntries"); + LOG("IDirect3DDevice8::GetPaletteEntries( " << PaletteNumber << " , " << pEntries << " )\n"); HRESULT hr = m_pDevice->GetPaletteEntries(PaletteNumber,pEntries); return hr; @@ -825,7 +733,7 @@ extern "C" /*STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetCurrentTexturePalette(UINT PaletteNumber) { - LOG("SetCurrentTexturePalette"); + LOG("IDirect3DDevice8::SetCurrentTexturePalette( " << PaletteNumber << " )\n"); HRESULT hr = m_pDevice->SetCurrentTexturePalette(PaletteNumber); return hr; @@ -834,7 +742,7 @@ extern "C" /*STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetCurrentTexturePalette(UINT *PaletteNumber) { - LOG("GetCurrentTexturePalette"); + LOG("IDirect3DDevice8::GetCurrentTexturePalette( " << PaletteNumber << " )\n"); HRESULT hr = m_pDevice->GetCurrentTexturePalette(PaletteNumber); return hr; @@ -843,7 +751,7 @@ extern "C" /*STDMETHOD(DrawPrimitive)(THIS_ D3D8Base::D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DrawPrimitive(D3D8Base::D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) { - LOG("DrawPrimitive"); + LOG("IDirect3DDevice8::DrawPrimitive( " << PrimitiveType << " , " << StartVertex << " , " << PrimitiveCount << " )\n"); HRESULT hr = m_pDevice->DrawPrimitive(PrimitiveType,StartVertex,PrimitiveCount); return hr; @@ -852,7 +760,7 @@ extern "C" /*STDMETHOD(DrawIndexedPrimitive)(THIS_ D3D8Base::D3DPRIMITIVETYPE,UINT minIndex,UINT NumVertices,UINT startIndex,UINT primCount) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DrawIndexedPrimitive(D3D8Base::D3DPRIMITIVETYPE PrimitiveType,UINT minIndex,UINT NumVertices,UINT startIndex,UINT primCount) { - LOG("DrawIndexedPrimitive"); + LOG("IDirect3DDevice8::DrawIndexedPrimitive( " << PrimitiveType << " , " << minIndex << " , " << NumVertices << " , " << startIndex << " , " << primCount << " )\n"); HRESULT hr = m_pDevice->DrawIndexedPrimitive(PrimitiveType,minIndex,NumVertices,startIndex,primCount); return hr; @@ -861,7 +769,7 @@ extern "C" /*STDMETHOD(DrawPrimitiveUP)(THIS_ D3D8Base::D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DrawPrimitiveUP(D3D8Base::D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) { - LOG("DrawPrimitiveUP"); + LOG("IDirect3DDevice8::DrawPrimitiveUP( " << PrimitiveType << " , " << PrimitiveCount << " , " << pVertexStreamZeroData << " , " << VertexStreamZeroStride << " )\n"); HRESULT hr = m_pDevice->DrawPrimitiveUP(PrimitiveType,PrimitiveCount,pVertexStreamZeroData,VertexStreamZeroStride); return hr; @@ -870,7 +778,7 @@ extern "C" /*STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3D8Base::D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertexIndices,UINT PrimitiveCount,CONST void* pIndexData,D3D8Base::D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DrawIndexedPrimitiveUP(D3D8Base::D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertexIndices,UINT PrimitiveCount,CONST void* pIndexData,D3D8Base::D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) { - LOG("DrawIndexedPrimitiveUP"); + LOG("IDirect3DDevice8::DrawIndexedPrimitiveUP( " << PrimitiveType << " , " << MinVertexIndex << " , " << NumVertexIndices << " , " << PrimitiveCount << " , " << pIndexData << " , " << IndexDataFormat << " , " << pVertexStreamZeroData << " , " << VertexStreamZeroStride << " )\n"); HRESULT hr = m_pDevice->DrawIndexedPrimitiveUP(PrimitiveType,MinVertexIndex,NumVertexIndices,PrimitiveCount,pIndexData,IndexDataFormat,pVertexStreamZeroData,VertexStreamZeroStride); return hr; @@ -879,7 +787,7 @@ extern "C" /*STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,D3D8Base::IDirect3DVertexBuffer8* pDestBuffer,DWORD Flags) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::ProcessVertices(UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,D3D8Wrapper::IDirect3DVertexBuffer8* pDestBuffer,DWORD Flags) { - LOG("ProcessVertices"); + LOG("IDirect3DDevice8::ProcessVertices( " << SrcStartIndex << " , " << DestIndex << " , " << VertexCount << " , " << pDestBuffer << " , " << Flags << " )\n"); HRESULT hr = m_pDevice->ProcessVertices(SrcStartIndex,DestIndex,VertexCount,pDestBuffer->GetVertexBuffer(),Flags); return hr; @@ -888,7 +796,7 @@ extern "C" /*STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pDeclaration,CONST DWORD* pFunction,DWORD* pHandle,DWORD Usage) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreateVertexShader(CONST DWORD* pDeclaration,CONST DWORD* pFunction,DWORD* pHandle,DWORD Usage) { - LOG("CreateVertexShader"); + LOG("IDirect3DDevice8::CreateVertexShader( " << pDeclaration << " , " << pFunction << " , " << pHandle << " , " << Usage << " )\n"); HRESULT hr = m_pDevice->CreateVertexShader(pDeclaration,pFunction,pHandle,Usage); return hr; @@ -897,7 +805,7 @@ extern "C" /*STDMETHOD(SetVertexShader)(THIS_ DWORD Handle) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetVertexShader(DWORD Handle) { - LOG("SetVertexShader"); + LOG("IDirect3DDevice8::SetVertexShader( " << Handle << " )\n"); HRESULT hr = m_pDevice->SetVertexShader(Handle); return hr; @@ -906,7 +814,7 @@ extern "C" /*STDMETHOD(GetVertexShader)(THIS_ DWORD* pHandle) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetVertexShader(DWORD* pHandle) { - LOG("GetVertexShader"); + LOG("IDirect3DDevice8::GetVertexShader( " << pHandle << " )\n"); HRESULT hr = m_pDevice->GetVertexShader(pHandle); return hr; @@ -915,7 +823,7 @@ extern "C" /*STDMETHOD(DeleteVertexShader)(THIS_ DWORD Handle) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DeleteVertexShader(DWORD Handle) { - LOG("DeleteVertexShader"); + LOG("IDirect3DDevice8::DeleteVertexShader( " << Handle << " )\n"); HRESULT hr = m_pDevice->DeleteVertexShader(Handle); return hr; @@ -924,7 +832,7 @@ extern "C" /*STDMETHOD(SetVertexShaderConstant)(THIS_ DWORD Register,CONST void* pConstantData,DWORD ConstantCount) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetVertexShaderConstant(DWORD Register,CONST void* pConstantData,DWORD ConstantCount) { - LOG("SetVertexShaderConstant"); + LOG("IDirect3DDevice8::SetVertexShaderConstant( " << Register << " , " << pConstantData << " , " << ConstantCount << " )\n"); HRESULT hr = m_pDevice->SetVertexShaderConstant(Register,pConstantData,ConstantCount); return hr; @@ -933,7 +841,7 @@ extern "C" /*STDMETHOD(GetVertexShaderConstant)(THIS_ DWORD Register,void* pConstantData,DWORD ConstantCount) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetVertexShaderConstant(DWORD Register,void* pConstantData,DWORD ConstantCount) { - LOG("GetVertexShaderConstant"); + LOG("IDirect3DDevice8::GetVertexShaderConstant( " << Register << " , " << pConstantData << " , " << ConstantCount << " )\n"); HRESULT hr = m_pDevice->GetVertexShaderConstant(Register,pConstantData,ConstantCount); return hr; @@ -942,7 +850,7 @@ extern "C" /*STDMETHOD(GetVertexShaderDeclaration)(THIS_ DWORD Handle,void* pData,DWORD* pSizeOfData) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetVertexShaderDeclaration(DWORD Handle,void* pData,DWORD* pSizeOfData) { - LOG("GetVertexShaderDeclaration"); + LOG("IDirect3DDevice8::GetVertexShaderDeclaration( " << Handle << " , " << pData << " , " << pSizeOfData << " )\n"); HRESULT hr = m_pDevice->GetVertexShaderDeclaration(Handle,pData,pSizeOfData); return hr; @@ -951,7 +859,7 @@ extern "C" /*STDMETHOD(GetVertexShaderFunction)(THIS_ DWORD Handle,void* pData,DWORD* pSizeOfData) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetVertexShaderFunction(DWORD Handle,void* pData,DWORD* pSizeOfData) { - LOG("GetVertexShaderFunction"); + LOG("IDirect3DDevice8::GetVertexShaderFunction( " << Handle << " , " << pData << " , " << pSizeOfData << " )\n"); HRESULT hr = m_pDevice->GetVertexShaderFunction(Handle,pData,pSizeOfData); return hr; @@ -960,7 +868,7 @@ extern "C" /*STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber,D3D8Base::IDirect3DVertexBuffer8* pStreamData,UINT Stride) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetStreamSource(UINT StreamNumber,D3D8Wrapper::IDirect3DVertexBuffer8* pStreamData,UINT Stride) { - LOG("SetStreamSource"); + LOG("IDirect3DDevice8::SetStreamSource( " << StreamNumber << " , " << pStreamData << " , " << Stride << " )\n"); HRESULT hr = m_pDevice->SetStreamSource(StreamNumber,pStreamData->GetVertexBuffer(),Stride); return hr; @@ -969,7 +877,7 @@ extern "C" /*STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber,D3D8Base::IDirect3DVertexBuffer8** ppStreamData,UINT* pStride) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetStreamSource(UINT StreamNumber,D3D8Wrapper::IDirect3DVertexBuffer8** ppStreamData,UINT* pStride) { - LOG("GetStreamSource"); + LOG("IDirect3DDevice8::GetStreamSource( " << StreamNumber << " , " << ppStreamData << " , " << pStride << " )\n"); D3D8Base::IDirect3DVertexBuffer8* fd = NULL; @@ -985,7 +893,7 @@ extern "C" /*STDMETHOD(SetIndices)(THIS_ D3D8Base::IDirect3DIndexBuffer8* pIndexData,UINT BaseVertexIndex) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetIndices(D3D8Wrapper::IDirect3DIndexBuffer8* pIndexData,UINT BaseVertexIndex) { - LOG("SetIndices"); + LOG("IDirect3DDevice8::SetIndices( " << pIndexData << " , " << BaseVertexIndex << " )\n"); HRESULT hr = m_pDevice->SetIndices(pIndexData->GetIndexBuffer(),BaseVertexIndex); return hr; @@ -994,7 +902,7 @@ extern "C" /*STDMETHOD(GetIndices)(THIS_ D3D8Base::IDirect3DIndexBuffer8** ppIndexData,UINT* pBaseVertexIndex) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetIndices(D3D8Wrapper::IDirect3DIndexBuffer8** ppIndexData,UINT* pBaseVertexIndex) { - LOG("GetIndices"); + LOG("IDirect3DDevice8::GetIndices( " << ppIndexData << " , " << pBaseVertexIndex << " )\n"); D3D8Base::IDirect3DIndexBuffer8* fd = NULL; @@ -1010,7 +918,7 @@ extern "C" /*STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction,DWORD* pHandle) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::CreatePixelShader(CONST DWORD* pFunction,DWORD* pHandle) { - LOG("CreatePixelShader"); + LOG("IDirect3DDevice8::CreatePixelShader( " << pFunction << " , " << pHandle << " )\n"); HRESULT hr = m_pDevice->CreatePixelShader(pFunction,pHandle); return hr; @@ -1019,7 +927,7 @@ extern "C" /*STDMETHOD(SetPixelShader)(THIS_ DWORD Handle) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetPixelShader(DWORD Handle) { - LOG("SetPixelShader"); + LOG("IDirect3DDevice8::SetPixelShader( " << Handle << " )\n"); HRESULT hr = m_pDevice->SetPixelShader(Handle); return hr; @@ -1028,7 +936,7 @@ extern "C" /*STDMETHOD(GetPixelShader)(THIS_ DWORD* pHandle) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetPixelShader(DWORD* pHandle) { - LOG("GetPixelShader"); + LOG("IDirect3DDevice8::GetPixelShader( " << pHandle << " )\n"); HRESULT hr = m_pDevice->GetPixelShader(pHandle); return hr; @@ -1037,7 +945,7 @@ extern "C" /*STDMETHOD(DeletePixelShader)(THIS_ DWORD Handle) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DeletePixelShader(DWORD Handle) { - LOG("DeletePixelShader"); + LOG("IDirect3DDevice8::DeletePixelShader( " << Handle << " )\n"); HRESULT hr = m_pDevice->DeletePixelShader(Handle); return hr; @@ -1046,7 +954,7 @@ extern "C" /*STDMETHOD(SetPixelShaderConstant)(THIS_ DWORD Register,CONST void* pConstantData,DWORD ConstantCount) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::SetPixelShaderConstant(DWORD Register,CONST void* pConstantData,DWORD ConstantCount) { - LOG("SetPixelShaderConstant"); + LOG("IDirect3DDevice8::SetPixelShaderConstant( " << Register << " , " << pConstantData << " , " << ConstantCount << " )\n"); HRESULT hr = m_pDevice->SetPixelShaderConstant(Register,pConstantData,ConstantCount); return hr; @@ -1055,7 +963,7 @@ extern "C" /*STDMETHOD(GetPixelShaderConstant)(THIS_ DWORD Register,void* pConstantData,DWORD ConstantCount) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetPixelShaderConstant(DWORD Register,void* pConstantData,DWORD ConstantCount) { - LOG("GetPixelShaderConstant"); + LOG("IDirect3DDevice8::GetPixelShaderConstant( " << Register << " , " << pConstantData << " , " << ConstantCount << " )\n"); HRESULT hr = m_pDevice->GetPixelShaderConstant(Register,pConstantData,ConstantCount); return hr; @@ -1064,7 +972,7 @@ extern "C" /*STDMETHOD(GetPixelShaderFunction)(THIS_ DWORD Handle,void* pData,DWORD* pSizeOfData) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::GetPixelShaderFunction(DWORD Handle,void* pData,DWORD* pSizeOfData) { - LOG("GetPixelShaderFunction"); + LOG("IDirect3DDevice8::GetPixelShaderFunction( " << Handle << " , " << pData << " , " << pSizeOfData << " )\n"); HRESULT hr = m_pDevice->GetPixelShaderFunction(Handle,pData,pSizeOfData); return hr; @@ -1073,7 +981,7 @@ extern "C" /*STDMETHOD(DrawRectPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3D8Base::D3DRECTPATCH_INFO* pRectPatchInfo) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DrawRectPatch(UINT Handle,CONST float* pNumSegs,CONST D3D8Base::D3DRECTPATCH_INFO* pRectPatchInfo) { - LOG("DrawRectPatch"); + LOG("IDirect3DDevice8::DrawRectPatch( " << Handle << " , " << pNumSegs << " , " << pRectPatchInfo << " )\n"); HRESULT hr = m_pDevice->DrawRectPatch(Handle,pNumSegs,pRectPatchInfo); return hr; @@ -1082,7 +990,7 @@ extern "C" /*STDMETHOD(DrawTriPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3D8Base::D3DTRIPATCH_INFO* pTriPatchInfo) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DrawTriPatch(UINT Handle,CONST float* pNumSegs,CONST D3D8Base::D3DTRIPATCH_INFO* pTriPatchInfo) { - LOG("DrawTriPatch"); + LOG("IDirect3DDevice8::DrawTriPatch( " << Handle << " , " << pNumSegs << " , " << pTriPatchInfo << " )\n"); HRESULT hr = m_pDevice->DrawTriPatch(Handle,pNumSegs,pTriPatchInfo); return hr; @@ -1091,7 +999,7 @@ extern "C" /*STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DDevice8::DeletePatch(UINT Handle) { - LOG("DeletePatch"); + LOG("IDirect3DDevice8::DeletePatch( " << Handle << " )\n"); HRESULT hr = m_pDevice->DeletePatch(Handle); return hr; diff --git a/libmupen64plus/D3D8Interceptor/Direct3DIndexBuffer8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DIndexBuffer8Functions.cpp index 51817caa4e..1dd10ca5c7 100644 --- a/libmupen64plus/D3D8Interceptor/Direct3DIndexBuffer8Functions.cpp +++ b/libmupen64plus/D3D8Interceptor/Direct3DIndexBuffer8Functions.cpp @@ -6,14 +6,14 @@ extern "C" { D3D8Wrapper::IDirect3DIndexBuffer8::IDirect3DIndexBuffer8(D3D8Base::IDirect3DIndexBuffer8* pTexture) : IDirect3DResource8((D3D8Base::IDirect3DResource8*) pTexture) { - LOG("IDirect3DIndexBuffer8"); + LOG("IDirect3DIndexBuffer8( " << pTexture << " )\n"); m_pD3D = pTexture; } /*STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DIndexBuffer8::Lock(UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags) { - LOG("IDirect3DIndexBuffer8::Lock"); + LOG("IDirect3DIndexBuffer8::Lock( " << OffsetToLock << " , " << SizeToLock << " , " << ppbData << " , " << Flags << " )\n"); HRESULT hr = m_pD3D->Lock(OffsetToLock,SizeToLock,ppbData,Flags); return hr; @@ -22,7 +22,7 @@ extern "C" /*STDMETHOD(Unlock)(THIS) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DIndexBuffer8::Unlock() { - LOG("IDirect3DIndexBuffer8::Unlock"); + LOG("IDirect3DIndexBuffer8::Unlock()\n"); HRESULT hr = m_pD3D->Unlock(); return hr; @@ -31,7 +31,7 @@ extern "C" /*STDMETHOD(GetDesc)(THIS_ D3D8Base::D3DINDEXBUFFER_DESC *pDesc) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DIndexBuffer8::GetDesc(D3D8Base::D3DINDEXBUFFER_DESC *pDesc) { - LOG("IDirect3DIndexBuffer8::GetDesc"); + LOG("IDirect3DIndexBuffer8::GetDesc( " << pDesc << " )\n"); HRESULT hr = m_pD3D->GetDesc(pDesc); return hr; diff --git a/libmupen64plus/D3D8Interceptor/Direct3DResource8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DResource8Functions.cpp index 4685a4824e..bfe43026bf 100644 --- a/libmupen64plus/D3D8Interceptor/Direct3DResource8Functions.cpp +++ b/libmupen64plus/D3D8Interceptor/Direct3DResource8Functions.cpp @@ -8,29 +8,30 @@ extern "C" D3D8Wrapper::IDirect3DResource8::IDirect3DResource8(D3D8Base::IDirect3DResource8* pResource) : IDirect3DUnknown((IUnknown*) pResource) { - LOG("IDirect3DResource8 from base " << pResource << " made " << this); + LOG("IDirect3DResource8::IDirect3DResource8( " << pResource << " )\n"); m_pD3D = pResource; } D3D8Wrapper::IDirect3DResource8* D3D8Wrapper::IDirect3DResource8::GetResource(D3D8Base::IDirect3DResource8* pSwapChain) { + LOG("IDirect3DResource8::GetResource( " << pSwapChain << " )\n"); D3D8Wrapper::IDirect3DResource8* p = (D3D8Wrapper::IDirect3DResource8*) m_List.GetDataPtr(pSwapChain); if( p == NULL ) { p = new D3D8Wrapper::IDirect3DResource8(pSwapChain); - LOG("IDirect3DResource8::GetResource " << pSwapChain << " created new " << p) + //LOG("IDirect3DResource8::GetResource " << pSwapChain << " created new " << p << "\n") m_List.AddMember(pSwapChain, p); return p; } p->m_ulRef++; - LOG("IDirect3DResource8::GetResource " << pSwapChain << " found existing " << p) + //LOG("IDirect3DResource8::GetResource " << pSwapChain << " found existing " << p << "\n") return p; } STDMETHODIMP_(ULONG) D3D8Wrapper::IDirect3DResource8::Release(THIS) { - LOG("IDirect3DResource8::Release " << this); + LOG("IDirect3DResource8::Release( " << this << " )\n"); m_pUnk->Release(); ULONG ulRef = --m_ulRef; @@ -46,7 +47,7 @@ extern "C" /*STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DResource8::GetDevice(D3D8Wrapper::IDirect3DDevice8** ppDevice) { - LOG("IDirect3DResource8::GetDevice"); + LOG("IDirect3DResource8::GetDevice( " << ppDevice << " )\n"); D3D8Base::IDirect3DDevice8* fd = NULL; HRESULT hr = m_pD3D->GetDevice(&fd);//ppDevice); @@ -61,7 +62,7 @@ extern "C" /*STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DResource8::SetPrivateData(REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) { - LOG("IDirect3DResource8::SetPrivateData"); + LOG("IDirect3DResource8::SetPrivateData( " << &refguid << " , " << pData << " , " << SizeOfData << " , " << Flags << " )\n"); HRESULT hr = m_pD3D->SetPrivateData(refguid,pData,SizeOfData,Flags); return hr; @@ -70,7 +71,7 @@ extern "C" /*STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DResource8::GetPrivateData(REFGUID refguid,void* pData,DWORD* pSizeOfData) { - LOG("IDirect3DResource8::GetPrivateData"); + LOG("IDirect3DResource8::GetPrivateData( " << &refguid << " , " << pData << " , " << pSizeOfData << " )\n"); HRESULT hr = m_pD3D->GetPrivateData(refguid,pData,pSizeOfData); return hr; @@ -79,7 +80,7 @@ extern "C" /*STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DResource8::FreePrivateData(REFGUID refguid) { - LOG("IDirect3DResource8::FreePrivateData"); + LOG("IDirect3DResource8::FreePrivateData( " << &refguid << " )\n"); HRESULT hr = m_pD3D->FreePrivateData(refguid); return hr; @@ -88,28 +89,28 @@ extern "C" /*STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE;*/ STDMETHODIMP_(DWORD) D3D8Wrapper::IDirect3DResource8::SetPriority(DWORD PriorityNew) { - LOG("IDirect3DResource8::SetPriority"); + LOG("IDirect3DResource8::SetPriority( " << PriorityNew << " )\n"); return m_pD3D->SetPriority(PriorityNew); } /*STDMETHOD_(DWORD, GetPriority)(THIS) PURE;*/ STDMETHODIMP_(DWORD) D3D8Wrapper::IDirect3DResource8::GetPriority() { - LOG("IDirect3DResource8::GetPriority"); + LOG("IDirect3DResource8::GetPriority()\n"); return m_pD3D->GetPriority(); } /*STDMETHOD_(void, PreLoad)(THIS) PURE;*/ STDMETHODIMP_(void) D3D8Wrapper::IDirect3DResource8::PreLoad() { - LOG("IDirect3DResource8::PreLoad"); + LOG("IDirect3DResource8::PreLoad()\n"); return m_pD3D->PreLoad(); } /*STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE;*/ STDMETHODIMP_(D3D8Base::D3DRESOURCETYPE) D3D8Wrapper::IDirect3DResource8::GetType() { - LOG("IDirect3DResource8::GetType"); + LOG("IDirect3DResource8::GetType()\n"); return m_pD3D->GetType(); } } diff --git a/libmupen64plus/D3D8Interceptor/Direct3DSurface8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DSurface8Functions.cpp index b9c0a548c8..308c4c54bc 100644 --- a/libmupen64plus/D3D8Interceptor/Direct3DSurface8Functions.cpp +++ b/libmupen64plus/D3D8Interceptor/Direct3DSurface8Functions.cpp @@ -6,15 +6,13 @@ extern "C" { D3D8Wrapper::IDirect3DSurface8::IDirect3DSurface8(D3D8Base::IDirect3DSurface8* pTexture) : IDirect3DUnknown((IUnknown*) pTexture) { - LOG("IDirect3DSurface8"); - LOG(this); + LOG("IDirect3DSurface8::IDirect3DSurface8( " << pTexture << " )\n"); m_pD3D = pTexture; } D3D8Wrapper::IDirect3DSurface8* D3D8Wrapper::IDirect3DSurface8::GetSurface(D3D8Base::IDirect3DSurface8* pSurface) { - LOG("GetSurface"); - LOG(pSurface); + LOG("IDirect3DSurface8::GetSurface( " << pSurface << " )\n"); D3D8Wrapper::IDirect3DSurface8* p = (D3D8Wrapper::IDirect3DSurface8*) m_List.GetDataPtr(pSurface); if(p == NULL) { @@ -29,8 +27,7 @@ extern "C" STDMETHODIMP_(ULONG) D3D8Wrapper::IDirect3DSurface8::Release(THIS) { - LOG("IDirect3DSurface8::Release"); - LOG(this); + LOG("IDirect3DSurface8::Release( " << this << " )\n"); m_pUnk->Release(); ULONG ulRef = --m_ulRef; @@ -46,7 +43,7 @@ extern "C" /*STDMETHOD(GetDevice)(THIS_ D3D8Wrapper::IDirect3DDevice8** ppDevice) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::GetDevice(D3D8Wrapper::IDirect3DDevice8** ppDevice) { - LOG("IDirect3DSurface8::GetDevice"); + LOG("IDirect3DSurface8::GetDevice( " << ppDevice << " )\n"); D3D8Base::IDirect3DDevice8* fd = NULL; @@ -62,7 +59,7 @@ extern "C" /*STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::SetPrivateData(REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) { - LOG("IDirect3DSurface8::SetPrivateData"); + LOG("IDirect3DSurface8::SetPrivateData( " << &refguid << " , " << pData << " , " << SizeOfData << " , " << Flags << " )\n"); HRESULT hr = m_pD3D->SetPrivateData(refguid,pData,SizeOfData,Flags); return hr; @@ -71,7 +68,7 @@ extern "C" /*STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::GetPrivateData(REFGUID refguid,void* pData,DWORD* pSizeOfData) { - LOG("IDirect3DSurface8::GetPrivateData"); + LOG("IDirect3DSurface8::GetPrivateData( " << &refguid << " , " << pData << " , " << pSizeOfData << " )\n"); HRESULT hr = m_pD3D->GetPrivateData(refguid,pData,pSizeOfData); return hr; @@ -80,7 +77,7 @@ extern "C" /*STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::FreePrivateData(REFGUID refguid) { - LOG("IDirect3DSurface8::FreePrivateData"); + LOG("IDirect3DSurface8::FreePrivateData( " << &refguid << " )\n"); HRESULT hr = m_pD3D->FreePrivateData(refguid); return hr; @@ -89,7 +86,7 @@ extern "C" /*STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::GetContainer(REFIID riid,void** ppContainer) { - LOG("IDirect3DSurface8::GetContainer"); + LOG("IDirect3DSurface8::GetContainer( " << &riid << " , " << ppContainer << " )\n"); HRESULT hr = m_pD3D->GetContainer(riid,ppContainer); return hr; @@ -98,7 +95,7 @@ extern "C" /*STDMETHOD(GetDesc)(THIS_ D3D8Base::D3DSURFACE_DESC *pDesc) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::GetDesc(D3D8Base::D3DSURFACE_DESC *pDesc) { - LOG("IDirect3DSurface8::GetDesc"); + LOG("IDirect3DSurface8::GetDesc( " << pDesc << " )\n"); HRESULT hr = m_pD3D->GetDesc(pDesc); return hr; @@ -107,7 +104,14 @@ extern "C" /*STDMETHOD(LockRect)(THIS_ D3D8Base::D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::LockRect(D3D8Base::D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) { - LOG("IDirect3DSurface8::LockRect"); +#ifdef LOGGING + LOG("IDirect3DSurface8::LockRect( " << pLockedRect << " , " << pRect); + if (pRect != NULL) + { + LOG("{ " << pRect->left << " , " << pRect->top << " , " << pRect->right << " , " << pRect->bottom << " }"); + } + LOG(" , " << Flags << " )\n"); +#endif HRESULT hr = m_pD3D->LockRect(pLockedRect,pRect,Flags); return hr; @@ -116,7 +120,7 @@ extern "C" /*STDMETHOD(UnlockRect)(THIS) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::UnlockRect() { - LOG("IDirect3DSurface8::UnlockRect"); + LOG("IDirect3DSurface8::UnlockRect()\n"); HRESULT hr = m_pD3D->UnlockRect(); return hr; diff --git a/libmupen64plus/D3D8Interceptor/Direct3DSwapChain8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DSwapChain8Functions.cpp index 30e1820843..981f804c2b 100644 --- a/libmupen64plus/D3D8Interceptor/Direct3DSwapChain8Functions.cpp +++ b/libmupen64plus/D3D8Interceptor/Direct3DSwapChain8Functions.cpp @@ -6,12 +6,13 @@ extern "C" { D3D8Wrapper::IDirect3DSwapChain8::IDirect3DSwapChain8(D3D8Base::IDirect3DSwapChain8* pSwapChain) : IDirect3DUnknown((IUnknown*) pSwapChain) { - LOG("IDirect3DSwapChain8"); + LOG("IDirect3DSwapChain8::IDirect3DSwapChain8( " << pSwapChain << " )\n"); m_pD3D = pSwapChain; } D3D8Wrapper::IDirect3DSwapChain8* D3D8Wrapper::IDirect3DSwapChain8::GetSwapChain(D3D8Base::IDirect3DSwapChain8* pSwapChain) { + LOG("IDirect3DSwapChain8::GetSwapChain( " << pSwapChain << " )\n"); D3D8Wrapper::IDirect3DSwapChain8* p = (D3D8Wrapper::IDirect3DSwapChain8*) m_List.GetDataPtr(pSwapChain); if( p == NULL ) { @@ -26,6 +27,7 @@ extern "C" STDMETHODIMP_(ULONG) D3D8Wrapper::IDirect3DSwapChain8::Release(THIS) { + LOG("IDirect3DSwapChain8::Release( " << this << " )\n"); m_pUnk->Release(); ULONG ulRef = --m_ulRef; @@ -40,7 +42,7 @@ extern "C" STDMETHODIMP D3D8Wrapper::IDirect3DSwapChain8::Present(CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) { - LOG("IDirect3DSwapChain8::Present"); + LOG("IDirect3DSwapChain8::Present( " << pSourceRect << " , " << pDestRect << " , " << hDestWindowOverride << " , " << pDirtyRegion << " )\n"); HRESULT hr = m_pD3D->Present(pSourceRect,pDestRect,hDestWindowOverride,pDirtyRegion); return hr; @@ -48,7 +50,7 @@ extern "C" STDMETHODIMP D3D8Wrapper::IDirect3DSwapChain8::GetBackBuffer(UINT BackBuffer,D3D8Base::D3DBACKBUFFER_TYPE Type,D3D8Wrapper::IDirect3DSurface8** ppBackBuffer) { - LOG("IDirect3DSwapChain8::GetBackBuffer"); + LOG("IDirect3DSwapChain8::GetBackBuffer( " << BackBuffer << " , " << Type << " , " << ppBackBuffer << " )\n"); D3D8Base::IDirect3DSurface8* fd = NULL; diff --git a/libmupen64plus/D3D8Interceptor/Direct3DTexture8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DTexture8Functions.cpp index 18b4868c08..9ab2bfa1e5 100644 --- a/libmupen64plus/D3D8Interceptor/Direct3DTexture8Functions.cpp +++ b/libmupen64plus/D3D8Interceptor/Direct3DTexture8Functions.cpp @@ -6,23 +6,24 @@ extern "C" { D3D8Wrapper::IDirect3DTexture8::IDirect3DTexture8(D3D8Base::IDirect3DTexture8* pTexture) : IDirect3DBaseTexture8((D3D8Base::IDirect3DBaseTexture8*) pTexture) { - LOG("IDirect3DTexture8"); + LOG("IDirect3DTexture8::IDirect3DTexture8( " << pTexture << " )\n"); m_pD3D = pTexture; } D3D8Wrapper::IDirect3DTexture8* D3D8Wrapper::IDirect3DTexture8::GetTexture(D3D8Base::IDirect3DTexture8* pTexture) { + LOG("IDirect3DTexture8::GetTexture( " << pTexture << " )\n"); D3D8Wrapper::IDirect3DTexture8* p = (D3D8Wrapper::IDirect3DTexture8*) D3D8Wrapper::IDirect3DResource8::m_List.GetDataPtr(pTexture); if( p == NULL ) { p = new D3D8Wrapper::IDirect3DTexture8(pTexture); - LOG("IDirect3DTexture8::GetTexture " << pTexture << " created new " << p) + //LOG("IDirect3DTexture8::GetTexture " << pTexture << " created new " << p << "\n") D3D8Wrapper::IDirect3DResource8::m_List.AddMember(pTexture, p); return p; } p->m_ulRef++; - LOG("IDirect3DTexture8::GetTexture " << pTexture << " found existing " << p) + //LOG("IDirect3DTexture8::GetTexture " << pTexture << " found existing " << p << "\n") return p; } @@ -30,7 +31,7 @@ extern "C" /*STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3D8Base::D3DSURFACE_DESC *pDesc) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::GetLevelDesc(UINT Level,D3D8Base::D3DSURFACE_DESC *pDesc) { - LOG("IDirect3DTexture8::GetLevelDesc"); + LOG("IDirect3DTexture8::GetLevelDesc( " << Level << " , " << pDesc << " )\n"); HRESULT hr = m_pD3D->GetLevelDesc(Level,pDesc); return hr; @@ -39,7 +40,7 @@ extern "C" /*STDMETHOD(GetSurfaceLevel)(THIS_ UINT Level,D3D8Wrapper::IDirect3DSurface8** ppSurfaceLevel) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::GetSurfaceLevel(UINT Level,D3D8Wrapper::IDirect3DSurface8** ppSurfaceLevel) { - LOG("IDirect3DTexture8::GetSurfaceLevel"); + LOG("IDirect3DTexture8::GetSurfaceLevel( " << Level << " , " << ppSurfaceLevel << " )\n"); D3D8Base::IDirect3DSurface8* fd = NULL; @@ -49,17 +50,13 @@ extern "C" *ppSurfaceLevel = f; - LOG(f); - LOG(f->GetSurface()); - LOG(hr); - return hr; } /*STDMETHOD(LockRect)(THIS_ UINT Level,D3D8Base::D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::LockRect(UINT Level,D3D8Base::D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) { - LOG("IDirect3DTexture8::LockRect"); + LOG("IDirect3DTexture8::LockRect( " << Level << " , " << pLockedRect << " , " << pRect << " , " << Flags << " )\n"); HRESULT hr = m_pD3D->LockRect(Level,pLockedRect,pRect,Flags); return hr; @@ -68,7 +65,7 @@ extern "C" /*STDMETHOD(UnlockRect)(THIS_ UINT Level) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::UnlockRect(UINT Level) { - LOG("IDirect3DTexture8::UnlockRect"); + LOG("IDirect3DTexture8::UnlockRect()\n"); HRESULT hr = m_pD3D->UnlockRect(Level); return hr; @@ -77,7 +74,7 @@ extern "C" /*STDMETHOD(AddDirtyRect)(THIS_ CONST RECT* pDirtyRect) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::AddDirtyRect(CONST RECT* pDirtyRect) { - LOG("IDirect3DTexture8::AddDirtyRect"); + LOG("IDirect3DTexture8::AddDirtyRect( " << pDirtyRect << " )\n"); HRESULT hr = m_pD3D->AddDirtyRect(pDirtyRect); return hr; diff --git a/libmupen64plus/D3D8Interceptor/Direct3DVertexBuffer8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DVertexBuffer8Functions.cpp index e0d82d8776..b44016bcd5 100644 --- a/libmupen64plus/D3D8Interceptor/Direct3DVertexBuffer8Functions.cpp +++ b/libmupen64plus/D3D8Interceptor/Direct3DVertexBuffer8Functions.cpp @@ -6,14 +6,14 @@ extern "C" { D3D8Wrapper::IDirect3DVertexBuffer8::IDirect3DVertexBuffer8(D3D8Base::IDirect3DVertexBuffer8* pTexture) : IDirect3DResource8((D3D8Base::IDirect3DResource8*) pTexture) { - LOG("IDirect3DVertexBuffer8"); + LOG("IDirect3DVertexBuffer8::IDirect3DVertexBuffer8( " << pTexture << " )\n"); m_pD3D = pTexture; } /*STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DVertexBuffer8::Lock(UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags) { - LOG("IDirect3DVertexBuffer8::Lock"); + LOG("IDirect3DVertexBuffer8::Lock( " << OffsetToLock << " , " << SizeToLock << " , " << ppbData << " , " << Flags << " )\n"); HRESULT hr = m_pD3D->Lock(OffsetToLock,SizeToLock,ppbData,Flags); return hr; @@ -22,7 +22,7 @@ extern "C" /*STDMETHOD(Unlock)(THIS) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DVertexBuffer8::Unlock() { - LOG("IDirect3DVertexBuffer8::Unlock"); + LOG("IDirect3DVertexBuffer8::Unlock()\n"); HRESULT hr = m_pD3D->Unlock(); return hr; @@ -31,7 +31,7 @@ extern "C" /*STDMETHOD(GetDesc)(THIS_ D3D8Base::D3DVERTEXBUFFER_DESC *pDesc) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DVertexBuffer8::GetDesc(D3D8Base::D3DVERTEXBUFFER_DESC *pDesc) { - LOG("IDirect3DVertexBuffer8::GetDesc"); + LOG("IDirect3DVertexBuffer8::GetDesc( " << pDesc << " )\n"); HRESULT hr = m_pD3D->GetDesc(pDesc); return hr; diff --git a/libmupen64plus/D3D8Interceptor/Direct3DVolume8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DVolume8Functions.cpp index 699587e93f..e13c86b00a 100644 --- a/libmupen64plus/D3D8Interceptor/Direct3DVolume8Functions.cpp +++ b/libmupen64plus/D3D8Interceptor/Direct3DVolume8Functions.cpp @@ -6,14 +6,14 @@ extern "C" { D3D8Wrapper::IDirect3DVolume8::IDirect3DVolume8(D3D8Base::IDirect3DVolume8* pTexture) : IDirect3DUnknown((IUnknown*) pTexture) { - LOG("IDirect3DVolume8"); + LOG("IDirect3DVolume8::IDirect3DVolume8( " << pTexture << " )\n"); m_pD3D = pTexture; } /*STDMETHOD(GetDevice)(THIS_ D3D8Wrapper::IDirect3DDevice8** ppDevice) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::GetDevice(D3D8Wrapper::IDirect3DDevice8** ppDevice) { - LOG("IDirect3DVolume8::GetDevice"); + LOG("IDirect3DVolume8::GetDevice( " << ppDevice << " )\n"); D3D8Base::IDirect3DDevice8* fd = NULL; @@ -29,7 +29,7 @@ extern "C" /*STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::SetPrivateData(REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) { - LOG("IDirect3DVolume8::SetPrivateData"); + LOG("IDirect3DVolume8::SetPrivateData( " << &refguid << " , " << pData << " , " << SizeOfData << " , " << Flags << " )\n"); HRESULT hr = m_pD3D->SetPrivateData(refguid,pData,SizeOfData,Flags); return hr; @@ -38,7 +38,7 @@ extern "C" /*STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::GetPrivateData(REFGUID refguid,void* pData,DWORD* pSizeOfData) { - LOG("IDirect3DVolume8::GetPrivateData"); + LOG("IDirect3DVolume8::GetPrivateData( " << &refguid << " , " << pData << " , " << pSizeOfData << " )\n"); HRESULT hr = m_pD3D->GetPrivateData(refguid,pData,pSizeOfData); return hr; @@ -47,7 +47,7 @@ extern "C" /*STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::FreePrivateData(REFGUID refguid) { - LOG("IDirect3DVolume8::FreePrivateData"); + LOG("IDirect3DVolume8::FreePrivateData( " << &refguid << " )\n"); HRESULT hr = m_pD3D->FreePrivateData(refguid); return hr; @@ -56,7 +56,7 @@ extern "C" /*STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::GetContainer(REFIID riid,void** ppContainer) { - LOG("IDirect3DVolume8::GetContainer"); + LOG("IDirect3DVolume8::GetContainer( " << &riid << " , " << ppContainer << " )\n"); HRESULT hr = m_pD3D->GetContainer(riid,ppContainer); return hr; @@ -65,7 +65,7 @@ extern "C" /*STDMETHOD(GetDesc)(THIS_ D3D8Base::D3DVOLUME_DESC *pDesc) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::GetDesc(D3D8Base::D3DVOLUME_DESC *pDesc) { - LOG("IDirect3DVolume8::GetDesc"); + LOG("IDirect3DVolume8::GetDesc( " << pDesc << " )\n"); HRESULT hr = m_pD3D->GetDesc(pDesc); return hr; @@ -74,7 +74,7 @@ extern "C" /*STDMETHOD(LockBox)(THIS_ D3D8Base::D3DLOCKED_BOX * pLockedVolume,CONST D3D8Base::D3DBOX* pBox,DWORD Flags) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::LockBox(D3D8Base::D3DLOCKED_BOX * pLockedVolume,CONST D3D8Base::D3DBOX* pBox,DWORD Flags) { - LOG("IDirect3DVolume8::LockBox"); + LOG("IDirect3DVolume8::LockBox( " << pLockedVolume << " , " << pBox << " , " << Flags << " )\n"); HRESULT hr = m_pD3D->LockBox(pLockedVolume,pBox,Flags); return hr; @@ -83,7 +83,7 @@ extern "C" /*STDMETHOD(UnlockBox)(THIS) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::UnlockBox() { - LOG("IDirect3DVolume8::UnlockBox"); + LOG("IDirect3DVolume8::UnlockBox()\n"); HRESULT hr = m_pD3D->UnlockBox(); return hr; diff --git a/libmupen64plus/D3D8Interceptor/Direct3DVolumeTexture8Functions.cpp b/libmupen64plus/D3D8Interceptor/Direct3DVolumeTexture8Functions.cpp index 6caf05951b..7a712bfc6e 100644 --- a/libmupen64plus/D3D8Interceptor/Direct3DVolumeTexture8Functions.cpp +++ b/libmupen64plus/D3D8Interceptor/Direct3DVolumeTexture8Functions.cpp @@ -6,14 +6,14 @@ extern "C" { D3D8Wrapper::IDirect3DVolumeTexture8::IDirect3DVolumeTexture8(D3D8Base::IDirect3DVolumeTexture8* pTexture) : IDirect3DBaseTexture8((D3D8Base::IDirect3DBaseTexture8*) pTexture) { - LOG("IDirect3DVolumeTexture8"); + LOG("IDirect3DVolumeTexture8( " << pTexture << " )\n"); m_pD3D = pTexture; } /*STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3D8Base::D3DVOLUME_DESC *pDesc) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DVolumeTexture8::GetLevelDesc(UINT Level,D3D8Base::D3DVOLUME_DESC *pDesc) { - LOG("IDirect3DVolumeTexture8::GetLevelDesc"); + LOG("IDirect3DVolumeTexture8::GetLevelDesc( " << Level << " , " << pDesc << " )\n"); HRESULT hr = m_pD3D->GetLevelDesc(Level,pDesc); return hr; @@ -22,7 +22,7 @@ extern "C" /*STDMETHOD(GetVolumeLevel)(THIS_ UINT Level,IDirect3DVolume8** ppVolumeLevel) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DVolumeTexture8::GetVolumeLevel(UINT Level,D3D8Wrapper::IDirect3DVolume8** ppVolumeLevel) { - LOG("IDirect3DVolumeTexture8::GetVolumeLevel"); + LOG("IDirect3DVolumeTexture8::GetVolumeLevel( " << Level << " , " << ppVolumeLevel << " )\n"); D3D8Base::IDirect3DVolume8* fd = NULL; @@ -38,7 +38,7 @@ extern "C" /*STDMETHOD(LockBox)(THIS_ UINT Level,D3D8Base::D3DLOCKED_BOX* pLockedVolume,CONST D3D8Base::D3DBOX* pBox,DWORD Flags) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DVolumeTexture8::LockBox(UINT Level,D3D8Base::D3DLOCKED_BOX* pLockedVolume,CONST D3D8Base::D3DBOX* pBox,DWORD Flags) { - LOG("IDirect3DVolumeTexture8::LockBox"); + LOG("IDirect3DVolumeTexture8::LockBox( " << Level << " , " << pLockedVolume << " , " << pBox << " , " << Flags << " )\n"); HRESULT hr = m_pD3D->LockBox(Level,pLockedVolume,pBox,Flags); return hr; @@ -47,7 +47,7 @@ extern "C" /*STDMETHOD(UnlockBox)(THIS_ UINT Level) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DVolumeTexture8::UnlockBox(UINT Level) { - LOG("IDirect3DVolumeTexture8::UnlockBox"); + LOG("IDirect3DVolumeTexture8::UnlockBox( " << Level << " )\n"); HRESULT hr = m_pD3D->UnlockBox(Level); return hr; @@ -56,7 +56,7 @@ extern "C" /*STDMETHOD(AddDirtyBox)(THIS_ CONST D3D8Base::D3DBOX* pDirtyBox) PURE;*/ STDMETHODIMP D3D8Wrapper::IDirect3DVolumeTexture8::AddDirtyBox(CONST D3D8Base::D3DBOX* pDirtyBox) { - LOG("IDirect3DVolumeTexture8::AddDirtyBox"); + LOG("IDirect3DVolumeTexture8::AddDirtyBox( " << pDirtyBox << " )\n"); HRESULT hr = m_pD3D->AddDirtyBox(pDirtyBox); return hr; diff --git a/libmupen64plus/D3D8Interceptor/d3d8Wrapper.cpp b/libmupen64plus/D3D8Interceptor/d3d8Wrapper.cpp index bce9cde378..2887a91484 100644 --- a/libmupen64plus/D3D8Interceptor/d3d8Wrapper.cpp +++ b/libmupen64plus/D3D8Interceptor/d3d8Wrapper.cpp @@ -2,7 +2,7 @@ D3D8Base::LPDIRECT3D8 g_D3D=NULL; -HMODULE hD3D; +HMODULE realDLL; ThreadSafePointerSet D3D8Wrapper::IDirect3DDevice8::m_List; ThreadSafePointerSet D3D8Wrapper::IDirect3DBaseTexture8::m_List; @@ -24,30 +24,30 @@ extern "C" D3D8Wrapper::IDirect3D8* WINAPI Direct3DCreate8(UINT Version) { - // Get the real DLL path + // Get the real DLL path from the system directory // Might be unsafe CHAR dll_path[1024]; GetSystemDirectory(dll_path,1024); strcat(dll_path,"\\d3d8.dll"); - hD3D = LoadLibrary(dll_path); + realDLL = LoadLibrary(dll_path); - D3D8Wrapper::D3DCREATE pCreate = (D3D8Wrapper::D3DCREATE)GetProcAddress(hD3D, "Direct3DCreate8"); + D3D8Wrapper::D3DCREATE realDirect3DCreate8 = (D3D8Wrapper::D3DCREATE)GetProcAddress(realDLL, "Direct3DCreate8"); // Use the real Direct3DCreate8 to make the base object - D3D8Base::IDirect3D8* pD3D = pCreate(D3D_SDK_VERSION); + D3D8Base::IDirect3D8* realD3D = realDirect3DCreate8(D3D_SDK_VERSION); // Wrap the object - D3D8Wrapper::IDirect3D8* fD3D = D3D8Wrapper::IDirect3D8::GetDirect3D(pD3D); + D3D8Wrapper::IDirect3D8* wrappedD3D = D3D8Wrapper::IDirect3D8::GetDirect3D(realD3D); - return fD3D; + return wrappedD3D; } } __declspec(dllexport) void __cdecl CloseDLL() { - FreeLibrary(hD3D); + FreeLibrary(realDLL); } __declspec(dllexport) void __cdecl SetRenderingCallback(void (*callback)(int)) diff --git a/libmupen64plus/D3D8Interceptor/d3d8Wrapper.h b/libmupen64plus/D3D8Interceptor/d3d8Wrapper.h index d809394ebd..56d37c7be2 100644 --- a/libmupen64plus/D3D8Interceptor/d3d8Wrapper.h +++ b/libmupen64plus/D3D8Interceptor/d3d8Wrapper.h @@ -6,8 +6,13 @@ #pragma comment(linker, "/EXPORT:Direct3DCreate8=_Direct3DCreate8@4") -//#define LOG(x) { std::ofstream myfile; myfile.open ("d3d8_wrapper_log.txt", std::ios::app); myfile << x << "\n"; myfile.close(); } +//#define LOGGING 1 + +#ifdef LOGGING +#define LOG(x) { std::ofstream myfile; myfile.open ("d3d8_wrapper_log.txt", std::ios::app); myfile << x; myfile.close(); } +#else #define LOG(x) +#endif #define TESTDLL_API __declspec(dllexport) @@ -111,9 +116,6 @@ extern "C" protected: D3D8Base::IDirect3DDevice8* m_pDevice; static ThreadSafePointerSet m_List; - - D3D8Wrapper::IDirect3DSurface8 * rTarget; - D3D8Wrapper::IDirect3DSurface8 * zStencil; public: STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) { diff --git a/output/dll/d3d8.dll b/output/dll/d3d8.dll index ae7e7f38b7..45b6091157 100644 Binary files a/output/dll/d3d8.dll and b/output/dll/d3d8.dll differ