rodecomp/Source/Render/Text/TextContext.h
ragnarok-clanker cbbf28e4de Maintenance: Add mandatory field offset markers /* XXXX */ and assertions to Render headers (DX7, DX9, Primitives, Text, Textures)
Batch #1060 by ragnarok-clanker: no function's compiled code changes; checked with 188 compiled unit(s), including every includer of Source/Render/DX7/DeviceOwnerDX7.h, Source/Render/DX7/DirectDrawEnumeration.h, Source/Render/DX7/RenderSystemDX7.h, Source/Render/DX7/RendererFogDX7.h, Source/Render/DX7/SurfaceDX7.h, Source/Render/DX9/DeviceOwnerDX9.h, Source/Render/DX9/DeviceStateDX9.h, Source/Render/DX9/RendererFogDX9.h, Source/Render/DeviceContext/DCSurface.h, Source/Render/DisplayMode.h, Source/Render/Primitives/LightmappedPrimitive.h, Source/Render/Primitives/RenderCommandPool.h, Source/Render/Primitives/RenderPrimitive.h, Source/Render/Primitives/RenderPrimitivePool.h, Source/Render/Primitives/RenderQueues.h, Source/Render/Primitives/RenderVertexPool.h, Source/Render/Projection/RendererViewport.h, Source/Render/RenderAdapter.h, Source/Render/Renderer.h, Source/Render/RendererBackBuffer.h, Source/Render/Text/TextContext.h, Source/Render/Textures/BitmapTextureCache.h, Source/Render/Textures/SpriteAtlas.h, Source/Render/Textures/Surface.h.
2026-10-27 13:48:11 +00:00

44 lines
1.2 KiB
C++

#ifndef RAGNAROK_SOURCE_RENDER_TEXT_TEXTCONTEXT_H
#define RAGNAROK_SOURCE_RENDER_TEXT_TEXTCONTEXT_H
#include <windows.h>
class CDC;
class FontCache;
struct TextLocale {
signed char language;
int service;
const unsigned short* serverLanguage;
bool inlineCharset;
};
class TextContext {
public:
TextContext(CDC& surface, FontCache& fonts, const TextLocale& locale);
~TextContext();
void SetFont(int family, int height, unsigned char bold, unsigned char italic);
void SetColor(COLORREF color);
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, bool enabled);
private:
/* 0000 */ HDC m_dc;
/* 0004 */ HGDIOBJ m_previous;
/* 0008 */ CDC* m_surface;
FontCache* m_fonts;
const TextLocale* m_locale;
int m_family;
int m_height;
unsigned m_charset;
unsigned char m_bold;
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