rodecomp/Source/Render/DX9/SurfaceDX9.h
ragnarok-clanker 15fd41fd65 Decompile 3 functions in Source/Render/DX9/TextureDX9.cpp, Source/Render/DX9/TextureDX9.h, ...
Batch #15609 by Yommy: 1 byte-identical, 2 confirmed by peer review.

- fn_02480 CTextureDX9::Create: logic confirmed by peer review
- fn_02484 CTextureDX9::ClearSurface: logic confirmed by peer review
- fn_02441 PackColorA1R5G5B5: byte-identical

Peer-reviewed-by: secret, KWDev, codeplay
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-11-10 07:36:13 +00:00

40 lines
1.2 KiB
C++

#ifndef RAGNAROK_SOURCE_RENDER_DX9_SURFACEDX9_H
#define RAGNAROK_SOURCE_RENDER_DX9_SURFACEDX9_H
#include "Render/Textures/Surface.h"
#include <d3d9.h>
class DeviceOwnerDX9;
std::uint16_t PackColorA1R5G5B5(std::uint32_t color);
class CSurfaceDX9 : public CSurface {
public:
CSurfaceDX9(DeviceOwnerDX9& owner, int width, int height);
CSurfaceDX9(DeviceOwnerDX9& owner, IDirect3DSurface9* surface);
~CSurfaceDX9() override;
std::uint32_t Width() override;
std::uint32_t Height() override;
bool Resize(int width, int height) override;
SurfaceLock Lock() override;
void Unlock() override;
bool GetDC(HDC* output) override;
void ReleaseDC(HDC dc) override;
void Upload(int x, int y, int width, int height, const std::uint32_t* pixels, int option, int sourceWidth) override;
void Fill(const RECT* rectangle, std::uint32_t color) override;
void Draw(int x, int y, int width, int height, std::uint32_t color) override;
void Stretch(int x, int y, int width, int height) override;
protected:
/* 0004 */ DeviceOwnerDX9* m_owner;
/* 0008 */ std::uint32_t m_width;
/* 000C */ std::uint32_t m_height;
/* 0010 */ IDirect3DSurface9* m_surface;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(CSurfaceDX9) == 20);
#endif
#endif