Batch #18241 by ragnarok-clanker: forced by an admin (2 lower score(s), 17 changed function(s)); checked with 378 compiled unit(s), including every includer of Source/Client/Session/Session.h, Source/Contents/Effects/Particles/EZ2STREffectEx.h, Source/Render/DX7/RendererDX7.h, Source/Render/DX9/RendererDX9.h, Source/Render/Renderer.h.
42 lines
926 B
C++
42 lines
926 B
C++
#include "Render/DX9/DeviceOwnerDX9.h"
|
|
#include "Render/DX9/RendererDX9.h"
|
|
|
|
// OFFSET: 0x00567E80
|
|
// FUNCTION: fn_02232
|
|
int CRendererDX9::LockBackBuffer() {
|
|
const DeviceOwnerDX9& owner = *this->device;
|
|
D3DLOCKED_RECT locked;
|
|
|
|
if (FAILED(owner.backBuffer->LockRect(&locked, nullptr, 0))) {
|
|
return 0;
|
|
}
|
|
|
|
this->backBuffer.pixels = locked.pBits;
|
|
this->backBuffer.pitch = locked.Pitch;
|
|
|
|
int bitsPerPixel;
|
|
switch (owner.backBufferDescription.Format) {
|
|
case D3DFMT_A8R8G8B8:
|
|
case D3DFMT_X8R8G8B8:
|
|
bitsPerPixel = 32;
|
|
break;
|
|
case D3DFMT_R5G6B5:
|
|
case D3DFMT_X1R5G5B5:
|
|
case D3DFMT_A1R5G5B5:
|
|
case D3DFMT_A4R4G4B4:
|
|
bitsPerPixel = 16;
|
|
break;
|
|
default:
|
|
bitsPerPixel = 0;
|
|
break;
|
|
}
|
|
this->backBuffer.bitsPerPixel = bitsPerPixel;
|
|
|
|
return 1;
|
|
}
|
|
|
|
// OFFSET: 0x00568ED0
|
|
// FUNCTION: fn_02243
|
|
HRESULT CRendererDX9::UnlockBackBuffer() {
|
|
return this->device->backBuffer->UnlockRect();
|
|
}
|