[Scummvm-cvs-logs] SF.net SVN: scummvm:[48787] scummvm/trunk/engines/sci

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sat Apr 24 22:41:26 CEST 2010


Revision: 48787
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48787&view=rev
Author:   m_kiewitz
Date:     2010-04-24 20:41:26 +0000 (Sat, 24 Apr 2010)

Log Message:
-----------
SCI: r48786 port updates were actually introduced during SCI01, qfg2 and xmas90ega only. We enable port updates only for non-multilingual SCI01 games now - fixes percentage bar for qfg1 japanese as well

Modified Paths:
--------------
    scummvm/trunk/engines/sci/event.cpp
    scummvm/trunk/engines/sci/event.h
    scummvm/trunk/engines/sci/graphics/animate.cpp
    scummvm/trunk/engines/sci/graphics/animate.h
    scummvm/trunk/engines/sci/graphics/gui.cpp
    scummvm/trunk/engines/sci/graphics/gui.h
    scummvm/trunk/engines/sci/sci.cpp

Modified: scummvm/trunk/engines/sci/event.cpp
===================================================================
--- scummvm/trunk/engines/sci/event.cpp	2010-04-24 20:08:03 UTC (rev 48786)
+++ scummvm/trunk/engines/sci/event.cpp	2010-04-24 20:41:26 UTC (rev 48787)
@@ -36,11 +36,8 @@
 
 #define SCANCODE_ROWS_NR 3
 
-SciEvent::SciEvent(ResourceManager *resMan)
-	: _resMan(resMan) {
-
-	// Check, if font of current game includes extended chars
-	_fontIsExtended = _resMan->detectFontExtended();
+SciEvent::SciEvent(bool fontIsExtended)
+	: _fontIsExtended(fontIsExtended) {
 }
 
 SciEvent::~SciEvent() {

Modified: scummvm/trunk/engines/sci/event.h
===================================================================
--- scummvm/trunk/engines/sci/event.h	2010-04-24 20:08:03 UTC (rev 48786)
+++ scummvm/trunk/engines/sci/event.h	2010-04-24 20:41:26 UTC (rev 48787)
@@ -113,7 +113,7 @@
 
 class SciEvent {
 public:
-	SciEvent(ResourceManager *resMan);
+	SciEvent(bool fontIsExtended);
 	~SciEvent();
 
 	sciEvent get(unsigned int mask);

Modified: scummvm/trunk/engines/sci/graphics/animate.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/animate.cpp	2010-04-24 20:08:03 UTC (rev 48786)
+++ scummvm/trunk/engines/sci/graphics/animate.cpp	2010-04-24 20:41:26 UTC (rev 48787)
@@ -42,8 +42,8 @@
 
 namespace Sci {
 
-GfxAnimate::GfxAnimate(EngineState *state, GfxCache *cache, GfxPorts *ports, GfxPaint16 *paint16, GfxScreen *screen, GfxPalette *palette, GfxCursor *cursor, GfxTransitions *transitions)
-	: _s(state), _cache(cache), _ports(ports), _paint16(paint16), _screen(screen), _palette(palette), _cursor(cursor), _transitions(transitions) {
+GfxAnimate::GfxAnimate(EngineState *state, GfxCache *cache, GfxPorts *ports, GfxPaint16 *paint16, GfxScreen *screen, GfxPalette *palette, GfxCursor *cursor, GfxTransitions *transitions, bool fontIsExtended)
+	: _s(state), _cache(cache), _ports(ports), _paint16(paint16), _screen(screen), _palette(palette), _cursor(cursor), _transitions(transitions), _fontIsExtended(fontIsExtended) {
 	init();
 }
 
@@ -66,6 +66,14 @@
 	//  (found in larry 1)
 	if (!_s->_segMan->findObjectByName("fastCast").isNull())
 		_ignoreFastCast = true;
+
+	// SCI01 introduced port-update calls, although only the non multilingual games qfg2 and xmas90ega
+	//  So we enable those for SCI1+ games all the time and for SCI01 games that don't have extended fonts
+	_doPortUpdate = false;
+	if ((getSciVersion() == SCI_VERSION_01) && (!_fontIsExtended))
+		_doPortUpdate = true;
+	if (getSciVersion() > SCI_VERSION_01)
+		_doPortUpdate = true;
 }
 
 void GfxAnimate::disposeLastCast() {
@@ -631,13 +639,13 @@
 	fill(old_picNotValid);
 
 	if (old_picNotValid) {
-		// beginUpdate()/endUpdate() were introduced SCI01
+		// beginUpdate()/endUpdate() were introduced SCI01 (xmas90ega and qfg2 only), in SCI1+ all the time
 		//  calling those for SCI0 will work most of the time but breaks minor stuff like percentage bar of qfg1ega
 		//   at the character skill screen
-		if (getSciVersion() >= SCI_VERSION_01)
+		if (_doPortUpdate)
 			_ports->beginUpdate(_ports->_picWind);
 		update();
-		if (getSciVersion() >= SCI_VERSION_01)
+		if (_doPortUpdate)
 			_ports->endUpdate(_ports->_picWind);
 	}
 

Modified: scummvm/trunk/engines/sci/graphics/animate.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/animate.h	2010-04-24 20:08:03 UTC (rev 48786)
+++ scummvm/trunk/engines/sci/graphics/animate.h	2010-04-24 20:41:26 UTC (rev 48787)
@@ -86,7 +86,7 @@
  */
 class GfxAnimate {
 public:
-	GfxAnimate(EngineState *state, GfxCache *cache, GfxPorts *ports, GfxPaint16 *paint16, GfxScreen *screen, GfxPalette *palette, GfxCursor *cursor, GfxTransitions *transitions);
+	GfxAnimate(EngineState *state, GfxCache *cache, GfxPorts *ports, GfxPaint16 *paint16, GfxScreen *screen, GfxPalette *palette, GfxCursor *cursor, GfxTransitions *transitions, bool fontIsExtended);
 	virtual ~GfxAnimate();
 
 	// FIXME: Don't store EngineState
@@ -133,6 +133,8 @@
 	AnimateEntry *_lastCastData;
 
 	bool _ignoreFastCast;
+	bool _fontIsExtended;
+	bool _doPortUpdate;
 };
 
 } // End of namespace Sci

Modified: scummvm/trunk/engines/sci/graphics/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui.cpp	2010-04-24 20:08:03 UTC (rev 48786)
+++ scummvm/trunk/engines/sci/graphics/gui.cpp	2010-04-24 20:41:26 UTC (rev 48787)
@@ -51,7 +51,7 @@
 
 namespace Sci {
 
-SciGui::SciGui(EngineState *state, GfxScreen *screen, GfxPalette *palette, GfxCache *cache, GfxCursor *cursor, GfxPorts *ports, AudioPlayer *audio)
+SciGui::SciGui(EngineState *state, GfxScreen *screen, GfxPalette *palette, GfxCache *cache, GfxCursor *cursor, GfxPorts *ports, AudioPlayer *audio, bool fontIsExtended)
 	: _s(state), _screen(screen), _palette(palette), _cache(cache), _cursor(cursor), _ports(ports), _audio(audio) {
 
 	// FIXME/TODO: If SciGui inits all the stuff below, then it should *own* it,
@@ -66,7 +66,7 @@
 	_paint16 = new GfxPaint16(g_sci->getResMan(), _s->_segMan, g_sci->getKernel(), this, _cache, _ports, _coordAdjuster, _screen, _palette, _transitions);
 	g_sci->_gfxPaint = _paint16;
 	g_sci->_gfxPaint16 = _paint16;
-	_animate = new GfxAnimate(_s, _cache, _ports, _paint16, _screen, _palette, _cursor, _transitions);
+	_animate = new GfxAnimate(_s, _cache, _ports, _paint16, _screen, _palette, _cursor, _transitions, fontIsExtended);
 	g_sci->_gfxAnimate = _animate;
 	_text16 = new GfxText16(g_sci->getResMan(), _cache, _ports, _paint16, _screen);
 	_controls = new GfxControls(_s->_segMan, _ports, _paint16, _text16, _screen);

Modified: scummvm/trunk/engines/sci/graphics/gui.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui.h	2010-04-24 20:08:03 UTC (rev 48786)
+++ scummvm/trunk/engines/sci/graphics/gui.h	2010-04-24 20:41:26 UTC (rev 48787)
@@ -46,7 +46,7 @@
 
 class SciGui {
 public:
-	SciGui(EngineState *s, GfxScreen *screen, GfxPalette *palette, GfxCache *cache, GfxCursor *cursor, GfxPorts *ports, AudioPlayer *audio);
+	SciGui(EngineState *s, GfxScreen *screen, GfxPalette *palette, GfxCache *cache, GfxCursor *cursor, GfxPorts *ports, AudioPlayer *audio, bool fontIsExtended);
 	virtual ~SciGui();
 
 	virtual void init(bool usesOldGfxFunctions);

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2010-04-24 20:08:03 UTC (rev 48786)
+++ scummvm/trunk/engines/sci/sci.cpp	2010-04-24 20:41:26 UTC (rev 48787)
@@ -181,8 +181,12 @@
 	_features = new GameFeatures(segMan, _kernel);
 
 	_gamestate = new EngineState(_vocabulary, segMan);
-	_gamestate->_event = new SciEvent(_resMan);
 
+	// Detect extended font used in multilingual games
+	bool fontIsExtended = _resMan->detectFontExtended();
+
+	_gamestate->_event = new SciEvent(fontIsExtended);
+
 	if (script_init_engine(_gamestate))
 		return Common::kUnknownError;
 
@@ -198,7 +202,7 @@
 	} else {
 #endif
 		_gfxPorts = new GfxPorts(segMan, screen);
-		_gui = new SciGui(_gamestate, screen, palette, cache, cursor, _gfxPorts, _audio);
+		_gui = new SciGui(_gamestate, screen, palette, cache, cursor, _gfxPorts, _audio, fontIsExtended);
 #ifdef ENABLE_SCI32
 		_gui32 = 0;
 		_gfxFrameout = 0;


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