Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.
Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
#include "Render/DX9/DeviceOwnerDX9.h"
|
|
|
|
// OFFSET: 0x005650E0
|
|
// FUNCTION: fn_02212
|
|
bool DeviceOwnerDX9::CaptureBackBuffer() {
|
|
if (!this->device) {
|
|
return false;
|
|
}
|
|
|
|
if (!this->capturedBackBuffer && FAILED(this->device->CreateOffscreenPlainSurface(
|
|
this->backBufferDescription.Width, this->backBufferDescription.Height, this->backBufferDescription.Format,
|
|
D3DPOOL_SYSTEMMEM, &this->capturedBackBuffer, nullptr
|
|
))) {
|
|
return false;
|
|
}
|
|
|
|
if (FAILED(this->device->GetRenderTargetData(this->backBuffer, this->capturedBackBuffer))) {
|
|
if (this->capturedBackBuffer) {
|
|
this->capturedBackBuffer->Release();
|
|
this->capturedBackBuffer = nullptr;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
// OFFSET: 0x00567FB0
|
|
// FUNCTION: fn_02233
|
|
bool DeviceOwnerDX9::RestoreBackBuffer() {
|
|
if (!this->device || !this->capturedBackBuffer) {
|
|
return false;
|
|
}
|
|
|
|
if (FAILED(this->device->UpdateSurface(this->capturedBackBuffer, nullptr, this->backBuffer, nullptr))) {
|
|
if (this->capturedBackBuffer) {
|
|
this->capturedBackBuffer->Release();
|
|
this->capturedBackBuffer = nullptr;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|