Decompile fn_02121 (DrawBackBufferText)

Batch #1833 by Yommy: 0 byte-identical, 1 confirmed by peer review.

- fn_02121 DrawBackBufferText: logic confirmed by peer review

Reviewed-by: ragnarok-clanker
This commit is contained in:
ragnarok-clanker 2026-10-28 22:50:09 +00:00
commit d010808f6d
2 changed files with 12 additions and 0 deletions

View file

@ -3,7 +3,9 @@
#include "Render/Textures/Surface.h" #include "Render/Textures/Surface.h"
#include "Render/DX7/RenderSystemDX7.h" #include "Render/DX7/RenderSystemDX7.h"
#include "Render/DX9/RenderSystemDX9.h" #include "Render/DX9/RenderSystemDX9.h"
#include "Render/Text/TextContext.h"
#include <cstring>
#include <utility> #include <utility>
// OFFSET: 0x0056A500 // OFFSET: 0x0056A500
@ -13,6 +15,15 @@ std::shared_ptr<CSurface> AcquireBackBufferSurface(CRenderSystemBase* system) {
} }
// OFFSET: 0x0055FAD0 // OFFSET: 0x0055FAD0
// FUNCTION: fn_02121
int DrawBackBufferText(int x, int y, const char* text, COLORREF color) {
CDCSurface surface(AcquireBackBufferSurface(GetRenderSystemHolder()->system));
TextContext context(surface);
context.SetFont(0, 12, 0, 0);
SetTextColor(context.Dc(), color);
TextOutA(context.Dc(), x, y, text, static_cast<int>(std::strlen(text)));
return 0;
}
// OFFSET: 0x00569F10 // OFFSET: 0x00569F10
// FUNCTION: fn_02274 // FUNCTION: fn_02274

View file

@ -25,6 +25,7 @@ public:
void Draw(int x, int y, const char* text, int bytes); void Draw(int x, int y, const char* text, int bytes);
static unsigned CodePage(unsigned charset); static unsigned CodePage(unsigned charset);
static unsigned Marker(const char* text, unsigned bytes); static unsigned Marker(const char* text, unsigned bytes);
HDC Dc() const { return this->m_dc; }
private: private:
/* 0000 */ HDC m_dc; /* 0000 */ HDC m_dc;