[Scummvm-cvs-logs] scummvm master -> 3fda4f0ef5ec56caad0332e473993f5628ca6e42

dreammaster dreammaster at scummvm.org
Thu Aug 4 03:47:19 CEST 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
3fda4f0ef5 TITANIC: Add CSound sound loading methods


Commit: 3fda4f0ef5ec56caad0332e473993f5628ca6e42
    https://github.com/scummvm/scummvm/commit/3fda4f0ef5ec56caad0332e473993f5628ca6e42
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-08-03T21:47:11-04:00

Commit Message:
TITANIC: Add CSound sound loading methods

Changed paths:
  A engines/titanic/sound/proximity.cpp
  A engines/titanic/sound/proximity.h
  A engines/titanic/sound/sound_resource.cpp
  A engines/titanic/sound/sound_resource.h
  R engines/titanic/support/proximity.cpp
  R engines/titanic/support/proximity.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/module.mk
    engines/titanic/sound/sound.cpp
    engines/titanic/sound/sound.h
    engines/titanic/sound/sound_manager.cpp
    engines/titanic/sound/sound_manager.h
    engines/titanic/true_talk/dialogue_file.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index c04f2e1..3036639 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -644,7 +644,17 @@ int CGameObject::playSound(const CString &name, int val2, int val3, int val4) {
 
 int CGameObject::playSound(const CString &name, CProximity &prox) {
 	if (prox._field28 == 2) {
-		// TODO
+		// If the proximity doesn't have a position defined, default it to
+		// the position of the view to which the game object belongs
+		if (prox._posX == 0.0 && prox._posY == 0.0 && prox._posZ == 0.0)
+			findView()->getPosition(prox._posX, prox._posY, prox._posZ);
+	}
+
+	CGameManager *gameManager = getGameManager();
+	if (gameManager) {
+		g_vm->_filesManager->preload(name);
+
+		gameManager->_sound.playSound(name, prox);
 	}
 
 	return 0;
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index abb7e99..ec7f77c 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -26,7 +26,7 @@
 #include "titanic/support/mouse_cursor.h"
 #include "titanic/support/credit_text.h"
 #include "titanic/support/movie_range_info.h"
-#include "titanic/support/proximity.h"
+#include "titanic/sound/proximity.h"
 #include "titanic/support/rect.h"
 #include "titanic/support/movie_clip.h"
 #include "titanic/core/named_item.h"
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 61e8071..d029a17 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -402,6 +402,7 @@ MODULE_OBJS := \
 	sound/music_room.o \
 	sound/music_player.o \
 	sound/node_auto_sound_player.o \
+	sound/proximity.o \
 	sound/restricted_auto_music_player.o \
 	sound/room_auto_sound_player.o \
 	sound/room_trigger_auto_music_player.o \
@@ -409,6 +410,7 @@ MODULE_OBJS := \
 	sound/seasonal_music_player.o \
 	sound/sound.o \
 	sound/sound_manager.o \
+	sound/sound_resource.o \
 	sound/titania_speech.o \
 	sound/trigger_auto_music_player.o \
 	sound/view_auto_sound_player.o \
@@ -460,7 +462,6 @@ MODULE_OBJS := \
 	support/movie_range_info.o \
 	support/movie_manager.o \
 	support/credit_text.o \
-	support/proximity.o \
 	support/rect.o \
 	support/screen_manager.o \
 	support/simple_file.o \
diff --git a/engines/titanic/sound/proximity.cpp b/engines/titanic/sound/proximity.cpp
new file mode 100644
index 0000000..af23b7b
--- /dev/null
+++ b/engines/titanic/sound/proximity.cpp
@@ -0,0 +1,37 @@
+/* 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.
+ *
+ */
+
+#include "titanic/sound/proximity.h"
+#include "titanic/true_talk/tt_talker.h"
+
+namespace Titanic {
+
+CProximity::CProximity() : _field4(0), _field8(100), _fieldC(0),
+		_speechHandle(-1), _field14(0), _field18(0), _field1C(1.875),
+		_field20(0), _field24(10), _field28(0), _field2C(0.0),
+		_field30(0.5), _field34(0), _posX(0.0), _posY(0.0), _posZ(0.0),
+		_field44(0), _field48(0), _field4C(0), _field50(0), _field54(0),
+		_field58(0), _field5C(0), _field60(0), _endTalkerFn(nullptr),
+		_talker(nullptr), _field6C(0) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/proximity.h b/engines/titanic/sound/proximity.h
new file mode 100644
index 0000000..4427574
--- /dev/null
+++ b/engines/titanic/sound/proximity.h
@@ -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.
+ *
+ */
+
+#ifndef TITANIC_PROXIMITY_H
+#define TITANIC_PROXIMITY_H
+
+#include "common/scummsys.h"
+
+namespace Titanic {
+
+class TTtalker;
+
+typedef void (*CEndTalkerFn)(TTtalker *talker);
+
+class CProximity {
+public:
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _speechHandle;
+	int _field14;
+	int _field18;
+	int _field1C;
+	int _field20;
+	int _field24;
+	int _field28;
+	double _field2C;
+	double _field30;
+	int _field34;
+	double _posX;
+	double _posY;
+	double _posZ;
+	int _field44;
+	int _field48;
+	int _field4C;
+	int _field50;
+	int _field54;
+	int _field58;
+	int _field5C;
+	int _field60;
+	CEndTalkerFn _endTalkerFn;
+	TTtalker *_talker;
+	int _field6C;
+public:
+	CProximity();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PROXIMITY_H */
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index 7968a08..34214f5 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -71,12 +71,40 @@ void CSound::fn3(int handle, int val2, int val3) {
 	warning("TODO: CSound::fn3");
 }
 
-int CSound::playSpeech(CDialogueFile *dialogueFile, int speechId, const CProximity &prox) {
-	warning("TODO: CSound::playSpeech");
-	return 0;
+void CSound::fn4(CSoundResource *soundRes, int val) {
+	// TODO
+}
+
+void CSound::checkSounds() {
+	for (CSoundItemList::iterator i = _sounds.begin(); i != _sounds.end(); ++i) {
+		CSoundItem *soundItem = *i;
+		if (soundItem->_field24 && soundItem->_field28) {
+			if (_soundManager.isActive(soundItem->_soundResource)) {
+				_sounds.remove(soundItem);
+				delete soundItem;
+			}
+		}
+	}
+}
+
+void CSound::removeOldest() {
+	for (CSoundItemList::iterator i = _sounds.reverse_begin();
+			i != _sounds.end(); --i) {
+		CSoundItem *soundItem = *i;
+		if (soundItem->_field28 && !_soundManager.isActive(soundItem->_soundResource)) {
+			_sounds.remove(soundItem);
+			delete soundItem;
+			break;
+		}
+	}
+}
+
+CSoundItem *CSound::getTrueTalkSound(CDialogueFile *dialogueFile, int index) {
+	warning("TODO: CSound::getTrueTalkSound");
+	return nullptr;
 }
 
-uint CSound::loadSound(const CString &name) {
+CSoundResource *CSound::loadSound(const CString &name) {
 	checkSounds();
 
 	// Check whether an entry for the given name is already active
@@ -86,16 +114,16 @@ uint CSound::loadSound(const CString &name) {
 			// Found it, so move it to the front of the list and return
 			_sounds.remove(soundItem);
 			_sounds.push_front(soundItem);
-			return soundItem->_soundHandle;
+			return soundItem->_soundResource;
 		}
 	}
 
 	// Create new sound item
 	CSoundItem *soundItem = new CSoundItem(name);
-	soundItem->_soundHandle = _soundManager.loadSound(name);
+	soundItem->_soundResource = _soundManager.loadSound(name);
 
-	if (!soundItem->_soundHandle) {
-		// Could load sound, so destroy new item and return
+	if (!soundItem->_soundResource) {
+		// Couldn't load sound, so destroy new item and return
 		delete soundItem;
 		return 0;
 	}
@@ -108,36 +136,65 @@ uint CSound::loadSound(const CString &name) {
 	if (_sounds.size() > 10)
 		removeOldest();
 
-	return soundItem->_soundHandle;
+	return soundItem->_soundResource;
 }
 
-void CSound::checkSounds() {
-	for (CSoundItemList::iterator i = _sounds.begin(); i != _sounds.end(); ++i) {
-		CSoundItem *soundItem = *i;
-		if (soundItem->_field24 && soundItem->_field28) {
-			if (_soundManager.isActive(soundItem->_soundHandle)) {
-				_sounds.remove(soundItem);
-				delete soundItem;
-			}
-		}
-	}
+int CSound::playSound(const CString &name, CProximity &prox) {
+	CSoundResource *soundRes  = loadSound(name);
+	if (!soundRes)
+		return -1;
+
+	prox._field6C = soundRes->fn1();
+	fn4(soundRes, prox._field60);
+
+	return _soundManager.playSound(*soundRes, prox);
 }
 
-void CSound::removeOldest() {
-	for (CSoundItemList::iterator i = _sounds.reverse_begin();
-			i != _sounds.end(); --i) {
+CSoundResource *CSound::loadSpeech(CDialogueFile *dialogueFile, int speechId) {
+	checkSounds();
+
+	// Check whether an entry for the given name is already active
+	for (CSoundItemList::iterator i = _sounds.begin(); i != _sounds.end(); ++i) {
 		CSoundItem *soundItem = *i;
-		if (soundItem->_field28 && !_soundManager.isActive(soundItem->_soundHandle)) {
+		if (soundItem->_dialogueFileHandle == dialogueFile->getFile()
+				&& soundItem->_speechId == speechId) {
+			// Found it, so move it to the front of the list and return
 			_sounds.remove(soundItem);
-			delete soundItem;
-			break;
+			_sounds.push_front(soundItem);
+			return soundItem->_soundResource;
 		}
 	}
+
+	// Create new sound item
+	CSoundItem *soundItem = new CSoundItem(dialogueFile->getFile(), speechId);
+	soundItem->_soundResource = _soundManager.loadSpeech(dialogueFile, speechId);
+
+	if (!soundItem->_soundResource) {
+		// Couldn't load speech, so destroy new item and return
+		delete soundItem;
+		return 0;
+	}
+
+	// Add the item to the list of sounds
+	_sounds.push_front(soundItem);
+
+	// If there are more than 10 sounds loaded, remove the last one,
+	// which is the least recently used of all of them
+	if (_sounds.size() > 10)
+		removeOldest();
+
+	return soundItem->_soundResource;
 }
 
-CSoundItem *CSound::getTrueTalkSound(CDialogueFile *dialogueFile, int index) {
-	warning("TODO: CSound::getTrueTalkSound");
-	return nullptr;
+int CSound::playSpeech(CDialogueFile *dialogueFile, int speechId, CProximity &prox) {
+	CSoundResource *soundRes = loadSpeech(dialogueFile, speechId);
+	if (!soundRes)
+		return -1;
+
+	prox._field6C = soundRes->fn1();
+	fn4(soundRes, prox._field60);
+
+	return _soundManager.playSound(*soundRes, prox);
 }
 
-} // End of namespace Titanic z
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
index f550493..bc61d48 100644
--- a/engines/titanic/sound/sound.h
+++ b/engines/titanic/sound/sound.h
@@ -24,8 +24,9 @@
 #define TITANIC_SOUND_H
 
 #include "titanic/support/simple_file.h"
-#include "titanic/support/proximity.h"
+#include "titanic/sound/proximity.h"
 #include "titanic/sound/sound_manager.h"
+#include "titanic/sound/sound_resource.h"
 #include "titanic/core/list.h"
 #include "titanic/core/view_item.h"
 #include "titanic/true_talk/dialogue_file.h"
@@ -37,16 +38,18 @@ class CGameManager;
 class CSoundItem : public ListItem {
 public:
 	CString _name;
-	int _soundHandle;
-	int _field1C;
-	int _field20;
+	CSoundResource *_soundResource;
+	File *_dialogueFileHandle;
+	int _speechId;
 	int _field24;
 	int _field28;
 public:
-	CSoundItem() : ListItem(), _soundHandle(0), _field1C(0),
-		_field20(0), _field24(0), _field28(0) {}
-	CSoundItem(const CString &name) : ListItem(), _name(name), 
-		_soundHandle(0), _field1C(0), _field20(0), _field24(0), _field28(0) {}
+	CSoundItem() : ListItem(), _soundResource(nullptr), _dialogueFileHandle(nullptr),
+		_speechId(0), _field24(0), _field28(0) {}
+	CSoundItem(const CString &name) : ListItem(), _name(name), _soundResource(nullptr),
+		_dialogueFileHandle(nullptr), _speechId(0), _field24(0), _field28(0) {}
+	CSoundItem(File *dialogueFile, int speechId) : ListItem(), _soundResource(nullptr),
+		_dialogueFileHandle(dialogueFile), _speechId(speechId), _field24(0), _field28(0) {}
 
 	int fn1();
 };
@@ -109,25 +112,38 @@ public:
 	 */
 	void preEnterView(CViewItem *newView, bool isNewRoom);
 
+	bool fn1(int val);
+	void fn2(int handle);
+	void fn3(int handle, int val2, int val3);
+	void fn4(CSoundResource *soundRes, int val);
+		
+	void managerProc8(int v) { _soundManager.proc8(v); }
+
+	CSoundItem *getTrueTalkSound(CDialogueFile *dialogueFile, int index);
+
 	/**
 	 * Load a sound
 	 * @param name		Name of sound resource
-	 * @returns			Sound handle Id
+	 * @returns			Sound item record
 	 */
-	uint loadSound(const CString &name);
-
-	bool fn1(int val);
-	void fn2(int handle);
-	void fn3(int handle, int val2, int val3);
+	CSoundResource *loadSpeech(CDialogueFile *dialogueFile, int speechId);
 
 	/**
 	 * Play a speech
 	 */
-	int playSpeech(CDialogueFile *dialogueFile, int speechId, const CProximity &prox);
-		
-	void managerProc8(int v) { _soundManager.proc8(v); }
+	int playSpeech(CDialogueFile *dialogueFile, int speechId, CProximity &prox);
 
-	CSoundItem *getTrueTalkSound(CDialogueFile *dialogueFile, int index);
+	/**
+	 * Load a sound
+	 * @param name		Name of sound resource
+	 * @returns			Sound item record
+	 */
+	CSoundResource *loadSound(const CString &name);
+
+	/**
+	 * Play a sound
+	 */
+	int playSound(const CString &name, CProximity &prox);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp
index 1cafe3b..5cc5b59 100644
--- a/engines/titanic/sound/sound_manager.cpp
+++ b/engines/titanic/sound/sound_manager.cpp
@@ -34,14 +34,14 @@ QSoundManager::QSoundManager() : _field18(0), _field1C(0) {
 	Common::fill(&_field4A0[0], &_field4A0[16], 0);
 }
 
-int QSoundManager::loadSound(const CString &name) {
+CSoundResource *QSoundManager::loadSound(const CString &name) {
 	warning("TODO");
-	return 0;
+	return nullptr;
 }
 
-int QSoundManager::proc4() const {
+CSoundResource *QSoundManager::loadSpeech(CDialogueFile *dialogueFile, int speechId) {
 	warning("TODO");
-	return 0;
+	return nullptr;
 }
 
 int QSoundManager::proc5() const {
@@ -49,8 +49,9 @@ int QSoundManager::proc5() const {
 	return 0;
 }
 
-void QSoundManager::proc6() {
+int QSoundManager::playSound(CSoundResource &soundRes, CProximity &prox) {
 	warning("TODO");
+	return 0;
 }
 
 void QSoundManager::proc7() {
@@ -86,7 +87,7 @@ bool QSoundManager::proc14() {
 	return false;
 }
 
-bool QSoundManager::isActive(int handle) const {
+bool QSoundManager::isActive(const CSoundResource *soundRes) const {
 	warning("TODO");
 	return false;
 }
diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h
index a65162d..5a3aa2f 100644
--- a/engines/titanic/sound/sound_manager.h
+++ b/engines/titanic/sound/sound_manager.h
@@ -24,6 +24,9 @@
 #define TITANIC_SOUND_MANAGER_H
 
 #include "titanic/support/simple_file.h"
+#include "titanic/sound/proximity.h"
+#include "titanic/sound/sound_resource.h"
+#include "titanic/true_talk/dialogue_file.h"
 
 namespace Titanic {
 
@@ -43,11 +46,22 @@ public:
 	 * @param name		Name of sound resource
 	 * @returns			Loaded sound handle
 	 */
-	virtual int loadSound(const CString &name) { return 0; }
+	virtual CSoundResource *loadSound(const CString &name) { return nullptr; }
+
+	/**
+	 * Loads a speech resource from a dialogue file
+	 * @param name		Name of sound resource
+	 * @returns			Loaded sound handle
+	 */
+	virtual CSoundResource *loadSpeech(CDialogueFile *dialogueFile, int speechId) { return 0; }
 
-	virtual int proc4() const { return 0; }
 	virtual int proc5() const { return 0; }
-	virtual void proc6() = 0;
+
+	/**
+	 * Start playing a previously loaded sound resource
+	 */
+	virtual int playSound(CSoundResource &soundRes, CProximity &prox) = 0;
+
 	virtual void proc7() = 0;
 	virtual void proc8(int v) = 0;
 	virtual void proc9() {}
@@ -56,7 +70,12 @@ public:
 	virtual void proc12() {}
 	virtual void proc13() {}
 	virtual bool proc14() = 0;
-	virtual bool isActive(int handle) const { return false; }
+
+	/**
+	 * Returns true if the given sound is currently active
+	 */
+	virtual bool isActive(const CSoundResource *soundRes) const { return false; }
+
 	virtual int proc16() const { return 0; }
 	virtual void WaveMixPump() {}
 	
@@ -117,11 +136,22 @@ public:
 	 * @param name		Name of sound resource
 	 * @returns			Loaded sound handle
 	 */
-	virtual int loadSound(const CString &name);
+	virtual CSoundResource *loadSound(const CString &name);
+
+	/**
+	 * Loads a speech resource from a dialogue file
+	 * @param name		Name of sound resource
+	 * @returns			Loaded sound handle
+	 */
+	virtual CSoundResource *loadSpeech(CDialogueFile *dialogueFile, int speechId);
 
-	virtual int proc4() const;
 	virtual int proc5() const;
-	virtual void proc6();
+
+	/**
+	 * Start playing a previously loaded sound resource
+	 */
+	virtual int playSound(CSoundResource &soundRes, CProximity &prox);
+	
 	virtual void proc7();
 	virtual void proc8(int v);
 	virtual void proc9();
@@ -130,7 +160,12 @@ public:
 	virtual void proc12();
 	virtual void proc13();
 	virtual bool proc14();
-	virtual bool isActive(int handle) const;
+
+	/**
+	 * Returns true if the given sound is currently active
+	 */
+	virtual bool isActive(const CSoundResource *soundRes) const;
+
 	virtual int proc16() const;
 	virtual void WaveMixPump();
 
diff --git a/engines/titanic/sound/sound_resource.cpp b/engines/titanic/sound/sound_resource.cpp
new file mode 100644
index 0000000..2184a25
--- /dev/null
+++ b/engines/titanic/sound/sound_resource.cpp
@@ -0,0 +1,32 @@
+/* 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.
+ *
+ */
+
+#include "titanic/sound/sound_resource.h"
+
+namespace Titanic {
+
+int CSoundResource::fn1() {
+	// TODO
+	return 0;
+}
+
+} // End of namespace Titanic z
diff --git a/engines/titanic/sound/sound_resource.h b/engines/titanic/sound/sound_resource.h
new file mode 100644
index 0000000..b88988e
--- /dev/null
+++ b/engines/titanic/sound/sound_resource.h
@@ -0,0 +1,35 @@
+/* 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.
+ *
+ */
+
+#ifndef TITANIC_SOUND_RESOURCE_H
+#define TITANIC_SOUND_RESOURCE_H
+
+namespace Titanic {
+
+class CSoundResource {
+public:
+	int fn1();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SOUND_RESOURCE_H */
diff --git a/engines/titanic/support/proximity.cpp b/engines/titanic/support/proximity.cpp
deleted file mode 100644
index 9784ae3..0000000
--- a/engines/titanic/support/proximity.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* 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.
- *
- */
-
-#include "titanic/support/proximity.h"
-#include "titanic/true_talk/tt_talker.h"
-
-namespace Titanic {
-
-CProximity::CProximity() : _field4(0), _field8(100), _fieldC(0),
-		_speechHandle(-1), _field14(0), _field18(0), _field1C(1.875),
-		_field20(0), _field24(10), _field28(0), _field2C(0.0),
-		_field30(0.5), _field34(0), _posX(0.0), _posY(0.0), _posZ(0.0),
-		_field44(0), _field48(0), _field4C(0), _field50(0), _field54(0),
-		_field58(0), _field5C(0), _field60(0), _endTalkerFn(nullptr),
-		_talker(nullptr), _field6C(0) {
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/support/proximity.h b/engines/titanic/support/proximity.h
deleted file mode 100644
index 4427574..0000000
--- a/engines/titanic/support/proximity.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* 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.
- *
- */
-
-#ifndef TITANIC_PROXIMITY_H
-#define TITANIC_PROXIMITY_H
-
-#include "common/scummsys.h"
-
-namespace Titanic {
-
-class TTtalker;
-
-typedef void (*CEndTalkerFn)(TTtalker *talker);
-
-class CProximity {
-public:
-	int _field4;
-	int _field8;
-	int _fieldC;
-	int _speechHandle;
-	int _field14;
-	int _field18;
-	int _field1C;
-	int _field20;
-	int _field24;
-	int _field28;
-	double _field2C;
-	double _field30;
-	int _field34;
-	double _posX;
-	double _posY;
-	double _posZ;
-	int _field44;
-	int _field48;
-	int _field4C;
-	int _field50;
-	int _field54;
-	int _field58;
-	int _field5C;
-	int _field60;
-	CEndTalkerFn _endTalkerFn;
-	TTtalker *_talker;
-	int _field6C;
-public:
-	CProximity();
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PROXIMITY_H */
diff --git a/engines/titanic/true_talk/dialogue_file.h b/engines/titanic/true_talk/dialogue_file.h
index 299d01d..19e94cf 100644
--- a/engines/titanic/true_talk/dialogue_file.h
+++ b/engines/titanic/true_talk/dialogue_file.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_DIALOGUE_FILE_H
 #define TITANIC_DIALOGUE_FILE_H
 
-#include "common/file.h"
+#include "titanic/support/simple_file.h"
 #include "titanic/support/string.h"
 
 namespace Titanic {
@@ -51,7 +51,7 @@ struct DialogueResource {
 
 class CDialogueFile {
 private:
-	Common::File _file;
+	File _file;
 	Common::Array<DialogueIndexEntry> _index;
 	Common::Array<DialogueResource> _cache;
 private:
@@ -68,6 +68,8 @@ public:
 	 */
 	void clear();
 
+	File *getFile() { return &_file; }
+
 	/**
 	 * Sets up a text entry within the dialogue file for access
 	 */






More information about the Scummvm-git-logs mailing list