Path: blob/master/libmupen64plus/D3D8Interceptor/Direct3DTexture8Functions.cpp
2 views
#include "d3d8Wrapper.h"12extern "C"3{4namespace D3D8Wrapper5{6D3D8Wrapper::IDirect3DTexture8::IDirect3DTexture8(D3D8Base::IDirect3DTexture8* realTexture) : IDirect3DBaseTexture8((D3D8Base::IDirect3DBaseTexture8*) realTexture)7{8LOG("IDirect3DTexture8::IDirect3DTexture8( " << realTexture << " )\n");9m_pD3D = realTexture;10}1112D3D8Wrapper::IDirect3DTexture8* D3D8Wrapper::IDirect3DTexture8::GetTexture(D3D8Base::IDirect3DTexture8* realTexture)13{14LOG("IDirect3DTexture8::GetTexture( " << realTexture << " )\n");15D3D8Wrapper::IDirect3DTexture8* wrappedTexture = (D3D8Wrapper::IDirect3DTexture8*) D3D8Wrapper::IDirect3DResource8::m_List.GetDataPtr(realTexture);16if( wrappedTexture == NULL )17{18wrappedTexture = new D3D8Wrapper::IDirect3DTexture8(realTexture);19D3D8Wrapper::IDirect3DResource8::m_List.AddMember(realTexture, wrappedTexture);20return wrappedTexture;21}2223wrappedTexture->m_ulRef++;24return wrappedTexture;25}2627STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::GetLevelDesc(UINT Level,D3D8Base::D3DSURFACE_DESC *pDesc)28{29LOG("IDirect3DTexture8::GetLevelDesc( " << Level << " , " << pDesc << " ) [ " << this << " ]\n");30return m_pD3D->GetLevelDesc(Level,pDesc);31}3233STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::GetSurfaceLevel(UINT Level,D3D8Wrapper::IDirect3DSurface8** ppSurfaceLevel)34{35LOG("IDirect3DTexture8::GetSurfaceLevel( " << Level << " , " << ppSurfaceLevel << " ) [ " << this << " ]\n");3637D3D8Base::IDirect3DSurface8* realD3D = NULL;3839HRESULT hr = m_pD3D->GetSurfaceLevel(Level,&realD3D);4041D3D8Wrapper::IDirect3DSurface8* wrappedD3D = D3D8Wrapper::IDirect3DSurface8::GetSurface(realD3D);4243*ppSurfaceLevel = wrappedD3D;4445return hr;46}4748STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::LockRect(UINT Level,D3D8Base::D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags)49{50LOG("IDirect3DTexture8::LockRect( " << Level << " , " << pLockedRect << " , " << pRect << " , " << Flags << " ) [ " << this << " ]\n");51return m_pD3D->LockRect(Level,pLockedRect,pRect,Flags);52}5354STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::UnlockRect(UINT Level)55{56LOG("IDirect3DTexture8::UnlockRect() [ " << this << " ]\n");57return m_pD3D->UnlockRect(Level);58}5960STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::AddDirtyRect(CONST RECT* pDirtyRect)61{62LOG("IDirect3DTexture8::AddDirtyRect( " << pDirtyRect << " ) [ " << this << " ]\n");63return m_pD3D->AddDirtyRect(pDirtyRect);64}65}66}6768