aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/render_manager.cpp16
-rw-r--r--engines/zvision/render_manager.h3
2 files changed, 19 insertions, 0 deletions
diff --git a/engines/zvision/render_manager.cpp b/engines/zvision/render_manager.cpp
index 72fa5d3fc6..1c1ce40c6c 100644
--- a/engines/zvision/render_manager.cpp
+++ b/engines/zvision/render_manager.cpp
@@ -346,6 +346,22 @@ void RenderManager::copyRectToWorkingWindow(const uint16 *buffer, int32 destX, i
_alphaDataEntries.push_back(entry);
}
+Common::Rect RenderManager::renderTextToWorkingWindow(const Common::String &text, TruetypeFont *font, int destX, int destY, uint16 textColor, int maxWidth, int maxHeight, Graphics::TextAlign align, bool wrap) {
+ AlphaDataEntry entry;
+ entry.alphaColor = 0;
+ entry.destX = destX;
+ entry.destY = destY;
+
+ // Draw the text to the working window
+ entry.data = font->drawTextToSurface(text, destX, destY, textColor, maxWidth, maxHeight, align, wrap);
+ entry.width = entry.data->w;
+ entry.height = entry.data->h;
+
+ _alphaDataEntries.push_back(entry);
+
+ return Common::Rect(destX, destY, destX + entry.width, destY + entry.height);
+}
+
void RenderManager::copyWorkingWindowSubRectToSurface(Graphics::Surface *destSurface, uint16 destX, uint16 destY, Common::Rect subRect) const {
uint32 destOffset = 0;
uint32 sourceOffset = 0;
diff --git a/engines/zvision/render_manager.h b/engines/zvision/render_manager.h
index f6106b39a3..84914cc5d3 100644
--- a/engines/zvision/render_manager.h
+++ b/engines/zvision/render_manager.h
@@ -29,6 +29,7 @@
#include "graphics/surface.h"
#include "zvision/render_table.h"
+#include "zvision/truetype_font.h"
class OSystem;
@@ -124,6 +125,8 @@ public:
void copyRectToWorkingWindow(const uint16 *buffer, int32 destX, int32 destY, int32 imageWidth, int32 width, int32 height);
void copyRectToWorkingWindow(const uint16 *buffer, int32 destX, int32 destY, int32 imageWidth, int32 width, int32 height, int16 alphaColor);
+ Common::Rect renderTextToWorkingWindow(const Common::String &text, TruetypeFont *font, int destX, int destY, uint16 textColor, int maxWidth, int maxHeight = -1, Graphics::TextAlign align = Graphics::kTextAlignLeft, bool wrap = true);
+
/**
* Fills the entire workingWindow with the specified color
*