TITANIC: Implemented sound manager loading

This commit is contained in:
Paul Gilbert 2016-03-12 12:35:41 -05:00
parent 60e137c651
commit c269c770ac
8 changed files with 279 additions and 7 deletions

View File

@ -403,6 +403,7 @@ MODULE_OBJS := \
sound/season_noises.o \
sound/seasonal_music_player.o \
sound/sound.o \
sound/sound_manager.o \
sound/titania_speech.o \
sound/trigger_auto_music_player.o \
sound/view_auto_sound_player.o \

View File

@ -28,11 +28,11 @@ CSound::CSound(CGameManager *owner) : _gameManager(owner) {
}
void CSound::save(SimpleFile *file) const {
_soundManager.save(file);
}
void CSound::load(SimpleFile *file) {
_soundManager.load(file);
}
} // End of namespace Titanic z

View File

@ -24,14 +24,16 @@
#define TITANIC_SOUND_H
#include "titanic/simple_file.h"
#include "titanic/sound/sound_manager.h"
namespace Titanic {
class CGameManager;
class CSound {
public:
private:
CGameManager *_gameManager;
QSoundManager _soundManager;
public:
CSound(CGameManager *owner);

View File

@ -0,0 +1,127 @@
/* 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_manager.h"
namespace Titanic {
SoundManager::SoundManager() : _field4(0), _field8(0),
_fieldC(0), _field10(0), _field14(1) {
}
/*------------------------------------------------------------------------*/
QSoundManager::QSoundManager() : _field18(0), _field1C(0) {
Common::fill(&_field4A0[0], &_field4A0[16], 0);
}
int QSoundManager::proc3() {
warning("TODO");
return 0;
}
int QSoundManager::proc4() {
warning("TODO");
return 0;
}
int QSoundManager::proc5() {
warning("TODO");
return 0;
}
void QSoundManager::proc6() {
warning("TODO");
}
void QSoundManager::proc7() {
warning("TODO");
}
void QSoundManager::proc8() {
warning("TODO");
}
void QSoundManager::proc9() {
warning("TODO");
}
void QSoundManager::proc10() {
warning("TODO");
}
void QSoundManager::proc11() {
warning("TODO");
}
void QSoundManager::proc12() {
warning("TODO");
}
void QSoundManager::proc13() {
warning("TODO");
}
void QSoundManager::proc14() {
warning("TODO");
}
int QSoundManager::proc15() {
warning("TODO");
return 0;
}
int QSoundManager::proc16() {
warning("TODO");
return 0;
}
void QSoundManager::WaveMixPump() {
warning("TODO");
}
int QSoundManager::proc18() const {
warning("TODO");
return 0;
}
void QSoundManager::proc19(int v) {
warning("TODO");
}
void QSoundManager::proc20(int v) {
warning("TODO");
}
void QSoundManager::proc21(int v) {
warning("TODO");
}
void QSoundManager::proc29() {
warning("TODO");
}
void QSoundManager::proc30() {
warning("TODO");
}
} // End of namespace Titanic z

View File

@ -0,0 +1,118 @@
/* 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_MANAGER_H
#define TITANIC_SOUND_MANAGER_H
#include "titanic/simple_file.h"
namespace Titanic {
class SoundManager {
protected:
int _field4;
int _field8;
int _fieldC;
int _field10;
int _field14;
public:
SoundManager();
virtual int proc3() const { return 0; }
virtual int proc4() const { return 0; }
virtual int proc5() const { return 0; }
virtual void proc6() = 0;
virtual void proc7() = 0;
virtual void proc8() = 0;
virtual void proc9() {}
virtual void proc10() = 0;
virtual void proc11() = 0;
virtual void proc12() {}
virtual void proc13() {}
virtual void proc14() = 0;
virtual int proc15() const { return 0; }
virtual int proc16() const { return 0; }
virtual void WaveMixPump() {}
virtual int proc18() const { return 0; }
virtual void proc19(int v) { _field4 = v; }
virtual void proc20(int v) { _field8 = v; }
virtual void proc21(int v) { _fieldC = v; }
virtual void proc22(int v) { _field10 = v; }
virtual void proc23() { proc10(); }
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) {}
virtual void proc25() {}
virtual void proc26() {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file) const {}
/**
* Called after saving is complete
*/
virtual void postSave() {}
virtual void proc29() {}
};
class QSoundManager : public SoundManager {
public:
int _field18;
int _field1C;
int _field4A0[16];
public:
QSoundManager();
virtual int proc3();
virtual int proc4();
virtual int proc5();
virtual void proc6();
virtual void proc7();
virtual void proc8();
virtual void proc9();
virtual void proc10();
virtual void proc11();
virtual void proc12();
virtual void proc13();
virtual void proc14();
virtual int proc15();
virtual int proc16();
virtual void WaveMixPump();
virtual int proc18() const;
virtual void proc19(int v);
virtual void proc20(int v);
virtual void proc21(int v);
virtual void proc29();
virtual void proc30();
};
} // End of namespace Titanic
#endif /* TITANIC_QSOUND_MANAGER_H */

View File

@ -62,11 +62,24 @@ void CTrueTalkManager::load(SimpleFile *file) {
// Iterate through loading characters
int charId = file->readNumber();
while (charId) {
uint ident = MKTAG_BE('U', 'R', 'A', 'H');
loadNPC(file, charId);
do {
int ident1 = file->readNumber();
int ident2 = file->readNumber();
int v = 0;
} while (1);
if (ident1 != MKTAG_BE('U', 'R', 'A', 'H')) {
while (ident2 != MKTAG_BE('A', 'K', 'E', 'R')) {
ident1 = ident2;
ident2 = file->readNumber();
if (!ident1)
break;
}
}
// Get start of next character
charId = file->readNumber();
}
}
@ -147,6 +160,12 @@ void CTrueTalkManager::setFlags(int index, int val) {
}
}
void CTrueTalkManager::loadNPC(SimpleFile *file, int charId) {
TTNamedScript *script = _scripts.getNamedScript(charId);
if (script)
script->load(file);
}
void CTrueTalkManager::saveNPC(SimpleFile *file, int charId) const {
TTNamedScript *script = _scripts.getNamedScript(charId);
if (script) {

View File

@ -47,6 +47,8 @@ private:
*/
static void saveStatics(SimpleFile *file);
void loadNPC(SimpleFile *file, int charId);
void saveNPC(SimpleFile *file, int charId) const;
public:
static int _v1;

View File

@ -36,7 +36,10 @@ TTNamedScriptBase::TTNamedScriptBase(int charId, const char *charClass, int v2,
TTNamedScript::TTNamedScript(int charId, const char *charClass, int v2,
const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
TTNamedScriptBase(charId, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
TTNamedScriptBase(charId, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
_subPtr(nullptr), _field60(0), _field64(0), _field68(0),
_field6C(0), _field70(0), _field74(0), _field78(0),
_field7C(0), _field80(0) {
CTrueTalkManager::_v2 = 0;
Common::fill(&_array[0], &_array[147], 0);