aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/ad/ad_talk_def.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/wintermute/ad/ad_talk_def.cpp')
-rw-r--r--engines/wintermute/ad/ad_talk_def.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/engines/wintermute/ad/ad_talk_def.cpp b/engines/wintermute/ad/ad_talk_def.cpp
index a85cd7f986..bf72b2916b 100644
--- a/engines/wintermute/ad/ad_talk_def.cpp
+++ b/engines/wintermute/ad/ad_talk_def.cpp
@@ -42,11 +42,11 @@ IMPLEMENT_PERSISTENT(AdTalkDef, false)
//////////////////////////////////////////////////////////////////////////
AdTalkDef::AdTalkDef(BaseGame *inGame) : BaseObject(inGame) {
- _defaultSpriteFilename = NULL;
- _defaultSprite = NULL;
+ _defaultSpriteFilename = nullptr;
+ _defaultSprite = nullptr;
- _defaultSpriteSetFilename = NULL;
- _defaultSpriteSet = NULL;
+ _defaultSpriteSetFilename = nullptr;
+ _defaultSpriteSet = nullptr;
}
@@ -59,20 +59,20 @@ AdTalkDef::~AdTalkDef() {
delete[] _defaultSpriteFilename;
delete _defaultSprite;
- _defaultSpriteFilename = NULL;
- _defaultSprite = NULL;
+ _defaultSpriteFilename = nullptr;
+ _defaultSprite = nullptr;
delete[] _defaultSpriteSetFilename;
delete _defaultSpriteSet;
- _defaultSpriteSetFilename = NULL;
- _defaultSpriteSet = NULL;
+ _defaultSpriteSetFilename = nullptr;
+ _defaultSpriteSet = nullptr;
}
//////////////////////////////////////////////////////////////////////////
bool AdTalkDef::loadFile(const char *filename) {
byte *buffer = BaseFileManager::getEngineInstance()->readWholeFile(filename);
- if (buffer == NULL) {
+ if (buffer == nullptr) {
_gameRef->LOG(0, "AdTalkDef::LoadFile failed for file '%s'", filename);
return STATUS_FAILED;
}
@@ -138,7 +138,7 @@ bool AdTalkDef::loadBuffer(byte *buffer, bool complete) {
_nodes.add(node);
} else {
delete node;
- node = NULL;
+ node = nullptr;
cmd = PARSERR_GENERIC;
}
}
@@ -157,7 +157,7 @@ bool AdTalkDef::loadBuffer(byte *buffer, bool complete) {
_defaultSpriteSet = new AdSpriteSet(_gameRef);
if (!_defaultSpriteSet || DID_FAIL(_defaultSpriteSet->loadBuffer(params, false))) {
delete _defaultSpriteSet;
- _defaultSpriteSet = NULL;
+ _defaultSpriteSet = nullptr;
cmd = PARSERR_GENERIC;
}
}
@@ -181,8 +181,8 @@ bool AdTalkDef::loadBuffer(byte *buffer, bool complete) {
delete _defaultSprite;
delete _defaultSpriteSet;
- _defaultSprite = NULL;
- _defaultSpriteSet = NULL;
+ _defaultSprite = nullptr;
+ _defaultSpriteSet = nullptr;
if (_defaultSpriteFilename) {
_defaultSprite = new BaseSprite(_gameRef);
@@ -208,9 +208,9 @@ bool AdTalkDef::persist(BasePersistenceManager *persistMgr) {
BaseObject::persist(persistMgr);
- persistMgr->transfer(TMEMBER(_defaultSprite));
+ persistMgr->transferPtr(TMEMBER_PTR(_defaultSprite));
persistMgr->transfer(TMEMBER(_defaultSpriteFilename));
- persistMgr->transfer(TMEMBER(_defaultSpriteSet));
+ persistMgr->transferPtr(TMEMBER_PTR(_defaultSpriteSet));
persistMgr->transfer(TMEMBER(_defaultSpriteSetFilename));
_nodes.persist(persistMgr);
@@ -250,7 +250,7 @@ bool AdTalkDef::loadDefaultSprite() {
_defaultSprite = new BaseSprite(_gameRef);
if (!_defaultSprite || DID_FAIL(_defaultSprite->loadFile(_defaultSpriteFilename))) {
delete _defaultSprite;
- _defaultSprite = NULL;
+ _defaultSprite = nullptr;
return STATUS_FAILED;
} else {
return STATUS_OK;
@@ -259,7 +259,7 @@ bool AdTalkDef::loadDefaultSprite() {
_defaultSpriteSet = new AdSpriteSet(_gameRef);
if (!_defaultSpriteSet || DID_FAIL(_defaultSpriteSet->loadFile(_defaultSpriteSetFilename))) {
delete _defaultSpriteSet;
- _defaultSpriteSet = NULL;
+ _defaultSpriteSet = nullptr;
return STATUS_FAILED;
} else {
return STATUS_OK;
@@ -278,7 +278,7 @@ BaseSprite *AdTalkDef::getDefaultSprite(TDirection dir) {
} else if (_defaultSpriteSet) {
return _defaultSpriteSet->getSprite(dir);
} else {
- return NULL;
+ return nullptr;
}
}