diff --git a/Source/Render/DeviceContext/DCSurface.cpp b/Source/Render/DeviceContext/DCSurface.cpp index 3547e06..e747306 100644 --- a/Source/Render/DeviceContext/DCSurface.cpp +++ b/Source/Render/DeviceContext/DCSurface.cpp @@ -3,7 +3,9 @@ #include "Render/Textures/Surface.h" #include "Render/DX7/RenderSystemDX7.h" #include "Render/DX9/RenderSystemDX9.h" +#include "Render/Text/TextContext.h" +#include #include // OFFSET: 0x0056A500 @@ -13,6 +15,15 @@ std::shared_ptr AcquireBackBufferSurface(CRenderSystemBase* system) { } // 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(std::strlen(text))); + return 0; +} // OFFSET: 0x00569F10 // FUNCTION: fn_02274 diff --git a/Source/Render/Text/TextContext.h b/Source/Render/Text/TextContext.h index 8785422..698bbfd 100644 --- a/Source/Render/Text/TextContext.h +++ b/Source/Render/Text/TextContext.h @@ -25,6 +25,7 @@ public: 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;