From d712875c02c6e82734f6ba9ea56f8206c51a22fe Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 5 May 2016 07:49:46 -0400 Subject: TITANIC: Renamed TT unnamed script classes to room scripts --- engines/titanic/core/room_item.cpp | 2 +- engines/titanic/module.mk | 2 +- engines/titanic/true_talk/true_talk_manager.cpp | 8 ++-- engines/titanic/true_talk/true_talk_manager.h | 2 +- engines/titanic/true_talk/tt_room_script.cpp | 64 +++++++++++++++++++++++++ engines/titanic/true_talk/tt_room_script.h | 62 ++++++++++++++++++++++++ engines/titanic/true_talk/tt_scripts.cpp | 28 +++++------ engines/titanic/true_talk/tt_scripts.h | 24 +++++----- engines/titanic/true_talk/tt_unnamed_script.cpp | 64 ------------------------- engines/titanic/true_talk/tt_unnamed_script.h | 62 ------------------------ 10 files changed, 159 insertions(+), 159 deletions(-) create mode 100644 engines/titanic/true_talk/tt_room_script.cpp create mode 100644 engines/titanic/true_talk/tt_room_script.h delete mode 100644 engines/titanic/true_talk/tt_unnamed_script.cpp delete mode 100644 engines/titanic/true_talk/tt_unnamed_script.h (limited to 'engines') diff --git a/engines/titanic/core/room_item.cpp b/engines/titanic/core/room_item.cpp index c5815795ae..b1c9aeeb10 100644 --- a/engines/titanic/core/room_item.cpp +++ b/engines/titanic/core/room_item.cpp @@ -100,7 +100,7 @@ void CRoomItem::load(SimpleFile *file) { } void CRoomItem::loading() { - // TODO + warning("TODO: CRoomItem::loading"); } void CRoomItem::calcNodePosition(const Point &nodePos, double &xVal, double &yVal) const { diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk index 778226dfa2..a1529317fd 100644 --- a/engines/titanic/module.mk +++ b/engines/titanic/module.mk @@ -458,7 +458,7 @@ MODULE_OBJS := \ true_talk/title_engine.o \ true_talk/true_talk_manager.o \ true_talk/tt_script_base.o \ - true_talk/tt_unnamed_script.o \ + true_talk/tt_room_script.o \ true_talk/tt_named_script.o \ true_talk/tt_scripts.o \ true_talk/tt_string.o diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp index 805ebd368d..c9343d1f39 100644 --- a/engines/titanic/true_talk/true_talk_manager.cpp +++ b/engines/titanic/true_talk/true_talk_manager.cpp @@ -231,18 +231,18 @@ TTNamedScript *CTrueTalkManager::getNpcScript(CGameObject *npc) const { return script; } -TTUnnamedScript *CTrueTalkManager::getRoomScript() const { +TTRoomScript *CTrueTalkManager::getRoomScript() const { CRoomItem *room = _gameManager->getRoom(); - TTUnnamedScript *script = nullptr; + TTRoomScript *script = nullptr; if (room) { int scriptId = room->getScriptId(); if (scriptId) - script = _scripts.getUnnamedScript(scriptId); + script = _scripts.getRoomScript(scriptId); } if (!script) { // Fall back on the default Room script - script = _scripts.getUnnamedScript(110); + script = _scripts.getRoomScript(110); } return script; diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h index ae740cb9f1..991bf1608f 100644 --- a/engines/titanic/true_talk/true_talk_manager.h +++ b/engines/titanic/true_talk/true_talk_manager.h @@ -67,7 +67,7 @@ private: /** * Gets the script associated with the current room */ - TTUnnamedScript *getRoomScript() const; + TTRoomScript *getRoomScript() const; public: static int _v1; static int _v2; diff --git a/engines/titanic/true_talk/tt_room_script.cpp b/engines/titanic/true_talk/tt_room_script.cpp new file mode 100644 index 0000000000..1c37a39bf0 --- /dev/null +++ b/engines/titanic/true_talk/tt_room_script.cpp @@ -0,0 +1,64 @@ +/* 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 "common/textconsole.h" +#include "titanic/true_talk/tt_room_script.h" + +namespace Titanic { + +TTRoomScriptBase::TTRoomScriptBase(int scriptId, + const char *charClass, const char *charName, + int v3, int v4, int v5, int v6, int v2, int v7) : _scriptId(scriptId), + TTScriptBase(3, charClass, v2, charName, v3, v4, v5, v6, v7) { +} + +/*------------------------------------------------------------------------*/ + +TTRoomScript::TTRoomScript(int scriptId) : + TTRoomScriptBase(scriptId, "", "", 0, -1, -1, -1, 0, 0) { +} + +void TTRoomScript::proc6() { + warning("TODO"); +} + +void TTRoomScript::proc7() { + warning("TODO"); +} + +void TTRoomScript::proc8() { + warning("TODO"); +} + +void TTRoomScript::proc9() { + warning("TODO"); +} + +void TTRoomScript::proc10() { + warning("TODO"); +} + +void TTRoomScript::proc11() { + warning("TODO"); +} + +} // End of namespace Titanic diff --git a/engines/titanic/true_talk/tt_room_script.h b/engines/titanic/true_talk/tt_room_script.h new file mode 100644 index 0000000000..ed17b29e9c --- /dev/null +++ b/engines/titanic/true_talk/tt_room_script.h @@ -0,0 +1,62 @@ +/* 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_TT_ROOM_SCRIPT_H +#define TITANIC_TT_ROOM_SCRIPT_H + +#include "titanic/true_talk/tt_script_base.h" + +namespace Titanic { + +class TTRoomScriptBase : public TTScriptBase { +public: + int _scriptId; +public: + TTRoomScriptBase(int scriptId, const char *charClass, const char *charName, + int v3, int v4, int v5, int v6, int v2, int v7); + + virtual void proc6() = 0; + virtual void proc7() = 0; + virtual void proc8() = 0; + virtual void proc9() = 0; + virtual void proc10() = 0; + virtual void proc11() = 0; +}; + + +class TTRoomScript : public TTRoomScriptBase { +private: + int _field54; +public: + TTRoomScript(int scriptId); + + virtual void proc6(); + virtual void proc7(); + virtual void proc8(); + virtual void proc9(); + virtual void proc10(); + virtual void proc11(); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_TT_ROOM_SCRIPT_H */ diff --git a/engines/titanic/true_talk/tt_scripts.cpp b/engines/titanic/true_talk/tt_scripts.cpp index 8e34ec5d2b..9bfa31af8b 100644 --- a/engines/titanic/true_talk/tt_scripts.cpp +++ b/engines/titanic/true_talk/tt_scripts.cpp @@ -45,9 +45,9 @@ TTNamedScript *TTNamedScriptList::findById(int charId) const { /*------------------------------------------------------------------------*/ -TTUnnamedScript *TTUnnamedScriptList::findById(int scriptId) const { - for (TTUnnamedScriptList::const_iterator i = begin(); i != end(); ++i) { - const TTUnnamedScriptListItem *item = *i; +TTRoomScript *TTRoomScriptList::findById(int scriptId) const { + for (TTRoomScriptList::const_iterator i = begin(); i != end(); ++i) { + const TTRoomScriptListItem *item = *i; if (item->_item->_scriptId == scriptId) return item->_item; } @@ -59,11 +59,11 @@ TTUnnamedScript *TTUnnamedScriptList::findById(int scriptId) const { TTScripts::TTScripts(CTitleEngine *titleEngine) : _titleEngine(titleEngine), _field24(0), _field28(0) { - // Load unnamed scripts + // Load room scripts for (int scriptNum = 100; scriptNum < 133; ++scriptNum) - addScript(new TTUnnamedScript(scriptNum)); + addScript(new TTRoomScript(scriptNum)); - // Load named scripts + // Load npc scripts addScript(new DoorbotScript(104, "Doorbot", 0, "Fentible", 11, 1, -1, -1, -1, 0), 100); addScript(new BellbotScript(101, "Bellbot", 0, "Krage", 8, 1), 110); addScript(new LiftbotScript(105, "LiftBot", 0, "Nobby", 11, 1, -1, -1, -1, 0), 103); @@ -77,19 +77,19 @@ TTScripts::TTScripts(CTitleEngine *titleEngine) : void TTScripts::addScript(TTNamedScript *script, int scriptId) { script->proc13(); - // Find the unnamed script this is associated with - TTUnnamedScript *unnamedScript = getUnnamedScript(scriptId); - assert(unnamedScript); + // Find the room script this is associated with + TTRoomScript *roomScript = getRoomScript(scriptId); + assert(roomScript); - _namedScripts.push_back(new TTNamedScriptListItem(script, unnamedScript)); + _namedScripts.push_back(new TTNamedScriptListItem(script, roomScript)); } -void TTScripts::addScript(TTUnnamedScript *script) { - _unnamedScripts.push_back(new TTUnnamedScriptListItem(script)); +void TTScripts::addScript(TTRoomScript *script) { + _roomScripts.push_back(new TTRoomScriptListItem(script)); } -TTUnnamedScript *TTScripts::getUnnamedScript(int scriptId) const { - return _unnamedScripts.findById(scriptId); +TTRoomScript *TTScripts::getRoomScript(int scriptId) const { + return _roomScripts.findById(scriptId); } TTNamedScript *TTScripts::getNamedScript(int charId) const { diff --git a/engines/titanic/true_talk/tt_scripts.h b/engines/titanic/true_talk/tt_scripts.h index 5934eb3625..00638a03d5 100644 --- a/engines/titanic/true_talk/tt_scripts.h +++ b/engines/titanic/true_talk/tt_scripts.h @@ -25,7 +25,7 @@ #include "titanic/core/list.h" #include "titanic/true_talk/tt_named_script.h" -#include "titanic/true_talk/tt_unnamed_script.h" +#include "titanic/true_talk/tt_room_script.h" namespace Titanic { @@ -34,30 +34,30 @@ class CTitleEngine; class TTNamedScriptListItem : public ListItem { public: TTNamedScript *_script; - TTUnnamedScript *_unnamedScript; + TTRoomScript *_roomScript; public: - TTNamedScriptListItem() : _script(nullptr), _unnamedScript(nullptr) {} - TTNamedScriptListItem(TTNamedScript *script, TTUnnamedScript *unnamedScript) : - _script(script), _unnamedScript(unnamedScript) {} + TTNamedScriptListItem() : _script(nullptr), _roomScript(nullptr) {} + TTNamedScriptListItem(TTNamedScript *script, TTRoomScript *roomScript) : + _script(script), _roomScript(roomScript) {} virtual ~TTNamedScriptListItem() { delete _script; } }; -PTR_LIST_ITEM(TTUnnamedScript); +PTR_LIST_ITEM(TTRoomScript); class TTNamedScriptList : public List { public: TTNamedScript *findById(int charId) const; }; -class TTUnnamedScriptList : public List { +class TTRoomScriptList : public List { public: - TTUnnamedScript *findById(int scriptId) const; + TTRoomScript *findById(int scriptId) const; }; class TTScripts { private: TTNamedScriptList _namedScripts; - TTUnnamedScriptList _unnamedScripts; + TTRoomScriptList _roomScripts; CTitleEngine *_titleEngine; int _field24; int _field28; @@ -70,14 +70,14 @@ private: /** * Add an unnamed script to the unnamed scripts list */ - void addScript(TTUnnamedScript *script); + void addScript(TTRoomScript *script); public: TTScripts(CTitleEngine *titleEngine); /** - * Return a pointer to the specified script + * Return a pointer to the specified room script */ - TTUnnamedScript *getUnnamedScript(int scriptId) const; + TTRoomScript *getRoomScript(int scriptId) const; /** * Return a pointer to the specified named character script diff --git a/engines/titanic/true_talk/tt_unnamed_script.cpp b/engines/titanic/true_talk/tt_unnamed_script.cpp deleted file mode 100644 index 8c91290fba..0000000000 --- a/engines/titanic/true_talk/tt_unnamed_script.cpp +++ /dev/null @@ -1,64 +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 "common/textconsole.h" -#include "titanic/true_talk/tt_unnamed_script.h" - -namespace Titanic { - -TTUnnamedScriptBase::TTUnnamedScriptBase(int scriptId, - const char *charClass, const char *charName, - int v3, int v4, int v5, int v6, int v2, int v7) : _scriptId(scriptId), - TTScriptBase(3, charClass, v2, charName, v3, v4, v5, v6, v7) { -} - -/*------------------------------------------------------------------------*/ - -TTUnnamedScript::TTUnnamedScript(int scriptId) : - TTUnnamedScriptBase(scriptId, "", "", 0, -1, -1, -1, 0, 0) { -} - -void TTUnnamedScript::proc6() { - warning("TODO"); -} - -void TTUnnamedScript::proc7() { - warning("TODO"); -} - -void TTUnnamedScript::proc8() { - warning("TODO"); -} - -void TTUnnamedScript::proc9() { - warning("TODO"); -} - -void TTUnnamedScript::proc10() { - warning("TODO"); -} - -void TTUnnamedScript::proc11() { - warning("TODO"); -} - -} // End of namespace Titanic diff --git a/engines/titanic/true_talk/tt_unnamed_script.h b/engines/titanic/true_talk/tt_unnamed_script.h deleted file mode 100644 index eeba200193..0000000000 --- a/engines/titanic/true_talk/tt_unnamed_script.h +++ /dev/null @@ -1,62 +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_TT_UNNAMED_SCRIPT_H -#define TITANIC_TT_UNNAMED_SCRIPT_H - -#include "titanic/true_talk/tt_script_base.h" - -namespace Titanic { - -class TTUnnamedScriptBase : public TTScriptBase { -public: - int _scriptId; -public: - TTUnnamedScriptBase(int scriptId, const char *charClass, const char *charName, - int v3, int v4, int v5, int v6, int v2, int v7); - - virtual void proc6() = 0; - virtual void proc7() = 0; - virtual void proc8() = 0; - virtual void proc9() = 0; - virtual void proc10() = 0; - virtual void proc11() = 0; -}; - - -class TTUnnamedScript : public TTUnnamedScriptBase { -private: - int _field54; -public: - TTUnnamedScript(int scriptId); - - virtual void proc6(); - virtual void proc7(); - virtual void proc8(); - virtual void proc9(); - virtual void proc10(); - virtual void proc11(); -}; - -} // End of namespace Titanic - -#endif /* TITANIC_TT_UNNAMED_SCRIPT_H */ -- cgit v1.2.3