rodecomp/Source/Render/DeviceContext/DCSurface.cpp
ragnarok-clanker bf6a44c117 Group Utility units into subsystem folders and require OFFSET provenance
Move Lexicon*, Text (TextTokens, TextEscapes, Base64), Math/RadialGrid, Hash (MD5, XxHash32) and Cipher (Rijndael, XorBytes) into Source/Utility subfolders; update includes, guards, compile.json and CMakeLists.txt. Backfill // OFFSET: above every standalone // FUNCTION: block (89 IDs, addresses from the symbol database) and make it mandatory in CODING_RULES.md and AGENTS.md. Remove the MatchLexicon cast chain.
2026-10-26 23:41:07 +01:00

185 lines
4.9 KiB
C++

#include "Render/DeviceContext/DCSurface.h"
#include "Render/RenderSystemBase.h"
#include "Render/Textures/Surface.h"
#include <utility>
// OFFSET: 0x0056A500
// FUNCTION: fn_02290
std::shared_ptr<CSurface> AcquireBackBufferSurface(CRenderSystemBase* system) {
return system ? system->BackBufferSurface() : std::shared_ptr<CSurface>{};
}
// OFFSET: 0x00569F10
// FUNCTION: fn_02274
CRenderer* RenderSystemHolder::CreateRenderer() {
return this->system ? this->system->CreateRenderer() : nullptr;
}
// OFFSET: 0x00569F80
// FUNCTION: fn_02278
HRESULT RenderSystemHolder::Close() {
return this->system ? this->system->Close() : E_ILLEGAL_METHOD_CALL;
}
// OFFSET: 0x00569FC0
// FUNCTION: fn_02280
void RenderSystemHolder::UpdateOption() {
if (this->system) {
this->system->UpdateOption();
}
}
// OFFSET: 0x00569FD0
// FUNCTION: fn_02281
void RenderSystemHolder::RestoreDisplayMode() {
if (this->system) {
this->system->RestoreDisplayMode();
}
}
// OFFSET: 0x00569FE0
// FUNCTION: fn_02282
void RenderSystemHolder::PrepareErrorDialog() {
if (this->system) {
this->system->PrepareErrorDialog();
}
}
// OFFSET: 0x0056A230
// FUNCTION: fn_02285
std::int32_t RenderSystemHolder::Backend() const {
return this->system ? this->system->Backend() : -1;
}
// OFFSET: 0x0056A280
// FUNCTION: fn_02287
CTexture* RenderSystemHolder::BackBufferTexture() const {
return this->system ? this->system->BackBufferTexture() : nullptr;
}
// OFFSET: 0x0056A290
// FUNCTION: fn_02288
std::uint32_t RenderSystemHolder::Height() const {
return this->system ? this->system->Height() : 0;
}
// OFFSET: 0x0056A690
// FUNCTION: fn_02292
std::uint32_t RenderSystemHolder::Width() const {
return this->system ? this->system->Width() : 0;
}
// OFFSET: 0x0056A790
// FUNCTION: fn_02294
bool RenderSystemHolder::IsWindowed() const {
return this->system ? this->system->IsWindowed() : false;
}
// OFFSET: 0x0056A7A0
// FUNCTION: fn_02295
HRESULT RenderSystemHolder::TestDevice() const {
return this->system ? this->system->TestDevice() : E_ILLEGAL_METHOD_CALL;
}
// OFFSET: 0x00548FE0
// FUNCTION: fn_01864
CDCSurface::CDCSurface(std::shared_ptr<CSurface> surface) : m_surface(std::move(surface)) {
}
// OFFSET: 0x005490D0
// OFFSET: 0x00549180
// FUNCTION: fn_01865
CDCSurface::~CDCSurface() = default;
// OFFSET: 0x005492C0
// FUNCTION: fn_01879
void CDCSurface::Grow(std::uint32_t width, std::uint32_t height) {
if (width > this->m_surface->Width() || height > this->m_surface->Height()) {
this->m_surface->Resize(width, height);
}
}
// OFFSET: 0x005492A0
// FUNCTION: fn_01877
bool CDCSurface::GetDC(HDC* output) {
return this->m_surface->GetDC(output);
}
// OFFSET: 0x005492B0
// FUNCTION: fn_01878
void CDCSurface::ReleaseDC(HDC dc) {
this->m_surface->ReleaseDC(dc);
}
// OFFSET: 0x00549320
// FUNCTION: fn_01881
void CDCSurface::Copy(int x, int y, int width, int height, const std::uint32_t* source, bool transparent) {
this->m_surface->Upload(x, y, width, height, source, transparent, 0);
}
// OFFSET: 0x005492F0
// FUNCTION: fn_01880
void CDCSurface::ScaleCopy(int x, int y, int sourceWidth, int sourceHeight, int, int, const std::uint32_t* source, int option) {
this->m_surface->Upload(x, y, sourceWidth, sourceHeight, source, option, 0);
}
// OFFSET: 0x00549260
// FUNCTION: fn_01873
void CDCSurface::Fill(const RECT* rectangle, std::uint32_t color) {
this->m_surface->Fill(rectangle, color);
}
// OFFSET: 0x00549290
// FUNCTION: fn_01876
void CDCSurface::Draw(CRenderSystemBase&, int x, int y, int width, int height, std::uint32_t color) {
this->m_surface->Draw(x, y, width, height, color);
}
// OFFSET: 0x00549360
// FUNCTION: fn_01883
void CDCSurface::CopyRegion(int, int, int, int, int, int, const std::uint32_t*, int, int, bool, bool) {
}
// OFFSET: 0x00549270
// FUNCTION: fn_01874
void CDCSurface::CopyFrom(int, int, int, int, int, int, const CDCBitmap&) {
}
// OFFSET: 0x00549280
// FUNCTION: fn_01875
void CDCSurface::BlendFrom(std::uint32_t, std::uint32_t, int, int, const CDCBitmap&) {
}
// OFFSET: 0x00549230
// FUNCTION: fn_01870
void CDCSurface::DrawRleSprite(int, int, std::span<const SpriteFrameCell>, const SpriteRleImage* const* const*, const std::uint32_t*, int) {
}
// OFFSET: 0x00549240
// FUNCTION: fn_01871
void CDCSurface::DrawSurface(int, int, CSurface*, int, int, int, int, bool, int, int, int, int) {
}
// OFFSET: 0x00549220
// FUNCTION: fn_01869
void CDCSurface::DrawScaledSprite(
int, int, int, int, std::span<const SpriteFrameCell>, const SpriteRleImage* const* const*, int, int, int, float, const std::uint32_t*, SpriteAtlas&,
CRenderSystemBase&, int, std::uint32_t
) {
}
// OFFSET: 0x00549250
// FUNCTION: fn_01872
void CDCSurface::DrawScaledSurface(int, int, int, int, CSurface*, int, int, float, float, std::uint32_t, bool, int, int, int, int, int) {
}
// OFFSET: 0x00549370
// FUNCTION: fn_01884
void CDCSurface::Brighten(int, int, int, int, int) {
}
// OFFSET: 0x00549350
// FUNCTION: fn_01882
void CDCSurface::Dim(int, int, int, int, int) {
}