aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichieSams2013-09-15 14:52:27 -0500
committerRichieSams2013-09-15 15:00:59 -0500
commitdc8c7ca2c04372a39af5cca80040daa8923e9658 (patch)
treeda24b3e44ae0d5fdddda193b58a62bb0d5b8455e
parentc643718dae5ca7f7fce8672ffa6000661e9fceaa (diff)
downloadscummvm-rg350-dc8c7ca2c04372a39af5cca80040daa8923e9658.tar.gz
scummvm-rg350-dc8c7ca2c04372a39af5cca80040daa8923e9658.tar.bz2
scummvm-rg350-dc8c7ca2c04372a39af5cca80040daa8923e9658.zip
ZVISION: Add RenderManager text support
-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
*