aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorathrxx2011-07-09 23:57:25 +0200
committerathrxx2011-07-09 23:57:51 +0200
commitf24bac2d0f79bc49041cfe035a681338850b2e9d (patch)
tree62abfef06a3a36f36a7b0d151aedad54c3287dc9 /engines
parente3dbae886dc138433f07e4fd9e85b14254471359 (diff)
downloadscummvm-rg350-f24bac2d0f79bc49041cfe035a681338850b2e9d.tar.gz
scummvm-rg350-f24bac2d0f79bc49041cfe035a681338850b2e9d.tar.bz2
scummvm-rg350-f24bac2d0f79bc49041cfe035a681338850b2e9d.zip
SCUMM: fix DS compilation
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/charset.cpp13
-rw-r--r--engines/scumm/charset.h1
-rw-r--r--engines/scumm/scumm.cpp4
-rw-r--r--engines/scumm/scumm.h8
4 files changed, 22 insertions, 4 deletions
diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index bba29bbe84..33010af12a 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -49,7 +49,7 @@ void ScummEngine::loadCJKFont() {
_newLineCharacter = 0;
if (_game.version <= 5 && _game.platform == Common::kPlatformFMTowns && _language == Common::JA_JPN) { // FM-TOWNS v3 / v5 Kanji
-#ifdef DISABLE_TOWNS_DUAL_LAYER_MODE
+#if defined(DISABLE_TOWNS_DUAL_LAYER_MODE) || !defined(USE_RGB_COLOR)
GUIErrorMessage("FM-Towns Kanji font drawing requires dual graphics layer support which is disabled in this build");
error("FM-Towns Kanji font drawing requires dual graphics layer support which is disabled in this build");
#else
@@ -61,6 +61,7 @@ void ScummEngine::loadCJKFont() {
_useCJKMode = true;
#endif
} else if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine && _language == Common::JA_JPN) {
+#ifdef USE_RGB_COLOR
// use PC-Engine System Card, since game files don't have kanji font resources
_cjkFont = Graphics::FontSJIS::createFont(_game.platform);
if (!_cjkFont)
@@ -72,7 +73,7 @@ void ScummEngine::loadCJKFont() {
_2byteWidth = _cjkFont->getMaxFontWidth();
_2byteHeight = _cjkFont->getFontHeight();
_useCJKMode = true;
-
+#endif
} else if (_game.id == GID_MONKEY && _game.platform == Common::kPlatformSegaCD && _language == Common::JA_JPN) {
int numChar = 1413;
_2byteWidth = 16;
@@ -963,18 +964,22 @@ void CharsetRendererTownsV3::enableShadow(bool enable) {
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
_shadowColor = 0x88;
+#ifdef USE_RGB_COLOR
if (_vm->_cjkFont)
_vm->_cjkFont->setDrawingMode(enable ? Graphics::FontSJIS::kFMTownsShadowMode : Graphics::FontSJIS::kDefaultMode);
#endif
+#endif
}
void CharsetRendererTownsV3::drawBits1(const Graphics::Surface &s, byte *dst, const byte *src, int drawTop, int width, int height, uint8 bitDepth) {
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
+#ifdef USE_RGB_COLOR
if (_sjisCurChar) {
assert(_vm->_cjkFont);
_vm->_cjkFont->drawChar(_vm->_textSurface, _sjisCurChar, _left * _vm->_textSurfaceMultiplier, _top * _vm->_textSurfaceMultiplier, _color, _shadowColor);
return;
}
+#endif
dst = (byte *)_vm->_textSurface.getBasePtr(_left * _vm->_textSurfaceMultiplier, _top * _vm->_textSurfaceMultiplier);
int sfPitch = _vm->_textSurface.pitch;
@@ -1054,18 +1059,22 @@ void CharsetRendererTownsV3::drawBits1(const Graphics::Surface &s, byte *dst, co
}
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
int CharsetRendererTownsV3::getDrawWidthIntern(uint16 chr) {
+#ifdef USE_RGB_COLOR
if (_vm->_useCJKMode && chr > 127) {
assert(_vm->_cjkFont);
return _vm->_cjkFont->getCharWidth(chr);
}
+#endif
return CharsetRendererV3::getDrawWidthIntern(chr);
}
int CharsetRendererTownsV3::getDrawHeightIntern(uint16 chr) {
+#ifdef USE_RGB_COLOR
if (_vm->_useCJKMode && chr > 127) {
assert(_vm->_cjkFont);
return _vm->_cjkFont->getFontHeight();
}
+#endif
return CharsetRendererV3::getDrawHeightIntern(chr);
}
diff --git a/engines/scumm/charset.h b/engines/scumm/charset.h
index 4a5799688c..b80db73a58 100644
--- a/engines/scumm/charset.h
+++ b/engines/scumm/charset.h
@@ -25,6 +25,7 @@
#include "common/scummsys.h"
#include "common/rect.h"
#include "graphics/sjis.h"
+#include "scumm/scumm.h"
#include "scumm/gfx.h"
#include "scumm/saveload.h"
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 173fb01f65..5233156fc7 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -283,8 +283,10 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
_16BitPalette = NULL;
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
_townsScreen = 0;
+#ifdef USE_RGB_COLOR
_cjkFont = 0;
#endif
+#endif
_shadowPalette = NULL;
_shadowPaletteSize = 0;
memset(_currentPalette, 0, sizeof(_currentPalette));
@@ -632,8 +634,10 @@ ScummEngine::~ScummEngine() {
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
delete _townsScreen;
+#ifdef USE_RGB_COLOR
delete _cjkFont;
#endif
+#endif
delete _debugger;
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index ed9f650b71..e503af750d 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1328,13 +1328,17 @@ public:
// Exists both in V7 and in V72HE:
byte VAR_NUM_GLOBAL_OBJS;
+#ifdef USE_RGB_COLOR
+ // FM-Towns / PC-Engine specific
+ Graphics::FontSJIS *_cjkFont;
+#endif
+
// FM-Towns specific
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
public:
bool towns_isRectInStringBox(int x1, int y1, int x2, int y2);
byte _townsPaletteFlags;
- byte _townsCharsetColorMap[16];
- Graphics::FontSJIS *_cjkFont;
+ byte _townsCharsetColorMap[16];
protected:
void towns_drawStripToScreen(VirtScreen *vs, int dstX, int dstY, int srcX, int srcY, int w, int h);