diff options
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/kyra_v1.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/kyra_v2.cpp | 3 | ||||
-rw-r--r-- | engines/kyra/kyra_v3.cpp | 3 | ||||
-rw-r--r-- | engines/kyra/screen.cpp | 55 | ||||
-rw-r--r-- | engines/kyra/screen.h | 8 |
5 files changed, 35 insertions, 38 deletions
diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index 719132929c..f9a9f6320c 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -168,8 +168,8 @@ KyraEngine_v1::~KyraEngine_v1() { int KyraEngine_v1::init() { _screen = new Screen_v1(this, _system); assert(_screen); - if (!_screen->init()) - error("_screen->init() failed"); + _screen->setResolution(); + KyraEngine::init(); _sprites = new Sprites(this, _system); diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index a144f71056..26c6753031 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -193,8 +193,7 @@ Movie *KyraEngine_v2::createWSAMovie() { int KyraEngine_v2::init() { _screen = new Screen_v2(this, _system); assert(_screen); - if (!_screen->init()) - error("_screen->init() failed"); + _screen->setResolution(); KyraEngine::init(); initStaticResource(); diff --git a/engines/kyra/kyra_v3.cpp b/engines/kyra/kyra_v3.cpp index 6fb23e6568..2edb0aabf7 100644 --- a/engines/kyra/kyra_v3.cpp +++ b/engines/kyra/kyra_v3.cpp @@ -196,8 +196,7 @@ KyraEngine_v3::~KyraEngine_v3() { int KyraEngine_v3::init() { _screen = new Screen_v3(this, _system); assert(_screen); - if (!_screen->init()) - error("_screen->init() failed"); + _screen->setResolution(); KyraEngine::init(); diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index b7536803a8..00312dc711 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -75,7 +75,34 @@ bool Screen::init() { _useSJIS = false; _sjisTempPage = _sjisFontData = 0; - setResolution(); + if (_vm->gameFlags().useHiResOverlay) { + _useOverlays = true; + _useSJIS = (_vm->gameFlags().lang == Common::JA_JPN); + _sjisInvisibleColor = (_vm->gameFlags().gameID == GI_KYRA1) ? 0x80 : 0xF6; + + for (int i = 0; i < SCREEN_OVLS_NUM; ++i) { + if (!_sjisOverlayPtrs[i]) { + _sjisOverlayPtrs[i] = new uint8[SCREEN_OVL_SJIS_SIZE]; + assert(_sjisOverlayPtrs[i]); + memset(_sjisOverlayPtrs[i], _sjisInvisibleColor, SCREEN_OVL_SJIS_SIZE); + } + } + + if (_useSJIS) { + if (!_sjisFontData) { + _sjisFontData = _vm->resource()->fileData("FMT_FNT.ROM", 0); + if (!_sjisFontData) + error("missing font rom ('FMT_FNT.ROM') required for this version"); + } + + if (!_sjisTempPage) { + _sjisTempPage = new uint8[420]; + assert(_sjisTempPage); + _sjisTempPage2 = _sjisTempPage + 60; + _sjisSourceChar = _sjisTempPage + 384; + } + } + } _curPage = 0; uint8 *pagePtr = new uint8[SCREEN_PAGE_SIZE * 8]; @@ -155,32 +182,6 @@ void Screen::setResolution() { else _system->initSize(640, 400); _system->endGFXTransaction(); - - _useOverlays = true; - _useSJIS = (_vm->gameFlags().lang == Common::JA_JPN); - _sjisInvisibleColor = (_vm->gameFlags().gameID == GI_KYRA1) ? 0x80 : 0xF6; - - for (int i = 0; i < SCREEN_OVLS_NUM; ++i) { - if (!_sjisOverlayPtrs[i]) { - _sjisOverlayPtrs[i] = new uint8[SCREEN_OVL_SJIS_SIZE]; - assert(_sjisOverlayPtrs[i]); - memset(_sjisOverlayPtrs[i], _sjisInvisibleColor, SCREEN_OVL_SJIS_SIZE); - } - } - if (_useSJIS) { - if (!_sjisFontData) { - _sjisFontData = _vm->resource()->fileData("FMT_FNT.ROM", 0); - if (!_sjisFontData) - error("missing font rom ('FMT_FNT.ROM') required for this version"); - } - - if (!_sjisTempPage) { - _sjisTempPage = new uint8[420]; - assert(_sjisTempPage); - _sjisTempPage2 = _sjisTempPage + 60; - _sjisSourceChar = _sjisTempPage + 384; - } - } } else { _system->beginGFXTransaction(); _vm->initCommonGFX(false); diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h index ed69e9260e..9eb2c835a4 100644 --- a/engines/kyra/screen.h +++ b/engines/kyra/screen.h @@ -59,9 +59,7 @@ struct Font { }; class Screen { - friend class Debugger_v1; public: - enum { SCREEN_W = 320, SCREEN_H = 200, @@ -97,7 +95,10 @@ public: Screen(KyraEngine *vm, OSystem *system); virtual ~Screen(); + // init virtual bool init(); + virtual void setResolution(); + void updateScreen(); @@ -349,9 +350,6 @@ protected: int _drawShapeVar4; int _drawShapeVar5; - // init - virtual void setResolution(); - // debug bool _debugEnabled; }; |