[Scummvm-cvs-logs] SF.net SVN: scummvm:[42767] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Sat Jul 25 18:08:31 CEST 2009


Revision: 42767
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42767&view=rev
Author:   drmccoy
Date:     2009-07-25 16:08:31 +0000 (Sat, 25 Jul 2009)

Log Message:
-----------
Moved the decision whether subtitles should be displayed, so that the broken subtitles in The Last Dynasty aren't shown

Modified Paths:
--------------
    scummvm/trunk/engines/gob/draw_v2.cpp
    scummvm/trunk/engines/gob/global.cpp
    scummvm/trunk/engines/gob/global.h
    scummvm/trunk/engines/gob/gob.cpp
    scummvm/trunk/engines/gob/gob.h
    scummvm/trunk/engines/gob/init.cpp
    scummvm/trunk/engines/gob/init.h
    scummvm/trunk/engines/gob/init_v1.cpp
    scummvm/trunk/engines/gob/init_v2.cpp
    scummvm/trunk/engines/gob/init_v3.cpp
    scummvm/trunk/engines/gob/init_v6.cpp
    scummvm/trunk/engines/gob/module.mk

Added Paths:
-----------
    scummvm/trunk/engines/gob/init_v4.cpp

Modified: scummvm/trunk/engines/gob/draw_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/draw_v2.cpp	2009-07-25 16:07:29 UTC (rev 42766)
+++ scummvm/trunk/engines/gob/draw_v2.cpp	2009-07-25 16:08:31 UTC (rev 42767)
@@ -218,7 +218,7 @@
 
 	bool isSubtitle = (ptr[1] & 0x80) != 0;
 
-	if (isSubtitle && !_vm->subtitles()) {
+	if (isSubtitle && !_vm->_global->_doSubtitles) {
 		delete textItem;
 		return;
 	}

Modified: scummvm/trunk/engines/gob/global.cpp
===================================================================
--- scummvm/trunk/engines/gob/global.cpp	2009-07-25 16:07:29 UTC (rev 42766)
+++ scummvm/trunk/engines/gob/global.cpp	2009-07-25 16:08:31 UTC (rev 42767)
@@ -124,6 +124,8 @@
 
 	_speedFactor = 1;
 
+	_doSubtitles = false;
+
 	_noCd = false;
 }
 

Modified: scummvm/trunk/engines/gob/global.h
===================================================================
--- scummvm/trunk/engines/gob/global.h	2009-07-25 16:07:29 UTC (rev 42766)
+++ scummvm/trunk/engines/gob/global.h	2009-07-25 16:08:31 UTC (rev 42767)
@@ -141,6 +141,8 @@
 	// Can be 1, 2 or 3 for normal, double and triple speed, respectively
 	uint8 _speedFactor;
 
+	bool _doSubtitles;
+
 	bool _noCd;
 
 	Global(GobEngine *vm);

Modified: scummvm/trunk/engines/gob/gob.cpp
===================================================================
--- scummvm/trunk/engines/gob/gob.cpp	2009-07-25 16:07:29 UTC (rev 42766)
+++ scummvm/trunk/engines/gob/gob.cpp	2009-07-25 16:08:31 UTC (rev 42767)
@@ -214,10 +214,6 @@
 	return (isSCNDemo() || isBATDemo());
 }
 
-bool GobEngine::subtitles() const {
-	return ConfMan.getBool("subtitles");
-}
-
 Common::Error GobEngine::run() {
 	if (!initGameParts()) {
 		GUIErrorMessage("GobEngine::init(): Unknown version of game engine");
@@ -318,6 +314,12 @@
 	_mixer->pauseAll(pause);
 }
 
+void GobEngine::syncSoundSettings() {
+	Engine::syncSoundSettings();
+
+	_init->updateConfig();
+}
+
 void GobEngine::pauseGame() {
 	pauseEngineIntern(true);
 
@@ -333,139 +335,138 @@
 
 	_saveLoad = 0;
 
-	_global = new Global(this);
-	_util = new Util(this);
-	_dataIO = new DataIO(this);
-	_palAnim = new PalAnim(this);
+	_global    = new Global(this);
+	_util      = new Util(this);
+	_dataIO    = new DataIO(this);
+	_palAnim   = new PalAnim(this);
 	_vidPlayer = new VideoPlayer(this);
-	_sound = new Sound(this);
-	_game = new Game(this);
+	_sound     = new Sound(this);
+	_game      = new Game(this);
 
 	switch (_gameType) {
 	case kGameTypeGeisha:
 	case kGameTypeAdibouUnknown:
 	case kGameTypeGob1:
-		_init = new Init_v1(this);
-		_video = new Video_v1(this);
-		_inter = new Inter_v1(this);
-		_mult = new Mult_v1(this);
-		_draw = new Draw_v1(this);
-		_map = new Map_v1(this);
-		_goblin = new Goblin_v1(this);
-		_scenery = new Scenery_v1(this);
+		_init     = new Init_v1(this);
+		_video    = new Video_v1(this);
+		_inter    = new Inter_v1(this);
+		_mult     = new Mult_v1(this);
+		_draw     = new Draw_v1(this);
+		_map      = new Map_v1(this);
+		_goblin   = new Goblin_v1(this);
+		_scenery  = new Scenery_v1(this);
 		break;
 
 	case kGameTypeFascination:
-		_init = new Init_v2(this);
-		_video = new Video_v2(this);
-		_inter = new Inter_Fascination(this);
-		_mult = new Mult_v2(this);
-		_draw = new Draw_v2(this);
-		_map = new Map_v2(this);
-		_goblin = new Goblin_v2(this);
-		_scenery = new Scenery_v2(this);
+		_init     = new Init_v2(this);
+		_video    = new Video_v2(this);
+		_inter    = new Inter_Fascination(this);
+		_mult     = new Mult_v2(this);
+		_draw     = new Draw_v2(this);
+		_map      = new Map_v2(this);
+		_goblin   = new Goblin_v2(this);
+		_scenery  = new Scenery_v2(this);
 		_saveLoad = new SaveLoad_v2(this, _targetName.c_str());
 		break;
 
 	case kGameTypeWeen:
 	case kGameTypeGob2:
-		_init = new Init_v2(this);
-		_video = new Video_v2(this);
-		_inter = new Inter_v2(this);
-		_mult = new Mult_v2(this);
-		_draw = new Draw_v2(this);
-		_map = new Map_v2(this);
-		_goblin = new Goblin_v2(this);
-		_scenery = new Scenery_v2(this);
+		_init     = new Init_v2(this);
+		_video    = new Video_v2(this);
+		_inter    = new Inter_v2(this);
+		_mult     = new Mult_v2(this);
+		_draw     = new Draw_v2(this);
+		_map      = new Map_v2(this);
+		_goblin   = new Goblin_v2(this);
+		_scenery  = new Scenery_v2(this);
 		_saveLoad = new SaveLoad_v2(this, _targetName.c_str());
 		break;
 
 	case kGameTypeBargon:
-		_init = new Init_v2(this);
-		_video = new Video_v2(this);
-		_inter = new Inter_Bargon(this);
-		_mult = new Mult_v2(this);
-		_draw = new Draw_Bargon(this);
-		_map = new Map_v2(this);
-		_goblin = new Goblin_v2(this);
-		_scenery = new Scenery_v2(this);
+		_init     = new Init_v2(this);
+		_video    = new Video_v2(this);
+		_inter    = new Inter_Bargon(this);
+		_mult     = new Mult_v2(this);
+		_draw     = new Draw_Bargon(this);
+		_map      = new Map_v2(this);
+		_goblin   = new Goblin_v2(this);
+		_scenery  = new Scenery_v2(this);
 		_saveLoad = new SaveLoad_v2(this, _targetName.c_str());
 		break;
 
 	case kGameTypeGob3:
 	case kGameTypeInca2:
-		_init = new Init_v3(this);
-		_video = new Video_v2(this);
-		_inter = new Inter_v3(this);
-		_mult = new Mult_v2(this);
-		_draw = new Draw_v2(this);
-		_map = new Map_v2(this);
-		_goblin = new Goblin_v3(this);
-		_scenery = new Scenery_v2(this);
+		_init     = new Init_v3(this);
+		_video    = new Video_v2(this);
+		_inter    = new Inter_v3(this);
+		_mult     = new Mult_v2(this);
+		_draw     = new Draw_v2(this);
+		_map      = new Map_v2(this);
+		_goblin   = new Goblin_v3(this);
+		_scenery  = new Scenery_v2(this);
 		_saveLoad = new SaveLoad_v3(this, _targetName.c_str(), SaveLoad_v3::kScreenshotTypeGob3);
 		break;
 
 	case kGameTypeLostInTime:
-		_init = new Init_v3(this);
-		_video = new Video_v2(this);
-		_inter = new Inter_v3(this);
-		_mult = new Mult_v2(this);
-		_draw = new Draw_v2(this);
-		_map = new Map_v2(this);
-		_goblin = new Goblin_v3(this);
-		_scenery = new Scenery_v2(this);
+		_init     = new Init_v3(this);
+		_video    = new Video_v2(this);
+		_inter    = new Inter_v3(this);
+		_mult     = new Mult_v2(this);
+		_draw     = new Draw_v2(this);
+		_map      = new Map_v2(this);
+		_goblin   = new Goblin_v3(this);
+		_scenery  = new Scenery_v2(this);
 		_saveLoad = new SaveLoad_v3(this, _targetName.c_str(), SaveLoad_v3::kScreenshotTypeLost);
 		break;
 
 	case kGameTypeWoodruff:
-		_init = new Init_v3(this);
-		_video = new Video_v2(this);
-		_inter = new Inter_v4(this);
-		_mult = new Mult_v2(this);
-		_draw = new Draw_v2(this);
-		_map = new Map_v2(this);
-		_goblin = new Goblin_v4(this);
-		_scenery = new Scenery_v2(this);
+		_init     = new Init_v4(this);
+		_video    = new Video_v2(this);
+		_inter    = new Inter_v4(this);
+		_mult     = new Mult_v2(this);
+		_draw     = new Draw_v2(this);
+		_map      = new Map_v2(this);
+		_goblin   = new Goblin_v4(this);
+		_scenery  = new Scenery_v2(this);
 		_saveLoad = new SaveLoad_v4(this, _targetName.c_str());
 		break;
 
 	case kGameTypeDynasty:
-		_init = new Init_v3(this);
-		_video = new Video_v2(this);
-		_inter = new Inter_v5(this);
-		_mult = new Mult_v2(this);
-		_draw = new Draw_v2(this);
-		_map = new Map_v2(this);
-		_goblin = new Goblin_v4(this);
-		_scenery = new Scenery_v2(this);
+		_init     = new Init_v3(this);
+		_video    = new Video_v2(this);
+		_inter    = new Inter_v5(this);
+		_mult     = new Mult_v2(this);
+		_draw     = new Draw_v2(this);
+		_map      = new Map_v2(this);
+		_goblin   = new Goblin_v4(this);
+		_scenery  = new Scenery_v2(this);
 		_saveLoad = new SaveLoad(this);
 		break;
 
 	case kGameTypeAdibou4:
 	case kGameTypeUrban:
-		_init = new Init_v6(this);
-		_video = new Video_v6(this);
-		_inter = new Inter_v6(this);
-		_mult = new Mult_v2(this);
-		_draw = new Draw_v2(this);
-		_map = new Map_v2(this);
-		_goblin = new Goblin_v4(this);
-		_scenery = new Scenery_v2(this);
+		_init     = new Init_v6(this);
+		_video    = new Video_v6(this);
+		_inter    = new Inter_v6(this);
+		_mult     = new Mult_v2(this);
+		_draw     = new Draw_v2(this);
+		_map      = new Map_v2(this);
+		_goblin   = new Goblin_v4(this);
+		_scenery  = new Scenery_v2(this);
 		_saveLoad = new SaveLoad_v6(this, _targetName.c_str());
 		break;
 
 	case kGameTypePlaytoon:
 	case kGameTypePlaytnCk:
 	case kGameTypeBambou:
-		_init = new Init_v2(this);
-		_video = new Video_v2(this);
-//		_inter = new Inter_Playtoons(this);
-		_inter = new Inter_v6(this);
-		_mult = new Mult_v2(this);
-		_draw = new Draw_v2(this);
-		_map = new Map_v2(this);
-		_goblin = new Goblin_v2(this);
-		_scenery = new Scenery_v2(this);
+		_init     = new Init_v2(this);
+		_video    = new Video_v2(this);
+		_inter    = new Inter_v6(this);
+		_mult     = new Mult_v2(this);
+		_draw     = new Draw_v2(this);
+		_map      = new Map_v2(this);
+		_goblin   = new Goblin_v2(this);
+		_scenery  = new Scenery_v2(this);
 		_saveLoad = new SaveLoad_Playtoons(this);
 		break;
 

Modified: scummvm/trunk/engines/gob/gob.h
===================================================================
--- scummvm/trunk/engines/gob/gob.h	2009-07-25 16:07:29 UTC (rev 42766)
+++ scummvm/trunk/engines/gob/gob.h	2009-07-25 16:08:31 UTC (rev 42767)
@@ -165,6 +165,7 @@
 	virtual Common::Error run();
 	virtual bool hasFeature(EngineFeature f) const;
 	virtual void pauseEngineIntern(bool pause);
+	virtual void syncSoundSettings();
 
 	bool initGameParts();
 	void deinitGameParts();
@@ -221,8 +222,6 @@
 	bool is800x600() const;
 	bool isDemo() const;
 
-	bool subtitles() const;
-
 	GobEngine(OSystem *syst);
 	virtual ~GobEngine();
 

Modified: scummvm/trunk/engines/gob/init.cpp
===================================================================
--- scummvm/trunk/engines/gob/init.cpp	2009-07-25 16:07:29 UTC (rev 42766)
+++ scummvm/trunk/engines/gob/init.cpp	2009-07-25 16:08:31 UTC (rev 42767)
@@ -49,6 +49,9 @@
 	_palDesc = 0;
 }
 
+Init::~Init() {
+}
+
 void Init::cleanup() {
 	_vm->_video->freeDriver();
 	_vm->_global->_primarySurfDesc.reset();
@@ -87,6 +90,7 @@
 	char buffer[128];
 
 	initVideo();
+	updateConfig();
 
 	if (!_vm->isDemo()) {
 		if (_vm->_dataIO->existData(_vm->_startStk.c_str()))
@@ -206,4 +210,7 @@
 	cleanup();
 }
 
+void Init::updateConfig() {
+}
+
 } // End of namespace Gob

Modified: scummvm/trunk/engines/gob/init.h
===================================================================
--- scummvm/trunk/engines/gob/init.h	2009-07-25 16:07:29 UTC (rev 42766)
+++ scummvm/trunk/engines/gob/init.h	2009-07-25 16:08:31 UTC (rev 42767)
@@ -32,12 +32,14 @@
 
 class Init {
 public:
+	Init(GobEngine *vm);
+	virtual ~Init();
+
 	virtual void initGame();
 
 	virtual void initVideo() = 0;
 
-	Init(GobEngine *vm);
-	virtual ~Init() {}
+	virtual void updateConfig();
 
 protected:
 	Video::PalDesc *_palDesc;
@@ -50,34 +52,42 @@
 
 class Init_v1 : public Init {
 public:
-	virtual void initVideo();
+	Init_v1(GobEngine *vm);
+	~Init_v1();
 
-	Init_v1(GobEngine *vm);
-	virtual ~Init_v1() {}
+	void initVideo();
 };
 
 class Init_v2 : public Init_v1 {
 public:
-	virtual void initVideo();
+	Init_v2(GobEngine *vm);
+	~Init_v2();
 
-	Init_v2(GobEngine *vm);
-	virtual ~Init_v2() {}
+	void initVideo();
 };
 
 class Init_v3 : public Init_v2 {
 public:
-	virtual void initVideo();
+	Init_v3(GobEngine *vm);
+	~Init_v3();
 
-	Init_v3(GobEngine *vm);
-	virtual ~Init_v3() {}
+	void initVideo();
 };
 
+class Init_v4 : public Init_v3 {
+public:
+	Init_v4(GobEngine *vm);
+	~Init_v4();
+
+	void updateConfig();
+};
+
 class Init_v6 : public Init_v3 {
 public:
-	virtual void initGame();
+	Init_v6(GobEngine *vm);
+	~Init_v6();
 
-	Init_v6(GobEngine *vm);
-	virtual ~Init_v6() {}
+	void initGame();
 };
 
 } // End of namespace Gob

Modified: scummvm/trunk/engines/gob/init_v1.cpp
===================================================================
--- scummvm/trunk/engines/gob/init_v1.cpp	2009-07-25 16:07:29 UTC (rev 42766)
+++ scummvm/trunk/engines/gob/init_v1.cpp	2009-07-25 16:08:31 UTC (rev 42767)
@@ -35,6 +35,9 @@
 Init_v1::Init_v1(GobEngine *vm) : Init(vm) {
 }
 
+Init_v1::~Init_v1() {
+}
+
 void Init_v1::initVideo() {
 	if (_vm->_global->_videoMode)
 		_vm->validateVideoMode(_vm->_global->_videoMode);

Modified: scummvm/trunk/engines/gob/init_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/init_v2.cpp	2009-07-25 16:07:29 UTC (rev 42766)
+++ scummvm/trunk/engines/gob/init_v2.cpp	2009-07-25 16:08:31 UTC (rev 42767)
@@ -36,6 +36,9 @@
 Init_v2::Init_v2(GobEngine *vm) : Init_v1(vm) {
 }
 
+Init_v2::~Init_v2() {
+}
+
 void Init_v2::initVideo() {
 	if (_vm->_global->_videoMode)
 		_vm->validateVideoMode(_vm->_global->_videoMode);

Modified: scummvm/trunk/engines/gob/init_v3.cpp
===================================================================
--- scummvm/trunk/engines/gob/init_v3.cpp	2009-07-25 16:07:29 UTC (rev 42766)
+++ scummvm/trunk/engines/gob/init_v3.cpp	2009-07-25 16:08:31 UTC (rev 42767)
@@ -34,6 +34,9 @@
 Init_v3::Init_v3(GobEngine *vm) : Init_v2(vm) {
 }
 
+Init_v3::~Init_v3() {
+}
+
 void Init_v3::initVideo() {
 	Init_v2::initVideo();
 

Copied: scummvm/trunk/engines/gob/init_v4.cpp (from rev 42766, scummvm/trunk/engines/gob/init_v3.cpp)
===================================================================
--- scummvm/trunk/engines/gob/init_v4.cpp	                        (rev 0)
+++ scummvm/trunk/engines/gob/init_v4.cpp	2009-07-25 16:08:31 UTC (rev 42767)
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "common/endian.h"
+#include "common/config-manager.h"
+
+#include "gob/gob.h"
+#include "gob/init.h"
+#include "gob/global.h"
+
+namespace Gob {
+
+Init_v4::Init_v4(GobEngine *vm) : Init_v3(vm) {
+}
+
+Init_v4::~Init_v4() {
+}
+
+void Init_v4::updateConfig() {
+	_vm->_global->_doSubtitles = ConfMan.getBool("subtitles");
+}
+
+} // End of namespace Gob

Modified: scummvm/trunk/engines/gob/init_v6.cpp
===================================================================
--- scummvm/trunk/engines/gob/init_v6.cpp	2009-07-25 16:07:29 UTC (rev 42766)
+++ scummvm/trunk/engines/gob/init_v6.cpp	2009-07-25 16:08:31 UTC (rev 42767)
@@ -34,6 +34,9 @@
 Init_v6::Init_v6(GobEngine *vm) : Init_v3(vm) {
 }
 
+Init_v6::~Init_v6() {
+}
+
 void Init_v6::initGame() {
 	_vm->_global->_noCd = false;
 

Modified: scummvm/trunk/engines/gob/module.mk
===================================================================
--- scummvm/trunk/engines/gob/module.mk	2009-07-25 16:07:29 UTC (rev 42766)
+++ scummvm/trunk/engines/gob/module.mk	2009-07-25 16:08:31 UTC (rev 42767)
@@ -23,6 +23,7 @@
 	init_v1.o \
 	init_v2.o \
 	init_v3.o \
+	init_v4.o \
 	init_v6.o \
 	inter.o \
 	inter_v1.o \


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