aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/charset.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/scumm/charset.h')
-rw-r--r--engines/scumm/charset.h29
1 files changed, 18 insertions, 11 deletions
diff --git a/engines/scumm/charset.h b/engines/scumm/charset.h
index b5fc7b1b15..4b2e053c6d 100644
--- a/engines/scumm/charset.h
+++ b/engines/scumm/charset.h
@@ -27,6 +27,7 @@
#include "common/scummsys.h"
#include "common/rect.h"
+#include "graphics/sjis.h"
#include "scumm/gfx.h"
#include "scumm/saveload.h"
@@ -37,9 +38,9 @@ class NutRenderer;
struct VirtScreen;
static inline bool checkSJISCode(byte c) {
- if ((c > 0x84 && c < 0x88) || (c > 0x9f && c < 0xe0) || (c > 0xea /* && c <= 0xff */))
- return false;
- return true;
+ if ((c >= 0x80 && c <= 0x9f) || (c >= 0xe0 && c <= 0xfd))
+ return true;
+ return false;
}
@@ -74,7 +75,7 @@ public:
virtual ~CharsetRenderer();
virtual void printChar(int chr, bool ignoreCharsetMask) = 0;
- virtual void drawChar(int chr, const Graphics::Surface &s, int x, int y) {}
+ virtual void drawChar(int chr, Graphics::Surface &s, int x, int y) {}
int getStringWidth(int a, const byte *str);
void addLinebreaks(int a, byte *str, int pos, int maxwidth);
@@ -112,7 +113,8 @@ protected:
ShadowMode _shadowMode;
void enableShadow(bool enable);
- virtual void drawBits1(const Graphics::Surface &s, byte *dst, const byte *src, int drawTop, int width, int height, uint8 bitDepth);
+ virtual void drawBits1(const Graphics::Surface &s, byte *dst, const byte *src, int drawTop, int width, int height, uint8 bitDepth, bool scale2x = false);
+
public:
CharsetRendererCommon(ScummEngine *vm);
@@ -124,7 +126,7 @@ public:
class CharsetRendererClassic : public CharsetRendererCommon {
protected:
- void drawBitsN(const Graphics::Surface &s, byte *dst, const byte *src, byte bpp, int drawTop, int width, int height);
+ void drawBitsN(const Graphics::Surface &s, byte *dst, const byte *src, byte bpp, int drawTop, int width, int height, bool scale2x = false);
void printCharIntern(bool is2byte, const byte *charPtr, int origWidth, int origHeight, int width, int height, VirtScreen *vs, bool ignoreCharsetMask);
@@ -132,23 +134,28 @@ public:
CharsetRendererClassic(ScummEngine *vm) : CharsetRendererCommon(vm) {}
void printChar(int chr, bool ignoreCharsetMask);
- void drawChar(int chr, const Graphics::Surface &s, int x, int y);
+ void drawChar(int chr, Graphics::Surface &s, int x, int y);
int getCharWidth(uint16 chr);
+
+ // Some SCUMM 5 games contain hard coded logic to determine whether to use
+ // the SCUMM fonts or the FM-Towns font rom to draw a character. For the other
+ // games we will simply check for a character greater 127.
+ bool useTownsFontRomCharacter(uint16 chr);
};
class CharsetRendererNES : public CharsetRendererCommon {
protected:
byte *_trTable;
- void drawBits1(const Graphics::Surface &s, byte *dst, const byte *src, int drawTop, int width, int height, uint8 bitDepth);
+ void drawBits1(const Graphics::Surface &s, byte *dst, const byte *src, int drawTop, int width, int height, uint8 bitDepth, bool scale2x = false);
public:
CharsetRendererNES(ScummEngine *vm) : CharsetRendererCommon(vm) {}
void setCurID(int32 id) {}
void printChar(int chr, bool ignoreCharsetMask);
- void drawChar(int chr, const Graphics::Surface &s, int x, int y);
+ void drawChar(int chr, Graphics::Surface &s, int x, int y);
int getFontHeight() { return 8; }
int getCharWidth(uint16 chr) { return 8; }
@@ -162,7 +169,7 @@ public:
CharsetRendererV3(ScummEngine *vm) : CharsetRendererCommon(vm) {}
void printChar(int chr, bool ignoreCharsetMask);
- void drawChar(int chr, const Graphics::Surface &s, int x, int y);
+ void drawChar(int chr, Graphics::Surface &s, int x, int y);
void setCurID(int32 id);
void setColor(byte color);
int getCharWidth(uint16 chr);
@@ -171,7 +178,7 @@ public:
#ifdef USE_RGB_COLOR
class CharsetRendererPCE : public CharsetRendererV3 {
protected:
- void drawBits1(const Graphics::Surface &s, byte *dst, const byte *src, int drawTop, int width, int height, uint8 bitDepth);
+ void drawBits1(const Graphics::Surface &s, byte *dst, const byte *src, int drawTop, int width, int height, uint8 bitDepth, bool scale2x = false);
public:
CharsetRendererPCE(ScummEngine *vm) : CharsetRendererV3(vm) {}