DRAGONS: fixed font mapping

This commit is contained in:
Eric Fry 2019-07-25 09:57:11 +10:00 committed by Eugene Sandulenko
parent 0312e61345
commit 627989e46f
2 changed files with 6 additions and 6 deletions

View File

@ -56,12 +56,10 @@ Font::~Font() {
free(_pixels);
}
uint16 mapChar(uint16 in) {
if (in >= 97) {
return in - 0x23;
}
return in - 0x20;
uint16 Font::mapChar(uint16 in) {
return _map[in - _map[0x03] + 0x05];
}
Graphics::Surface *Font::render(uint16 *text, uint16 length, byte *palette) {
Graphics::Surface *surface = new Graphics::Surface();
Graphics::PixelFormat pixelFormat16(2, 5, 5, 5, 1, 10, 5, 0, 15); //TODO move this to a better location.

View File

@ -43,6 +43,8 @@ public:
Font(Common::SeekableReadStream &stream, uint32 mapSize, uint32 pixelOffset, uint32 pixelSize);
~Font();
Graphics::Surface *render(uint16 *text, uint16 length, byte *palette);
private:
uint16 mapChar(uint16 in);
};
struct ScreenTextEntry {
@ -55,7 +57,7 @@ private:
DragonsEngine *_vm;
Font *_fonts[3];
Screen *_screen;
Common::List<ScreenTextEntry*> _screenTexts;
Common::List<ScreenTextEntry *> _screenTexts;
byte *_palettes;
public: