rodecomp/Source/Render/Text/TextContext.h
ragnarok-clanker 2a105fd3d0 Confirm 12 functions in Source/Render/Text/TextContext.h, Source/UI/Window/UIWindow.cpp, ...
Batch #18651 by eAthena: 4 byte-identical, 8 confirmed by peer review.

- fn_02120 CRendererDX7::CleanupTextures: logic confirmed by peer review (already on main)
- fn_02121 DrawBackBufferText: logic confirmed by peer review (already on main)
- fn_16971 UIWindow::TextHeight: logic confirmed by peer review (already on main)
- fn_16975 UIWindow::TextWidth: logic confirmed by peer review (already on main)
- fn_17009 UIWindow::DrawTextAt: byte-identical (already on main)
- fn_17016 UIWindow::DrawOutlinedText: byte-identical (already on main)
- fn_17018 UIWindow::DrawCenteredOutlinedText: logic confirmed by peer review (already on main)
- fn_17019 UIWindow::DrawRightOutlinedText: logic confirmed by peer review (already on main)
- fn_17020 UIWindow::DrawVerticalOutlinedText: logic confirmed by peer review (already on main)
- fn_17021 UIWindow::DrawRightAlignedText: logic confirmed by peer review (already on main)
- fn_17022 UIWindow::DrawShadowedText: byte-identical (already on main)
- fn_17024 UIWindow::DrawEmboldenedText: byte-identical (already on main)

Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-11-12 17:28:41 +00:00

46 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 */ int padding_0018;
/* 001C */ unsigned char padding_001C;
/* 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