[Scummvm-cvs-logs] SF.net SVN: scummvm: [28289] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun Jul 29 16:24:32 CEST 2007


Revision: 28289
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28289&view=rev
Author:   peres001
Date:     2007-07-29 07:24:31 -0700 (Sun, 29 Jul 2007)

Log Message:
-----------
Moved specialized initialization code into subclasses.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parallaction.h

Added Paths:
-----------
    scummvm/trunk/engines/parallaction/parallaction_br.cpp
    scummvm/trunk/engines/parallaction/parallaction_ns.cpp

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2007-07-29 14:23:26 UTC (rev 28288)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2007-07-29 14:24:31 UTC (rev 28289)
@@ -146,12 +146,6 @@
 
 int Parallaction::init() {
 
-	// Detect game
-	if (!detectGame()) {
-		GUIErrorMessage("No valid games were found in the specified directory.");
-		return -1;
-	}
-
 	_objectsNames = NULL;
 	_globalTable = NULL;
 	_localFlagNames = NULL;
@@ -170,20 +164,8 @@
 //	_musicData1 = 0;
 	strcpy(_characterName1, "null");
 
-	_soundMan = 0;
-
 	_baseTime = 0;
 
-
-	if (_vm->getGameType() == GType_Nippon) {
-		_screenWidth = 320;
-		_screenHeight = 200;
-	} else
-	if (_vm->getGameType() == GType_BRA) {
-		_screenWidth = 640;
-		_screenHeight = 400;
-	}
-
 	_screenMaskWidth = _screenWidth / 4;
 	_screenPathWidth = _screenWidth / 8;
 
@@ -191,25 +173,6 @@
 	_screenMaskSize = _screenMaskWidth * _screenHeight;
 	_screenPathSize = _screenPathWidth * _screenHeight;
 
-	if (getGameType() == GType_Nippon) {
-		if (getPlatform() == Common::kPlatformPC) {
-			_disk = new DosDisk_ns(this);
-		} else {
-			if (getFeatures() & GF_DEMO) {
-				strcpy(_location._name, "fognedemo");
-			}
-			_disk = new AmigaDisk_ns(this);
-			_disk->selectArchive((_vm->getFeatures() & GF_DEMO) ? "disk0" : "disk1");
-		}
-	} else
-	if (getGameType() == GType_BRA) {
-		if (getPlatform() == Common::kPlatformPC) {
-			_disk = new DosDisk_br(this);
-		} else
-			error("unsupported platform for Big Red Adventure");
-	} else
-		error("unknown game type");
-
 	_engineFlags = 0;
 
 	strcpy(_characterName, "dough");
@@ -231,15 +194,6 @@
 	_animations.push_front(&_vm->_char._ani);
 	_gfx = new Gfx(this);
 
-	if (getPlatform() == Common::kPlatformPC) {
-		int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI);
-		MidiDriver *driver = MidiDriver::createMidi(midiDriver);
-		_soundMan = new DosSoundMan(this, driver);
-		_soundMan->setMusicVolume(ConfMan.getInt("music_volume"));
-	} else {
-		_soundMan = new AmigaSoundMan(this);
-	}
-
 	_debugger = new Debugger(this);
 
 	return 0;

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2007-07-29 14:23:26 UTC (rev 28288)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2007-07-29 14:24:31 UTC (rev 28289)
@@ -486,6 +486,7 @@
 	Parallaction_ns(OSystem* syst) : Parallaction(syst) { }
 	~Parallaction_ns() { }
 
+	int init();
 };
 
 class Parallaction_br : public Parallaction {
@@ -494,6 +495,8 @@
 	Parallaction_br(OSystem* syst) : Parallaction(syst) { }
 	~Parallaction_br() { }
 
+	int init();
+
 };
 
 // FIXME: remove global

Added: scummvm/trunk/engines/parallaction/parallaction_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_br.cpp	                        (rev 0)
+++ scummvm/trunk/engines/parallaction/parallaction_br.cpp	2007-07-29 14:24:31 UTC (rev 28289)
@@ -0,0 +1,58 @@
+/* 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/stdafx.h"
+#include "parallaction/parallaction.h"
+#include "parallaction/sound.h"
+
+namespace Parallaction {
+
+int Parallaction_br::init() {
+
+	// Detect game
+	if (!detectGame()) {
+		GUIErrorMessage("No valid games were found in the specified directory.");
+		return -1;
+	}
+
+	_screenWidth = 640;
+	_screenHeight = 400;
+
+	if (getGameType() == GType_BRA) {
+		if (getPlatform() == Common::kPlatformPC) {
+			_disk = new DosDisk_br(this);
+		} else
+			error("unsupported platform for Big Red Adventure");
+	} else
+		error("unknown game type");
+
+	_soundMan = new DummySoundMan(this);
+
+	Parallaction::init();
+
+	return 0;
+}
+
+} // namespace Parallaction


Property changes on: scummvm/trunk/engines/parallaction/parallaction_br.cpp
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Date Rev Author URL Id
Name: svn:eol-style
   + native

Added: scummvm/trunk/engines/parallaction/parallaction_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_ns.cpp	                        (rev 0)
+++ scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2007-07-29 14:24:31 UTC (rev 28289)
@@ -0,0 +1,69 @@
+/* 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/stdafx.h"
+#include "common/config-manager.h"
+
+#include "parallaction/parallaction.h"
+#include "parallaction/sound.h"
+
+namespace Parallaction {
+
+int Parallaction_ns::init() {
+
+	// Detect game
+	if (!detectGame()) {
+		GUIErrorMessage("No valid games were found in the specified directory.");
+		return -1;
+	}
+
+	_screenWidth = 320;
+	_screenHeight = 200;
+
+	if (getPlatform() == Common::kPlatformPC) {
+		_disk = new DosDisk_ns(this);
+	} else {
+		if (getFeatures() & GF_DEMO) {
+			strcpy(_location._name, "fognedemo");
+		}
+		_disk = new AmigaDisk_ns(this);
+		_disk->selectArchive((_vm->getFeatures() & GF_DEMO) ? "disk0" : "disk1");
+	}
+
+	if (getPlatform() == Common::kPlatformPC) {
+		int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI);
+		MidiDriver *driver = MidiDriver::createMidi(midiDriver);
+		_soundMan = new DosSoundMan(this, driver);
+		_soundMan->setMusicVolume(ConfMan.getInt("music_volume"));
+	} else {
+		_soundMan = new AmigaSoundMan(this);
+	}
+
+	Parallaction::init();
+
+	return 0;
+}
+
+} // namespace Parallaction


Property changes on: scummvm/trunk/engines/parallaction/parallaction_ns.cpp
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Date Rev Author URL Id
Name: svn:eol-style
   + native


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