aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/text32.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/graphics/text32.h')
-rw-r--r--engines/sci/graphics/text32.h30
1 files changed, 8 insertions, 22 deletions
diff --git a/engines/sci/graphics/text32.h b/engines/sci/graphics/text32.h
index 39fe710a86..3a411ce663 100644
--- a/engines/sci/graphics/text32.h
+++ b/engines/sci/graphics/text32.h
@@ -26,24 +26,8 @@
#ifndef SCI_GRAPHICS_TEXT32_H
#define SCI_GRAPHICS_TEXT32_H
-#include "common/hashmap.h"
-
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<uint32, TextEntry *> TextCache;
-
/**
* Text32 class, handles text calculation and displaying of text for SCI2, SCI21 and SCI3 games
*/
@@ -51,18 +35,20 @@ class GfxText32 {
public:
GfxText32(SegManager *segMan, GfxCache *fonts, GfxScreen *screen);
~GfxText32();
- void createTextBitmap(reg_t textObject);
- void drawTextBitmap(reg_t textObject, uint16 textX, uint16 textY, uint16 w);
+ reg_t createTextBitmap(reg_t textObject, uint16 maxWidth = 0, uint16 maxHeight = 0, reg_t prevHunk = NULL_REG);
+ void disposeTextBitmap(reg_t hunkId);
+ void drawTextBitmap(uint16 x, uint16 y, Common::Rect planeRect, 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);
- void purgeCache();
+ 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);
SegManager *_segMan;
GfxCache *_cache;
- TextCache _textCache;
GfxScreen *_screen;
};