aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/font.h
diff options
context:
space:
mode:
authorPeter Kohaut2019-07-14 22:02:48 +0200
committerPeter Kohaut2019-07-16 21:32:34 +0200
commitffbfe90afad5c1b6a24705e94235172d2d38b032 (patch)
treedc58d3fbb1da18545b2676c408355d0d82f1da34 /engines/bladerunner/font.h
parent0781584dfcf02ed063cd114fa02572a0bf7f81ee (diff)
downloadscummvm-rg350-ffbfe90afad5c1b6a24705e94235172d2d38b032.tar.gz
scummvm-rg350-ffbfe90afad5c1b6a24705e94235172d2d38b032.tar.bz2
scummvm-rg350-ffbfe90afad5c1b6a24705e94235172d2d38b032.zip
BLADERUNNER: Ajdust font interface to ScummVM's one
Diffstat (limited to 'engines/bladerunner/font.h')
-rw-r--r--engines/bladerunner/font.h53
1 files changed, 23 insertions, 30 deletions
diff --git a/engines/bladerunner/font.h b/engines/bladerunner/font.h
index ba5b32789d..38fd305a4d 100644
--- a/engines/bladerunner/font.h
+++ b/engines/bladerunner/font.h
@@ -23,8 +23,11 @@
#ifndef BLADERUNNER_FONT_H
#define BLADERUNNER_FONT_H
+#include "common/array.h"
#include "common/str.h"
+#include "graphics/font.h"
+
namespace Graphics {
struct Surface;
}
@@ -33,7 +36,7 @@ namespace BladeRunner {
class BladeRunnerEngine;
-class Font {
+class Font : public Graphics::Font {
struct Character {
int x;
int y;
@@ -42,43 +45,33 @@ class Font {
int dataOffset;
};
- BladeRunnerEngine *_vm;
-
- int _characterCount;
- int _maxWidth;
- int _maxHeight;
- Character _characters[256];
- int _dataSize;
- uint16 *_data;
- int _screenWidth;
- int _screenHeight;
- int _spacing1;
- int _spacing2;
- uint16 _defaultColor;
- uint16 _color;
- int _intersperse;
+ uint32 _characterCount;
+ int _maxWidth;
+ int _maxHeight;
+ Common::Array<Character> _characters;
+ int _dataSize;
+ uint16 *_data;
+ int _screenWidth;
+ int _screenHeight;
+ int _spacing;
+ bool _useFontColor;
+ int _intersperse;
public:
- Font(BladeRunnerEngine *vm);
~Font();
- bool open(const Common::String &fileName, int screenWidth, int screenHeight, int spacing1, int spacing2, uint16 color);
- void close();
-
- void setSpacing(int spacing1, int spacing2);
- void setColor(uint16 color);
+ static Font* load(BladeRunnerEngine *vm, const Common::String &fileName, int spacing, bool useFontColor);
- void draw(const Common::String &text, Graphics::Surface &surface, int x, int y) const;
- void drawColor(const Common::String &text, Graphics::Surface &surface, int x, int y, uint16 color);
- void drawNumber(int num, Graphics::Surface &surface, int x, int y) const;
-
- int getTextWidth(const Common::String &text) const;
- int getTextHeight(const Common::String &text) const;
+ int getFontHeight() const;
+ int getMaxCharWidth() const;
+ int getCharWidth(uint32 chr) const;
+ void drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const;
private:
+ Font();
void reset();
-
- void drawCharacter(const uint8 character, Graphics::Surface &surface, int x, int y) const;
+ void close();
+ // void drawCharacter(const uint8 character, Graphics::Surface &surface, int x, int y) const;
};
} // End of namespace BladeRunner