aboutsummaryrefslogtreecommitdiff
path: root/engines/tucker
diff options
context:
space:
mode:
authorAdrian Frühwirth2018-07-04 11:45:34 +0200
committerAdrian Frühwirth2018-07-04 12:42:34 +0200
commitdd431526bed297298a4e42a47a95a73d70d8ccd3 (patch)
tree936d01e8e0afa8d80d36a22ee070e5db152e49d1 /engines/tucker
parent6c8ef2309d30e21a2d8ec3a2948437b3d93a33f3 (diff)
downloadscummvm-rg350-dd431526bed297298a4e42a47a95a73d70d8ccd3.tar.gz
scummvm-rg350-dd431526bed297298a4e42a47a95a73d70d8ccd3.tar.bz2
scummvm-rg350-dd431526bed297298a4e42a47a95a73d70d8ccd3.zip
TUCKER: Use nullptr
Diffstat (limited to 'engines/tucker')
-rw-r--r--engines/tucker/detection.cpp4
-rw-r--r--engines/tucker/resource.cpp20
-rw-r--r--engines/tucker/sequences.cpp22
-rw-r--r--engines/tucker/staticres.cpp6
-rw-r--r--engines/tucker/tucker.cpp10
5 files changed, 31 insertions, 31 deletions
diff --git a/engines/tucker/detection.cpp b/engines/tucker/detection.cpp
index 2318947b12..86f2acd705 100644
--- a/engines/tucker/detection.cpp
+++ b/engines/tucker/detection.cpp
@@ -32,7 +32,7 @@
static const PlainGameDescriptor tuckerGames[] = {
{ "tucker", "Bud Tucker in Double Trouble" },
- { 0, 0 }
+ { nullptr, nullptr }
};
static const ADGameDescription tuckerGameDescriptions[] = {
@@ -146,7 +146,7 @@ public:
if (desc) {
*engine = new Tucker::TuckerEngine(syst, desc->language, desc->flags);
}
- return desc != 0;
+ return desc != nullptr;
}
virtual ADDetectedGame fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const override {
diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp
index 5d7ae2c2d5..ed26aa4a1f 100644
--- a/engines/tucker/resource.cpp
+++ b/engines/tucker/resource.cpp
@@ -58,7 +58,7 @@ static const CompressedSoundFile compressedSoundFilesTable[] = {
#ifdef USE_MAD
{ "TUCKER.SO3", Audio::makeMP3Stream },
#endif
- { 0, 0 }
+ { nullptr, nullptr }
};
static void decodeData(uint8 *data, int dataSize) {
@@ -195,7 +195,7 @@ uint8 *TuckerEngine::loadFile(const char *fname, uint8 *p) {
Common::File f;
if (!f.open(filename)) {
warning("Unable to open '%s'", filename.c_str());
- return 0;
+ return nullptr;
}
const int sz = f.size();
if (!p) {
@@ -234,7 +234,7 @@ void CompressedSound::closeFile() {
Audio::RewindableAudioStream *CompressedSound::load(CompressedSoundType type, int num) {
if (_compressedSoundType < 0) {
- return 0;
+ return nullptr;
}
int offset = 0;
switch (type) {
@@ -254,9 +254,9 @@ Audio::RewindableAudioStream *CompressedSound::load(CompressedSoundType type, in
break;
}
if (offset == 0) {
- return 0;
+ return nullptr;
}
- Audio::SeekableAudioStream *stream = 0;
+ Audio::SeekableAudioStream *stream = nullptr;
_fCompressedSound.seek(offset);
int dirOffset = _fCompressedSound.readUint32LE();
int dirSize = _fCompressedSound.readUint32LE();
@@ -558,10 +558,10 @@ void TuckerEngine::loadObj() {
Common::String filename;
filename = Common::String::format("objtxt%d.c", _part);
free(_objTxtBuf);
- _objTxtBuf = loadFile(filename.c_str(), 0);
+ _objTxtBuf = loadFile(filename.c_str(), nullptr);
filename = Common::String::format("pt%dtext.c", _part);
free(_ptTextBuf);
- _ptTextBuf = loadFile(filename.c_str(), 0);
+ _ptTextBuf = loadFile(filename.c_str(), nullptr);
_characterSpeechDataPtr = _ptTextBuf;
loadData();
loadPanObj();
@@ -818,7 +818,7 @@ void TuckerEngine::loadSprA02_01() {
const int count = _sprA02LookupTable[_location];
for (int i = 1; i < count + 1; ++i) {
Common::String filename = Common::String::format("sprites/a%02d_%02d.spr", _location, i);
- _sprA02Table[i] = loadFile(filename.c_str(), 0);
+ _sprA02Table[i] = loadFile(filename.c_str(), nullptr);
}
_sprA02Table[0] = _sprA02Table[1];
}
@@ -836,7 +836,7 @@ void TuckerEngine::loadSprC02_01() {
const int count = _sprC02LookupTable[_location];
for (int i = 1; i < count + 1; ++i) {
Common::String filename = Common::String::format("sprites/c%02d_%02d.spr", _location, i);
- _sprC02Table[i] = loadFile(filename.c_str(), 0);
+ _sprC02Table[i] = loadFile(filename.c_str(), nullptr);
}
_sprC02Table[0] = _sprC02Table[1];
_spritesCount = _sprC02LookupTable2[_location];
@@ -935,7 +935,7 @@ void TuckerEngine::loadFx() {
}
void TuckerEngine::loadSound(Audio::Mixer::SoundType type, int num, int volume, bool loop, Audio::SoundHandle *handle) {
- Audio::RewindableAudioStream *stream = 0;
+ Audio::RewindableAudioStream *stream = nullptr;
switch (type) {
case Audio::Mixer::kSFXSoundType:
stream = _compressedSound.load(kSoundTypeFx, num);
diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp
index fd66c4f49c..c3ae2e86f6 100644
--- a/engines/tucker/sequences.cpp
+++ b/engines/tucker/sequences.cpp
@@ -228,7 +228,7 @@ void TuckerEngine::handleNewPartSequence() {
default:
break;
}
- _sprC02Table[1] = loadFile(filename.c_str(), 0);
+ _sprC02Table[1] = loadFile(filename.c_str(), nullptr);
startSpeechSound(9000, 60);
_fadePaletteCounter = 0;
do {
@@ -517,7 +517,7 @@ void AnimationSequencePlayer::mainLoop() {
{ 13, 2, &AnimationSequencePlayer::loadIntroSeq13_14, &AnimationSequencePlayer::playIntroSeq13_14 },
{ 15, 2, &AnimationSequencePlayer::loadIntroSeq15_16, &AnimationSequencePlayer::playIntroSeq15_16 },
{ 27, 2, &AnimationSequencePlayer::loadIntroSeq27_28, &AnimationSequencePlayer::playIntroSeq27_28 },
- { 1, 0, 0, 0 }
+ { 1, 0, nullptr, nullptr }
};
static const SequenceUpdateFunc _gameSeqUpdateFuncs[] = {
{ 17, 1, &AnimationSequencePlayer::loadIntroSeq17_18, &AnimationSequencePlayer::playIntroSeq17_18 },
@@ -525,7 +525,7 @@ void AnimationSequencePlayer::mainLoop() {
{ 3, 2, &AnimationSequencePlayer::loadIntroSeq3_4, &AnimationSequencePlayer::playIntroSeq3_4 },
{ 9, 2, &AnimationSequencePlayer::loadIntroSeq9_10, &AnimationSequencePlayer::playIntroSeq9_10 },
{ 21, 2, &AnimationSequencePlayer::loadIntroSeq21_22, &AnimationSequencePlayer::playIntroSeq21_22 },
- { 1, 0, 0, 0 }
+ { 1, 0, nullptr, nullptr }
};
switch (_seqNum) {
case kFirstAnimationSequenceDemo:
@@ -632,7 +632,7 @@ Audio::RewindableAudioStream *AnimationSequencePlayer::loadSound(int index, Anim
void AnimationSequencePlayer::loadSounds(int num) {
if (_soundSeqDataList[num].musicVolume != 0) {
Audio::AudioStream *s;
- if ((s = loadSound(_soundSeqDataList[num].musicIndex, kAnimationSoundType8BitsRAW)) != 0) {
+ if ((s = loadSound(_soundSeqDataList[num].musicIndex, kAnimationSoundType8BitsRAW)) != nullptr) {
_mixer->playStream(Audio::Mixer::kMusicSoundType, &_musicHandle, s, -1, scaleMixerVolume(_soundSeqDataList[num].musicVolume));
}
}
@@ -642,17 +642,17 @@ void AnimationSequencePlayer::loadSounds(int num) {
}
void AnimationSequencePlayer::updateSounds() {
- Audio::RewindableAudioStream *s = 0;
+ Audio::RewindableAudioStream *s = nullptr;
const SoundSequenceData *p = &_soundSeqData[_soundSeqDataIndex];
while (_soundSeqDataIndex < _soundSeqDataCount && p->timestamp <= _frameCounter) {
switch (p->opcode) {
case 0:
- if ((s = loadSound(p->num, kAnimationSoundTypeWAV)) != 0) {
+ if ((s = loadSound(p->num, kAnimationSoundTypeWAV)) != nullptr) {
_mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundsHandle[p->index], s, -1, scaleMixerVolume(p->volume));
}
break;
case 1:
- if ((s = loadSound(p->num, kAnimationSoundTypeWAV)) != 0) {
+ if ((s = loadSound(p->num, kAnimationSoundTypeWAV)) != nullptr) {
_mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundsHandle[p->index], Audio::makeLoopingAudioStream(s, 0),
-1, scaleMixerVolume(p->volume));
}
@@ -665,18 +665,18 @@ void AnimationSequencePlayer::updateSounds() {
break;
case 4:
_mixer->stopHandle(_musicHandle);
- if ((s = loadSound(p->num, kAnimationSoundType8BitsRAW)) != 0) {
+ if ((s = loadSound(p->num, kAnimationSoundType8BitsRAW)) != nullptr) {
_mixer->playStream(Audio::Mixer::kMusicSoundType, &_musicHandle, s, -1, scaleMixerVolume(p->volume));
}
break;
case 5:
- if ((s = loadSound(p->num, kAnimationSoundTypeWAV)) != 0) {
+ if ((s = loadSound(p->num, kAnimationSoundTypeWAV)) != nullptr) {
_mixer->playStream(Audio::Mixer::kSFXSoundType, &_sfxHandle, s, -1, scaleMixerVolume(p->volume));
}
break;
case 6:
_mixer->stopHandle(_musicHandle);
- if ((s = loadSound(p->num, kAnimationSoundType16BitsRAW)) != 0) {
+ if ((s = loadSound(p->num, kAnimationSoundType16BitsRAW)) != nullptr) {
_mixer->playStream(Audio::Mixer::kMusicSoundType, &_musicHandle, s, -1, scaleMixerVolume(p->volume));
}
break;
@@ -810,7 +810,7 @@ void AnimationSequencePlayer::playIntroSeq19_20() {
// The intro credits animation. This uses 2 animations: the foreground one, which
// is the actual intro credits, and the background one, which is an animation of
// cogs, and is being replayed when an intro credit appears
- const ::Graphics::Surface *surface = 0;
+ const ::Graphics::Surface *surface = nullptr;
if (_flicPlayer[0].getCurFrame() >= 115) {
surface = _flicPlayer[1].decodeNextFrame();
diff --git a/engines/tucker/staticres.cpp b/engines/tucker/staticres.cpp
index 7443a04e27..1e155cf6da 100644
--- a/engines/tucker/staticres.cpp
+++ b/engines/tucker/staticres.cpp
@@ -335,13 +335,13 @@ static const SoundSequenceData _soundDataSeq19_20[] = {
// version here. The volume is just a guess, though.
const SoundSequenceDataList AnimationSequencePlayer::_soundSeqDataList[] = {
- { 130, 80, 14, 10, 58, _soundDataSeq3_4 },
- { 0, 0, 14, 5, 60, _soundDataSeq9_10 },
+ { 130, 80, 14, 10, 58, _soundDataSeq3_4 },
+ { 0, 0, 14, 5, 60, _soundDataSeq9_10 },
{ 0, 0, 14, 9, 48, _soundDataSeq21_20 },
{ 1, 80, 14, 4, 25, _soundDataSeq13_14 },
{ 1, 80, 13, 9, 43, _soundDataSeq15_16 },
{ 1, 80, 11, 0, 11, _soundDataSeq27_28 },
- { 104, 100, 0, 0, 0, 0 },
+ { 104, 100, 0, 0, 0, nullptr },
{ 0, 0, 4, 0, 7, _soundDataSeq19_20 }
};
diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp
index 3a49260ab5..81c6193336 100644
--- a/engines/tucker/tucker.cpp
+++ b/engines/tucker/tucker.cpp
@@ -376,10 +376,10 @@ void TuckerEngine::mainLoop() {
_infoBarBuf[getPositionForLine(kVerbPrepositionWith, _infoBarBuf)] = 'c';
}
- _data5Buf = loadFile("data5.c", 0);
- _bgTextBuf = loadFile("bgtext.c", 0);
- _charNameBuf = loadFile("charname.c", 0);
- _csDataBuf = loadFile("csdata.c", 0);
+ _data5Buf = loadFile("data5.c", nullptr);
+ _bgTextBuf = loadFile("bgtext.c", nullptr);
+ _charNameBuf = loadFile("charname.c", nullptr);
+ _csDataBuf = loadFile("csdata.c", nullptr);
_csDataSize = _fileLoadSize;
_currentSaveLoadGameState = 1;
@@ -3213,7 +3213,7 @@ static const struct {
{ "wfx", kCode_wfx },
{ "xhr", kCode_xhr },
{ "xhm", kCode_xhm },
- { 0, 0 }
+ { nullptr, 0 }
};
int TuckerEngine::readTableInstructionCode(int *index) {