BURIED: Use nullptr

Using clang-tidy modernize-use-nullptr
This commit is contained in:
Orgad Shaneh 2021-11-13 23:40:18 +02:00 committed by Filippos Karapetis
parent 6965dd663e
commit 369eae5f35
18 changed files with 34 additions and 34 deletions

View File

@ -250,7 +250,7 @@ void BioChipRightWindow::onLButtonUp(const Common::Point &point, uint flags) {
((GameUIWindow *)_parent)->_navArrowWindow->updateAllArrows(0, 0, 0, 0, 0);
VideoWindow *video = new VideoWindow(_vm, this);
video->setWindowPos(0, 2, 22, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder | kWindowPosHideWindow);
video->setWindowPos(nullptr, 2, 22, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder | kWindowPosHideWindow);
if (!video->openVideo(_vm->getFilePath(IDS_BC_CLOAKING_MOVIE_FILENAME))) {
error("Failed to load cloaking video");
}
@ -286,7 +286,7 @@ void BioChipRightWindow::onLButtonUp(const Common::Point &point, uint flags) {
_status = 0;
VideoWindow *video = new VideoWindow(_vm, this);
video->setWindowPos(0, 2, 22, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder | kWindowPosHideWindow);
video->setWindowPos(nullptr, 2, 22, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder | kWindowPosHideWindow);
if (!video->openVideo(_vm->getFilePath(IDS_BC_CLOAKING_MOVIE_FILENAME))) {
error("Failed to load cloaking video");
}

View File

@ -784,7 +784,7 @@ Window *BioChipMainViewWindow::createBioChipSpecificViewWindow(int bioChipID) {
}
// No entry for this BioChip
return 0;
return nullptr;
}
} // End of namespace Buried

View File

@ -86,7 +86,7 @@ Common::Error BuriedEngine::run() {
setDebugger(new BuriedConsole(this));
if (isTrueColor()) {
initGraphics(640, 480, 0);
initGraphics(640, 480, nullptr);
if (_system->getScreenFormat().bytesPerPixel == 1)
return Common::kUnsupportedColorMode;

View File

@ -269,7 +269,7 @@ void CompletionWindow::onLButtonUp(const Common::Point &point, uint flags) {
if (!_gageVideo->openVideo("BITDATA/FUTAPT/FA_FIN.BTV"))
error("Failed to load finale video");
_gageVideo->setWindowPos(0, 104, 145, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder);
_gageVideo->setWindowPos(nullptr, 104, 145, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder);
_gageVideo->enableWindow(false);
_gageVideo->showWindow(kWindowShow);
_gageVideo->playVideo();

View File

@ -228,12 +228,12 @@ FrameWindow *BuriedConsole::getFrameWindow() {
if (!frameWindow) {
debugPrintf("Main window not yet created!\n");
return 0;
return nullptr;
}
if (!frameWindow->isGameInProgress()) {
debugPrintf("The game is currently not in progress!\n");
return 0;
return nullptr;
}
return frameWindow;

View File

@ -50,7 +50,7 @@ MovieDisplayWindow::MovieDisplayWindow(BuriedEngine *vm, Window *parent, const C
if (!_movie->openVideo(movie))
error("Failed to open movie '%s'", movie.c_str());
_movie->setWindowPos(0, movieLeft, movieTop, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder);
_movie->setWindowPos(nullptr, movieLeft, movieTop, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder);
_movie->enableWindow(false);
_timer = 0;

View File

@ -32,7 +32,7 @@
static const PlainGameDescriptor buriedGames[] = {
{"buried", "The Journeyman Project 2: Buried in Time"},
{0, 0}
{nullptr, nullptr}
};
#include "buried/detection_tables.h"
@ -42,7 +42,7 @@ namespace Buried {
static const char *directoryGlobs[] = {
"win31",
"manual",
0
nullptr
};
} // End of namespace Buried

View File

@ -50,7 +50,7 @@
namespace Buried {
FrameWindow::FrameWindow(BuriedEngine *vm) : Window(vm, 0) {
FrameWindow::FrameWindow(BuriedEngine *vm) : Window(vm, nullptr) {
// Initialize member variables
_mainChildWindow = nullptr;
_controlDown = false;
@ -110,7 +110,7 @@ bool FrameWindow::showTitleSequence() {
x = (_rect.right - video->getRect().right) / 2;
y = (_rect.bottom - video->getRect().bottom) / 2;
video->setWindowPos(0, x, y, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder | kWindowPosShowWindow);
video->setWindowPos(nullptr, x, y, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder | kWindowPosShowWindow);
video->playVideo();
enableWindow(true);

View File

@ -89,7 +89,7 @@ bool GameUIWindow::startNewGameIntro(bool walkthrough) {
if (!video->openVideo(_vm->getFilePath(19972))) // FIXME: Why is this not a constant?
error("Failed to load intro video");
video->setWindowPos(0, 104, 145, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder);
video->setWindowPos(nullptr, 104, 145, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder);
video->enableWindow(false);
video->showWindow(kWindowShow);
_vm->_sound->stop();

View File

@ -201,7 +201,7 @@ Graphics::Surface *GraphicsManager::getBitmap(Common::SeekableReadStream *stream
Image::BitmapDecoder decoder;
if (!decoder.loadStream(*stream)) {
delete stream;
return 0;
return nullptr;
}
delete stream;

View File

@ -53,7 +53,7 @@ InventoryInfoWindow::InventoryInfoWindow(BuriedEngine *vm, Window *parent, int c
if (!_videoWindow->openVideo(_vm->getFilePath(_vm->isDemo() ? IDS_INVENTORY_SPIN_FILENAME_DEMO : IDS_INVENTORY_SPIN_FILENAME)))
error("Failed to load inventory info file");
_videoWindow->setWindowPos(0, 268, 17, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder | kWindowPosShowWindow);
_videoWindow->setWindowPos(nullptr, 268, 17, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder | kWindowPosShowWindow);
_videoWindow->enableWindow(false);
_timer = setTimer(100);

View File

@ -95,7 +95,7 @@ InventoryWindow::InventoryWindow(BuriedEngine *vm, Window *parent) : Window(vm,
_dragFrames = new AVIFrames(dragFramesFileName);
} else {
// The full version uses bitmaps
_dragFrames = NULL;
_dragFrames = nullptr;
}
}

View File

@ -207,7 +207,7 @@ void MainMenuWindow::onLButtonUp(const Common::Point &point, uint flags) {
VideoWindow *video = new VideoWindow(_vm, this);
if (video->openVideo("BITDATA/INTRO/INTRO_O.BTV")) {
video->setWindowPos(0, 104, 145, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder);
video->setWindowPos(nullptr, 104, 145, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder);
video->enableWindow(false);
video->showWindow(kWindowShow);
_vm->_sound->stop();

View File

@ -144,7 +144,7 @@ bool BuriedEngine::loadState(Common::SeekableReadStream *saveFile, Location &loc
if (saveFile->eos() || memcmp(header, s_savedGameHeader, kSavedGameHeaderSizeAlt) != 0)
return false;
Common::Serializer s(saveFile, 0);
Common::Serializer s(saveFile, nullptr);
if (!syncLocation(s, location))
return false;
@ -173,7 +173,7 @@ bool BuriedEngine::loadState(Common::SeekableReadStream *saveFile, Location &loc
bool BuriedEngine::saveState(Common::WriteStream *saveFile, Location &location, GlobalFlags &flags, Common::Array<int> &inventoryItems) {
saveFile->write(s_savedGameHeader, kSavedGameHeaderSize);
Common::Serializer s(0, saveFile);
Common::Serializer s(nullptr, saveFile);
if (!syncLocation(s, location))
return false;

View File

@ -732,7 +732,7 @@ bool SceneViewWindow::timeSuitJump(int destination) {
error("Failed to play small jump movie");
// Reposition
jumpMovie->setWindowPos(0, 0, 28, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder | kWindowPosHideWindow);
jumpMovie->setWindowPos(nullptr, 0, 28, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder | kWindowPosHideWindow);
// Notify the BioChip of the change
((GameUIWindow *)_parent)->_bioChipRightWindow->jumpInitiated(false);
@ -784,7 +784,7 @@ bool SceneViewWindow::timeSuitJump(int destination) {
if (!jumpMovie->openVideo(fileName))
error("Failed to play movie '%s'", fileName.c_str());
jumpMovie->setWindowPos(0, 0, 0, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder | kWindowPosHideWindow);
jumpMovie->setWindowPos(nullptr, 0, 0, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder | kWindowPosHideWindow);
// Show and disable the window
jumpMovie->enableWindow(false);
@ -865,7 +865,7 @@ bool SceneViewWindow::timeSuitJump(int destination) {
if (!jumpMovie->openVideo(_vm->getFilePath(IDS_BC_JUMP_MOVIE_FILENAME)))
error("Failed to play small jump movie");
jumpMovie->setWindowPos(0, 0, 28, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder | kWindowPosHideWindow);
jumpMovie->setWindowPos(nullptr, 0, 28, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder | kWindowPosHideWindow);
// Notify the BioChip of the change
((GameUIWindow *)_parent)->_bioChipRightWindow->jumpEnded(false);
@ -1370,14 +1370,14 @@ const Graphics::Surface *SceneViewWindow::getStillFrame(int frameIndex) {
Graphics::Surface *SceneViewWindow::getCycleFrameCopy(int frameIndex) {
if (!isCyclingEnabled())
return 0;
return nullptr;
return _cycleFrames->getFrameCopy(frameIndex);
}
const Graphics::Surface *SceneViewWindow::getCycleFrame(int frameIndex) {
if (!isCyclingEnabled())
return 0;
return nullptr;
return _cycleFrames->getFrame(frameIndex);
}
@ -1888,7 +1888,7 @@ bool SceneViewWindow::startPlacedAsynchronousAnimation(int left, int top, int wi
_asyncMovieFileName = fileName;
}
_asyncMovie->setWindowPos(0, left, top, width, height, kWindowPosNoZOrder);
_asyncMovie->setWindowPos(nullptr, left, top, width, height, kWindowPosNoZOrder);
_asyncMovie->enableWindow(false);
_asyncMovieStartFrame = animData->startFrame;
@ -1933,7 +1933,7 @@ bool SceneViewWindow::startPlacedAsynchronousAnimation(int left, int top, int wi
_asyncMovieFileName = fileName;
}
_asyncMovie->setWindowPos(0, left, top, width, height, kWindowPosNoZOrder);
_asyncMovie->setWindowPos(nullptr, left, top, width, height, kWindowPosNoZOrder);
_asyncMovie->enableWindow(false);
_asyncMovieStartFrame = (startPosition < 0) ? 0 : startPosition;
@ -1978,7 +1978,7 @@ bool SceneViewWindow::startPlacedAsynchronousAnimationExtern(int left, int top,
_asyncMovieFileName = fileName;
}
_asyncMovie->setWindowPos(0, left, top, width, height, kWindowPosNoZOrder);
_asyncMovie->setWindowPos(nullptr, left, top, width, height, kWindowPosNoZOrder);
_asyncMovie->enableWindow(false);
_asyncMovieStartFrame = (startPosition < 0) ? 0 : startPosition;
@ -2614,7 +2614,7 @@ int SceneViewWindow::droppedItem(int itemID, const Common::Point &location, int
}
bool SceneViewWindow::updatePrebufferWithSprite(Sprite &spriteData) {
if (_currentSprite.image != spriteData.image && _currentSprite.image != 0) {
if (_currentSprite.image != spriteData.image && _currentSprite.image != nullptr) {
_currentSprite.image->free();
delete _currentSprite.image;
}

View File

@ -219,7 +219,7 @@ bool SoundManager::adjustAmbientSoundVolume(byte newVolumeLevel, bool fade, byte
}
bool SoundManager::isAmbientSoundPlaying() {
return _soundData[kAmbientIndexBase + _lastAmbient]->_handle != 0;
return _soundData[kAmbientIndexBase + _lastAmbient]->_handle != nullptr;
}
bool SoundManager::setSecondaryAmbientSound(const Common::String &fileName, bool fade, byte finalVolumeLevel) {
@ -723,7 +723,7 @@ bool SoundManager::Sound::load(const Common::String &fileName) {
return false;
_soundData = Audio::makeWAVStream(stream, DisposeAfterUse::YES);
return _soundData != 0;
return _soundData != nullptr;
}
bool SoundManager::Sound::start() {

View File

@ -77,7 +77,7 @@ bool TitleSequenceWindow::playTitleSequence() {
return false;
}
_currentMovie->setWindowPos(0, 195, 115, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder);
_currentMovie->setWindowPos(nullptr, 195, 115, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder);
_currentMovie->enableWindow(false);
_currentMovie->showWindow(kWindowShow);
_currentMovie->playVideo();
@ -96,7 +96,7 @@ bool TitleSequenceWindow::playTitleSequence() {
return false;
}
_currentMovie->setWindowPos(0, 200, 60, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder);
_currentMovie->setWindowPos(nullptr, 200, 60, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder);
_currentMovie->enableWindow(false);
_currentMovie->showWindow(kWindowShow);
_currentMovie->playVideo();
@ -114,7 +114,7 @@ bool TitleSequenceWindow::playTitleSequence() {
return false;
}
_currentMovie->setWindowPos(0, 60, 138, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder);
_currentMovie->setWindowPos(nullptr, 60, 138, 0, 0, kWindowPosNoSize | kWindowPosNoZOrder);
_currentMovie->enableWindow(false);
_currentMovie->showWindow(kWindowShow);
invalidateWindow();

View File

@ -30,7 +30,7 @@
namespace Buried {
VideoWindow::VideoWindow(BuriedEngine *vm, Window *parent) : Window(vm, parent), _video(nullptr), _mode(kModeClosed), _lastFrame(0) {
VideoWindow::VideoWindow(BuriedEngine *vm, Window *parent) : Window(vm, parent), _video(nullptr), _mode(kModeClosed), _lastFrame(nullptr) {
_vm->addVideo(this);
_needsPalConversion = false;
_ownedFrame = nullptr;