mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-04 08:28:41 +00:00
TITANIC: Added TTconcept deleteSiblings
This commit is contained in:
parent
bcfebf8f0f
commit
1ffb8ff92b
@ -97,6 +97,15 @@ TTconcept::~TTconcept() {
|
||||
g_vm->_exeResources._owner->setParserConcept(this, nullptr);
|
||||
}
|
||||
|
||||
void TTconcept::deleteSiblings() {
|
||||
for (TTconcept *currP = _nextP, *nextP; currP; currP = nextP) {
|
||||
nextP = currP->_nextP;
|
||||
delete currP;
|
||||
}
|
||||
|
||||
_nextP = nullptr;
|
||||
}
|
||||
|
||||
bool TTconcept::setStatus() {
|
||||
if (_string1.isValid() && _string2.isValid()) {
|
||||
_status = SS_VALID;
|
||||
|
@ -81,6 +81,11 @@ public:
|
||||
TTconcept(TTconcept &src);
|
||||
~TTconcept();
|
||||
|
||||
/**
|
||||
* Destroys any attached sibling concepts to the given concept
|
||||
*/
|
||||
void deleteSiblings();
|
||||
|
||||
/**
|
||||
* Compares the name of the associated word, if any,
|
||||
* to the passed string
|
||||
|
@ -31,8 +31,8 @@
|
||||
namespace Titanic {
|
||||
|
||||
TTparser::TTparser(CScriptHandler *owner) : _owner(owner), _sentenceSub(nullptr),
|
||||
_sentence(nullptr), _fieldC(0), _field10(0), _field14(0), _field18(0),
|
||||
_nodesP(nullptr), _conceptP(nullptr) {
|
||||
_sentence(nullptr), _fieldC(0), _field10(0), _field14(0),
|
||||
_currentWordP(nullptr), _nodesP(nullptr), _conceptP(nullptr) {
|
||||
loadArrays();
|
||||
}
|
||||
|
||||
@ -41,6 +41,13 @@ TTparser::~TTparser() {
|
||||
_nodesP->deleteSiblings();
|
||||
delete _nodesP;
|
||||
}
|
||||
|
||||
if (_conceptP) {
|
||||
_conceptP->deleteSiblings();
|
||||
delete _conceptP;
|
||||
}
|
||||
|
||||
delete _currentWordP;
|
||||
}
|
||||
|
||||
void TTparser::loadArrays() {
|
||||
|
@ -162,7 +162,7 @@ public:
|
||||
int _fieldC;
|
||||
int _field10;
|
||||
int _field14;
|
||||
int _field18;
|
||||
TTword *_currentWordP;
|
||||
public:
|
||||
TTparser(CScriptHandler *owner);
|
||||
~TTparser();
|
||||
|
Loading…
Reference in New Issue
Block a user