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

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Sun Jul 5 13:29:54 CEST 2009


Revision: 42130
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42130&view=rev
Author:   drmccoy
Date:     2009-07-05 11:29:54 +0000 (Sun, 05 Jul 2009)

Log Message:
-----------
Putting the Urban noCD check into Init_v6::initGame()

Modified Paths:
--------------
    scummvm/trunk/engines/gob/game.cpp
    scummvm/trunk/engines/gob/game.h
    scummvm/trunk/engines/gob/game_v6.cpp
    scummvm/trunk/engines/gob/global.cpp
    scummvm/trunk/engines/gob/global.h
    scummvm/trunk/engines/gob/gob.cpp
    scummvm/trunk/engines/gob/init.h
    scummvm/trunk/engines/gob/inter_v6.cpp
    scummvm/trunk/engines/gob/module.mk

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

Modified: scummvm/trunk/engines/gob/game.cpp
===================================================================
--- scummvm/trunk/engines/gob/game.cpp	2009-07-05 11:29:30 UTC (rev 42129)
+++ scummvm/trunk/engines/gob/game.cpp	2009-07-05 11:29:54 UTC (rev 42130)
@@ -186,8 +186,6 @@
 	_preventScroll = false;
 	_scrollHandleMouse = false;
 
-	_noCd = false;
-
 	_tempStr[0] = 0;
 
 	_numEnvironments = 0;

Modified: scummvm/trunk/engines/gob/game.h
===================================================================
--- scummvm/trunk/engines/gob/game.h	2009-07-05 11:29:30 UTC (rev 42129)
+++ scummvm/trunk/engines/gob/game.h	2009-07-05 11:29:54 UTC (rev 42130)
@@ -84,15 +84,13 @@
 	bool _preventScroll;
 	bool _scrollHandleMouse;
 
-	bool _noCd;
-
 	byte _handleMouse;
 	char _forceHandleMouse;
 
 	Game(GobEngine *vm);
 	virtual ~Game();
 
-	virtual void prepareStart();
+	void prepareStart();
 
 	void playTot(int16 skipPlay);
 
@@ -145,8 +143,6 @@
 public:
 	Game_v6(GobEngine *vm);
 	virtual ~Game_v6() {}
-
-	virtual void prepareStart();
 };
 
 } // End of namespace Gob

Modified: scummvm/trunk/engines/gob/game_v6.cpp
===================================================================
--- scummvm/trunk/engines/gob/game_v6.cpp	2009-07-05 11:29:30 UTC (rev 42129)
+++ scummvm/trunk/engines/gob/game_v6.cpp	2009-07-05 11:29:54 UTC (rev 42130)
@@ -42,15 +42,4 @@
 Game_v6::Game_v6(GobEngine *vm) : Game_v2(vm) {
 }
 
-void Game_v6::prepareStart() {
-	_noCd = false;
-
-	if (Common::File::exists("cd1.itk") && Common::File::exists("cd2.itk") &&
-	    Common::File::exists("cd3.itk") && Common::File::exists("cd4.itk")) {
-		_noCd = true;
-	}
-
-	Game::prepareStart();
-}
-
 } // End of namespace Gob

Modified: scummvm/trunk/engines/gob/global.cpp
===================================================================
--- scummvm/trunk/engines/gob/global.cpp	2009-07-05 11:29:30 UTC (rev 42129)
+++ scummvm/trunk/engines/gob/global.cpp	2009-07-05 11:29:54 UTC (rev 42130)
@@ -123,6 +123,8 @@
 	_inter_mouseY = 0;
 
 	_speedFactor = 1;
+
+	_noCd = false;
 }
 
 Global::~Global() {

Modified: scummvm/trunk/engines/gob/global.h
===================================================================
--- scummvm/trunk/engines/gob/global.h	2009-07-05 11:29:30 UTC (rev 42129)
+++ scummvm/trunk/engines/gob/global.h	2009-07-05 11:29:54 UTC (rev 42130)
@@ -141,6 +141,8 @@
 	// Can be 1, 2 or 3 for normal, double and triple speed, respectively
 	uint8 _speedFactor;
 
+	bool _noCd;
+
 	Global(GobEngine *vm);
 	~Global();
 

Modified: scummvm/trunk/engines/gob/gob.cpp
===================================================================
--- scummvm/trunk/engines/gob/gob.cpp	2009-07-05 11:29:30 UTC (rev 42129)
+++ scummvm/trunk/engines/gob/gob.cpp	2009-07-05 11:29:54 UTC (rev 42130)
@@ -445,7 +445,7 @@
 
 	case kGameTypeAdibou4:
 	case kGameTypeUrban:
-		_init = new Init_v3(this);
+		_init = new Init_v6(this);
 		_video = new Video_v6(this);
 		_inter = new Inter_v6(this);
 		_mult = new Mult_v2(this);

Modified: scummvm/trunk/engines/gob/init.h
===================================================================
--- scummvm/trunk/engines/gob/init.h	2009-07-05 11:29:30 UTC (rev 42129)
+++ scummvm/trunk/engines/gob/init.h	2009-07-05 11:29:54 UTC (rev 42130)
@@ -32,7 +32,7 @@
 
 class Init {
 public:
-	void initGame();
+	virtual void initGame();
 
 	virtual void initVideo() = 0;
 
@@ -72,6 +72,14 @@
 	virtual ~Init_v3() {}
 };
 
+class Init_v6 : public Init_v3 {
+public:
+	virtual void initGame();
+
+	Init_v6(GobEngine *vm);
+	virtual ~Init_v6() {}
+};
+
 } // End of namespace Gob
 
 #endif // GOB_INIT_H

Copied: scummvm/trunk/engines/gob/init_v6.cpp (from rev 42129, scummvm/trunk/engines/gob/game_v6.cpp)
===================================================================
--- scummvm/trunk/engines/gob/init_v6.cpp	                        (rev 0)
+++ scummvm/trunk/engines/gob/init_v6.cpp	2009-07-05 11:29:54 UTC (rev 42130)
@@ -0,0 +1,48 @@
+/* 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 "gob/gob.h"
+#include "gob/init.h"
+#include "gob/global.h"
+
+namespace Gob {
+
+Init_v6::Init_v6(GobEngine *vm) : Init_v3(vm) {
+}
+
+void Init_v6::initGame() {
+	_vm->_global->_noCd = false;
+
+	if (Common::File::exists("cd1.itk") && Common::File::exists("cd2.itk") &&
+	    Common::File::exists("cd3.itk") && Common::File::exists("cd4.itk")) {
+		_vm->_global->_noCd = true;
+	}
+
+	Init::initGame();
+}
+
+} // End of namespace Gob

Modified: scummvm/trunk/engines/gob/inter_v6.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v6.cpp	2009-07-05 11:29:30 UTC (rev 42129)
+++ scummvm/trunk/engines/gob/inter_v6.cpp	2009-07-05 11:29:54 UTC (rev 42130)
@@ -189,7 +189,7 @@
 	// (it checks CD1.ITK - CD4.ITK and the first that's found determines
 	// the CD number), while its NO_CD modus wants everything in CD1.ITK.
 	// So we just open the other ITKs, too.
-	if (_vm->_game->_noCd && !scumm_stricmp(fileName, "CD1.ITK")) {
+	if (_vm->_global->_noCd && !scumm_stricmp(fileName, "CD1.ITK")) {
 		_vm->_dataIO->openDataFile("CD2.ITK", true);
 		_vm->_dataIO->openDataFile("CD3.ITK", true);
 		_vm->_dataIO->openDataFile("CD4.ITK", true);

Modified: scummvm/trunk/engines/gob/module.mk
===================================================================
--- scummvm/trunk/engines/gob/module.mk	2009-07-05 11:29:30 UTC (rev 42129)
+++ scummvm/trunk/engines/gob/module.mk	2009-07-05 11:29:54 UTC (rev 42130)
@@ -26,6 +26,7 @@
 	init_v1.o \
 	init_v2.o \
 	init_v3.o \
+	init_v6.o \
 	inter.o \
 	inter_v1.o \
 	inter_v2.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