mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-04 10:29:15 +01:00
[d3d8] Refactor D3D8Volume implementation
This commit is contained in:
parent
7bb8819fbc
commit
9d37e4abb4
39
src/d3d8/d3d8_volume.cpp
Normal file
39
src/d3d8/d3d8_volume.cpp
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#include "d3d8_volume.h"
|
||||||
|
|
||||||
|
#include "d3d8_d3d9_util.h"
|
||||||
|
|
||||||
|
namespace dxvk {
|
||||||
|
|
||||||
|
D3D8Volume::D3D8Volume(
|
||||||
|
D3D8Device* pDevice,
|
||||||
|
IDirect3DVolumeTexture8* pTexture,
|
||||||
|
Com<d3d9::IDirect3DVolume9>&& pVolume)
|
||||||
|
: D3D8VolumeBase(pDevice, std::move(pVolume), pTexture) {
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE D3D8Volume::GetDesc(D3DVOLUME_DESC* pDesc) {
|
||||||
|
if (unlikely(pDesc == nullptr))
|
||||||
|
return D3DERR_INVALIDCALL;
|
||||||
|
|
||||||
|
d3d9::D3DVOLUME_DESC desc;
|
||||||
|
HRESULT res = GetD3D9()->GetDesc(&desc);
|
||||||
|
|
||||||
|
if (likely(SUCCEEDED(res)))
|
||||||
|
ConvertVolumeDesc8(&desc, pDesc);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE D3D8Volume::LockBox(D3DLOCKED_BOX* pLockedBox, CONST D3DBOX* pBox, DWORD Flags) {
|
||||||
|
return GetD3D9()->LockBox(
|
||||||
|
reinterpret_cast<d3d9::D3DLOCKED_BOX*>(pLockedBox),
|
||||||
|
reinterpret_cast<const d3d9::D3DBOX*>(pBox),
|
||||||
|
Flags
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE D3D8Volume::UnlockBox() {
|
||||||
|
return GetD3D9()->UnlockBox();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,7 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "d3d8_subresource.h"
|
#include "d3d8_subresource.h"
|
||||||
#include "d3d8_d3d9_util.h"
|
|
||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
@ -13,33 +12,13 @@ namespace dxvk {
|
|||||||
D3D8Volume(
|
D3D8Volume(
|
||||||
D3D8Device* pDevice,
|
D3D8Device* pDevice,
|
||||||
IDirect3DVolumeTexture8* pTexture,
|
IDirect3DVolumeTexture8* pTexture,
|
||||||
Com<d3d9::IDirect3DVolume9>&& pVolume)
|
Com<d3d9::IDirect3DVolume9>&& pVolume);
|
||||||
: D3D8VolumeBase(pDevice, std::move(pVolume), pTexture) {}
|
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE GetDesc(D3DVOLUME_DESC* pDesc) {
|
HRESULT STDMETHODCALLTYPE GetDesc(D3DVOLUME_DESC* pDesc);
|
||||||
if (unlikely(pDesc == nullptr))
|
|
||||||
return D3DERR_INVALIDCALL;
|
|
||||||
|
|
||||||
d3d9::D3DVOLUME_DESC desc;
|
HRESULT STDMETHODCALLTYPE LockBox(D3DLOCKED_BOX* pLockedBox, CONST D3DBOX* pBox, DWORD Flags) final;
|
||||||
HRESULT res = GetD3D9()->GetDesc(&desc);
|
|
||||||
|
|
||||||
if (likely(SUCCEEDED(res)))
|
HRESULT STDMETHODCALLTYPE UnlockBox() final;
|
||||||
ConvertVolumeDesc8(&desc, pDesc);
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE LockBox(D3DLOCKED_BOX* pLockedBox, CONST D3DBOX* pBox, DWORD Flags) final {
|
|
||||||
return GetD3D9()->LockBox(
|
|
||||||
reinterpret_cast<d3d9::D3DLOCKED_BOX*>(pLockedBox),
|
|
||||||
reinterpret_cast<const d3d9::D3DBOX*>(pBox),
|
|
||||||
Flags
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE UnlockBox() final {
|
|
||||||
return GetD3D9()->UnlockBox();
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -10,7 +10,8 @@ d3d8_src = [
|
|||||||
'd3d8_state_block.cpp',
|
'd3d8_state_block.cpp',
|
||||||
'd3d8_surface.cpp',
|
'd3d8_surface.cpp',
|
||||||
'd3d8_swapchain.cpp',
|
'd3d8_swapchain.cpp',
|
||||||
'd3d8_texture.cpp'
|
'd3d8_texture.cpp',
|
||||||
|
'd3d8_volume.cpp'
|
||||||
]
|
]
|
||||||
|
|
||||||
d3d8_ld_args = []
|
d3d8_ld_args = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user