[Scummvm-cvs-logs] SF.net SVN: scummvm: [31730] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Sat Apr 26 12:15:54 CEST 2008
Revision: 31730
http://scummvm.svn.sourceforge.net/scummvm/?rev=31730&view=rev
Author: lordhoto
Date: 2008-04-26 03:15:54 -0700 (Sat, 26 Apr 2008)
Log Message:
-----------
Fixed kyra screen initialization.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/kyra_v1.cpp
scummvm/trunk/engines/kyra/kyra_v2.cpp
scummvm/trunk/engines/kyra/kyra_v3.cpp
scummvm/trunk/engines/kyra/screen.cpp
scummvm/trunk/engines/kyra/screen.h
Modified: scummvm/trunk/engines/kyra/kyra_v1.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v1.cpp 2008-04-26 09:52:17 UTC (rev 31729)
+++ scummvm/trunk/engines/kyra/kyra_v1.cpp 2008-04-26 10:15:54 UTC (rev 31730)
@@ -168,8 +168,8 @@
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);
Modified: scummvm/trunk/engines/kyra/kyra_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.cpp 2008-04-26 09:52:17 UTC (rev 31729)
+++ scummvm/trunk/engines/kyra/kyra_v2.cpp 2008-04-26 10:15:54 UTC (rev 31730)
@@ -193,8 +193,7 @@
int KyraEngine_v2::init() {
_screen = new Screen_v2(this, _system);
assert(_screen);
- if (!_screen->init())
- error("_screen->init() failed");
+ _screen->setResolution();
KyraEngine::init();
initStaticResource();
Modified: scummvm/trunk/engines/kyra/kyra_v3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v3.cpp 2008-04-26 09:52:17 UTC (rev 31729)
+++ scummvm/trunk/engines/kyra/kyra_v3.cpp 2008-04-26 10:15:54 UTC (rev 31730)
@@ -196,8 +196,7 @@
int KyraEngine_v3::init() {
_screen = new Screen_v3(this, _system);
assert(_screen);
- if (!_screen->init())
- error("_screen->init() failed");
+ _screen->setResolution();
KyraEngine::init();
Modified: scummvm/trunk/engines/kyra/screen.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen.cpp 2008-04-26 09:52:17 UTC (rev 31729)
+++ scummvm/trunk/engines/kyra/screen.cpp 2008-04-26 10:15:54 UTC (rev 31730)
@@ -75,8 +75,35 @@
_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];
for (int pageNum = 0; pageNum < SCREEN_PAGE_NUM; pageNum += 2)
@@ -155,32 +182,6 @@
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);
Modified: scummvm/trunk/engines/kyra/screen.h
===================================================================
--- scummvm/trunk/engines/kyra/screen.h 2008-04-26 09:52:17 UTC (rev 31729)
+++ scummvm/trunk/engines/kyra/screen.h 2008-04-26 10:15:54 UTC (rev 31730)
@@ -59,9 +59,7 @@
};
class Screen {
- friend class Debugger_v1;
public:
-
enum {
SCREEN_W = 320,
SCREEN_H = 200,
@@ -97,8 +95,11 @@
Screen(KyraEngine *vm, OSystem *system);
virtual ~Screen();
+ // init
virtual bool init();
+ virtual void setResolution();
+
void updateScreen();
// debug functions
@@ -349,9 +350,6 @@
int _drawShapeVar4;
int _drawShapeVar5;
- // init
- virtual void setResolution();
-
// debug
bool _debugEnabled;
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list