rodecomp/Source/Render/Text/TextContext.h
ragnarok-clanker d010808f6d 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
2026-10-28 22:50:09 +00:00

45 lines
1.3 KiB
C++

#ifndef RAGNAROK_SOURCE_RENDER_TEXT_TEXTCONTEXT_H
#define RAGNAROK_SOURCE_RENDER_TEXT_TEXTCONTEXT_H
#include <windows.h>
class CDC;
struct TextLocale {
signed char language;
int service;
const unsigned short* serverLanguage;
bool inlineCharset;
};
class TextContext {
public:
explicit TextContext(CDC& surface);
~TextContext();
void SetFont(int family, int height, unsigned char bold, unsigned char italic);
void SetColor(COLORREF color);
void SetBackgroundColor(COLORREF color);
void SetBackgroundMode(int mode);
void SetBackground(COLORREF color, int mode);
SIZE Measure(const char* text, int bytes);
void Draw(int x, int y, const char* text, int bytes);
static unsigned CodePage(unsigned charset);
static unsigned Marker(const char* text, unsigned bytes);
HDC Dc() const { return this->m_dc; }
private:
/* 0000 */ HDC m_dc;
/* 0004 */ HGDIOBJ m_previous;
/* 0008 */ CDC* m_surface;
/* 000C */ int m_family;
/* 0010 */ int m_height;
/* 0014 */ unsigned m_charset;
/* 0018 */ unsigned char unknown_0018[5];
/* 001D */ unsigned char m_bold;
/* 001E */ unsigned char m_italic;
SIZE MeasurePart(const char* text, int bytes, unsigned charset);
void DrawPart(int x, int y, const char* text, int bytes, unsigned charset);
void DrawPair(int x, int y, const char* text, int bytes);
};
#endif