From 96ce226967741e65684c8b4d55adfbb5526fa787 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 11 Oct 2011 01:24:28 +0300 Subject: SCI: Proper implementation of text drawing for SCI2+ --- engines/sci/graphics/text32.h | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'engines/sci/graphics/text32.h') diff --git a/engines/sci/graphics/text32.h b/engines/sci/graphics/text32.h index 113fbb46a2..4c1e53d971 100644 --- a/engines/sci/graphics/text32.h +++ b/engines/sci/graphics/text32.h @@ -30,20 +30,6 @@ namespace Sci { -struct TextEntry { - reg_t object; - uint16 x; - uint16 y; - uint16 width; - uint16 height; - byte *surface; - Common::String text; -}; - -// TODO: Move to Cache, perhaps? -#define MAX_CACHED_TEXTS 20 -typedef Common::HashMap TextCache; - /** * Text32 class, handles text calculation and displaying of text for SCI2, SCI21 and SCI3 games */ @@ -52,22 +38,21 @@ public: GfxText32(SegManager *segMan, GfxCache *fonts, GfxScreen *screen); ~GfxText32(); reg_t createTextBitmap(reg_t textObject, uint16 maxWidth = 0, uint16 maxHeight = 0); - void drawTextBitmap(reg_t textObject, uint16 textX, uint16 textY, uint16 planeWidth); + void disposeTextBitmap(reg_t hunkId); + void drawTextBitmap(reg_t textObject); int16 GetLongest(const char *text, int16 maxWidth, GfxFont *font); - TextEntry *getTextEntry(reg_t textObject); void kernelTextSize(const char *text, int16 font, int16 maxWidth, int16 *textWidth, int16 *textHeight); private: - TextEntry *createTextEntry(reg_t textObject, uint16 maxWidth, uint16 maxHeight); int16 Size(Common::Rect &rect, const char *text, GuiResourceId fontId, int16 maxWidth); void Width(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int16 &textWidth, int16 &textHeight, bool restoreFont); void StringWidth(const char *str, GuiResourceId orgFontId, int16 &textWidth, int16 &textHeight); - void purgeCache(); + Common::Rect getPlaneRect(reg_t textObject); + Common::Rect getNSRect(reg_t textObject); SegManager *_segMan; GfxCache *_cache; - TextCache _textCache; GfxScreen *_screen; }; -- cgit v1.2.3